From 3673cf0fd1f41648bb4827f450f1e60e3db90517 Mon Sep 17 00:00:00 2001 From: Reinhard Tartler Date: Thu, 24 Jul 2008 15:15:29 +0200 Subject: add packaging --- debian/rules | 113 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 113 insertions(+) create mode 100755 debian/rules (limited to 'debian/rules') diff --git a/debian/rules b/debian/rules new file mode 100755 index 00000000..50fe8b52 --- /dev/null +++ b/debian/rules @@ -0,0 +1,113 @@ +#!/usr/bin/make -f + +# Uncomment this to turn on verbose mode. +#export DH_VERBOSE=1 + +# These are used for cross-compiling and for saving the configure script +# from having to guess our platform (since we know it already) +DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE) +DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE) + +TMP:=$(CURDIR)/debian/tmp + +ifneq (,$(findstring debug,$(DEB_BUILD_OPTIONS))) + CFLAGS += -g +endif +ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS))) + INSTALL_PROGRAM += -s +endif + +configure: configure-stamp +configure-stamp: + dh_testdir + ./configure $(DEB_EXTRA_CONFIG_FLAGS) LDFLAGS="-Wl,--as-needed" + touch configure-stamp + +build-stamp: configure-stamp + dh_testdir + $(MAKE) + touch build-stamp +ifeq (,$(findstring nocheck,$(DEB_BUILD_OPTIONS))) + -./runtest.pl ALL +endif + +# generated files for removal +GENERATED_FILES = ExceptionCodes.txt infrastructure/BoxPlatform.pm +GENERATED_FILES += lib/common/BoxConfig.h runtest.pl +GENERATED_FILES += infrastructure/makebuildenv.pl +GENERATED_FILES += infrastructure/makedistribution.pl +GENERATED_FILES += infrastructure/makeparcels.pl +GENERATED_FILES += lib/common/makeexception.pl +GENERATED_FILES += lib/raidfile/raidfile-config +GENERATED_FILES += lib/server/makeprotocol.pl +GENERATED_FILES += test/backupstorefix/testfiles/testbackupstorefix.pl +GENERATED_FILES += test/bbackupd/testfiles/extcheck1.pl +GENERATED_FILES += test/bbackupd/testfiles/extcheck2.pl +GENERATED_FILES += test/bbackupd/testfiles/notifyscript.pl +GENERATED_FILES += test/bbackupd/testfiles/syncallowscript.pl +GENERATED_FILES += bin/bbackupd/bbackupd-config +GENERATED_FILES += bin/bbackupquery/makedocumentation.pl +GENERATED_FILES += bin/bbstored/bbstored-certs +GENERATED_FILES += bin/bbstored/bbstored-config + +build: build-stamp + +clean: + dh_testdir + dh_testroot + dh_clean build-stamp configure-stamp + + find . -name '*.o' | xargs --no-run-if-empty rm + find . -name '*.a' | xargs --no-run-if-empty rm + find . -name 'autogen_*' | xargs --no-run-if-empty rm + find . -name '_*' | xargs --no-run-if-empty rm + find . -name 'test-*.log' | xargs --no-run-if-empty rm + find . -name 'Makefile' | xargs --no-run-if-empty rm + + # the test scripts do strange things here + # (directories without write permissions) + [ ! -d debug ] || chmod -R +rw debug/ + rm -fr release/ debug/ local/ parcels/ + + dh_clean config.log config.status + [ ! -f Makefile ] || $(MAKE) clean + dh_clean $(GENERATED_FILES) + +install: DH_OPTIONS= +install: build + dh_testdir + dh_testroot + dh_clean -k + dh_installdirs + + mkdir -p $(TMP)/etc/logcheck/ignore.d.workstation + mkdir -p $(TMP)/etc/logcheck/ignore.d.server + install -m 644 debian/boxbackup-server.logcheck.ignore $(TMP)/etc/logcheck/ignore.d.workstation/boxbackup-server + install -m 644 debian/boxbackup-server.logcheck.ignore $(TMP)/etc/logcheck/ignore.d.server/boxbackup-server + + dh_install + +binary-indep: +# no architecture independant packages are being built + +# Build architecture-dependent files here. +binary-arch: build install + dh_testdir -a + dh_testroot -a + dh_installdebconf -a + dh_installdocs -a -A ExceptionCodes.txt + dh_installinit -a + dh_installcron -a + dh_installman + dh_installchangelogs -a + dh_strip -a + dh_compress -a + dh_fixperms -a + dh_installdeb -a + dh_shlibdeps -a + dh_gencontrol -a + dh_md5sums -a + dh_builddeb -a + +binary: binary-arch +.PHONY: build clean binary-indep binary-arch binary install -- cgit v1.2.3