summaryrefslogtreecommitdiff
path: root/debian/rules
diff options
context:
space:
mode:
Diffstat (limited to 'debian/rules')
-rwxr-xr-xdebian/rules304
1 files changed, 304 insertions, 0 deletions
diff --git a/debian/rules b/debian/rules
new file mode 100755
index 0000000..3f3a730
--- /dev/null
+++ b/debian/rules
@@ -0,0 +1,304 @@
+#!/usr/bin/make -f
+# Sample debian/rules that uses debhelper.
+# This file is public domain software, originally written by Joey Hess.
+#
+# This version is for a hypothetical package that builds an
+# architecture-dependant package, as well as an architecture-independent
+# package.
+
+# Uncomment this to turn on verbose mode.
+export DH_VERBOSE=1
+
+buildname=$${build:-`$(SHELL) scripts/os-type`-`$(SHELL) scripts/arch-type`}
+
+# Include dpatch stuff.
+include /usr/share/dpatch/dpatch.make
+
+DEBIAN:=$(shell pwd)/debian
+
+CFLAGS = -g -Wall -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE
+
+ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
+CFLAGS += -O0
+else
+CFLAGS += -O2
+endif
+
+export CFLAGS
+
+# Which packages should we build?
+buildbasepackages=yes
+
+builddaemonpackages=exim4-daemon-heavy
+# If you want to build a daemon with a configuration tailored to YOUR special
+# needs, call "fakeroot debian/rules unpack-configs", copy EDITME.exim4-light
+# to EDITME.exim4-custom and modify it.
+#
+# Afterwards EITHER disable the definition of builddaemonpackages 4 lines above
+# by adding a hash-mark (#) at the start of the line and enable the one
+# below instead by removing the hash-mark OR simply call
+# "fakeroot debian/rules buildbasepackages=no builddaemonpackages=exim4-daemon-custom binary"
+#builddaemonpackages=exim4-daemon-custom
+
+# If you want to build a source-package that builds the custom daemon call
+# "fakeroot debian/rules pack-configs" after customizing EDITME.exim4-custom
+
+ifeq ($(buildbasepackages),yes)
+buildpackages=exim4-base exim4-daemon-light eximon4 $(builddaemonpackages)
+else
+buildpackages=$(builddaemonpackages)
+endif
+
+# generate -pexim4-base -peximon4 ... commandline for debhelper
+dhbuildpackages=$(addprefix -p,$(buildpackages))
+# exim4-daemon-light --> build-exim4-daemon-light/exim
+daemonbinaries=$(addprefix build-,$(addsuffix /exim,$(builddaemonpackages)))
+debiandaemonbinaries=$(addprefix $(DEBIAN)/,$(addsuffix /usr/sbin/exim4,$(builddaemonpackages)))
+
+unpack-configs: patch
+ patch -o EDITME.exim4-light src/EDITME debian/EDITME.exim4-light.diff
+ patch -o EDITME.exim4-heavy EDITME.exim4-light debian/EDITME.exim4-heavy.diff
+ if [ -f debian/EDITME.exim4-custom.diff ]; then \
+ patch -o EDITME.exim4-custom EDITME.exim4-light debian/EDITME.exim4-custom.diff;\
+ fi
+ patch -o EDITME.eximon exim_monitor/EDITME debian/EDITME.eximon.diff
+
+pack-configs: patch
+ -diff -u src/EDITME EDITME.exim4-light > debian/EDITME.exim4-light.diff
+ -diff -u EDITME.exim4-light EDITME.exim4-heavy > debian/EDITME.exim4-heavy.diff
+ -if [ -f EDITME.exim4-custom ]; then \
+ diff -u EDITME.exim4-light EDITME.exim4-custom \
+ > debian/EDITME.exim4-custom.diff;\
+ fi
+ -diff -u exim_monitor/EDITME EDITME.eximon > debian/EDITME.eximon.diff
+
+configure: configure-stamp
+
+# the patches might change src/EDITME.
+configure-stamp: patch-stamp
+ dh_testdir
+ # Add here commands to configure the package.
+ patch -o EDITME.exim4-light src/EDITME debian/EDITME.exim4-light.diff
+ patch -o EDITME.exim4-heavy EDITME.exim4-light debian/EDITME.exim4-heavy.diff
+ if [ -f debian/EDITME.exim4-custom.diff ]; then \
+ patch -o EDITME.exim4-custom EDITME.exim4-light debian/EDITME.exim4-custom.diff;\
+ fi
+ patch -o EDITME.eximon exim_monitor/EDITME debian/EDITME.eximon.diff
+
+ touch configure-stamp
+
+# Build binaries for the base package, the eximon4 package, and the
+# exim4-daemon-light package.
+build-exim4-daemon-light/exim: configure-stamp
+ echo build-exim4-daemon-light
+ dh_testdir
+
+ rm -rf build-$(buildname)
+ # Add here command to compile/build the package.
+ mkdir -p Local
+ cp EDITME.exim4-light Local/Makefile
+ cp EDITME.eximon Local/eximon.conf
+ $(MAKE)
+ mv build-$(buildname) build-exim4-daemon-light
+
+build-exim4-daemon-custom/exim: configure-stamp
+ echo build-exim4-daemon-custom
+ dh_testdir
+
+ rm -rf build-$(buildname)
+ # Add here command to compile/build the package.
+ mkdir -p Local
+ cp EDITME.exim4-custom Local/Makefile
+ $(MAKE) Local/Makefile configure
+ # This is a kludge. The upstream Makefile should be fixed, really.
+ $(MAKE) -C build-$(buildname) checklocalmake Makefile os.h os.c config.h buildpcre buildlookups buildrouters buildtransports buildauths exim
+ mv build-$(buildname) build-exim4-daemon-custom
+
+build-exim4-daemon-heavy/exim: configure-stamp
+ echo build-exim4-daemon-heavy
+ dh_testdir
+
+ rm -rf build-$(buildname)
+ # Add here command to compile/build the package.
+ mkdir -p Local
+ cp EDITME.exim4-heavy Local/Makefile
+ $(MAKE) Local/Makefile configure
+ # This is a kludge. The upstream Makefile should be fixed, really.
+ $(MAKE) -C build-$(buildname) checklocalmake Makefile os.h os.c config.h buildpcre buildlookups buildrouters buildtransports buildauths exim
+ mv build-$(buildname) build-exim4-daemon-heavy
+ # build perl localscan-plugin
+ make -C contrib/local-scan-perl
+
+build-indep: build-indep-stamp
+build-indep-stamp:
+ dh_testdir
+
+ # Add here command to compile/build the arch indep package.
+ # It's ok not to do anything here, if you don't need to build
+ # anything for this package.
+ #/usr/bin/docbook-to-man debian/exim.sgml > exim.1
+
+ touch build-indep-stamp
+
+build-arch: build-arch-stamp
+
+ifeq ($(buildbasepackages),yes)
+build-arch-stamp: build-exim4-daemon-light/exim $(daemonbinaries)
+else
+build-arch-stamp: $(daemonbinaries)
+endif
+ dh_testdir
+ touch build-arch-stamp
+
+build: build-arch build-indep
+
+clean: cleanfiles unpatch
+
+cleanfiles:
+ dh_testdir
+ dh_testroot
+ rm -f build-stamp configure-stamp installbase-stamp
+
+ # Add here commands to clean up after the build process.
+ -$(MAKE) clean
+ -$(MAKE) -C contrib/local-scan-perl clean
+ -rm -rf build-* doc/tmp
+ -rm -f EDITME.* Local/Makefile Local/eximon.conf
+
+ chmod 755 $(DEBIAN)/exim-gencert
+ dh_clean
+
+installbase-stamp: build-exim4-daemon-light/exim
+ dh_testdir
+ dh_testroot
+ dh_clean -k
+ dh_installdirs
+
+ rm -rf build-$(buildname)
+ ln -s build-exim4-daemon-light build-$(buildname)
+ $(MAKE) install \
+ INSTALL_ARG=-no_symlink \
+ inst_conf=$(DEBIAN)/exim4-base/usr/share/doc/exim4-base/examples/example.conf \
+ inst_aliases=$(DEBIAN)/exim4-base/usr/share/doc/exim4-base/examples/aliases \
+ inst_dest=$(DEBIAN)/exim4-base/usr/sbin
+ sed -e 's,PERL_COMMAND,/usr/bin/perl,' < src/convert4r4.src \
+ > $(DEBIAN)/exim4-base/usr/sbin/exim_convert4r4
+ chmod 755 $(DEBIAN)/exim4-base/usr/sbin/exim_convert4r4
+ mv $(DEBIAN)/exim4-base/usr/sbin/exim \
+ $(DEBIAN)/exim4-daemon-light/usr/sbin/exim4
+ mv $(DEBIAN)/exim4-base/usr/sbin/eximon \
+ $(DEBIAN)/eximon4/usr/sbin
+ mv $(DEBIAN)/exim4-base/usr/sbin/eximon.bin \
+ $(DEBIAN)/eximon4/usr/lib/exim4
+ pod2man --center=EXIM4 --section=8 \
+ $(DEBIAN)/exim4-base/usr/sbin/eximstats \
+ $(DEBIAN)/exim4-base/usr/share/man/man8/eximstats.8
+ # if you change anything here, you will have to change
+ # config-custom/debian/rules as well
+ sed -e \
+ "s/^UPEX4C_version=\"\"/UPEX4C_version=\"`dpkg-parsechangelog | sed -n '/^Version: /s/^Version: //p'`\"/" \
+ < $(DEBIAN)/debconf/update-exim4.conf \
+ > $(DEBIAN)/exim4-config/usr/sbin/update-exim4.conf
+ chmod 755 $(DEBIAN)/exim4-config/usr/sbin/update-exim4.conf
+ install -m 755 $(DEBIAN)/update-exim4defaults $(DEBIAN)/exim4-config/usr/sbin
+
+ cd $(DEBIAN)/debconf/conf.d && \
+ tar cf - `find \( -path '*/CVS/*' -prune \) -or \( -type f -print \)` | \
+ { cd $(DEBIAN)/exim4-config/etc/exim4/conf.d/ && \
+ tar xf - ; }
+
+ # ship a copy in examples
+ # install -m644 debian/debconf/exim4.conf.template debian/exim4-config/usr/share/doc/exim4-config/examples/exim4.conf.template.debconf
+ install -m644 debian/email-addresses debian/exim4-config/etc/exim4
+ install -m755 debian/ip-up.d debian/exim4-config/etc/ppp/ip-up.d/exim4
+# dh_movefiles
+ touch installbase-stamp
+
+
+# This dependency expands to
+# debian/exim4-daemon-heavy/usr/sbin/exim4: build-exim4-daemon-heavy/exim
+$(debiandaemonbinaries): $(DEBIAN)/%/usr/sbin/exim4: build-%/exim
+ dh_testdir
+ dh_testroot
+ dh_installdirs
+ install -m4755 -oroot -groot $< $@
+
+
+# Build architecture-independent files here.
+# this is just exim4-config and exim4.
+binary-indep: build $(install)
+ifeq ($(buildbasepackages),yes)
+ dh_testdir -i
+ dh_testroot -i
+ # upstream changelog is only in exim4-base
+ dh_link -i
+ dh_installchangelogs -i
+ dh_installdocs -i
+ dh_installexamples -i
+ #dh_installmenu -i
+ dh_installdebconf -i
+ dh_installlogrotate -i
+# dh_installemacsen -i
+ #dh_installpam -i
+ #dh_installmime -i
+# dh_installinit -i
+ dh_installcron -i
+# dh_installinfo -i
+# dh_undocumented -i
+ dh_installman -i
+ dh_install -i
+ dh_strip -i
+ dh_compress -i
+ dh_fixperms -i
+# dh_makeshlibs -i
+ dh_installdeb -i
+# dh_perl -i
+ dh_shlibdeps -i
+ dh_gencontrol -i
+ dh_md5sums -i
+ dh_builddeb -i
+endif
+
+# Build architecture-dependent files here.
+ifeq ($(buildbasepackages),yes)
+install=installbase-stamp $(debiandaemonbinaries)
+else
+install=$(debiandaemonbinaries)
+endif
+
+binary-arch: build $(install)
+ dh_testdir $(dhbuildpackages)
+ dh_testroot $(dhbuildpackages)
+ # upstream changelog is only in exim4-base, the other packages include
+ # a symlink
+ dh_installchangelogs -pexim4-base doc/ChangeLog
+ # remove "-pexim4-base" from "-pexim4-base -pexim4-daemon-light ..."
+ dh_installchangelogs $(subst -pexim4-base,,$(dhbuildpackages))
+ dh_installdocs $(dhbuildpackages)
+ dh_installexamples $(dhbuildpackages)
+ dh_installmenu $(dhbuildpackages)
+ dh_installdebconf $(dhbuildpackages)
+ dh_installlogrotate $(dhbuildpackages)
+# dh_installemacsen $(dhbuildpackages)
+ dh_installpam $(dhbuildpackages)
+ dh_installmime $(dhbuildpackages)
+ dh_installinit $(dhbuildpackages) --noscripts --init-script=exim4
+ dh_installcron $(dhbuildpackages)
+# dh_installinfo $(dhbuildpackages)
+# dh_undocumented $(dhbuildpackages)
+ dh_installman $(dhbuildpackages)
+ dh_install $(dhbuildpackages)
+ dh_strip $(dhbuildpackages)
+ dh_link $(dhbuildpackages)
+ dh_compress $(dhbuildpackages)
+ dh_fixperms $(dhbuildpackages) -Xusr/sbin/exim4
+# dh_makeshlibs $(dhbuildpackages)
+ dh_installdeb $(dhbuildpackages)
+# dh_perl $(dhbuildpackages)
+ dh_shlibdeps $(dhbuildpackages)
+ dh_gencontrol $(dhbuildpackages)
+ dh_md5sums $(dhbuildpackages)
+ dh_builddeb $(dhbuildpackages)
+
+binary: binary-arch binary-indep
+.PHONY: build clean binary-indep binary-arch binary install