#!/usr/bin/make -f # -*- sh -*- # Uncomment this to turn on verbose mode. export DH_VERBOSE=1 # This is the debhelper compatibility version to use. export DH_COMPAT=5 export DEBUILD_DPKG_BUILDPACKAGE_OPTS="-i" #export WITH_GC="--with-gc" export WITH_SIEVE=--with-sieve export WITH_SQLITE=--with-sqlite export WITH_MYSQL=--with-mysql export WITH_PGSQL=--with-pgsql export WITH_LDAP=--with-auth-ldap export SHARED=--enable-shared=yes export SHARED=--enable-static=no CFLAGS = -Wall -O1 LDFLAGS = -lcrypt # 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) ifneq (,$(findstring devel,$(DEB_BUILD_OPTIONS))) export WITH_CHECK=--with-check export WITH_MYSQL= export WITH_PGSQL= export WITH_SQLITE= export WITH_LDAP= export WITH_SIEVE= export SHARED=--enable-shared=no export STATIC=--enable-static=yes CFLAGS += -g endif ifneq (,$(findstring mysql,$(DEB_BUILD_OPTIONS))) export WITH_MYSQL=--with-mysql endif ifneq (,$(findstring pgsql,$(DEB_BUILD_OPTIONS))) export WITH_PGSQL=--with-pgsql endif ifneq (,$(findstring sqlite,$(DEB_BUILD_OPTIONS))) export WITH_SQLITE=--with-sqlite endif ifneq (,$(findstring ldap,$(DEB_BUILD_OPTIONS))) export WITH_LDAP=--with-auth-ldap endif ifneq (,$(findstring sieve,$(DEB_BUILD_OPTIONS))) export WITH_SIEVE=--with-sieve endif ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS))) INSTALL_PROGRAM += -s endif # dpatch export PACKAGE=dbmail export PACKAGES=dbmail include /usr/share/dpatch/dpatch.make CONFFLAGS=--host=$(DEB_HOST_GNU_TYPE) --build=$(DEB_BUILD_GNU_TYPE) \ --prefix=/usr --mandir=\$${prefix}/share/man --sysconfdir=/etc/dbmail \ --localstatedir=/var/run/dbmail --with-logdir=/var/log/dbmail --infodir=\$${prefix}/share/info \ $(WITH_GC) $(WITH_CHECK) $(SHARED) $(STATIC) $(WITH_SIEVE) $(WITH_LDAP) $(WITH_MYSQL) $(WITH_PGSQL) $(WITH_SQLITE) build: stamps/build stamps/build: stamps patch configure $(PACKAGES) touch $@ stamps: mkdir stamps configure: stamps/configure stamps/configure: autoreconf -i touch $@ dbmail: stamps/dbmail stamps/dbmail: $(MAKE) clean || true env CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)" PATH="$(PATH):/usr/lib/postgresql/bin/" \ ./configure $(CONFFLAGS) $(MAKE) $(MAKE) install DESTDIR=$(CURDIR)/debian/tmp touch $@ clean: clean1 unpatch clean1: # run clean dh_testroot dh_testdir rm -rf stamps rm -f `find . -name ".#*"` rm -f `find . -name "*.la"` rm -f `find . -name "*.lo"` rm -f `find . -name "*.o"` rm -f `find . -name "*.pyc"` rm -f `find man -name "*.xml"` rm -f `find man -name "*.[1-8]"` # Add here commands to clean up after the build process. -$(MAKE) clean rm -rf debian/dbmail; \ for file in config.in aclocal.m4 acconfig.h configure `find . -name Makefile.in`; do \ rm -rf $$file || true; \ done rm -rf autom4te.cache for file in Makefile config.h config.status libtool stamp-h .deps .libs; do \ rm -rf `find . -name $$file`; \ done rm -f stamp-h* config.log aclocal.m4 configure dbmail.h rm -rf buildtools || true dh_clean # Build architecture-dependent files here. binary-common: build dh_testroot dh_testdir dh_installdirs -a dh_install -a --sourcedir=debian/tmp dh_installinit -a --name=dbmail -- defaults 25 dh_installcron -a --name=dbmail dh_installlogrotate -a --name=dbmail dh_installdebconf -a dh_installman -a dh_installdocs -a dh_installdocs -A debian/README.Debian debian/TODO dh_installchangelogs -a dh_installexamples -a dh_installdirs -A etc/dbmail var/run/dbmail var/log/dbmail dh_strip -a dh_link -a dh_compress -a dh_fixperms -a dh_installdeb -a dh_makeshlibs -a dh_gencontrol -a dh_md5sums -a dh_builddeb -a binary-indep: build install binary-arch: build install $(MAKE) -f debian/rules DH_OPTIONS=-a binary-common binary-%: build install make -f debian/rules binary-common $* DH_OPTIONS=-p$* binary: binary-indep binary-arch .PHONY: build clean clean1 patch binary binary-common binary-indep binary-arch unpatch configure install