]> asedeno.scripts.mit.edu Git - 1ts-debian.git/blob - zephyr/debian/rules
finalize -3
[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 SONAME=3
15 CONFIGURE_ROOT=--prefix=/usr --mandir=\$${prefix}/share/man --infodir=\$${prefix}/share/info --sysconfdir=/etc --datadir=/etc  --with-ares=/usr --with-hesiod=/usr
16
17 # see /usr/share/doc/autotools-dev/README.Debian.gz
18 export DEB_HOST_GNU_TYPE  ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
19 export DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
20
21 # FOR AUTOCONF 2.52 AND NEWER ONLY
22 ifeq ($(DEB_BUILD_GNU_TYPE), $(DEB_HOST_GNU_TYPE))
23   confflags += --build $(DEB_HOST_GNU_TYPE)
24 else
25   confflags += --build $(DEB_BUILD_GNU_TYPE) --host $(DEB_HOST_GNU_TYPE)
26 endif
27
28
29 # The autotools target adds forced build-time dependencies on
30 # autotools-dev (for /usr/share/misc/config.*) and devscripts (for dch)
31 # It's also a .PHONY make target.
32 autotools:
33         chmod u+x config.sub
34         chmod u+x config.guess
35         OLDDATESUB=`./config.sub -t | tr -d -` ;\
36         OLDDATEGUESS=`./config.guess -t | tr -d -` ;\
37         NEWDATESUB=`/usr/share/misc/config.sub -t | tr -d -` ;\
38         NEWDATEGUESS=`/usr/share/misc/config.guess -t | tr -d -` ;\
39         if [ $$OLDDATESUB -lt $$NEWDATESUB -o \
40              $$OLDDATEGUESS -lt $$NEWDATEGUESS ]; then \
41            dch -a -p "GNU config automated update: config.sub\
42              ($$OLDDATESUB to $$NEWDATESUB), config.guess\
43              ($$OLDDATEGUESS to $$NEWDATEGUESS)" ;\
44            cp -f /usr/share/misc/config.sub config.sub ;\
45            cp -f /usr/share/misc/config.guess config.guess ;\
46            echo WARNING: GNU config scripts updated from master copies 1>&2 ;\
47         fi
48
49 configure: configure-stamp autotools
50 configure-stamp:
51         dh_testdir
52         # Add here commands to configure the package.
53         -mkdir krb
54         cd krb&&../configure --with-krb4=/usr $(CONFIGURE_ROOT)
55         -mkdir no-krb
56         cd no-krb&&../configure $(CONFIGURE_ROOT)
57         touch configure-stamp
58
59 build: configure-stamp build-stamp
60 build-stamp:
61         dh_testdir
62
63         # Add here commands to compile the package.
64         set -e; \
65         for dir in krb no-krb ; do  \
66                 cd $$dir; \
67         rm -f lib/*.o || true; \
68                 $(MAKE) -C lib                  \
69                  FPIC=                                  \
70                  LIBEXT=a; \
71                 rm -f lib/*.o; \
72                 $(MAKE) LIBEXT=so \
73                         FPIC=-fpic SONAME=$(SONAME); \
74                 cd ..; \
75                 done
76
77         touch build-stamp
78
79 clean:
80         dh_testdir
81         dh_testroot
82         -rm -f build-stamp configure-stamp
83
84         # Add here commands to clean up after the build process.
85         -rm -rf krb no-krb debian/tmp-krb
86         -rm debian/zephyr-server-krb.files
87         -rm debian/zephyr-server-krb.templates
88         -rm debian/zephyr-server-krb.config
89         -rm debian/zephyr-server-krb.postinst
90         -rm debian/libzephyr3-krb.files
91
92         dh_clean
93
94 install: DH_OPTIONS=
95 install: build
96         dh_testdir
97         dh_testroot
98         dh_clean -k
99         -rm -rf debian/tmp-krb
100         dh_installdirs
101
102         # Add here commands to install the package into debian/tmp.
103         cd no-krb&&$(MAKE) install DESTDIR=`pwd`/../debian/tmp
104         cd krb&&$(MAKE)  DESTDIR=`pwd`/../debian/tmp-krb 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 -pr debian/tmp/etc/zephyr/acl debian/tmp-krb/etc/zephyr
110
111 # Build architecture-independent files here.
112 # Pass -i to all debhelper commands in this target to reduce clutter.
113 binary-indep: build install
114
115 # Build architecture-dependent files here.
116 # Pass -a to all debhelper commands in this target to reduce clutter.
117 binary-arch: build install
118         dh_testdir
119         dh_testroot
120         set -e; \
121         for file  in  files templates config postinst docs; do \
122                 cp debian/zephyr-server.$$file debian/zephyr-server-krb.$$file; \
123                 done
124         cp debian/libzephyr3.files debian/libzephyr3-krb.files
125         dh_movefiles  -plibzephyr3 -pzephyr-clients -pzephyr-server -plibzephyr-dev
126         dh_movefiles --sourcedir=debian/tmp-krb -plibzephyr3-krb -pzephyr-server-krb
127         dh_installdebconf 
128         dh_installdocs
129 #       dh_installexamples
130 #       dh_installmenu
131 #       dh_installemacsen
132 #       dh_installpam
133         dh_installinit -pzephyr-clients --init-script=zhm --no-start
134         dh_installinit -pzephyr-server-krb --init-script=zephyrd
135         dh_installinit -pzephyr-server --init-script=zephyrd
136 #       dh_installcron
137 #       dh_installmanpages
138 #       dh_installinfo
139 #       dh_undocumented
140         dh_installchangelogs 
141         dh_strip
142 #       dh_link
143         dh_compress
144         dh_fixperms
145         # You may want to make some executables suid here.
146         dh_makeshlibs
147         # sigh
148         cp debian/libzephyr3/DEBIAN/shlibs debian/libzephyr3-krb/DEBIAN/shlibs
149         dh_shlibdeps
150         dh_installdeb
151 #       dh_perl
152         dh_gencontrol
153         dh_md5sums
154         dh_builddeb
155
156 binary: binary-indep binary-arch
157
158 .PHONY: autotools build clean binary-indep binary-arch binary install configure
159
160