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
|
#!/usr/bin/make -f
# apache2 debian/rules Makefile. Written 7-82001, by an extremely bored:
# Daniel Stone <daniel@sfarc.net>
#
# Shamelessly flogged from the original apache package, as it was apparently a
# good example of DBS. *shrug*
#
# So, credit to:
# Johnie Ingram <johnie@debian.org>
# Adam Heath <doogie@debian.org>
# Uncomment the following to turn on verbose output.
#export DH_VERBOSE=1
#export NOISY=1
export DEB_BUILD_OPTIONS
version=0.9.1
major=0
AP2_VERSION := $(shell dpkg-parsechangelog | sed -n 's/^Version: //p;' | sed -e 's/-.*//;')
export DH_COMPAT=4
export DH_OPTIONS
AP2_COMMON_CONFARGS = --enable-layout=Debian --enable-so \
--with-program-name=apache2 --with-dbm=db42 \
--with-external-pcre=/usr \
--enable-logio --enable-userdir=shared \
--enable-ssl=shared --enable-deflate=shared \
--with-ldap=yes --with-ldap-include=/usr/include \
--with-ldap-lib=/usr/lib \
--enable-ldap=shared --enable-auth-ldap=shared \
--with-suexec-caller=www-data \
--with-suexec-bin=/usr/lib/apache2/suexec2 \
--with-suexec-docroot=/var/www \
--with-suexec-userdir=public_html \
--with-suexec-logfile=/var/log/apache2/suexec.log \
--enable-speling=shared --enable-include=shared \
--enable-rewrite=shared --enable-cgid=shared \
--enable-vhost-alias=shared --enable-info=shared \
--enable-suexec=shared \
--enable-unique-id=shared --enable-usertrack=shared \
--enable-expires=shared --enable-cern-meta=shared \
--enable-mime-magic=shared --enable-headers=shared \
--enable-auth-anon=shared --enable-proxy=shared \
--enable-dav=shared --enable-dav-fs=shared \
--enable-auth-dbm=shared \
--enable-cgi=shared --enable-asis=shared \
--enable-imap=shared \
--enable-ext-filter=shared \
--enable-authn-dbm=shared --enable-authn-anon=shared \
--enable-authz-dbm=shared --enable-auth-digest=shared \
--enable-actions=shared \
--enable-file-cache=shared --enable-cache=shared \
--enable-disk-cache=shared --enable-mem-cache=shared
AP2_CONFLAGS = $(CFLAGS) -pipe -I/usr/include/xmltok -I/usr/include/openssl -Wall
#AP2_CONFLAGS += -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
AP2_LDFLAGS = -ldl -lexpat -lcrypt -ldb-4.2
#support debug building
ifneq (,$(findstring debug,$(DEB_BUILD_OPTIONS)))
AP2_CONFLAGS += -g -O0
else
AP2_CONFLAGS += -O2
endif
B=$(SOURCE_DIR)/apache2
BUILD=$(SOURCE_DIR)/apache2-build
include debian/scripts/vars
SHELL=/bin/bash
LIBTOOL=/usr/bin/libtool
INSTALL=/usr/bin/install
BUILDINFO=make dpkg-dev debian-policy debhelper
REALCURDIR=$(CURDIR)
FIRSTMPM=worker
PREFORKMPM=prefork
OTHERMPMS=perchild
THREADEDMPMS=worker perchild
source.make: $(STAMP_DIR)/source.make
$(STAMP_DIR)/source.make:
$(MAKE) -f debian/sys-build.mk source.make
extract: source.make
configure: $(STAMP_DIR)/configure
$(STAMP_DIR)/configure: $(STAMP_DIR)/source.make
for i in config.guess config.sub ltmain.sh; do \
for j in $$(find $(B)/ -name $$i); do \
cp /usr/share/libtool/$$i $$j; \
done; \
done
cd $(B) && ./buildconf
touch $@
build: $(STAMP_DIR)/build-mpms
$(STAMP_DIR)/build-mpms: $(STAMP_DIR)/configure
dh_testdir
for i in $(FIRSTMPM); do \
mkdir -p $(BUILD)/$$i ;\
cd $(BUILD)/$$i && ac_cv_prog_AWK=mawk CFLAGS="$(AP2_CONFLAGS)" LDFLAGS="$(AP2_LDFLAGS)" $(REALCURDIR)/$(B)/configure --srcdir=$(REALCURDIR)/$(B) $(AP2_COMMON_CONFARGS) $(AP2_CONFARGS) --with-mpm=$$i ;\
$(MAKE); \
cd $(REALCURDIR);\
done
for i in $(OTHERMPMS) $(PREFORKMPM); do \
mkdir -p $(BUILD)/$$i ;\
cd $(BUILD)/$$i && ac_cv_prog_AWK=mawk CFLAGS="$(AP2_CONFLAGS)" LDFLAGS="$(AP2_LDFLAGS)" $(REALCURDIR)/$(B)/configure --srcdir=$(REALCURDIR)/$(B) $(AP2_COMMON_CONFARGS) --with-mpm=$$i ;\
$(MAKE); \
cd $(REALCURDIR);\
done
touch $@
clean:
dh_testdir
dh_testroot
rm -f $(STAMP_DIR)/configure $(STAMP_DIR)/build $(STAMP_DIR)/install
rm -rf $(BUILD)
$(MAKE) -f debian/sys-build.mk source.clean
rm -rf debian/stampdir debian.diff
for i in $(FIRSTMPM) $(OTHERMPMS); do \
rm -f debian/apache2-mpm-$$i.postinst ;\
rm -f debian/apache2-mpm-$$i.prerm ;\
rm -f debian/apache2-mpm-$$i.preinst ;\
rm -f debian/apache2-mpm-$$i.init.d ;\
done
rm -f debian/apache2-mpm-prefork.prerm
rm -f debian/apache2-mpm-prefork.init.d
rm -f debian/apache2-common.init.d
dh_clean
install: $(STAMP_DIR)/inst-mpms $(STAMP_DIR)/move
$(STAMP_DIR)/inst-mpms: build
dh_clean -k
dh_installdirs
for i in $(FIRSTMPM) $(PREFORKMPM); do \
cd $(BUILD)/$$i && $(MAKE) DESTDIR=$(REALCURDIR)/debian/apache2-mpm-$$i install ; \
cd $(REALCURDIR) ; \
done
for i in $(OTHERMPMS); do \
$(INSTALL) -d $(REALCURDIR)/debian/apache2-mpm-$$i/usr/sbin/; \
cd $(BUILD)/$$i && $(LIBTOOL) --mode=install $(INSTALL) apache2 $(REALCURDIR)/debian/apache2-mpm-$$i/usr/sbin/ ; \
cd $(REALCURDIR) ; \
done
$(STAMP_DIR)/move: $(STAMP_DIR)/inst-mpms
dh_testroot
#install apr stuff.
mv debian/apache2-mpm-worker/usr/include/apache2/apr* debian/libapr$(major)-dev/usr/include/apr-$(major)
mv debian/apache2-mpm-worker/usr/include/apache2/apu* debian/libapr$(major)-dev/usr/include/apr-$(major)
mv debian/apache2-mpm-worker/usr/lib/libapr*a debian/libapr$(major)-dev/usr/lib
mv debian/apache2-mpm-worker/usr/lib/libapr*.so debian/libapr$(major)-dev/usr/lib
mv debian/apache2-mpm-worker/usr/lib/libapr* debian/libapr$(major)/usr/lib
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
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
# 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
# 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
rm -f debian/apache2-mpm-worker/usr/bin/apr-config debian/apache2-mpm-worker/usr/bin/apu-config
#install apache2 dev stuff
for i in $(PREFORKMPM) $(FIRSTMPM); do \
if [ "$$i" = "prefork" ]; then \
TARGET=prefork;\
else\
TARGET=threaded;\
fi;\
mv debian/apache2-mpm-$$i/usr/include/apache2/* debian/apache2-$$TARGET-dev/usr/include/apache2 ;\
mv debian/apache2-mpm-$$i/usr/sbin/apxs debian/apache2-$$TARGET-dev/usr/bin/apxs2 ;\
mv debian/apache2-mpm-$$i/usr/share/man/man8/apxs.8 debian/apache2-$$TARGET-dev/usr/share/man/man8/apxs2.8 ;\
cp build-tree/apache2/build/special.mk debian/apache2-$$TARGET-dev/usr/share/apache2/build/special.mk ;\
mv debian/apache2-mpm-$$i/usr/share/apache2/build/* debian/apache2-$$TARGET-dev/usr/share/apache2/build/ ;\
sed -e "s,`pwd`/build-tree/apache2-build/$$i/srclib/apr/libapr-0.la,/usr/lib/libapr-0.la," \
-e "s,`pwd`/build-tree/apache2-build/$$i/srclib/apr-util/libaprutil-0.la,/usr/lib/libaprutil-0.la," \
-e "s,`pwd`/build-tree/apache2-build/$$i/srclib/pcre/libpcre.la,," \
-e "s,^EXTRA_INCLUDES =.*$$,EXTRA_INCLUDES = -I/usr/include/openssl -I/usr/include/apache2 -I/usr/include/apr-0," \
-e "s,^abs_srcdir =.*$$,abs_srcdir =," \
-e "s,^LIBTOOL =.*$$,LIBTOOL = /bin/sh /usr/bin/libtool --silent," \
-e "s,^SH_LIBTOOL =.*$$,SH_LIBTOOL = /bin/sh /usr/bin/libtool --silent," \
-e "s,APR_INCLUDEDIR =.*$$,APR_INCLUDEDIR = /usr/include/apr-0," \
-e "s,APU_INCLUDEDIR =.*$$,APU_INCLUDEDIR = /usr/include/apr-0," \
build-tree/apache2-build/$$i/build/config_vars.mk > debian/apache2-$$TARGET-dev/usr/share/apache2/build/config_vars.mk; \
done
#apache2-utils stuff
mv debian/apache2-mpm-worker/usr/sbin/ab debian/apache2-utils/usr/sbin/ab
mv debian/apache2-mpm-worker/usr/share/man/man8/ab.8 debian/apache2-utils/usr/share/man/man8/ab.8
cp build-tree/apache2/support/check_forensic debian/apache2-utils/usr/sbin/check_forensic
cp debian/check_forensic.8 debian/apache2-utils/usr/share/man/man8/check_forensic.8
mv debian/apache2-mpm-worker/usr/sbin/checkgid debian/apache2-utils/usr/sbin/checkgid
cp debian/checkgid.8 debian/apache2-utils/usr/share/man/man8/checkgid.8
mv debian/apache2-mpm-worker/usr/sbin/dbmmanage debian/apache2-utils/usr/bin/dbmmanage
mv debian/apache2-mpm-worker/usr/share/man/man1/dbmmanage.1 debian/apache2-utils/usr/share/man/man1/dbmmanage.1
mv debian/apache2-mpm-worker/usr/sbin/htdbm debian/apache2-utils/usr/bin/htdbm
mv debian/apache2-mpm-worker/usr/sbin/htdigest debian/apache2-utils/usr/bin/htdigest
mv debian/apache2-mpm-worker/usr/share/man/man1/htdigest.1 debian/apache2-utils/usr/share/man/man1/htdigest.1
mv debian/apache2-mpm-worker/usr/sbin/htpasswd debian/apache2-utils/usr/bin/htpasswd
mv debian/apache2-mpm-worker/usr/share/man/man1/htpasswd.1 debian/apache2-utils/usr/share/man/man1/htpasswd.1
mv debian/apache2-mpm-worker/usr/sbin/logresolve debian/apache2-utils/usr/sbin/logresolve
mv debian/apache2-mpm-worker/usr/share/man/man8/logresolve.8 debian/apache2-utils/usr/share/man/man8/logresolve.8
cp build-tree/apache2-build/worker/support/split-logfile debian/apache2-utils/usr/sbin/split-logfile
chmod 755 debian/apache2-utils/usr/sbin/split-logfile
mv debian/apache2-mpm-worker/usr/sbin/rotatelogs debian/apache2-utils/usr/sbin/rotatelogs
mv debian/apache2-mpm-worker/usr/share/man/man8/rotatelogs.8 debian/apache2-utils/usr/share/man/man8/rotatelogs.8
#apache2-utils backward compatibility symlinks
ln -s ab debian/apache2-utils/usr/sbin/ab2
ln -s checkgid debian/apache2-utils/usr/sbin/checkgid2
ln -s dbmmanage debian/apache2-utils/usr/bin/dbmmanage2
ln -s htdigest debian/apache2-utils/usr/bin/htdigest2
ln -s htpasswd debian/apache2-utils/usr/bin/htpasswd2
ln -s logresolve debian/apache2-utils/usr/sbin/logresolve2
ln -s rotatelogs debian/apache2-utils/usr/sbin/rotatelogs2
#apache2-common stuff
mv debian/apache2-mpm-worker/usr/share/apache2/icons/* debian/apache2-common/usr/share/apache2/icons/
mv debian/apache2-mpm-worker/usr/share/apache2/error/* debian/apache2-common/usr/share/apache2/error/
mv debian/apache2-mpm-worker/usr/sbin/apachectl debian/apache2-common/usr/sbin/apache2ctl
mv debian/apache2-mpm-worker/usr/sbin/suexec debian/apache2-common/usr/lib/apache2/suexec2
mv debian/apache2-mpm-worker/etc/apache2/*.conf debian/apache2-common/usr/share/doc/apache2/examples
mv debian/apache2-mpm-worker/usr/lib/apache2/modules debian/apache2-common/usr/lib/apache2/modules
cp debian/apache2.8 debian/apache2-common/usr/share/man/man8/apache2.8
cp debian/apache2ctl.8 debian/apache2-common/usr/share/man/man8/apache2ctl.8
mv debian/apache2-mpm-worker/usr/share/man/man8/suexec.8 debian/apache2-common/usr/share/man/man8/suexec2.8
mv debian/apache2-mpm-worker/usr/sbin/envvars* debian/apache2-common/usr/share/apache2/build/
mv debian/apache2-common/usr/share/apache2/build/envvars debian/apache2-common/etc/apache2/
mv debian/apache2-mpm-worker/usr/share/apache2/default-site/htdocs/ debian/apache2-common/var/www/apache2-default/
rm -r debian/apache2-common/var/www/apache2-default/manual
cp debian/robots.txt debian/apache2-common/var/www/apache2-default/
cp -R debian/config-sites/* debian/apache2-common/usr/share/apache2/config
cp -R debian/config-mods/*.load debian/apache2-common/etc/apache2/mods-available
cp -R debian/config-mods/*.conf debian/apache2-common/etc/apache2/mods-available
cp -R debian/config/* debian/apache2-common/etc/apache2/
cp -R build-tree/apache2/docs/* debian/apache2-doc/usr/share/doc/apache2-doc
cp build-tree/apache2/CHANGES debian/apache2-common/usr/share/doc/apache2/changelog
rm -f debian/apache2-doc/usr/share/doc/apache2-doc/manual/LICENSE
rm -f debian/apache2-doc/usr/share/doc/apache2-doc/manual/vhosts/LICENSE
rm -f debian/apache2-mpm-worker/usr/lib/cgi-bin/test-cgi.bat
rm -f debian/apache2-doc/usr/share/doc/apache2-doc/conf/ssl-std.conf
rm -f debian/apache2-mpm-worker/usr/lib/apache2/modules/httpd.exp
rm -f debian/apache2-mpm-worker/usr/lib/apache2/*.exp
rm -r debian/apache2-mpm-worker/usr/lib/cgi-bin/
# chmod +x debian/apache2-common/usr/lib/cgi-bin/*
chmod u+x debian/apache2*/usr/sbin/*
for i in `find debian/a2-scripts -name .svn -prune -o -name .arch-ids -prune -o -type f -print`; \
do install -m755 $$i debian/apache2-common/usr/sbin; \
done
cp debian/default-site debian/apache2-common/etc/apache2/sites-available/default
cp debian/apache2-doc.conf debian/apache2-doc/etc/apache2/conf.d/apache2-doc
cp debian/ssleay.cnf debian/apache2-common/usr/share/apache2/ssleay.cnf
$(INSTALL) debian/ssl-certificate debian/apache2-common/usr/sbin/apache2-ssl-certificate
chown root:www-data debian/apache2-common/usr/lib/apache2/suexec2
chmod 4750 debian/apache2-common/usr/lib/apache2/suexec2
chmod +x debian/libapr$(major)-dev/usr/bin/*
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
# FIXME - HACK!!!!
mv debian/apache2-mpm-prefork/usr/sbin/apache2 debian/apache2-mpm-prefork/usr/apache2
rm -rf debian/apache2-mpm-prefork/usr/sbin/
mkdir debian/apache2-mpm-prefork/usr/sbin/
mv debian/apache2-mpm-prefork/usr/apache2 debian/apache2-mpm-prefork/usr/sbin/apache2
# EOH
for i in $(THREADEDMPMS) ; do \
cp debian/mpm-postinst-threaded debian/apache2-mpm-$$i.postinst ; \
cp debian/mpm-preinst-threaded debian/apache2-mpm-$$i.preinst ; \
done
for i in $(THREADEDMPMS) $(PREFORKMPM); do \
cp debian/mpms.prerm debian/apache2-mpm-$$i.prerm; \
done
cp debian/init-script debian/apache2-common.init.d
mkdir -p debian/apache2-common/etc/logrotate.d
cp debian/logrotate debian/apache2-common/etc/logrotate.d/apache2
cp debian/README.etc debian/apache2-common/etc/apache2/README
cp debian/README.etc debian/apache2-common/usr/share/doc/apache2/README.etc
touch $@
binary-indep: build install
dh_testdir -i
dh_testroot -i
dh_installdocs -i
dh_installchangelogs -i
dh_link -i
dh_compress -i
dh_fixperms -i -Xsuexec2
dh_installdeb -i
dh_gencontrol -i
dh_md5sums -i
dh_builddeb -i
# Build architecture-dependent files here.
binary-arch: build install
dh_testdir -a
dh_testroot -a
dh_installdocs -a
dh_installman -a
dh_installinit -a -r --init-script=apache2 debian/apache2-common.init.d -- defaults 91
dh_installchangelogs -a
dh_installdebconf -a
ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
dh_strip -a
endif
dh_link -a
dh_compress -a
dh_fixperms -a -Xsuexec2
chown -R www-data:www-data debian/apache2-common/var/cache/apache2
chmod 644 debian/apache2-common/usr/share/man/man8/suexec2.8.gz
dh_makeshlibs -a -V
dh_installdeb -a
dh_shlibdeps -a -l debian/libapr0/usr/lib -- -Ldebian/libapr0/DEBIAN/shlibs
dh_gencontrol -a
dh_md5sums -a
dh_builddeb -a
binary: binary-indep binary-arch
.PHONY: build clean binary-indep binary-arch binary install configure
reset:
rm -rf $(STAMP_DIR)/build build-tree $(STAMP_DIR)/configure debian.diff
$(MAKE) -f debian/sys-build.mk source.clean
$(MAKE) -f debian/sys-build.mk source.make
patch:
-cd $(B) && $(MAKE) clean
$(MAKE) -f debian/sys-build.mk make-diff
|