File: rules

package info (click to toggle)
zephyr 2.0.4-7
  • links: PTS
  • area: main
  • in suites: potato
  • size: 2,796 kB
  • ctags: 2,989
  • sloc: ansic: 29,327; sh: 1,447; makefile: 957; yacc: 498; lex: 137; lisp: 127
file content (150 lines) | stat: -rwxr-xr-x 4,107 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
#!/usr/bin/make -f

# Uncomment this to turn on verbose mode. 
#export DH_VERBOSE=1

host=$$(dpkg --print-architecture)-debian-linux
VERSION=2.0.4
SONAME=2

WITHOUT_HESIOD=--without-hesiod

#PACKAGES=$(shell sed -n '/-doc/d;/garbage/d;s/^Package: \(.*\)$$/\1/p' < debian/control)

#IPACKAGES=$(filter %-i,$(PACKAGES))
#USPACKAGES=$(filter-out %-i,$(PACKAGES))

#P_US=$(USPACKAGES:%=-p%)
#P_I =$(IPACKAGES:%=-p%)

#ifeq ($(shell test -e international-stamp || echo us-only),)
# WITHOUT_KRB4=
# I=-i
# P=$(P_I)
#else
 WITHOUT_KRB4=--without-krb4
 I=
# P=$(P_US)
#endif

debug:
	@echo $P
	@echo $I
	@echo $(WITHOUT_KRB4)

build: build-stamp
build-stamp:
	dh_testdir
	@if [ -d /usr/athena ] ; then echo Error, /usr/athena exists, this will cause problems ; exit 1 ; fi

	  CPPFLAGS='-I/usr/include/et'  	\
	  confdir='/etc/zephyr'			\
	  lsbindir='/usr/sbin'			\
	./configure --enable-athena     	\
	 --prefix='/usr'			\
	 --datadir='/usr/share/zephyr' 		\
	 --mandir='/usr/share/man' 		\
	 $(WITHOUT_HESIOD) $(WITHOUT_KRB4)	\
	 --host="${host}"
	$(MAKE) 				\
	 READLINE_LIBS=-lreadline		\
	 READLINE_CFLAGS=-DHAVE_READLINE	\
	 FPIC=-fPIC				\
	 SONAME=$(SONAME) 			\
	 LIBEXT=so
	rm -f lib/zephyr/*.o
	$(MAKE) -C lib/zephyr			\
	 FPIC= 					\
	 LIBEXT=a
	rm -f lib/zephyr/*.o

	touch build-stamp

clean:
	dh_testdir
	! test -d debian/tmp || test -O debian/tmp || dh_testroot
	rm -f build-stamp

	-$(MAKE) clean
	rm -f $$(find . -name configure.in -o -name '*.in' -print | sed 's/\.in$$//')
	rm -f config.cache config.status config.log stamp-config
	rm -rf clients/zwgc/y.tab.h h/com_err.h h/ss h/zephyr/zephyr_err.h server/version.h

	dh_clean


binary-indep: build-stamp
	dh_testdir -i
	dh_testroot -i
	dh_clean -i -k

	dh_installdocs -i 
	dh_installchangelogs -i
	dh_compress -i
	dh_fixperms -i
	dh_installdeb -i
	dh_gencontrol -u-isp -i
	dh_md5sums -i
	dh_builddeb -i

binary-arch: build-stamp
	dh_testdir
	dh_testroot
	dh_clean -a -k

#	LIBEXT is so it doesn't notice the new .a's and relink the programs
	$(MAKE) 				\
	 LIBEXT=so				\
	 confdir="`pwd`/debian/tmp/etc/zephyr"	\
	 lsbindir="`pwd`/debian/tmp/usr/sbin"	\
	 prefix="`pwd`/debian/tmp/usr"		\
	 datadir="`pwd`/debian/tmp/usr/share/zephyr"	\
	 install

#	the makefile seems to ignore --mandir, sigh
	mv -f debian/tmp/usr/man debian/tmp/usr/share/man

	mv debian/tmp/usr/lib/libzephyr.so debian/tmp/usr/lib/libzephyr.so.$(VERSION)
	ln -s libzephyr.so.$(VERSION) debian/tmp/usr/lib/libzephyr.so.2
	ln -s libzephyr.so.$(VERSION) debian/tmp/usr/lib/libzephyr.so

# 	I'm not even sure this syslogd works on linux, someone should try it
	mv debian/tmp/usr/sbin/syslogd debian/tmp/usr/sbin/zsyslogd
	mv debian/tmp/usr/share/man/man8/syslogd.8 debian/tmp/usr/share/man/man8/zsyslogd.8

	install -m 755 -o root -g root debian/zinit 		debian/tmp/usr/sbin/zinit
	install -m 644 -o root -g root debian/zinit.8 		debian/tmp/usr/share/man/man8/zinit.8
	install -m 755 -o root -g root debian/zephyrconfig	debian/tmp/usr/sbin/zephyrconfig
	install -m 644 -o root -g root debian/zephyrconfig.8 	debian/tmp/usr/share/man/man8/zephyrconfig.8

	install -d debian/tmp/etc/init.d
	install -m 755 -o root -g root debian/zhm.init 		debian/tmp/etc/init.d/zhm
	install -m 755 -o root -g root debian/zephyrd.init 	debian/tmp/etc/init.d/zephyrd

	dh_movefiles -a $P
#	-rmdir `find debian/tmp -depth -type d -print`
	install -m 755 -o root -g root --directory 		debian/libzephyr2$I/etc/zephyr/zinit.d

	dh_installdocs -a $P
	dh_installexamples -a $P
	dh_installmenu -a $P
	dh_installchangelogs -a $P
	dh_strip -a $P
	dh_compress -a $P
	dh_fixperms -a $P
	dh_installdeb -a $P

	cd debian/zephyr-server$I ; ls etc/zephyr/acl/* | sed 's;^;/;' >> DEBIAN/conffiles

	LD_LIBRARY_PATH=`pwd`/debian/tmp/usr/lib \
	 dh_shlibdeps -a $P -u-Ldebian/shlibs.local$I
	dh_gencontrol -u-isp -a $P
	dh_md5sums -a $P
	dh_builddeb -a $P

binary: binary-indep binary-arch

source diff:                                                                  
	@echo >&2 'source and diff are obsolete - use dpkg-source -b'; false

.PHONY: build clean binary-indep binary-arch binary binary-us binary-i