]> asedeno.scripts.mit.edu Git - 1ts-debian.git/blob - zephyr/debian/rules
zephyr (2.1.20010518.SNAPSHOT-16) unstable; urgency=low
[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 is the debhelper compatability version to use.
13 export DH_COMPAT=4
14
15 # This has to be exported to make some magic below work.
16 export DH_OPTIONS
17 SONAME=3
18 CONFIGURE_ROOT=--prefix=/usr --mandir=\$${prefix}/share/man --infodir=\$${prefix}/share/info --sysconfdir=/etc --datadir=/etc  --with-ares=/usr --with-hesiod=/usr
19
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)
23
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)
27 else
28   confflags += --build $(DEB_BUILD_GNU_TYPE) --host $(DEB_HOST_GNU_TYPE)
29 endif
30
31
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.
35 autotools:
36         chmod u+x config.sub
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 ;\
50         fi
51
52 configure: configure-stamp autotools
53 configure-stamp:
54         dh_testdir
55         # Add here commands to configure the package.
56         -mkdir krb
57         cd krb&&../configure --with-krb4=/usr $(CONFIGURE_ROOT)
58         -mkdir no-krb
59         cd no-krb&&../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 krb no-krb ; do  \
69                 cd $$dir; \
70         rm -f lib/*.o || true; \
71                 $(MAKE) -C lib                  \
72                  FPIC=                                  \
73                  LIBEXT=a; \
74                 rm -f lib/*.o; \
75                 $(MAKE) LIBEXT=so \
76                         FPIC=-fpic SONAME=$(SONAME); \
77                 cd ..; \
78                 done
79
80         touch build-stamp
81
82 clean:
83         dh_testdir
84         dh_testroot
85         -rm -f build-stamp configure-stamp
86
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
94
95         dh_clean
96
97 install: DH_OPTIONS=
98 install: build
99         dh_testdir
100         dh_testroot
101         dh_clean -k
102         -rm -rf debian/tmp-krb
103         dh_installdirs
104
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
117
118 # Build architecture-independent files here.
119 # Pass -i to all debhelper commands in this target to reduce clutter.
120 binary-indep: build install
121
122 # Build architecture-dependent files here.
123 # Pass -a to all debhelper commands in this target to reduce clutter.
124 binary-arch: build install
125         dh_testdir
126         dh_testroot
127         set -e; \
128         for file  in  files templates config postinst docs; do \
129                 cp debian/zephyr-server.$$file debian/zephyr-server-krb.$$file; \
130                 done
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
134         dh_installdebconf 
135         dh_installdocs
136 #       dh_installexamples
137 #       dh_installmenu
138 #       dh_installemacsen
139 #       dh_installpam
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
143 #       dh_installcron
144 #       dh_installmanpages
145 #       dh_installinfo
146 #       dh_undocumented
147         dh_installchangelogs 
148         dh_strip
149 #       dh_link
150         dh_compress
151         dh_fixperms
152         # You may want to make some executables suid here.
153         dh_makeshlibs
154         # sigh
155         cp debian/libzephyr3/DEBIAN/shlibs debian/libzephyr3-krb/DEBIAN/shlibs
156         dh_shlibdeps
157         dh_installdeb
158 #       dh_perl
159         dh_gencontrol
160         dh_md5sums
161         dh_builddeb
162
163 binary: binary-indep binary-arch
164
165 .PHONY: autotools build clean binary-indep binary-arch binary install configure
166
167