3
# apache2 debian/rules Makefile. Written 7-82001, by an extremely bored:
4
# Daniel Stone <daniel@sfarc.net>
6
# Shamelessly flogged from the original apache package, as it was apparently a
7
# good example of DBS. *shrug*
10
# Johnie Ingram <johnie@debian.org>
11
# Adam Heath <doogie@debian.org>
13
# Uncomment the following to turn on verbose output.
16
export DEB_BUILD_OPTIONS
21
AP2_VERSION := $(shell dpkg-parsechangelog | sed -n 's/^Version: //p;' | sed -e 's/-.*//;')
26
AP2_COMMON_CONFARGS = --enable-layout=Debian --enable-so \
27
--with-program-name=apache2 --with-dbm=db42 \
28
--enable-logio --enable-userdir=shared \
29
--enable-ssl=shared --enable-deflate=shared \
30
--with-ldap=yes --with-ldap-include=/usr/include \
31
--with-ldap-lib=/usr/lib \
32
--enable-ldap=shared --enable-auth-ldap=shared \
33
--with-suexec-caller=www-data \
34
--with-suexec-bin=/usr/lib/apache2/suexec2 \
35
--with-suexec-docroot=/var/www \
36
--with-suexec-userdir=public_html \
37
--with-suexec-logfile=/var/log/apache2/suexec.log \
38
--enable-speling=shared --enable-include=shared \
39
--enable-rewrite=shared --enable-cgid=shared \
40
--enable-vhost-alias=shared --enable-info=shared \
41
--enable-suexec=shared \
42
--enable-unique-id=shared --enable-usertrack=shared \
43
--enable-expires=shared --enable-cern-meta=shared \
44
--enable-mime-magic=shared --enable-headers=shared \
45
--enable-auth-anon=shared --enable-proxy=shared \
46
--enable-dav=shared --enable-dav-fs=shared \
47
--enable-auth-dbm=shared \
48
--enable-cgi=shared --enable-asis=shared \
49
--enable-imap=shared \
50
--enable-ext-filter=shared \
51
--enable-authn-dbm=shared --enable-authn-anon=shared \
52
--enable-authz-dbm=shared --enable-auth-digest=shared \
53
--enable-actions=shared \
54
--enable-file-cache=shared --enable-cache=shared \
55
--enable-disk-cache=shared --enable-mem-cache=shared
57
AP2_CONFLAGS = $(CFLAGS) -pipe -I/usr/include/xmltok -I/usr/include/openssl
58
#AP2_CONFLAGS += -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
59
AP2_LDFLAGS = -ldl -lexpat -lcrypt -ldb-4.2
61
#support debug building
62
ifneq (,$(findstring debug,$(DEB_BUILD_OPTIONS)))
63
AP2_CONFLAGS += -g -O0
68
B=$(SOURCE_DIR)/apache2
69
BUILD=$(SOURCE_DIR)/apache2-build
70
include debian/scripts/vars
72
LIBTOOL=/usr/bin/libtool
73
INSTALL=/usr/bin/install
74
BUILDINFO=make dpkg-dev debian-policy debhelper
78
OTHERMPMS=perchild threadpool
79
THREADEDMPMS=worker perchild threadpool
81
source.make: $(STAMP_DIR)/source.make
82
$(STAMP_DIR)/source.make:
83
$(MAKE) -f debian/sys-build.mk source.make
87
configure: $(STAMP_DIR)/configure
88
$(STAMP_DIR)/configure: $(STAMP_DIR)/source.make
89
cd $(B) && ./buildconf
92
build: $(STAMP_DIR)/build-mpms
93
$(STAMP_DIR)/build-mpms: $(STAMP_DIR)/configure
95
for i in $(FIRSTMPM); do \
96
mkdir -p $(BUILD)/$$i ;\
97
cd $(BUILD)/$$i && ac_cv_func_pthread_mutexattr_setpshared=no ac_cv_func_sem_open=no CFLAGS="$(AP2_CONFLAGS)" LDFLAGS="$(AP2_LDFLAGS)" $(REALCURDIR)/$(B)/configure --srcdir=$(REALCURDIR)/$(B) $(AP2_COMMON_CONFARGS) $(AP2_CONFARGS) --with-mpm=$$i ;\
101
for i in $(OTHERMPMS) $(PREFORKMPM); do \
102
mkdir -p $(BUILD)/$$i ;\
103
cd $(BUILD)/$$i && ac_cv_func_pthread_mutexattr_setpshared=no ac_cv_func_sem_open=no CFLAGS="$(AP2_CONFLAGS)" LDFLAGS="$(AP2_LDFLAGS)" $(REALCURDIR)/$(B)/configure --srcdir=$(REALCURDIR)/$(B) $(AP2_COMMON_CONFARGS) --with-mpm=$$i ;\
112
rm -f $(STAMP_DIR)/configure $(STAMP_DIR)/build $(STAMP_DIR)/install
114
$(MAKE) -f debian/sys-build.mk source.clean
115
rm -rf debian/stampdir debian.diff
116
for i in $(FIRSTMPM) $(OTHERMPMS); do \
117
rm -f debian/apache2-mpm-$$i.postinst ;\
118
rm -f debian/apache2-mpm-$$i.prerm ;\
119
rm -f debian/apache2-mpm-$$i.init.d ;\
121
rm -f debian/apache2-mpm-prefork.init.d
122
rm -f debian/apache2-common.init.d
125
install: $(STAMP_DIR)/inst-mpms $(STAMP_DIR)/move
127
$(STAMP_DIR)/inst-mpms: build
130
for i in $(FIRSTMPM) $(PREFORKMPM); do \
131
cd $(BUILD)/$$i && $(MAKE) DESTDIR=$(REALCURDIR)/debian/apache2-mpm-$$i install ; \
134
for i in $(OTHERMPMS); do \
135
$(INSTALL) -d $(REALCURDIR)/debian/apache2-mpm-$$i/usr/sbin/; \
136
cd $(BUILD)/$$i && $(LIBTOOL) --mode=install $(INSTALL) apache2 $(REALCURDIR)/debian/apache2-mpm-$$i/usr/sbin/ ; \
140
$(STAMP_DIR)/move: $(STAMP_DIR)/inst-mpms
144
mv debian/apache2-mpm-worker/usr/include/apache2/apr* debian/libapr$(major)-dev/usr/include/apr-$(major)
145
mv debian/apache2-mpm-worker/usr/include/apache2/apu* debian/libapr$(major)-dev/usr/include/apr-$(major)
146
mv debian/apache2-mpm-worker/usr/lib/libapr*a debian/libapr$(major)-dev/usr/lib
147
mv debian/apache2-mpm-worker/usr/lib/libapr*.so debian/libapr$(major)-dev/usr/lib
148
mv debian/apache2-mpm-worker/usr/lib/libapr* debian/libapr$(major)/usr/lib
149
sed -e 's|-I/home/thom/.* |-I/usr/include/apr-0 |' -e 's|-I/usr/local/src/Packages/.* |-I/usr/include/apr-0 |' -e 's|/usr/include/apache2|/usr/include/apr-0|' < debian/apache2-mpm-worker/usr/bin/apu-config > debian/libapr$(major)-dev/usr/bin/apu-config
150
sed -e 's|-I/home/thom/.* |-I/usr/include/apr-0 |' -e 's|-I/usr/local/src/Packages/.* |-I/usr/include/apr-0 |' -e 's|/usr/include/apache2|/usr/include/apr-0|' < debian/apache2-mpm-worker/usr/bin/apr-config > debian/libapr$(major)-dev/usr/bin/apr-config
151
# sed -e 's|-I/usr/local/src/Packages/.* |-I/usr/include/apache2 |' < debian/apache2-mpm-worker/usr/bin/apu-config > debian/libapr$(major)-dev/usr/bin/apu-config
152
# sed -e 's|-I/usr/local/src/Packages/.* |-I/usr/include/apache2 |' < debian/apache2-mpm-worker/usr/bin/apr-config > debian/libapr$(major)-dev/usr/bin/apr-config
153
rm -f debian/apache2-mpm-worker/usr/bin/apr-config debian/apache2-mpm-worker/usr/bin/apu-config
155
#install apache2 dev stuff
156
for i in $(PREFORKMPM) $(FIRSTMPM); do \
157
if [ "$$i" = "prefork" ]; then \
162
mv debian/apache2-mpm-$$i/usr/include/apache2/* debian/apache2-$$TARGET-dev/usr/include/apache2 ;\
163
mv debian/apache2-mpm-$$i/usr/sbin/apxs debian/apache2-$$TARGET-dev/usr/bin/apxs2 ;\
164
mv debian/apache2-mpm-$$i/usr/share/man/man8/apxs.8 debian/apache2-$$TARGET-dev/usr/share/man/man8/apxs2.8 ;\
165
cp build-tree/apache2/build/special.mk debian/apache2-$$TARGET-dev/usr/share/apache2/build/special.mk ;\
166
mv debian/apache2-mpm-$$i/usr/share/apache2/build/* debian/apache2-$$TARGET-dev/usr/share/apache2/build/ ;\
168
#should be a line up :/ cp debian/config_vars.mk debian/apache2-$$TARGET-dev/usr/share/apache2/build/config_vars.mk ;\
170
mv debian/apache2-mpm-worker/usr/share/apache2/icons/* debian/apache2-common/usr/share/apache2/icons/
171
mv debian/apache2-mpm-worker/usr/share/apache2/error/* debian/apache2-common/usr/share/apache2/error/
172
mv debian/apache2-mpm-worker/usr/sbin/apachectl debian/apache2-common/usr/sbin/apache2ctl
173
mv debian/apache2-mpm-worker/usr/sbin/htdigest debian/apache2-common/usr/bin/htdigest2
174
mv debian/apache2-mpm-worker/usr/sbin/htpasswd debian/apache2-common/usr/bin/htpasswd2
175
mv debian/apache2-mpm-worker/usr/sbin/logresolve debian/apache2-common/usr/sbin/logresolve2
176
mv debian/apache2-mpm-worker/usr/sbin/ab debian/apache2-common/usr/bin/ab2
177
mv debian/apache2-mpm-worker/usr/sbin/suexec debian/apache2-common/usr/lib/apache2/suexec2
178
mv debian/apache2-mpm-worker/usr/sbin/rotatelogs debian/apache2-common/usr/sbin/rotatelogs2
179
mv debian/apache2-mpm-worker/usr/sbin/dbmmanage debian/apache2-common/usr/sbin/dbmmanage2
180
mv debian/apache2-mpm-worker/usr/sbin/checkgid debian/apache2-common/usr/sbin/checkgid2
181
mv debian/apache2-mpm-worker/etc/apache2/*.conf debian/apache2-common/usr/share/doc/apache2/examples
182
mv debian/apache2-mpm-worker/usr/lib/apache2/modules debian/apache2-common/usr/lib/apache2/modules
183
mv debian/apache2-mpm-worker/usr/share/man/man1/htdigest.1 debian/apache2-common/usr/share/man/man1/htdigest2.1
184
mv debian/apache2-mpm-worker/usr/share/man/man1/htpasswd.1 debian/apache2-common/usr/share/man/man1/htpasswd2.1
185
mv debian/apache2-mpm-worker/usr/share/man/man1/dbmmanage.1 debian/apache2-common/usr/share/man/man1/dbmmanage2.1
186
mv debian/apache2-mpm-worker/usr/share/man/man8/ab.8 debian/apache2-common/usr/share/man/man8/ab2.8
187
cp debian/apache2.8 debian/apache2-common/usr/share/man/man8/apache2.8
188
cp debian/apache2ctl.8 debian/apache2-common/usr/share/man/man8/apache2ctl.8
189
mv debian/apache2-mpm-worker/usr/share/man/man8/logresolve.8 debian/apache2-common/usr/share/man/man8/logresolve2.8
190
mv debian/apache2-mpm-worker/usr/share/man/man8/rotatelogs.8 debian/apache2-common/usr/share/man/man8/rotatelogs2.8
191
mv debian/apache2-mpm-worker/usr/share/man/man8/suexec.8 debian/apache2-common/usr/share/man/man8/suexec2.8
192
mv debian/apache2-mpm-worker/usr/sbin/htdbm debian/apache2-common/usr/sbin/
193
mv debian/apache2-mpm-worker/usr/sbin/envvars* debian/apache2-common/usr/share/apache2/build/
194
mv debian/apache2-mpm-worker/usr/share/apache2/default-site/htdocs/ debian/apache2-common/var/www/apache2-default/
195
rm -r debian/apache2-common/var/www/apache2-default/manual
196
cp debian/robots.txt debian/apache2-common/var/www/apache2-default/
197
cp -R debian/config-sites/* debian/apache2-common/usr/share/apache2/config
198
cp -R debian/config-mods/*.load debian/apache2-common/etc/apache2/mods-available
199
cp -R debian/config-mods/*.conf debian/apache2-common/etc/apache2/mods-available
200
cp -R debian/config/* debian/apache2-common/etc/apache2/
202
cp -R build-tree/apache2/docs/* debian/apache2-doc/usr/share/doc/apache2-doc
203
cp build-tree/apache2/CHANGES debian/apache2-common/usr/share/doc/apache2/changelog
204
rm -f debian/apache2-doc/usr/share/doc/apache2-doc/manual/LICENSE
205
rm -f debian/apache2-doc/usr/share/doc/apache2-doc/manual/vhosts/LICENSE
206
rm -f debian/apache2-mpm-worker/usr/lib/cgi-bin/test-cgi.bat
207
rm -f debian/apache2-doc/usr/share/doc/apache2-doc/conf/ssl-std.conf
208
rm -f debian/apache2-mpm-worker/usr/lib/apache2/modules/httpd.exp
209
rm -f debian/apache2-mpm-worker/usr/lib/apache2/*.exp
210
rm -r debian/apache2-mpm-worker/usr/lib/cgi-bin/
211
# chmod +x debian/apache2-common/usr/lib/cgi-bin/*
212
chmod u+x debian/apache2*/usr/sbin/*
213
for i in `find debian/a2-scripts -name .svn -prune -o -name .arch-ids -prune -o -type f -print`; \
214
do install -m755 $$i debian/apache2-common/usr/sbin; \
216
cp debian/default-site debian/apache2-common/etc/apache2/sites-available/default
217
cp debian/apache2-doc.conf debian/apache2-doc/etc/apache2/conf.d/apache2-doc
218
cp debian/ssleay.cnf debian/apache2-common/usr/share/apache2/ssleay.cnf
219
$(INSTALL) debian/ssl-certificate debian/apache2-common/usr/sbin/apache2-ssl-certificate
220
chmod 4755 debian/apache2-common/usr/lib/apache2/suexec2
221
chmod +x debian/libapr$(major)-dev/usr/bin/*
222
rm -rf debian/apache2-mpm-worker/usr/bin/httpd.exp debian/apache2-mpm-worker/include debian/apache2-mpm-worker/manual debian/apache2-mpm-worker/etc/apache2/build debian/apache2-mpm-worker/etc debian/apache2-mpm-worker/var debian/apache2-mpm-worker/usr/lib debian/apache2-mpm-worker/usr/share debian/apache2-mpm-worker/usr/bin debian/apache2-mpm-prefork/usr/share debian/apache2-mpm-prefork/etc/apache2 debian/apache2-mpm-prefork/var debian/apache2-mpm-prefork/usr/bin debian/apache2-mpm-prefork/usr/include debian/apache2-mpm-prefork/usr/lib debian/apache2-mpm-prefork/find_apu.m4 debian/apache2-prefork-dev/usr/include/apache2/apr* debian/apache2-prefork-dev/usr/include/apache2/apu* debian/apache2-mpm-worker/find_apu.m4
224
mv debian/apache2-mpm-prefork/usr/sbin/apache2 debian/apache2-mpm-prefork/usr/apache2
225
rm -rf debian/apache2-mpm-prefork/usr/sbin/
226
mkdir debian/apache2-mpm-prefork/usr/sbin/
227
mv debian/apache2-mpm-prefork/usr/apache2 debian/apache2-mpm-prefork/usr/sbin/apache2
229
for i in $(THREADEDMPMS) ; do \
230
cp debian/mpm-postinst-threaded debian/apache2-mpm-$$i.postinst ; \
231
cp debian/mpm-preinst-threaded debian/apache2-mpm-$$i.preinst ; \
233
for i in $(THREADEDMPMS) $(PREFORKMPM); do \
234
cp debian/mpms.prerm debian/apache2-mpm-$$i.prerm; \
236
cp debian/init-script debian/apache2-common.init.d
237
mkdir -p debian/apache2-common/etc/logrotate.d
238
cp debian/logrotate debian/apache2-common/etc/logrotate.d/apache2
239
cp debian/README.etc debian/apache2-common/etc/apache2/README
240
cp debian/README.etc debian/apache2-common/usr/share/doc/apache2/README.etc
243
binary-indep: build install
247
dh_installchangelogs -i
250
dh_fixperms -i -Xsuexec2
256
# Build architecture-dependent files here.
257
binary-arch: build install
262
dh_installinit -a -r --init-script=apache2 debian/apache2-common.init.d -- defaults 91
263
dh_installchangelogs -a
265
ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
270
dh_fixperms -a -Xsuexec2
271
chown -R www-data:www-data debian/apache2-common/var/cache/apache2
272
chmod 644 debian/apache2-common/usr/share/man/man8/suexec2.8.gz
275
dh_shlibdeps -a -l debian/libapr0/usr/lib -- -Ldebian/libapr0/DEBIAN/shlibs
280
binary: binary-indep binary-arch
281
.PHONY: build clean binary-indep binary-arch binary install configure
284
rm -rf $(STAMP_DIR)/build build-tree $(STAMP_DIR)/configure debian.diff
285
$(MAKE) -f debian/sys-build.mk source.clean
286
$(MAKE) -f debian/sys-build.mk source.make
289
-cd $(B) && $(MAKE) clean
290
$(MAKE) -f debian/sys-build.mk make-diff