File: rules

package info (click to toggle)
apache 1.3.26-0woody6
  • links: PTS
  • area: main
  • in suites: woody
  • size: 3,572 kB
  • ctags: 196
  • sloc: ansic: 1,679; perl: 779; sh: 543; makefile: 411
file content (346 lines) | stat: -rwxr-xr-x 11,963 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
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
#!/usr/bin/make -f
# -*- makefile -*-
# Made with the aid of dh_make, by Craig Small.
# Sample debian/rules that uses debhelper. GNU copyright 1997 by Joey Hess.
# Also some stuff taken from debmake scripts, by Christoph Lameter.
# And from the X build system by Adam Heath.

# The ./configure invocation from hell - tweak CFLAGS here.

CONFLAGS =	-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -O1

EXTRA_CONFARGS =

CONFARGS =	--target=apache --with-layout=Debian \
		--enable-suexec --suexec-caller=www-data \
		--suexec-docroot=/var/www --includedir=/$(inc) \
		--suexec-logfile=/var/log/apache/suexec.log \
		--without-confadjust --without-execstrip \
		--enable-shared=max --enable-rule=SHARED_CHAIN \
		--enable-module=most --enable-module=status \
		--enable-module=auth_digest --enable-module=log_referer \
		--enable-module=log_agent --enable-module=auth_db \
		$(EXTRA_CONFARGS) \
		--activate-module=src/modules/extra/mod_macro.c

# CAVEAT COMPILOR
#
#    $(B) version also hardcoded in debian/scripts/vars and debian/control
#    Change these for new upstream version.

B=$(SOURCE_DIR)/apache_1.3.26
C=$(SOURCE_DIR)/apache-contrib-1.0.8

######################################################################

include debian/scripts/vars
SHELL=/bin/bash
BUILDINFO=make dpkg-dev debian-policy debhelper
IN_TARGETS=$(patsubst %,debian/%,docs apache-dev.docs \
	apache-doc.docs apache-common.examples examples)

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

FHS=$(shell test -f /usr/share/doc/debhelper/copyright && echo FHS)
ifeq ($(FHS),FHS)
doc=usr/share/doc/apache
man=usr/share/man
else
doc=usr/doc/apache
man=usr/man
endif

lib=usr/lib/apache/1.3
inc=usr/include/apache-1.3


build: build-stamp
build-stamp: configure-stamp
	dh_testdir
	@echo -e "\n\n*** Compiling daemon and modules\n"	
	cd $(B) && $(MAKE)
	@echo -e "\n--- modules: engelschall apache-contrib ---\n"
	cd $(C) && $(MAKE) APXS=$(CURDIR)/debian/local-apxs
	rm -f $(C)/mod_random/mod_random.so # in separate package
	rm -f $(C)/mod_layout/mod_layout.so # in separate package

	@echo -e "\n--- modules: netgods debian-contrib ---\n"
	cd contrib && $(MAKE) -k APXS=$(CURDIR)/debian/local-apxs

	@echo -e "\n--- modules: build-tree mod_auth_cache ---\n"
	cd build-tree/mod_auth_cache* \
		&& $(CURDIR)/debian/local-apxs -c mod_auth_cache.c
	@echo -e "\n--- modules: build-tree mod_throttle ---\n"
	cd build-tree/mod_throttle* \
		&& $(CURDIR)/debian/local-apxs -c mod_throttle.c

	@echo -e "\n--- sanity: module manifest check ---\n"
	find build-tree/ contrib/ \
		-name "*.so" -exec install -m 644 {} $(B) \;
	@set -e; echo; cd $(B) && cat $(CURDIR)/debian/module-manifest \
		| xargs -i ls -l --no-group {}; echo
	touch build-stamp

source.make: $(STAMP_DIR)/source.make
$(STAMP_DIR)/source.make:
	$(MAKE) -f debian/sys-build.mk source.make
#	false

configure-stamp: $(STAMP_DIR)/source.make
	@echo -e "\n\n*** Commencing laborious build of Debian Apache \
		1.3 $(FHS)\n"

	@echo -e "\n--- sanity: source code check ---\n"
	test -f /usr/bin/uudecode
	test -f /usr/include/db.h

	set -e ; for foo in debian/*inst* debian/*ostrm debian/*rerm ; \
		do echo -n "$$foo " ; sh -n $$foo ; done ; echo

	test ! -d $(C)/mod_cvs # mod_cvs in apache-contrib is non-free

	@echo -e "\n--- patch: EAPI support ---\n"
	cp build-tree/pkg.eapi/*.h $(B)/src/include
	cp build-tree/pkg.eapi/*.c $(B)/src/ap
	patch -d $(B) -p0 < build-tree/pkg.eapi/eapi.patch

	@echo -e "\n--- configure: APACI and APXS ---\n"
	cp $(C)/mod_macro/mod_macro.c $(B)/src/modules/extra

	cd $(B) && CFLAGS="$(CONFLAGS)" ./configure $(CONFARGS)

	chmod +x debian/ubersed
	(debian/ubersed $(B)/src/apaci; \
		cat debian/apaci.append) > debian/apaci
	install debian/apaci $(B)/src/apaci

	cd $(B)/src/support && $(MAKE) apxs
	set -e; INCL=$$(echo $$(pwd)/$(B)/src/include); \
	 SBIN=$$(echo $$(pwd)/$(B)/src); sed \
	   	-e "s;^#!/.*;#!/usr/bin/perl;" \
		-e "s;\@prefix\@;/usr;" \
		-e "s;\@sbindir\@;$$SBIN;" \
		-e "s;\@libexecdir\@;/usr/lib/apache/1.3;" \
		-e "s;\@includedir\@;$$INCL;" \
		-e "s;\@sysconfdir\@;/etc/apache;" \
		-e "s;/httpd;/apache;g" \
		-e "s;-lm;-lc -lm;" \
		-e "s;-ldbm -ldb;;" \
		-e "s;-lndbm -ldb;;" \
		-e "s;-DTARGET;-DEAPI -DTARGET;" \
		-e "s;CFG_SYSCONFDIR/\$$CFG_TARGET;CFG_SYSCONFDIR/httpd;g" \
		$(B)/src/support/apxs > debian/local-apxs; \
	set -e; INCL=$$(echo $$(pwd)/$(B)/src/include); \
	 SBIN=$$(echo $$(pwd)/$(B)/src); sed \
		-e "s;$$INCL;/usr/include/apache-1.3;" \
		-e "s;$$SBIN;/usr/sbin;" \
		debian/local-apxs > debian/apxs
	chmod +x debian/{apxs,local-apxs}
	cp -a $(B)/src/os/unix/{*.h,*inline.c} \
		$(B)/src/include
	touch configure-stamp

clean:
	dh_testdir
	dh_testroot
	rm -rf build-stamp install-stamp configure-stamp
	rm -f debian/apaci debian/buildinfo.Debian
	rm -f debian/{*.gif,*.jpg,*.gz,local-apxs,apxs} o debian/o
	rm -rf debian/debian $(IN_TARGETS) contrib/*/*o
	chmod +x debian/{*post*,*preinst*,*prerm*,modchk}
	chmod +x debian/{ubersed,apacheconfig,sys-build.mk,scripts/*.*}
	$(MAKE) -f debian/sys-build.mk source.clean
	rm -rf debian.diff debian/stampdir
	dh_clean

install: install-stamp
install-stamp: build-stamp $(IN_TARGETS)
	@echo -e "\n\n*** So Far So Good\n"
	dh_testdir
	dh_testroot
	dh_clean -k
	dh_installdirs
	cd debian && uudecode logos.uue && tar -zxf logos.tar.gz
	mkdir -p debian/tmp/$(doc)

	@echo -e "\n--- install: apache ---\n"
	mkdir -p debian/tmp/$(man)/man8
	install $(B)/src/apache \
		debian/apacheconfig debian/tmp/usr/sbin
	cp -a debian/apacheconfig.8 debian/tmp/$(man)/man8

	mkdir -p debian/tmp/etc/logrotate.d
	cp -a debian/logrotate debian/tmp/etc/logrotate.d/apache

	chmod +x debian/ubersed
	debian/ubersed < $(B)/src/support/apachectl \
		>>  debian/tmp/usr/sbin/apachectl
	chmod +x debian/tmp/usr/sbin/apachectl
	debian/ubersed < $(B)/src/support/httpd.8 \
		> debian/tmp/$(man)/man8/apache.8
	debian/ubersed < $(B)/src/support/apachectl.8 \
		> debian/tmp/$(man)/man8/apachectl.8

	@echo -e "\n--- install: apache-common ---\n"

	mkdir -p debian/apache-common/{$(lib),usr/share/apache/icons/small}
	mkdir -p debian/apache-common/usr/{bin,sbin}
	cp -a info/* $$(find $(B) contrib/ -maxdepth 1 -name "*.so") \
		debian/apache-common/$(lib)
	cp -a $(B)/icons/*.{gif,png} debian/*.gif debian/*.jpg debian/debian \
		debian/apache-common/usr/share/apache/icons
	cp -a $(B)/icons/small/*.{gif,png} \
		debian/apache-common/usr/share/apache/icons/small
	mkdir -p debian/apache-common/$(doc)-common
	cp -a $(B)/icons/README \
		debian/apache-common/$(doc)-common/README.icons
	cp -a $(B)/icons/small/README.txt \
		debian/apache-common/$(doc)-common/README.small.icons
	cp -a $(B)/src/support/suexec.{c,h} \
		$(B)/src/include/ap_config.h \
		debian/apache-common/$(doc)-common/
	mkdir -p debian/apache-common/$(man)/man{1,8}

	install -m 4755 $(B)/src/support/suexec \
		debian/apache-common/usr/lib/apache/suexec
	install -D -m644 debian/apache-common.lintian \
		debian/apache-common/usr/share/lintian/overrides/apache-common
	install $(B)/src/support/{logresolve,rotatelogs,ab} \
		debian/apache-common/usr/sbin
	debian/ubersed < $(B)/src/support/suexec.8 \
		> debian/apache-common/$(man)/man8/suexec.8
	debian/ubersed < $(B)/src/support/logresolve.8 \
		> debian/apache-common/$(man)/man8/logresolve.8
	debian/ubersed < $(B)/src/support/rotatelogs.8 \
		> debian/apache-common/$(man)/man8/rotatelogs.8
	debian/ubersed < $(B)/src/support/ab.8 \
		> debian/apache-common/$(man)/man8/ab.8

	install $(B)/src/support/{htpasswd,htdigest,dbmmanage} \
		debian/apache-common/usr/bin
	debian/ubersed < $(B)/src/support/htpasswd.1 \
		> debian/apache-common/$(man)/man1/htpasswd.1
	debian/ubersed < $(B)/src/support/htdigest.1 \
		> debian/apache-common/$(man)/man1/htdigest.1
	debian/ubersed < $(B)/src/support/dbmmanage.1 \
		> debian/apache-common/$(man)/man1/dbmmanage.1

	@echo -e "\n--- install: apache-common module docs ---\n"

	for mod in $$(cd $(C) && sh -c "find * -type d -maxdepth 0") ; \
		do if [ -f $(C)/$$mod/README ] ; \
		then echo "++ $(C)/$$mod/README" ; cp -a $(C)/$$mod/README \
		debian/apache-common/$(doc)-common/README.$$mod \
		; fi ; done
	cp -v $(C)/*/*.html debian/apache-common/$(doc)-common/
	mkdir debian/apache-common/$(doc)-common/mod_auth_cache && \
		cp build-tree/mod_auth_cache*/{ChangeLog,INSTALL,README,TODO} \
		debian/apache-common/$(doc)-common/mod_auth_cache/
	mkdir debian/apache-common/$(doc)-common/mod_throttle && \
		cp -a build-tree/mod_throttle*/{Img,*html} \
		debian/apache-common/$(doc)-common/mod_throttle/
	cd debian/apache-common/$(doc)-common/mod_throttle/ \
		&& mv index.shtml index.html

	rm -f $$(find debian/apache-common -name "*fastcgi*" -o -name "*~")
	@echo -e "\n--- sanity: module .info check ---\n"
	chmod +x debian/modchk && debian/modchk

	@echo -e "\n--- install: apache-dev ---\n"
	mkdir -p debian/apache-dev/$(man)/man{1,8} \
		debian/apache-dev/usr/{bin,sbin}
	debian/ubersed < $(B)/src/support/apxs.8 \
		> debian/apache-dev/$(man)/man1/apxs.1
	install debian/apxs debian/apache-dev/usr/bin/apxs
	mkdir -p debian/apache-dev/$(inc)
	cp -a $(B)/src/include/* debian/apache-dev/$(inc)
	mkdir -p debian/apache-dev/$(doc)-dev
	install -m644 debian/apaci debian/apache-dev/$(doc)-dev/apaci
	install $(B)/src/apache debian/apache-dev/usr/sbin/apache.dbg
	install -D -m644 debian/apache-dev.lintian \
		debian/apache-dev/usr/share/lintian/overrides/apache-dev
	debian/ubersed < $(B)/src/support/httpd.8 \
		> debian/apache-dev/$(man)/man8/apache.dbg.8

	@echo -e "\n--- install: apache-doc ---\n"

	mkdir -p debian/apache-doc/$(doc)/manual
	cp -a $(B)/src/README debian/apache-doc/$(doc)/README.src
	cp -a $(B)/htdocs/manual/* debian/apache-doc/$(doc)/manual
	rm -f debian/apache-doc/$(doc)/manual/LICENSE
	debian/ubersed < $(B)/htdocs/index.html.en \
		> debian/apache-doc/$(doc)/manual.html
	ln -s ../../apache/icons debian/apache-doc/$(doc)/icons

#	@echo -e "\n--- install: pointless debmakeism ---\n"
#	echo; (date -u; echo; dpkg -l gcc "libc6*" binutils ldso $(BUILDINFO) \
#		| awk '$$1 == "ii" { printf("%s-%s\n", $$2, $$3) }'; echo; \
#		uname -a) | tee debian/buildinfo.Debian; echo
#	dh_installdocs -A debian/buildinfo.Debian
	touch install-stamp

# Build architecture-independent files here.
binary-indep: build install
	@echo -e "\n\n*** Architecture Indepdendent (apache-doc)\n"
	dh_testdir -i
	dh_testroot -i
	dh_installdocs -i
	dh_installexamples -i
	dh_installmenu -i
#	dh_installcron -i
	dh_installchangelogs -i $(B)/src/CHANGES
	dh_link -i
	dh_compress -i
	dh_fixperms -i --exclude=suexec
	dh_installdeb -i
	dh_gencontrol -i -u-isp
	dh_md5sums -i
	dh_builddeb -i

# Build architecture-dependent files here.
binary-pre-arch: build install
	@echo -e "\n\n*** Architecture Specific (apache, dev, common)\n"
	dh_testdir -a
	dh_testroot -a
	dh_installdocs -a
	dh_installexamples -a
	dh_installmenu -a
	dh_installinit -a
#	dh_installcron -a
	dh_installchangelogs -a $(B)/src/CHANGES
	dh_strip -a --exclude=dbg
	dh_link -a
#	This avoids a lintian warning by breaking policy -- fun, eh?	
	dh_compress -a --exclude=log_server_status \
		--exclude=httpd.conf --exclude=access.conf --exclude=srm.conf
	dh_fixperms -a --exclude=suexec
	dh_installdeb -a
	dh_shlibdeps -a debian/tmp/usr/sbin/apache


binary-arch: binary-pre-arch
	dh_gencontrol -a -u-isp
	dh_md5sums -a
	dh_builddeb -a
	@echo -e "\nw00 w00\n"

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

binary: binary-indep binary-arch
.PHONY: build clean binary-indep binary-arch binary install

$(IN_TARGETS): % : %.in debian/scripts/vars
	sed 's|$$(BUILD_TREE)|$(B)|g' $@.in > $@

reset:
	rm -rf build-stamp build-tree configure-stamp debian.diff
	$(MAKE) -f debian/sys-build.mk source.clean
	$(MAKE) -f debian/sys-build.mk source.make

patch:
	-cd $(B) && $(MAKE) clean
#	-find $(B) -name "*.orig" -exec rm {} \;
	$(MAKE) -f debian/sys-build.mk make-diff