[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

How to create Debian GNU/Hurd packages (part II)



And this is "part II" (slightly edited).


Now for the fun part:

As it already happens with C programs :-), if we follow the procedure for
creating a Debian package, we will obtain a .deb package suitable for the
system in which we are creating it. For example, if we do that in a
GNU/Linux-intel machine, we will obtain a .deb for the i386 Debian
architecture.

dpkg will refuse to install an i386 .deb package on a GNU/Linux-alpha
machine, and viceversa, because the architecture for which the package is
compiled is stored in the .deb file itself.

So to cross-compile .deb packages we just need some wrappers.
The ideal place for these wrappers is /usr/i386-gnu/bin, so that
they work iff the cross-compilers also work.

My dpkg-buildpackage is just:

#!/bin/sh
/usr/bin/dpkg-buildpackage -ahurd-i386 "$@"

This tells dpkg-buildpackage to use "hurd-i386" for the .changes file
name.

My dpkg-genchanges (which is automatically called by dpkg-buildpackage) is:

#!/bin/sh
/usr/bin/dpkg-genchanges -DArchitecture=hurd-i386 -DDistribution="unstable" \
 -DUrgency="low" -DMaintainer="Santiago Vila <sanvila@ctv.es>" "$@"

This tells dpkg-genchanges to use "hurd-i386" for the Architecture
field in the .changes file, and some other things.

Obviously, my name would have to be replaced by the yours, but it has to
match the one in the PGP keyring. Since I use "Santiago Vila" as my
name for Debian and "Santiago Vila Doncel" for my PGP key, I have yet
another dpkg-buildpackage in /usr/local/bin which fixes this :-)

And my dpkg-gencontrol is this one:

#!/bin/sh
/usr/bin/dpkg-gencontrol -DArchitecture=hurd-i386 "$@"

I have also a "ldd" in /usr/i386-gnu/bin like this:

#!/bin/sh
echo "  statically linked (ELF)"

Well, this is not really required but it makes the compilation to be a
little smooth.

So in short, when I'm going to *try* to cross-compile a package I do:

PATH=/usr/i386-gnu/bin:$PATH

[obtain debian source]
Unpack it with dpkg-source -x foo_version-debversion.dsc
cd foo-version
dpkg-buildpackage -B -rfakeroot

And that's all, I think.


[ Note about the non-free status of PGP, which we need to sign the
uploads: Yes, we plan to switch to "gpg" some day, but it will take some
time until gpg is stable enough to trust on it ].


Following this procedure, I have already cross-compiled and uploaded the
following packages:

hello, base-passwd, bison, flex, grep, gzip, hostname, indent, m4, patch,
recode, sed, sharutils, textutils, gettext.

They should be available at the Debian archives and mirrors under the
"binary-hurd-i386" trees in the new "sid" distribution.

Next mail will be "part III".


-- 
To UNSUBSCRIBE, email to debian-hurd-request@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org


Reply to: