Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

There are three files (or more) you should check.

debian/changelog

This file controls the target package version and the repo you wnat to place the binary packages to. Let's see at the structure:

Code Block
titlechangelog
jdupes (1.18.1-1~bpo10+1) buster-backports; urgency=medium

  * Rebuild for buster-backports.

 -- Joao Eriberto Mota Filho <eriberto@debian.org>  Wed, 15 Jul 2020 17:56:23 -0300

/*** cut ***/
  • jdupes - the package name
  • 1.18.1-1~bpro10+1 - version of the package
  • buster-backports - target repo
  • rebuild for buster-backports - a message which changes have been made (and why)
  • -- Joao Eriberto Mota Filho <eriberto@debian.org> Wed, 15 Jul 2020 17:56:23 -0300 - who made the changes and when

We add a new record to the file above the first line (like the LIFO or stack).

Code Block
titlechanges in changlog
jdupes (1.18.1-1~bpo10+1+dilos1) unstable; urgency=medium

  * Build for DilOS.

 -- DilOS Team <dilos@dilos.org>  Mon, 10 Aug 2020 12:06:57 +0300

jdupes (1.18.1-1~bpo10+1) buster-backports; urgency=medium

  * Rebuild for buster-backports.

 -- Joao Eriberto Mota Filho <eriberto@debian.org>  Wed, 15 Jul 2020 17:56:23 -0300

As you see we added +dilos1 to the version ( to mark our changes), the repo now is unstable (if you plan to contribute the result to the main repo), the message says it is a build for DilOS and the last line shows who did the changes. To generate the date just use date -R command in the shell:

Code Block
titledate -R
du3p03% date -R
Mon, 10 Aug 2020 12:06:57 +0300

The file is ready and we're preparing next file...

debian/control

This file is used to specify dependencies o build the package(s):

Code Block
titledependencies
Build-Depends: debhelper-compat (= 13)

You see it ad check stage.

Also the file contains list of the producced packages and their architechtures:

Code Block
titlepackages and architectures
Package: jdupes
Architecture: any
Multi-Arch: foreign
Depends: ${misc:Depends}, ${shlibs:Depends}
Description: identify and delete or link duplicate files
/*** cut ***/

Built package will have name jdupes (as the source package). Architecture any means for any platform. It could be:

  • any - for any architectures (binary package)
  • all - for all plafroms (documentation, configurations etc)
  • linux-any - platform specific package (in this example for linux only), we cannot build such packages (as is)

In this example we don't need to change anything, just leave it as is.

debian/rules

Speaking shortly it is a Makefile that is used to build all target packages (from the contol file, using version from changelog). Usualy the file contains valid options to build packages for our platform, but from time to time you need to change something. For example, gnu ld accepts -Wl,-as-needed option, illumos ld does not, just remove this option from the list. Other cases are too specific to describe them as example, just ask us on #dilos at FreeNode or via the mail list.

debian/pre* and post* scripts

Another stuff is he pre/post scripts, probably you should change them (if package has them). Our platform should be able to bootstrap zones, it means the packages could be installed into an alternative root. For this purpose we use BASEDIR environment variable to specify it (it comes from apt/apt-get). Let's take an example from reprepro package:

Code Block
titlepostinst
desktop% pwd
/export/home/denis/projects/dilos/du3/components

desktop% cat reprepro/debian/postinst
#!/bin/sh

set -e
if [ "${BASEDIR:=/}" = "/" ]; then
	BASEDIR=""
fi

case "$1" in
    configure)
        if [ -f ${BASEDIR}/etc/bash_completion.d/reprepro.dpkg-remove ] ; then
		echo "Removing obsolete unmodified conffile /etc/bash_completion.d/reprepro"
		rm -f ${BASEDIR}/etc/bash_completion.d/reprepro.dpkg-remove
	fi
    ;;
esac

#DEBHELPER#

exit 0

If we install the package as is (in the current environment) the BASEDIR is "/" and we just clear it, but if we will install it to a zone at bootstrap stage it

create package directory and copy Makefile from another package

...