]> asedeno.scripts.mit.edu Git - 1ts-debian.git/blob - zephyr/debian/rules
c06f918a816360c550a6ce2082e980b1776e4a46
[1ts-debian.git] / zephyr / debian / rules
1 #!/usr/bin/make -f
2 # Sample debian/rules that uses debhelper. 
3 # GNU copyright 1997 by Joey Hess.
4 #
5 # This version is for a hypothetical package that builds an
6 # architecture-dependant package, as well as an architecture-independent
7 # package.
8
9 # Uncomment this to turn on verbose mode. 
10 #export DH_VERBOSE=1
11
12 # This has to be exported to make some magic below work.
13 export DH_OPTIONS
14 CONFIGURE_ROOT=--prefix=/usr --mandir=\$${prefix}/share/man --infodir=\$${prefix}/share/info --sysconfdir=/etc --datadir=/etc  --with-ares=/usr --with-hesiod=/usr
15
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)
19
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)
23 else
24   confflags += --build $(DEB_BUILD_GNU_TYPE) --host $(DEB_HOST_GNU_TYPE)
25 endif
26
27
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.
31 autotools:
32         chmod u+x config.sub
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 ;\
46         fi
47
48 configure: configure-stamp autotools
49 configure-stamp:
50         dh_testdir
51         # Add here commands to configure the package.
52         -mkdir krb5
53         cd krb5 && CFLAGS="" ../configure --with-krb5=/usr --with-openssl=/usr $(CONFIGURE_ROOT)
54         -mkdir krb45
55         cd krb45 && CFLAGS="" ../configure --with-krb4=/usr --with-krb5=/usr $(CONFIGURE_ROOT)
56         -mkdir krb4
57         cd krb4 && CFLAGS="" ../configure --with-krb4=/usr $(CONFIGURE_ROOT)
58         -mkdir no-krb
59         cd no-krb && CFLAGS="" ../configure $(CONFIGURE_ROOT)
60         touch configure-stamp
61
62 build: configure-stamp build-stamp
63 build-stamp:
64         dh_testdir
65
66         # Add here commands to compile the package.
67         set -e; \
68         for dir in krb5 krb45 krb4 ; do  \
69                 $(MAKE) -C $$dir/lib; $(MAKE) -C $$dir/server; \
70         done
71         $(MAKE) -C no-krb
72
73         touch build-stamp
74
75 clean:
76         dh_testdir
77         dh_testroot
78         -rm -f build-stamp configure-stamp
79
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
89
90         dh_clean
91
92 install: DH_OPTIONS=
93 install: build
94         dh_testdir
95         dh_testroot
96         dh_clean -k
97         -rm -rf debian/tmp-krb*
98         dh_installdirs
99
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; \
104         done
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
112
113 # Build architecture-independent files here.
114 # Pass -i to all debhelper commands in this target to reduce clutter.
115 binary-indep: build install
116
117 # Build architecture-dependent files here.
118 # Pass -a to all debhelper commands in this target to reduce clutter.
119 binary-arch: build install
120         dh_testdir
121         dh_testroot
122         set -e; \
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; \
127                 done
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; \
131         done
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
139         dh_installdebconf 
140         dh_installdocs
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
146         dh_installchangelogs 
147         dh_strip
148         dh_compress
149         dh_fixperms
150         # You may want to make some executables suid here.
151         dh_makeshlibs
152         # sigh
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
156         dh_shlibdeps
157         dh_installdeb
158         dh_gencontrol
159         dh_md5sums
160         dh_builddeb
161
162 binary: binary-indep binary-arch
163
164 .PHONY: autotools build clean binary-indep binary-arch binary install configure
165
166