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
|
#!/usr/bin/make -f
# Sample debian/rules that uses debhelper.
# GNU copyright 1997 by Joey Hess.
#
# This version is for a hypothetical package that builds an
# architecture-dependant package, as well as an architecture-independent
# package.
# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1
# This is the debhelper compatability version to use.
export DH_COMPAT=2
# This has to be exported to make some magic below work.
export DH_OPTIONS
modules=gd imap ldap mhash mysql pgsql snmp xml
apachever=$(shell dpkg -s apache-dev | grep ^Version | cut -d\ -f2 | cut -d- -f1)
php4ver=$(shell head -1 debian/changelog | cut -d\ -f 2 | sed 's/[()]//g')
build: build-apache-stamp build-cgi-stamp
build-apache-stamp: configure-apache-stamp
dh_testdir
# Add here commands to compile the package.
cd apache-build && $(MAKE)
#for i in $(modules); do \
# make -C apache-build/ext/$$i clean; \
#done
#cd apache-build && \
# make LIBS="-L`pwd`/.libs -lphp4"
touch build-apache-stamp
build-cgi-stamp: configure-cgi-stamp
dh_testdir
cd cgi-build && $(MAKE) && mv php php4.cgi
#HACK to not rebuild CGI twice
cd cgi-build && mv php_config.h php_config.h.old && \
sed -e 's/FORCE_CGI_REDIRECT 1/FORCE_CGI_REDIRECT 0/' \
-e 's/DISCARD_PATH 0/DISCARD_PATH 1/' < php_config.h.old > php_config.h && \
touch -r php_config.h.old php_config.h
cd cgi-build/sapi/cgi && make clean
cd cgi-build && $(MAKE)
touch build-cgi-stamp
configure: configure-apache-stamp
configure-apache-stamp:
dh_testdir
if [ -d apache-build ]; then rm -rf apache-build; fi
-mkdir apache-build
#aclocal
#automake
#autoconf
cd apache-build && \
../configure --prefix=/usr --with-apxs=/usr/bin/apxs --with-regex=system \
--with-config-file-path=/etc/php4/apache \
--enable-calendar \
--with-db \
--without-dom \
--enable-filepro \
--enable-ftp \
--with-gettext \
--enable-sysvsem \
--enable-sysvshm \
--enable-track-vars \
--enable-trans-sid \
--disable-debug --disable-static \
--with-gd=shared \
--with-imap=shared \
--with-ldap=shared,/usr \
--with-mm \
--with-mhash=shared \
--with-mysql=shared,/usr \
--with-regex=system \
--with-pcre-regex=/usr \
--with-pgsql=shared,/usr \
--with-snmp=shared \
--enable-sockets \
--with-ttf --enable-freetype-4bit-antialias-hack --with-t1lib \
--with-xml=shared,/usr \
--enable-yp \
--with-zlib \
--enable-ucd-snmp-hack
# --enable-versioning
touch configure-apache-stamp
configure-cgi-stamp:
dh_testdir
if [ -d cgi-build ]; then rm -rf cgi-build; fi
-mkdir cgi-build
#aclocal
#automake
#autoconf
cd cgi-build && \
../configure --prefix=/usr --prefix=/usr --with-regex=system --enable-force-cgi-redirect \
--with-config-file-path=/etc/php4/cgi \
--enable-calendar \
--with-db \
--without-dom \
--enable-filepro \
--enable-ftp \
--with-gettext \
--enable-sysvsem \
--enable-sysvshm \
--enable-track-vars \
--enable-trans-sid \
--disable-debug --disable-static \
--with-gd=shared \
--with-imap=shared \
--with-ldap=shared,/usr \
--with-mhash=shared \
--with-mm \
--with-mysql=shared,/usr \
--with-regex=system \
--with-pcre-regex=/usr \
--with-pgsql=shared,/usr \
--with-snmp=shared \
--enable-sockets \
--with-ttf --enable-freetype-4bit-antialias-hack --with-t1lib \
--with-xml=shared,/usr \
--enable-yp \
--with-zlib \
--enable-ucd-snmp-hack
# --enable-versioning
touch configure-cgi-stamp
clean:
dh_testdir
dh_testroot
rm -f configure-apache-stamp build-apache-stamp
rm -f configure-cgi-stamp build-cgi-stamp
rm -f install-stamp
# Add here commands to clean up after the build process.
#-$(MAKE) distclean
rm -rf apache-build
rm -rf cgi-build
rm -f debian/copyright
dh_clean
install: DH_OPTIONS=
install: build
dh_testdir
dh_testroot
dh_clean -k
dh_installdirs
# Add here commands to install the package into debian/php4.
#$(MAKE) install prefix=`pwd`/debian/php4/usr
cp apache-build/.libs/libphp4.so debian/php4/usr/lib/apache/1.3
cp debian/500mod_php4.info debian/php4/usr/lib/apache/1.3
# sanitize php.ini file
cat php.ini-dist | tr "\t" " " > debian/php4/etc/php4/apache/php.ini
cat php.ini-dist | tr "\t" " " | sed -e "s;/usr/lib/php4/apache;/usr/lib/php4/cgi;" > debian/php4-cgi/etc/php4/cgi/php.ini
#install the apache modules' files
for i in $(modules); do \
install -m 644 -o root -g root \
apache-build/ext/$$i/.libs/$$i.so \
debian/php4-$$i/usr/lib/php4/apache/$$i.so; \
done
cd cgi-build && make install DESTDIR=`pwd`/../debian/php4-cgi
for i in $(modules); do \
install -m 644 -o root -g root \
debian/php4-cgi/usr/lib/php4/$$i.so \
debian/php4-cgi-$$i/usr/lib/php4/cgi/$$i.so; \
done
# #install the apache modules' files
# for i in $(modules); do \
# cp cgi-build/ext/$$i/.libs/$$i.so \
# debian/php4-cgi-$$i/usr/lib/php4/cgi; \
# done
dh_movefiles --sourcedir=debian/php4-cgi
# INSTALL different versions for commandline and cgi php4
mv debian/php4-cgi/usr/bin/php debian/php4-cgi/usr/bin/php4
cp cgi-build/php4.cgi debian/php4-cgi/usr/lib/cgi-bin/php4
# mv debian/php4-cgi/usr/bin/php debian/php4-cgi/usr/lib/cgi-bin/php4
# ln -s ../lib/cgi-bin/php4 debian/php4-cgi/usr/bin/php4
install -m 755 -o root -g root ext/ext_skel debian/php4-dev/usr/bin/ext_skel
# rm -rf debian/php4-cgi/usr/bin
# rm -rf debian/php4-cgi/usr/include
# rm -rf debian/php4-cgi/usr/lib/php4
# just to be sure
rm -f debian/php4-cgi/usr/lib/php4/*.so
# touch install-stamp
# Build architecture-independent files here.
# Pass -i to all debhelper commands in this target to reduce clutter.
binary-indep: DH_OPTIONS=-i
binary-indep: build install
# Need this version of debhelper for DH_OPTIONS to work.
dh_testversion 1.1.17
dh_testdir
dh_testroot
# dh_installdebconf
dh_installdocs
dh_installexamples
dh_installmenu
# dh_installemacsen
# dh_installpam
# dh_installinit
dh_installcron
# dh_installmanpages
dh_installinfo
# dh_undocumented
dh_installchangelogs -i NEWS
dh_link
dh_compress
dh_fixperms
# You may want to make some executables suid here.
dh_suidregister
dh_installdeb
# dh_perl
dh_gencontrol
dh_md5sums
dh_builddeb
# Build architecture-dependent files here.
# Pass -a to all debhelper commands in this target to reduce clutter.
#binary-arch: DH_OPTIONS=-a
binary-arch: build install
# Need this version of debhelper for DH_OPTIONS to work.
dh_testversion 1.1.17
dh_testdir
dh_testroot
# dh_installdebconf
cat debian/copyright.header LICENSE Zend/LICENSE >debian/copyright
dh_installdocs -a
for i in $(modules); do \
rm -rf debian/php4-$$i/usr/share/doc/php4-$$i; \
ln -s php4 debian/php4-$$i/usr/share/doc/php4-$$i; \
done
for i in $(modules); do \
rm -rf debian/php4-cgi-$$i/usr/share/doc/php4-cgi-$$i; \
ln -s php4-cgi debian/php4-cgi-$$i/usr/share/doc/php4-cgi-$$i; \
done
# dh_installexamples
# dh_installmenu
# dh_installemacsen
# dh_installpam
# dh_installinit
# dh_installcron
# dh_installmanpages
# dh_installinfo
# dh_undocumented
dh_installchangelogs -pphp4 NEWS
dh_installchangelogs -pphp4-cgi NEWS
dh_strip -a
dh_link -a
dh_compress -a
dh_fixperms -a
# # You may want to make some executables suid here.
# dh_suidregister
dh_installdeb -a
# dh_makeshlibs
# dh_perl
LD_LIBRARY_PATH=`pwd`/debian/php4/usr/lib/apache/1.3 dh_shlibdeps -a
echo "apache:Depends=apache-common (>= $(apachever)), apache-common (<< $(apachever).1)" >>debian/substvars
for i in $(modules); do \
echo "php4:Depends=php4 (= $(php4ver))" >>debian/php4-$$i.substvars; \
done
for i in $(modules); do \
echo "php4-cgi:Depends=php4-cgi (= $(php4ver))" >>debian/php4-cgi-$$i.substvars; \
done
dh_gencontrol -a
dh_md5sums -a
dh_builddeb -a
binary: binary-arch binary-indep
.PHONY: build clean binary-indep binary-arch binary install configure
|