2 # Sample debian/rules that uses debhelper.
3 # GNU copyright 1997 by Joey Hess.
5 # This version is for a hypothetical package that builds an
6 # architecture-dependant package, as well as an architecture-independent
9 # Uncomment this to turn on verbose mode.
12 # This has to be exported to make some magic below work.
15 CONFIGURE_ROOT=--prefix=/usr --mandir=\$${prefix}/share/man --infodir=\$${prefix}/share/info --sysconfdir=/etc --datadir=/etc --with-ares=/usr --with-hesiod=/usr
17 # see /usr/share/doc/autotools-dev/README.Debian.gz
18 export DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
19 export DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
21 # FOR AUTOCONF 2.52 AND NEWER ONLY
22 ifeq ($(DEB_BUILD_GNU_TYPE), $(DEB_HOST_GNU_TYPE))
23 confflags += --build $(DEB_HOST_GNU_TYPE)
25 confflags += --build $(DEB_BUILD_GNU_TYPE) --host $(DEB_HOST_GNU_TYPE)
29 # The autotools target adds forced build-time dependencies on
30 # autotools-dev (for /usr/share/misc/config.*) and devscripts (for dch)
31 # It's also a .PHONY make target.
34 chmod u+x config.guess
35 OLDDATESUB=`./config.sub -t | tr -d -` ;\
36 OLDDATEGUESS=`./config.guess -t | tr -d -` ;\
37 NEWDATESUB=`/usr/share/misc/config.sub -t | tr -d -` ;\
38 NEWDATEGUESS=`/usr/share/misc/config.guess -t | tr -d -` ;\
39 if [ $$OLDDATESUB -lt $$NEWDATESUB -o \
40 $$OLDDATEGUESS -lt $$NEWDATEGUESS ]; then \
41 dch -a -p "GNU config automated update: config.sub\
42 ($$OLDDATESUB to $$NEWDATESUB), config.guess\
43 ($$OLDDATEGUESS to $$NEWDATEGUESS)" ;\
44 cp -f /usr/share/misc/config.sub config.sub ;\
45 cp -f /usr/share/misc/config.guess config.guess ;\
46 echo WARNING: GNU config scripts updated from master copies 1>&2 ;\
49 configure: configure-stamp autotools
52 # Add here commands to configure the package.
54 cd krb&& CFLAGS=-g ../configure --with-krb4=/usr --with-krb5=/usr $(CONFIGURE_ROOT)
56 cd no-krb&& CFLAGS=-g ../configure $(CONFIGURE_ROOT)
59 build: configure-stamp build-stamp
63 # Add here commands to compile the package.
65 for dir in krb no-krb ; do \
67 rm -f lib/*.o || true; \
73 FPIC=-fpic SONAME=$(SONAME); \
82 -rm -f build-stamp configure-stamp
84 # Add here commands to clean up after the build process.
85 -rm -rf krb no-krb debian/tmp-krb
86 -rm debian/zephyr-server-krb.files
87 -rm debian/zephyr-server-krb.templates
88 -rm debian/zephyr-server-krb.config
89 -rm debian/zephyr-server-krb.postinst
90 -rm debian/libzephyr3-krb.files
99 -rm -rf debian/tmp-krb
102 # Add here commands to install the package into debian/tmp.
103 cd no-krb&&$(MAKE) install DESTDIR=`pwd`/../debian/tmp
104 cd krb&&$(MAKE) DESTDIR=`pwd`/../debian/tmp-krb install
105 mkdir -p debian/tmp/etc/zephyr/acl
106 set -x; for i in debian/acl/*; do install -c -m 644 -o root $$i debian/tmp/etc/zephyr/acl; done; set +x
107 install -c -m 644 debian/zephyr.vars debian/tmp/etc/zephyr
108 install -c -m 644 debian/default.subscriptions debian/tmp/etc/zephyr
109 cp -pr debian/tmp/etc/zephyr/acl debian/tmp-krb/etc/zephyr
111 # Build architecture-independent files here.
112 # Pass -i to all debhelper commands in this target to reduce clutter.
113 binary-indep: build install
115 # Build architecture-dependent files here.
116 # Pass -a to all debhelper commands in this target to reduce clutter.
117 binary-arch: build install
121 for file in files templates config postinst docs; do \
122 cp debian/zephyr-server.$$file debian/zephyr-server-krb.$$file; \
124 cp debian/libzephyr3.files debian/libzephyr3-krb.files
125 dh_movefiles -plibzephyr3 -pzephyr-clients -pzephyr-server -plibzephyr-dev
126 dh_movefiles --sourcedir=debian/tmp-krb -plibzephyr3-krb -pzephyr-server-krb
129 dh_installinit -pzephyr-clients --init-script=zhm --no-start
130 dh_installinit -pzephyr-server-krb --init-script=zephyrd
131 dh_installinit -pzephyr-server --init-script=zephyrd
136 # You may want to make some executables suid here.
139 cp debian/libzephyr3/DEBIAN/shlibs debian/libzephyr3-krb/DEBIAN/shlibs
146 binary: binary-indep binary-arch
148 .PHONY: autotools build clean binary-indep binary-arch binary install configure