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
18 # see /usr/share/doc/autotools-dev/README.Debian.gz
19 export DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
20 export DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
22 # FOR AUTOCONF 2.52 AND NEWER ONLY
23 ifeq ($(DEB_BUILD_GNU_TYPE), $(DEB_HOST_GNU_TYPE))
24 confflags += --build $(DEB_HOST_GNU_TYPE)
26 confflags += --build $(DEB_BUILD_GNU_TYPE) --host $(DEB_HOST_GNU_TYPE)
30 # The autotools target adds forced build-time dependencies on
31 # autotools-dev (for /usr/share/misc/config.*) and devscripts (for dch)
32 # It's also a .PHONY make target.
35 chmod u+x config.guess
36 OLDDATESUB=`./config.sub -t | tr -d -` ;\
37 OLDDATEGUESS=`./config.guess -t | tr -d -` ;\
38 NEWDATESUB=`/usr/share/misc/config.sub -t | tr -d -` ;\
39 NEWDATEGUESS=`/usr/share/misc/config.guess -t | tr -d -` ;\
40 if [ $$OLDDATESUB -lt $$NEWDATESUB -o \
41 $$OLDDATEGUESS -lt $$NEWDATEGUESS ]; then \
42 dch -a -p "GNU config automated update: config.sub\
43 ($$OLDDATESUB to $$NEWDATESUB), config.guess\
44 ($$OLDDATEGUESS to $$NEWDATEGUESS)" ;\
45 cp -f /usr/share/misc/config.sub config.sub ;\
46 cp -f /usr/share/misc/config.guess config.guess ;\
47 echo WARNING: GNU config scripts updated from master copies 1>&2 ;\
50 configure: configure-stamp autotools
53 # Add here commands to configure the package.
55 cd krb5 && CFLAGS="" ../configure --with-krb5=/usr --with-openssl=/usr $(CONFIGURE_ROOT)
57 cd krb45 && CFLAGS="" ../configure --with-krb4=/usr --with-krb5=/usr $(CONFIGURE_ROOT)
59 cd krb4 && CFLAGS="" ../configure --with-krb4=/usr $(CONFIGURE_ROOT)
61 cd no-krb && CFLAGS="" ../configure $(CONFIGURE_ROOT)
64 build: configure-stamp build-stamp
68 # Add here commands to compile the package.
70 for dir in krb5 krb45 krb4 ; do \
71 $(MAKE) -C $$dir/lib; $(MAKE) -C $$dir/server; \
80 -rm -f build-stamp configure-stamp
82 # Add here commands to clean up after the build process.
83 -rm -rf krb krb4 krb5 krb45 no-krb debian/tmp-krb*
84 -rm debian/zephyr-server-krb.files
85 -rm debian/zephyr-server-krb.templates
86 -rm debian/zephyr-server-krb.config
87 -rm debian/zephyr-server-krb.postinst
88 -rm debian/zephyr-server-krb5.*
89 -rm debian/zephyr-server-krb45.*
90 -rm debian/libzephyr4-krb.files debian/libzephyr4-krb5.files debian/libzephyr4-krb45.files
99 -rm -rf debian/tmp-krb*
102 # Add here commands to install the package into debian/tmp.
103 $(MAKE) -C no-krb DESTDIR=$(CURDIR)/debian/tmp install
104 for dir in krb5 krb45 krb4 ; do \
105 $(MAKE) -C $$dir SUBDIRS="lib server" DESTDIR=$(CURDIR)/debian/tmp-$$dir install; \
107 mkdir -p debian/tmp/etc/zephyr/acl
108 set -x; for i in debian/acl/*; do install -c -m 644 -o root $$i debian/tmp/etc/zephyr/acl; done; set +x
109 install -c -m 644 debian/zephyr.vars debian/tmp/etc/zephyr
110 install -c -m 644 debian/default.subscriptions debian/tmp/etc/zephyr
111 cp -rp debian/tmp/etc/zephyr/acl debian/tmp-krb4/etc/zephyr
112 cp -rp debian/tmp/etc/zephyr/acl debian/tmp-krb5/etc/zephyr
113 cp -rp debian/tmp/etc/zephyr/acl debian/tmp-krb45/etc/zephyr
115 # Build architecture-independent files here.
116 # Pass -i to all debhelper commands in this target to reduce clutter.
117 binary-indep: build install
119 # Build architecture-dependent files here.
120 # Pass -a to all debhelper commands in this target to reduce clutter.
121 binary-arch: build install
125 for file in files templates config postinst docs; do \
126 cp debian/zephyr-server.$$file debian/zephyr-server-krb.$$file; \
127 cp debian/zephyr-server.$$file debian/zephyr-server-krb5.$$file; \
128 cp debian/zephyr-server.$$file debian/zephyr-server-krb45.$$file; \
130 for file in README.Debian docs init postrm; do \
131 cp debian/zephyr-server-krb.$$file debian/zephyr-server-krb5.$$file; \
132 cp debian/zephyr-server-krb.$$file debian/zephyr-server-krb45.$$file; \
134 cp debian/libzephyr4.files debian/libzephyr4-krb.files
135 cp debian/libzephyr4.files debian/libzephyr4-krb5.files
136 cp debian/libzephyr4.files debian/libzephyr4-krb45.files
137 dh_movefiles -plibzephyr4 -pzephyr-clients -pzephyr-server -plibzephyr-dev
138 dh_movefiles --sourcedir=debian/tmp-krb4 -plibzephyr4-krb -pzephyr-server-krb
139 dh_movefiles --sourcedir=debian/tmp-krb5 -plibzephyr4-krb5 -pzephyr-server-krb5
140 dh_movefiles --sourcedir=debian/tmp-krb45 -plibzephyr4-krb45 -pzephyr-server-krb45
143 dh_installinit -pzephyr-clients --init-script=zhm --no-start
144 dh_installinit -pzephyr-server --init-script=zephyrd
145 dh_installinit -pzephyr-server-krb --init-script=zephyrd
146 dh_installinit -pzephyr-server-krb5 --init-script=zephyrd
147 dh_installinit -pzephyr-server-krb45 --init-script=zephyrd
152 # You may want to make some executables suid here.
155 cp debian/libzephyr4/DEBIAN/shlibs debian/libzephyr4-krb/DEBIAN/shlibs
156 cp debian/libzephyr4/DEBIAN/shlibs debian/libzephyr4-krb5/DEBIAN/shlibs
157 cp debian/libzephyr4/DEBIAN/shlibs debian/libzephyr4-krb45/DEBIAN/shlibs
164 binary: binary-indep binary-arch
166 .PHONY: autotools build clean binary-indep binary-arch binary install configure