trinity-devel@lists.pearsoncomputing.net

Message: previous - next
Month: December 2013

Re: [trinity-devel] Switch debian/ubuntu packages format to quilt

From: Slávek Banko <slavek.banko@...>
Date: Wed, 25 Dec 2013 18:32:21 +0100
On Wednesday 25 of December 2013 06:02:12 Michele Calgaro wrote:
> > What exactly is required to switch to quilt format?  Is this a simple
> > change to the dpkg-buildpackage call or something more complex?
>
> Tim,
> I don't have the experience of Slavek (so I may be missing something), but
> switching to quilt will require:
> 1) change the format inside debian/source/format from native to quilt
> 2) switch debian/ubuntu specific patches to quilt format
> 3) bremove anything related to quilt from debian/rules
> 4) modify the building scripts to create a "<source package>_<upstream
> version>.orig.tar.gz" file from the package source before building 
> 5) modify the building scripts to build using format 3.0(quilt), which
> requires the .orig.tar.gz file to be in the parent directory of the debian
> folder
>
> I have just updated dpkg on my Debian/Jessie, so in the next few days I
> will have to work on this, because I have already experience build
> failures, as Slavek initially mentioned. If I find some other changes that
> are required, I will update the post.
>
> Here are a couple of useful links as well:
> https://wiki.debian.org/Projects/DebSrc3.0#Advantages_of_new_formats
> https://wiki.debian.org/DebianMentorsFaq#What_is_the_ifference_between_a_na
>tive_Debian_package_and_a_non-native_package.3F - section 2.4
>
> Cheers
>   Michele
>

In calling dpkg-buildpackage is basically the only difference - in
parent folder must exists tarball with the sources (except debian
folder) named "package_release.orig.tar.xz", for example:
tdelibs-trinity_14.0.0-r974.orig.tar.xz.

As is evident from the name - orig.tar.xz is one common to all
distributions. However, the condition is that it cannot be created
again for each distribution => must be the binary same == created only
once. At the same time, if package is updated only due to the change
in tde-packaging, but not a change in the source code, orig.tar.xz
must remain binary same as previous. For this reason I use script
create_tarball that source tarball creates only if it does not exist.


As I mentioned earlier - my script to prepare the source deb packages
I already have prepared for these steps. Legenda: DEB_DIR is folder with
deb packages for particular module, TARBALL_DIR is folder with tarballs
created by create_tarball script, NAME is package name (including -trinity,
readed from changelog file), REL is "base" release number - for above
example "4:14.0.0-r974"), SRC is source tarball.

Ad 1) From my script:
        if [ -f $DEB_DIR/source/debian/source/format ]; then
          grep -q "(native)" $DEB_DIR/source/debian/source/format ] &&
          sed -i "s|(native)|(quilt)|" $DEB_DIR/source/debian/source/format
        else
          mkdir -p $DEB_DIR/source/debian/source
          echo "3.0 (quilt)" >$DEB_DIR/source/debian/source/format
        fi

Ad 2) Already done.

Ad 3) From my script:
        grep -q "^include.*/usr/share/cdbs/1/rules/patchsys-quilt\.mk" $DEB_DIR/source/debian/rules &&
        sed -i "s|^\(include.*/usr/share/cdbs/1/rules/patchsys-quilt\.mk\)|#\1|" 
$DEB_DIR/source/debian/rules

Ad 4) In my script I use create-tarball from 'scripts' and this tarball
I use as orig.tar.xz. From my script:
            ln -s $TARBALL_DIR/$SRC.tar.xz $DEB_DIR/${NAME}_${REL#*:}.orig.tar.xz

Ad 5) If the package specify format "3.0 (quilt)" it is not necessary to
modify the call dpkg-buildpackage. In my script I use one condition - if
orig.tar.xz is new tarball, for the first distribution is added option "-sa",
in other cases "-sd". This ensures that the orig.tar.xz uploads only once.


As I realized yesterday, the problem is meta packages that do not contain
source code independently of the distribution, but the files are in
tde-packaging. My current script's leaves this package as "native".
Now I working to change it. Then I will be able to send my script
as an example.

Slavek