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 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102
|
#! /usr/bin/make -f
# Debian -*-makefile-*- rules for building 'cfengine'
package := cfengine
PWD := $(shell pwd)
SHELL := /bin/bash
# Builds the binary package.
build: stamp-build
stamp-build:
chmod +x configure config.sub config.guess install-sh
-test ! -f stamp-configure && \
./configure --prefix=/usr && \
touch stamp-configure
$(MAKE) CFLAGS="-g3 -O2" LIBS="-lwrap -ldb -lm -L../pub -lcfpub -lnsl"
cd doc && $(MAKE) cfengine.html
cd doc && $(MAKE) cfengine.info
touch stamp-build
# Undoes the effect of `debian/rules build'.
clean:
rm -f stamp-* 0
-$(MAKE) distclean
rm -rf $$(find debian/* -type d) doc/*.html
rm -rf debian/tmp debian/substvars debian/files
find . \( -name "*~" -o -name "#*" \) -exec rm -f {} \;
find .. -name $(package)*dsc.asc -size 0 -maxdepth 1 -exec rm {} ";"
chmod +x debian/postinst debian/prerm
binary: binary-indep binary-arch
# Makes a binary package.
binary-indep: stamp-build
@echo "No architecture-independent packages."
binary-arch: stamp-build
# Clean before we install
-rm -rf debian/tmp && install -d debian/tmp
-rm -f debian/*.debhelper
# Setup the directory structure
cd debian/tmp && install -d $$(cat ../dirs)
# Install the darned thing
$(MAKE) install prefix=`pwd`/debian/tmp/usr
# Move the files to the correct place (FSSTD)
mv debian/tmp/usr/share/$(package)/*example \
debian/tmp/usr/doc/$(package)/examples
mv debian/tmp/usr/sbin/* debian/tmp/usr/lib/$(package)/bin
mv debian/tmp/usr/lib/$(package)/bin/cfengine \
debian/tmp/usr/bin/cfengine
# Change the paths in the various scripts
cd debian/tmp/usr/share/$(package); for file in * ; do \
mv $$file /tmp ;\
sed </tmp/$$file >$$file \
-e "s|/local/gnu/lib/$(package)|/usr/lib/$(package)|g" \
-e "s|/iu/nexus|...wherever...|g" \
-e "s|/local/gnu/bin|/bin|g" \
-e "s|/usr/lib/$(package)/inputs|/etc/$(package)|g" ;\
rm -f /tmp/$$file ;\
done
cd debian/tmp/usr && mv share/$(package)/* lib/$(package)/bin
rmdir debian/tmp/usr/sbin debian/tmp/usr/share/$(package)
# Install TexInfo-documentation
install -o root -g root -m 644 -p doc/cfengine.info* debian/tmp/usr/info
# Install example configurations
cp debian/*.conf debian/tmp/usr/doc/$(package)/examples/
# Install default configuration
install -m 755 -p debian/cf.empty.conf \
debian/tmp/etc/$(package)/$(package).conf
# Remove backups
find debian/tmp \( -name "*~" -o -name "#*" \) -exec rm -vf {} \;
# Change some executable-bits debhelper won't touch
chmod 755 debian/tmp/usr/lib/cfengine/bin/*
# Oops, we did too much!
chmod a-x debian/tmp/usr/lib/cfengine/bin/backup.exclude
# Do the debhelper-dance
dh_installchangelogs VERSION.DIFF
dh_installdocs README doc/cfengine.html
dh_installmanpages
dh_installcron
dh_installdeb
dh_strip
dh_compress
dh_fixperms
dh_md5sums
dh_shlibdeps
dpkg-gencontrol -is -ip
dh_builddeb
|