Re: [HELP][LONG] Multiple-binaries packages
On 4/26/07, David Paleino <d.paleino@gmail.com> wrote:
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Dear Mentors,
I'm trying to package integcheck before ITPing it (see RFP #230769). Since I'm
just starting with packaging stuff, I encountrered some problems with this one
(never created multiple-binaries packages before).
I should create two packages: integcheck-server and -client. For that, I created
two Package sections in debian/control, and created the various
integcheck-*.{dirs,post*,pre*,*} files.
Now, let's go to debian/rules. What should I edit here? I've seen *-indep and
*-arch targets, but they are supposed to be used with different archs, aren't
they? My package runs on any arch, so are they of any use?
*-indep is for Architecture: all binary packages; *-arch is for
anything else. If you only have one or the other (that is,
everything's arch:all, or nothing's arch:all), then you can leave the
other blank, or even (I think) just remove -arch or -indep and use eg
binary:. Since your install script seems to be installing just perl
and shell scripts, this shouldn't be a problem.
Do consider whether your package really /needs/ it though.
Secondly, the Makefile is totally useless in this case. Here is it:
- ---8<---
etc=/etc
prefix=/usr
package:
dpkg-buildpackage -us -uc -rfakeroot
install-client:
install -m 755 -o root -g root bin/integcheck-shell.pl
$(prefix)/bin/integcheck-shell
install-server:
install -m 755 -o root -g root bin/integcheck-compare.pl
$(prefix)/bin/integcheck-compare
install -m 755 -o root -g root bin/integcheck-run.sh
$(prefix)/bin/integcheck-run
install -m 644 -o root -g root etc/integcheck.cron $(etc)/cron.d/integcheck
- ---8<---
The upstream author provides a debian/ directory (building from it causes
lintian complain about *tons* of things), and the Makefile contains a "package"
target which used dpkg-buildpackage. That's not what we want to use for official
packages, don't we?
Now, I tried to use dh_install into the install-arch target of debian/rules, but
the manpage says it can't rename files. Ok. So I use /usr/bin/install, and
debuild complains about the inability to find ./bin/integcheck-*.
Splitting the installed files into multiple packages actually is a job
for dh_install. Try something like (this is based on the dh_make
template):
install: build
dh_testdir
dh_testroot
dh_clean -k
dh_installdirs
$(MAKE) install prefix=$(CURDIR)/debian/tmp/usr
rm -rf $(CURDIR)/debian/tmp/usr/etc # use dh_installcron for
the crontab, not make install
binary: install
dh_testdir
dh_testroot
dh_installchangelogs
dh_installdocs
dh_installexamples
dh_install --fail-missing --sourcedir=debian/tmp
dh_link
dh_compress
dh_fixperms
dh_installdeb
dh_shlibdeps
dh_gencontrol
dh_md5sums
dh_builddeb
Now put in debian/<binary package name>.install a series of wildcard
patterns for what to include, for example:
debian/integcheck-server.install:
usr/bin/integcheck-compare
usr/bin/integcheck-run
debian/integcheck-client.install
usr/bin/integcheck-shell
For a more complete template debian/rules and etc, delete the debian/
directory and run dh_make.
Reply to: