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.
14 CONFIGURE_ROOT=--prefix=/usr --mandir=\$${prefix}/share/man --infodir=\$${prefix}/share/info --sysconfdir=/etc --datadir=/etc --with-ares=/usr --with-hesiod=/usr
16 # see /usr/share/doc/autotools-dev/README.Debian.gz
17 export DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
18 export DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
20 # FOR AUTOCONF 2.52 AND NEWER ONLY
21 ifeq ($(DEB_BUILD_GNU_TYPE), $(DEB_HOST_GNU_TYPE))
22 confflags += --build $(DEB_HOST_GNU_TYPE)
24 confflags += --build $(DEB_BUILD_GNU_TYPE) --host $(DEB_HOST_GNU_TYPE)
28 # The autotools target adds forced build-time dependencies on
29 # autotools-dev (for /usr/share/misc/config.*) and devscripts (for dch)
30 # It's also a .PHONY make target.
33 chmod u+x config.guess
34 OLDDATESUB=`./config.sub -t | tr -d -` ;\
35 OLDDATEGUESS=`./config.guess -t | tr -d -` ;\
36 NEWDATESUB=`/usr/share/misc/config.sub -t | tr -d -` ;\
37 NEWDATEGUESS=`/usr/share/misc/config.guess -t | tr -d -` ;\
38 if [ $$OLDDATESUB -lt $$NEWDATESUB -o \
39 $$OLDDATEGUESS -lt $$NEWDATEGUESS ]; then \
40 dch -a -p "GNU config automated update: config.sub\
41 ($$OLDDATESUB to $$NEWDATESUB), config.guess\
42 ($$OLDDATEGUESS to $$NEWDATEGUESS)" ;\
43 cp -f /usr/share/misc/config.sub config.sub ;\
44 cp -f /usr/share/misc/config.guess config.guess ;\
45 echo WARNING: GNU config scripts updated from master copies 1>&2 ;\
48 configure: configure-stamp autotools
51 # Add here commands to configure the package.
53 cd krb5 && CFLAGS="" ../configure --with-krb5=/usr --with-openssl=/usr $(CONFIGURE_ROOT)
55 cd krb45 && CFLAGS="" ../configure --with-krb4=/usr --with-krb5=/usr $(CONFIGURE_ROOT)
57 cd krb4 && CFLAGS="" ../configure --with-krb4=/usr $(CONFIGURE_ROOT)
59 cd no-krb && CFLAGS="" ../configure $(CONFIGURE_ROOT)
62 build: configure-stamp build-stamp
66 # Add here commands to compile the package.
68 for dir in krb5 krb45 krb4 ; do \
69 $(MAKE) -C $$dir/lib; $(MAKE) -C $$dir/server; \
78 -rm -f build-stamp configure-stamp
80 # Add here commands to clean up after the build process.
81 -rm -rf krb krb4 krb5 krb45 no-krb debian/tmp-krb*
82 -rm debian/zephyr-server-krb.files
83 -rm debian/zephyr-server-krb.templates
84 -rm debian/zephyr-server-krb.config
85 -rm debian/zephyr-server-krb.postinst
86 -rm debian/zephyr-server-krb5.*
87 -rm debian/zephyr-server-krb45.*
88 -rm debian/libzephyr4-krb.files debian/libzephyr4-krb5.files debian/libzephyr4-krb45.files
97 -rm -rf debian/tmp-krb*
100 # Add here commands to install the package into debian/tmp.
101 $(MAKE) -C no-krb DESTDIR=$(CURDIR)/debian/tmp install
102 for dir in krb5 krb45 krb4 ; do \
103 $(MAKE) -C $$dir SUBDIRS="lib server" DESTDIR=$(CURDIR)/debian/tmp-$$dir 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 -rp debian/tmp/etc/zephyr/acl debian/tmp-krb4/etc/zephyr
110 cp -rp debian/tmp/etc/zephyr/acl debian/tmp-krb5/etc/zephyr
111 cp -rp debian/tmp/etc/zephyr/acl debian/tmp-krb45/etc/zephyr
113 # Build architecture-independent files here.
114 # Pass -i to all debhelper commands in this target to reduce clutter.
115 binary-indep: build install
117 # Build architecture-dependent files here.
118 # Pass -a to all debhelper commands in this target to reduce clutter.
119 binary-arch: build install
123 for file in files templates config postinst docs; do \
124 cp debian/zephyr-server.$$file debian/zephyr-server-krb.$$file; \
125 cp debian/zephyr-server.$$file debian/zephyr-server-krb5.$$file; \
126 cp debian/zephyr-server.$$file debian/zephyr-server-krb45.$$file; \
128 for file in README.Debian docs init postrm; do \
129 cp debian/zephyr-server-krb.$$file debian/zephyr-server-krb5.$$file; \
130 cp debian/zephyr-server-krb.$$file debian/zephyr-server-krb45.$$file; \
132 cp debian/libzephyr4.files debian/libzephyr4-krb.files
133 cp debian/libzephyr4.files debian/libzephyr4-krb5.files
134 cp debian/libzephyr4.files debian/libzephyr4-krb45.files
135 dh_movefiles -plibzephyr4 -pzephyr-clients -pzephyr-server -plibzephyr-dev
136 dh_movefiles --sourcedir=debian/tmp-krb4 -plibzephyr4-krb -pzephyr-server-krb
137 dh_movefiles --sourcedir=debian/tmp-krb5 -plibzephyr4-krb5 -pzephyr-server-krb5
138 dh_movefiles --sourcedir=debian/tmp-krb45 -plibzephyr4-krb45 -pzephyr-server-krb45
141 dh_installinit -pzephyr-clients --init-script=zhm --no-start
142 dh_installinit -pzephyr-server --init-script=zephyrd
143 dh_installinit -pzephyr-server-krb --init-script=zephyrd
144 dh_installinit -pzephyr-server-krb5 --init-script=zephyrd
145 dh_installinit -pzephyr-server-krb45 --init-script=zephyrd
150 # You may want to make some executables suid here.
153 cp debian/libzephyr4/DEBIAN/shlibs debian/libzephyr4-krb/DEBIAN/shlibs
154 cp debian/libzephyr4/DEBIAN/shlibs debian/libzephyr4-krb5/DEBIAN/shlibs
155 cp debian/libzephyr4/DEBIAN/shlibs debian/libzephyr4-krb45/DEBIAN/shlibs
162 binary: binary-indep binary-arch
164 .PHONY: autotools build clean binary-indep binary-arch binary install configure