Re: Separating packages.
(reposted because I think a virus-eater killed the attachment?)
Jeroen van Wolffelaar <firstname.lastname@example.org> writes:
> On Tue, Apr 06, 2004 at 08:18:55AM -0400, Erik Bourget wrote:
>> Fabian Fagerholm <email@example.com> writes:
>> This is perhaps the most difficult thing to understand about Debian
>> packaging. It's implied in several places, and it's briefly spelt out in
>> some other places, but in general, you are referred to "examples" which
>> vary as much as the packages in the Debian archive.
> Maybe it's an idea to improve the available documents? (thinking NM
This is an EXCELLENT idea, I was totally clueless until I found this list and
the policy/NMG were frustratingly almost helpful.
On a related note, here is the rules file that I made after cutting up
dh_make's "Multiple Binary" option. I think that it's a lot clearer when
there is not necessarily arch and indep versions (my packages are a perl
program and a shell-script wrapper to run it via daemontools, so this didn't
really fit the mold).
Something like this should possibly be added to dh_make, as multiple binary !=
arch and indep always, especially with big python, perl, java, etc programs.
What you do is just specify the packages you are making in BUILD_PACKAGES,
INSTALL_PACKAGES, and BINARY_PACKAGES (I'm sure that make has loops but I
don't know how to do them, you could turn this into one variable pretty
easily) and it will Just Go, calling make install-$(PACKAGENAME) with the
appropriate DESTDIR for each package.
For reference, my packages were called "ossadmin" and "ossadmin-run", I left
these in the rules file.
IOW: Here's another 'example'. 8D~
# -*- makefile -*-
# Sample debian/rules that uses debhelper.
# GNU copyright 1997 to 1999 by Joey Hess.
# Modified to make a template file for a multi-binary package with separated
# build-arch and build-indep targets by Bill Allombert 2001
# Hacked up to use wildcarding instead of explicit arch/indep stuff by
# Erik Bourget 2004
# Uncomment this to turn on verbose mode.
# This has to be exported to make some magic below work.
CFLAGS = -Wall -g
BUILD_PACKAGES = build-ossadmin build-ossadmin-run
INSTALL_PACKAGES = install-ossadmin install-ossadmin-run
BINARY_PACKAGES = binary-ossadmin binary-ossadmin-run
ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
CFLAGS += -O0
CFLAGS += -O2
ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
INSTALL_PROGRAM += -s
# nothing to be done
rm -f *-stamp
dh_clean -k -p$*
$(MAKE) install-$* DESTDIR=$(CURDIR)/debian/$*
# Must not depend on anything. This is to be called by
# in another 'make' thread.
# Build architecture independant packages using the common target.
binary-%: build-% install-%
$(MAKE) -f debian/rules DH_OPTIONS=-p$* binary-common
.PHONY: build clean binary install configure