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 is the debhelper compatability version to use.
15 # This has to be exported to make some magic below work.
18 CONFIGURE_ROOT=--prefix=/usr --mandir=\$${prefix}/share/man --infodir=\$${prefix}/share/info --sysconfdir=/etc --datadir=/etc --with-ares=/usr --with-hesiod=/usr
20 # see /usr/share/doc/autotools-dev/README.Debian.gz
21 export DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
22 export DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
24 # FOR AUTOCONF 2.52 AND NEWER ONLY
25 ifeq ($(DEB_BUILD_GNU_TYPE), $(DEB_HOST_GNU_TYPE))
26 confflags += --build $(DEB_HOST_GNU_TYPE)
28 confflags += --build $(DEB_BUILD_GNU_TYPE) --host $(DEB_HOST_GNU_TYPE)
32 # The autotools target adds forced build-time dependencies on
33 # autotools-dev (for /usr/share/misc/config.*) and devscripts (for dch)
34 # It's also a .PHONY make target.
37 chmod u+x config.guess
38 OLDDATESUB=`config.sub -t | tr -d -` ;\
39 OLDDATEGUESS=`config.guess -t | tr -d -` ;\
40 NEWDATESUB=`/usr/share/misc/config.sub -t | tr -d -` ;\
41 NEWDATEGUESS=`/usr/share/misc/config.guess -t | tr -d -` ;\
42 if [ $$OLDDATESUB -lt $$NEWDATESUB -o \
43 $$OLDDATEGUESS -lt $$NEWDATEGUESS ]; then \
44 dch -a -p "GNU config automated update: config.sub\
45 ($$OLDDATESUB to $$NEWDATESUB), config.guess\
46 ($$OLDDATEGUESS to $$NEWDATEGUESS)" ;\
47 cp -f /usr/share/misc/config.sub config.sub ;\
48 cp -f /usr/share/misc/config.guess config.guess ;\
49 echo WARNING: GNU config scripts updated from master copies 1>&2 ;\
52 configure: configure-stamp autotools
55 # Add here commands to configure the package.
57 cd krb&&../configure --with-krb4=/usr $(CONFIGURE_ROOT)
59 cd no-krb&&../configure $(CONFIGURE_ROOT)
62 build: configure-stamp build-stamp
66 # Add here commands to compile the package.
68 for dir in krb no-krb ; do \
70 rm -f lib/*.o || true; \
76 FPIC=-fpic SONAME=$(SONAME); \
85 -rm -f build-stamp configure-stamp
87 # Add here commands to clean up after the build process.
88 -rm -rf krb no-krb debian/tmp-krb
89 -rm debian/zephyr-server-krb.files
90 -rm debian/zephyr-server-krb.templates
91 -rm debian/zephyr-server-krb.config
92 -rm debian/zephyr-server-krb.postinst
93 -rm debian/libzephyr3-krb.files
102 -rm -rf debian/tmp-krb
105 # Add here commands to install the package into debian/tmp.
106 cd no-krb&&$(MAKE) install DESTDIR=`pwd`/../debian/tmp
107 cd krb&&$(MAKE) DESTDIR=`pwd`/../debian/tmp-krb install
108 mv debian/tmp/usr/lib/libzephyr.so debian/tmp/usr/lib/libzephyr.so.$(SONAME)
109 ln -s libzephyr.so.$(SONAME) debian/tmp/usr/lib/libzephyr.so
110 mv debian/tmp-krb/usr/lib/libzephyr.so debian/tmp-krb/usr/lib/libzephyr.so.$(SONAME)
111 ln -s libzephyr.so.$(SONAME) debian/tmp-krb/usr/lib/libzephyr.so
112 mkdir -p debian/tmp/etc/zephyr/acl
113 set -x; for i in debian/acl/*; do install -c -m 644 -o root $$i debian/tmp/etc/zephyr/acl; done; set +x
114 install -c -m 644 debian/zephyr.vars debian/tmp/etc/zephyr
115 install -c -m 644 debian/default.subscriptions debian/tmp/etc/zephyr
116 cp -pr debian/tmp/etc/zephyr/acl debian/tmp-krb/etc/zephyr
118 # Build architecture-independent files here.
119 # Pass -i to all debhelper commands in this target to reduce clutter.
120 binary-indep: build install
122 # Build architecture-dependent files here.
123 # Pass -a to all debhelper commands in this target to reduce clutter.
124 binary-arch: build install
128 for file in files templates config postinst docs; do \
129 cp debian/zephyr-server.$$file debian/zephyr-server-krb.$$file; \
131 cp debian/libzephyr3.files debian/libzephyr3-krb.files
132 dh_movefiles -plibzephyr3 -pzephyr-clients -pzephyr-server -plibzephyr-dev
133 dh_movefiles --sourcedir=debian/tmp-krb -plibzephyr3-krb -pzephyr-server-krb
140 dh_installinit -pzephyr-clients --init-script=zhm --no-start
141 dh_installinit -pzephyr-server-krb --init-script=zephyrd
142 dh_installinit -pzephyr-server --init-script=zephyrd
152 # You may want to make some executables suid here.
155 cp debian/libzephyr3/DEBIAN/shlibs debian/libzephyr3-krb/DEBIAN/shlibs
163 binary: binary-indep binary-arch
165 .PHONY: autotools build clean binary-indep binary-arch binary install configure