File: rules

package info (click to toggle)
apache 1.3.0-5
  • links: PTS
  • area: main
  • in suites: hamm
  • size: 6,488 kB
  • ctags: 6,702
  • sloc: ansic: 47,562; sh: 3,221; makefile: 1,382; perl: 1,346; cpp: 55
file content (278 lines) | stat: -rwxr-xr-x 10,253 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
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
#!/usr/bin/make -f
# Sample debian.rules -*- makefile -*- for GNU Hello (1.3).
# Copyright 1994,1995 by Ian Jackson.
# I hereby give you perpetual unlimited permission to copy,
# modify and relicense this file, provided that you do not remove
# my name from the file itself.  (I assert my moral right of
# paternity under the Copyright, Designs and Patents Act 1988.)
# This file may have to be extensively modified
#
# Modified to be a prototype for debmake by Christoph Lameter
# <clameter@debian.org>.

package=apache

arch=$(shell dpkg --print-architecture)
version=$(shell expr `pwd` : '.*-\([0-9.].*\)')
version_main=$(shell expr `pwd` : '.*-\([0-9]*.[0-9.]*\)')
version_main=1.3

SHELL=/bin/bash
INST=install -p
CC=cc

ifeq ($(arch),sparc)
DISABLEMODS=--disable-module=rewrite --disable-module=auth_dbm  \
	--disable-module=auth_db
endif
ifeq ($(arch),alpha)
DISABLEMODS=--disable-module=unique_id
endif

build: stamp-configure
	$(checkdir)
	@echo -e "\n--- establishing $(package) $(version_main) sanity ---\n"
	$(MAKE) -f debian/rules check-apache-scripts
	@echo -e "\n--- building $(package) ---\n"
	$(MAKE) LDFLAGS_SHLIB="-Bshareable -lc"
	@$(MAKE) -f debian/rules debian/inc2shtml
	@$(MAKE) -f debian/rules debian/unescape
	@echo -e "\n--- building $(package) modules ---\n"
	cd src/modules/throttle && \
		gcc -DLINUX=2 -DSTATUS -DUSE_HSREGEX -fpic -DSHARED_MODULE \
		-I../../include  -I../../os/unix -c mod_throttle.c && \
		ld -Bshareable -lc -o mod_throttle.so mod_throttle.o
	touch build


include debian/rules.common

stamp-configure: src/Configuration
	./configure --enable-shared=max --enable-rule=STATUS \
		--enable-suexec \
		--suexec-caller=www-data --enable-module=most \
		--enable-module=log_referer --enable-module=log_agent \
		--enable-module=auth_db --enable-module=auth_dbm \
		--prefix=/usr --libexecdir=/usr/lib/apache/1.3 \
		--sysconfdir=/etc/apache --localstatedir=/var/state/apache \
		--runtimedir=/var/run --logfiledir=/var/log/apache \
		--proxycachedir=/var/cache/apache \
		--includedir=/usr/include/apache-1.3 \
		--datadir=/var/www $(DISABLEMODS)
	$(INST) debian/apaci src/
	touch stamp-configure


debian/inc2shtml:
	cd debian; gcc -O2 -s -o inc2shtml inc2shtml.c
debian/unescape:
	cd debian; gcc -O2 -s -o unescape unescape.c


check-apache-links:
	-(cd ../common && ls) | xargs -t -i sh -c \
		"diff -u ../common/{} debian/{}"


check-apache-scripts:
	if grep "trap SIG" debian/{*.p*,*.d*,p*,*html}; then false; fi
	if grep "/var/web" debian/{*.p*,*.d*,p*,*html} src/*.c; then false; fi
	if grep "/home/www" debian/{*.p*,*.d*,p*,*html} src/*.c; then false; fi
	if grep "Authorative" debian/*info src/*.c}; then false; fi
	bash -n debian/cron.daily
	bash -n debian/init.d
	bash -n debian/preinst
	bash -n debian/postinst
	bash -n debian/prerm
	bash -n debian/postrm


clean: clean-common
	rm -f stamp-configure
	cd src/support && $(MAKE) clean; rm -f suexec
	if [ -f src/Makefile ]; then cd src; $(MAKE) clean; rm -f Makefile; fi
	rm -f debian/{inc2shtml,unescape,*.tar.gz*} src/buildmark.c.rej
	rm -f debian/{*.tar.gz,*.gif,*.jpg} .install*
	chmod +x debian/$(package)config
	find .. -name $(package)*dsc.asc -size 0 -maxdepth 1 -exec rm {} ";"


binary-indep: checkroot
	@echo -e "\n\n*** Package $(package)-doc\n"
	rm -rf debian/doc
	mkdir -p debian/doc/{DEBIAN,usr/doc/$(package)}
	cp -p -r htdocs/* debian/doc/usr/doc/$(package)
	rm -rf $$(find debian/doc -name CVS)
	chown -R root.root debian/doc && chmod -R go=rX debian/doc
	dh_installdocs -v -p$(package)-doc -Pdebian/doc 
	dpkg-gencontrol -p$(package)-doc -Pdebian/doc
	dh_installchangelogs -p$(package)-doc -Pdebian/doc src/CHANGES
	dh_compress -v -p$(package) -Pdebian/doc
	dh_md5sums -p$(package)-doc -Pdebian/doc
	dh_fixperms -p$(package)-doc -Pdebian/doc
	dpkg --build debian/doc ..
	@echo -e "\n\n*** Package $(package)-dev\n"
	rm -rf debian/dev
	$(INST) -d debian/dev/{DEBIAN,usr/{doc,include/$(package)-$(version_main)}}
	dh_installdocs -p$(package)-dev -Pdebian/dev
	cp -a src/include/*.h src/os/unix/*.h \
		debian/dev/usr/include/$(package)-$(version_main)
	chown -R root.root debian/dev && chmod -R go=rX debian/dev
	dpkg-gencontrol -p$(package)-dev -Pdebian/dev

	dh_installchangelogs -p$(package)-dev -Pdebian/dev src/CHANGES
	dh_compress -v -p$(package)-dev -Pdebian/dev
	dh_md5sums -p$(package)-dev -Pdebian/dev
	dh_fixperms -p$(package)-dev -Pdebian/dev
	dpkg --build debian/dev ..


install-support:
	@echo -e "\n--- installing support binaries and docs ---\n"
	$(INST) -s src/support/{htpasswd,htdigest} \
		debian/{unescape,inc2shtml} \
		debian/tmp/usr/bin
	$(INST) -s src/support/{logresolve,rotatelogs} \
		debian/tmp/usr/sbin
	$(INST) -s src/support/suexec debian/tmp/usr/lib/$(package)
	sed -e s?/usr/local/etc/httpd/logs/httpd.pid?/var/run/$(package).pid?g \
		-e s?/usr/local/etc/httpd/src/httpd?/usr/sbin/$(package)?g \
		src/support/apachectl > debian/tmp/usr/sbin/$(package)ctl
	chmod 755 debian/tmp/usr/sbin/$(package)ctl
	sed -e s?/usr/local/bin/perl?/usr/bin/perl?g \
		src/support/dbmmanage > debian/tmp/usr/sbin/dbmmanage
	chmod 755 debian/tmp/usr/sbin/dbmmanage
	$(INST) -s src/support/ab debian/tmp/usr/bin/ab
	ln -s ../man7/undocumented.7.gz debian/tmp/usr/man/man1/unescape.1.gz
	ln -s ../man7/undocumented.7.gz debian/tmp/usr/man/man1/inc2shtml.1.gz
	ln -s ../man7/undocumented.7.gz debian/tmp/usr/man/man8/apachectl.8.gz
	set -x; cd src/support; for m in *.8; do \
	    sed -e "s/httpd/apache/g" -e "s/HTTPD/APACHE/g" \
		-e "s?usr/local/apache/conf?etc/apache?g" \
		-e "s/1m/8/g" -e "s/apache.conf/httpd.conf/g" \
		-e "s?usr/local/apache/logs?var/log/apache?g" \
		-e "s?_log?.log?g" \
		-e "s?var/log/apache/httpd.pid?var/run/apache.pid?g" $$m \
		> ../../debian/tmp/usr/man/man8/$$m; \
	done
	set -x; cd src/support; for m in *.1; do \
	    sed -e "s/httpd/apache/g" -e "s/HTTPD/APACHE/g" \
		-e "s/1m/8/g" $$m -e "s/apache.conf/httpd.conf/g" \
		> ../../debian/tmp/usr/man/man1/$$m; \
	done
	set -x; cd debian; for m in *.8; do \
	    sed -e "s/httpd/apache/g" -e "s/HTTPD/APACHE/g" \
		-e "s/1m/8/g" $$m -e "s/apache.conf/httpd.conf/g" \
		> ../debian/tmp/usr/man/man8/$$m; \
	done
	mv debian/tmp/usr/man/man8/httpd.8 debian/tmp/usr/man/man8/apache.8 


install-apache:
	@echo -e "\n--- installing $(package) libraries and docs ---\n"
	$(INST) debian/apacheconfig debian/tmp/usr/sbin/$(package)config
	dh_installdocs -p$(package)
	-$(INST) -m 644 debian/*.info \
		debian/tmp/usr/lib/$(package)/$(version_main)
	sed -e 's;^#!/.*;#!/usr/bin/perl;' \
		-e 's;\@prefix\@;/usr;' \
		-e 's;\@sbindir\@;/usr/sbin;' \
		-e 's;\@libexecdir\@;/usr/lib/apache/1.3;' \
		-e 's;\@includedir\@;/usr/include/apache-1.3;' \
		-e 's;\@sysconfdir\@;/etc/apache;' src/support/apxs \
		-e 's;/httpd;/apache;g' \
		-e 's;httpd.conf;apache.conf;g' \
		> debian/tmp/usr/lib/$(package)/apxs
	chmod 755 debian/tmp/usr/lib/$(package)/apxs
	$(INST) debian/cron.daily debian/tmp/etc/cron.daily/$(package)
	$(INST) debian/init.d debian/tmp/etc/init.d/$(package)
	$(INST) -d debian/tmp/usr/{man/man{1,8},share/$(package)/icons}
	cp -p CHANGES README.NT src/README* ABOUT_APACHE KEYS Announcement \
		debian/tmp/usr/doc/$(package)
	cp -p README debian/tmp/usr/doc/$(package)/OVERVIEW
	cp -p debian/intro.html debian/mod*txt src/support/suexec.{c,h} \
		debian/tmp/usr/doc/$(package)
	cd debian && munpack logos.uue && tar -zxvf logos.tar.gz
	cp -p icons/{README,*.gif} htdocs/*.gif debian/*.gif \
		debian/tmp/usr/share/$(package)/icons
	cp -p htdocs/*.gif debian/*.gif \
		debian/tmp/usr/doc/$(package)/icons
	ln -s ../man7/undocumented.7.gz \
		debian/tmp/usr/man/man8/$(package)config.8.gz
	$(INST) -m 644 $$(cat debian/examples) \
		debian/tmp/usr/doc/$(package)/examples
	sed -e s?/usr/local/bin/perl?/usr/bin/perl?g \
		cgi-bin/printenv \
		> debian/tmp/usr/doc/$(package)/examples/printenv
	sed -e s?/usr/local/bin/perl?/usr/bin/perl?g \
		src/support/phf_abuse_log.cgi \
		> debian/tmp/usr/doc/$(package)/examples/phf_abuse_log.cgi


binary-arch: checkroot build
#	$(MAKE) -s -f debian/rules check-apache-links
	@echo -e "\n\n*** Main Package $(package)\n"
	rm -rf debian/tmp
	$(INST) -d debian/tmp/usr/{bin,sbin}
	$(INST) -d debian/tmp/usr/lib/cgi-bin
	$(INST) -d debian/tmp/etc/{cron.daily,init.d}
	$(INST) -d debian/tmp/usr/man/man{1,8}
	$(INST) -d debian/tmp/etc/$(package)
	$(INST) -d debian/tmp/usr/doc/$(package)/{icons,examples}
	$(INST) -d debian/tmp/var/log/$(package)
	$(INST) -d debian/tmp/var/cache/$(package)
	$(INST) -d debian/tmp/usr/lib/$(package)/$(version_main)
	$(INST) -m 644 src/modules/*/*.so \
		debian/tmp/usr/lib/$(package)/$(version_main)
ifeq ($(arch),sparc)
	rm -vf debian/tmp/usr/lib/$(package)/$(version_main)/{*rewrite*,*_db*}
endif
ifeq ($(arch),alpha)
	rm -vf debian/tmp/usr/lib/$(package)/$(version_main)/*unique_id*
endif
	@$(MAKE) -f debian/rules install-apache
	@$(MAKE) -f debian/rules install-support
	echo; dpkg -l gcc "libc6*" binutils ldso make dpkg-dev $(BUILDINFO) \
		| awk '$$1 == "ii" { printf("%s-%s\n", $$2, $$3) }' \
		| tee debian/tmp/usr/doc/$(package)/buildinfo.Debian; echo
	@echo -e "\n--- final processing ---\n"
	dh_strip -p$(package)
	$(INST) src/httpd debian/tmp/usr/sbin/$(package)
	strip --strip-unneeded debian/tmp/usr/sbin/$(package)
	$(INST) -d debian/tmp/{usr/lib/cgi-bin,var/{log,cache}}
	$(INST) src/CHANGES debian/tmp/usr/doc/$(package)/changelog
	$(INST) debian/changelog \
		debian/tmp/usr/doc/$(package)/changelog.Debian
	$(INST) -m 644 conf/high* conf/*dist-win \
		debian/tmp/usr/doc/$(package)/examples
	dh_compress -v -p$(package)
	$(INST) -m 644 debian/*.conf \
		debian/tmp/usr/doc/$(package)/examples
	chown -R root.root debian/tmp
	chmod -R go=rX debian/tmp
	$(INST) -o root -g www-data -m 2775 \
		-d debian/tmp/var/cache/apache
	dh_installdeb -p$(package)
	LD_LIBRARY_PATH=$(shell pwd)/debian/tmp/usr/lib/apache/1.3 \
		dh_shlibdeps -p$(package)
	dh_gencontrol -p$(package)
	dh_md5sums -p$(package)
	dpkg --build debian/tmp ..


define checkdir
	test -f debian/rules
endef

# Below here is fairly generic really

binary:		binary-indep binary-arch

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

checkroot:
	$(checkdir)
	test root = "`whoami`"

.PHONY: binary binary-arch binary-indep clean checkroot