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

Re: Packaging automation - separation of 'debian/' directory



On Thu, Sep 07, 2006 at 02:03:28PM +1000, Ben Finney wrote:
> So that leads to the question: What "best practices" are there for
> creating the Debian sources ('foo_X.Y.orig.tar.gz', 'foo_X.Y-Z.dsc',
> 'foo_X.Y-Z.diff.gz') automatically from a source working tree that
> already contains the 'debian/' directory?

I ended up using a makefile that automatically builds the .orig.tar.gz
if it doesn't yet exist, leaving away debian/.  The version number on
the .orig.tar.gz is taken from debian/changelog.

--- clip ---
ORIG_NAME = $(shell dpkg-parsechangelog -l$(1)/debian/changelog | grep '^Source:' | cut -d' ' -f2-)_$(shell dpkg-parsechangelog -l$(1)/debian/changelog | grep '^Version:' | cut -d' ' -f2- | cut -d- -f1).orig.tar.gz

define DEBUILD_RULE
ORIG := $(call ORIG_NAME,$(1))
ORIG_TARS := $$(ORIG_TARS) $$(ORIG)

$(1)-build-stamp: $$(ORIG)
$$(ORIG):
	( cd $(1) && fakeroot make -f debian/rules clean )
	$(TAR) czf $$@ --exclude debian --exclude _darcs $(1)
endef

$(foreach pkg, $(OWN_BUILDPKG), $(eval $(call DEBUILD_RULE,$(pkg))))

all: $(ORIG_TARS)

--- clip ---

You can also add make rules for actually building the packages.  As long
as you have the source tree with everything and .orig.tar.gz's as made
above, dpkg-source does the right thing.  (You may want to exclude VC
files, though.)

Panu

-- 
personal contact:	panu.kalliokoski@helsinki.fi, +35841 5323835
technical contact:	atehwa@iki.fi, http://www.iki.fi/atehwa/
PGP fingerprint:	0EA5 9D33 6590 FFD4 921C  5A5F BE85 08F1 3169 70EC
Please consider membership of http://www.hospitalityclub.org/!



Reply to: