1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81
|
#!/usr/bin/make -f
# -*- makefile -*-
PACKNAME=$(shell dh_listpackages)
SOURCENAME=$(shell dpkg-parsechangelog | grep "Source:" | cut -d ' ' -f 2)
DEBVER=$(shell dpkg-parsechangelog | grep "Version:" | cut -d ' ' -f 2)
VER=$(shell dpkg-parsechangelog | grep "Version:" | cut -d ' ' -f 2 | cut -f 1 -d -)
BINDIR=/usr/sbin
ETCDIR=/etc/$(PACKNAME)
MANDIR=/usr/share/man/man8
LOGROTATEDIR=/etc/logrotate.d
INITDIR=/etc/init.d
DISTFILE=$(SOURCENAME)_$(VER).orig.tar.xz
DISTFILES=$(DISTFILE) $(SOURCENAME)_$(DEBVER).debian.tar.gz
all:
echo $(VER) $(DEBVER) $(MDIST) $(DIST) $(PACKNAME) $(SOURCENAME)
echo $(DEB_HOST_GNU_TYPE) $(DEB_BUILD_GNU_TYPE)
configure:
build:
install:
[ -d $(DESTDIR)/$(MANDIR) ] || mkdir -p $(DESTDIR)/$(MANDIR)
cp $(PACKNAME).8 $(DESTDIR)/$(MANDIR)
[ -d $(DESTDIR)/$(ETCDIR) ] || mkdir -p $(DESTDIR)/$(ETCDIR)
[ -d $(DESTDIR)/$(ETCDIR)/before.d ] || mkdir -p $(DESTDIR)/$(ETCDIR)/before.d
[ -d $(DESTDIR)/$(ETCDIR)/after.d ] || mkdir -p $(DESTDIR)/$(ETCDIR)/after.d
[ -d $(DESTDIR)/$(LOGROTATEDIR)/ ] || mkdir -p $(DESTDIR)/$(LOGROTATEDIR)
cp logrotate $(DESTDIR)/$(LOGROTATEDIR)/$(PACKNAME)
cp conf $(DESTDIR)/$(ETCDIR)
cp plugins.before/* $(DESTDIR)/$(ETCDIR)/before.d/
cp plugins.after/* $(DESTDIR)/$(ETCDIR)/after.d/
install -D init.d $(DESTDIR)/$(INITDIR)/$(PACKNAME)
install -D $(PACKNAME) $(DESTDIR)/$(BINDIR)/$(PACKNAME)
test:
./test1
./test2
clean:
find -name '*~' -exec rm {} \;
#rm -f configure-up-stamp unpack-up-stamp build-up-stamp install-up-stamp
#Set on target rules the policy for tags
tag-release:
git diff
git tag release/$(VER)
tag-debian:
git diff
git tag debian/$(DEBVER)
# Experimental rule to build archive for public distribution
dist: clean
if test -e ../$(DISTFILE) ; then echo "$(DISTFILE) file should be generated only once" ; false ; fi
git diff
sleep 30
git checkout release/$(VER) && cd .. && tar --exclude='.svn' --exclude='debian' --exclude='tmp' --exclude='*~' --exclude='.git' -cf - $(SOURCENAME) | xz -v9 -c > $(DISTFILE)
gpg --armor --detach-sign ../switchconf_$(VER).orig.tar.xz
deb:
git diff
sleep 30
git checkout debian/$(DEBVER)
debuild -uc -us
fakeroot debian/rules clean
dev:
if test -e ../$(DISTFILE) ; then echo "$(DISTFILE) file should be generated only once" ; false ; fi
cd .. && tar --exclude='.svn' --exclude='debian' --exclude='tmp' --exclude='*~' --exclude='.git' -cf - $(SOURCENAME) | xz -v9 -c > $(DISTFILE)
debuild -uc -us
fakeroot debian/rules clean
mv -f ../$(DISTFILE) ../$(DISTFILE).dev
.PHONY: build clean binary-indep binary-arch binary install configure
|