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 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544
|
#!/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=4
# This has to be exported to make some magic below work.
export DH_OPTIONS
DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
DEB_BUILD_ARCH ?= $(shell dpkg-architecture -qDEB_BUILD_ARCH)
PHP5_HOST_GNU_TYPE = $(shell echo $(DEB_HOST_GNU_TYPE) | sed 's/-gnu$$//')
PHP5_BUILD_GNU_TYPE = $(shell echo $(DEB_BUILD_GNU_TYPE) | sed 's/-gnu$$//')
PHP5_SOURCE_VERSION = $(shell dpkg-parsechangelog | grep ^Version | sed "s/Version: //")
PHP5_UPSTREAM_VERSION = $(shell echo $(PHP5_SOURCE_VERSION) | sed -e "s/-.*//" -e "s/.*://")
PHP5_DEBIAN_REVISION = $(shell echo $(PHP5_SOURCE_VERSION) | sed "s/.*-//")
APACHE_VERSION = $(shell dpkg -s apache-dev | grep ^Version | cut -d\ -f2 | cut -d- -f1)
PROG_SENDMAIL = /usr/sbin/sendmail
CFLAGS = -O2 -Wall -fsigned-char -fno-strict-aliasing
# LFS support
CFLAGS += $(shell getconf LFS_CFLAGS)
# Enable IEEE-conformant floating point math on alphas (not the default)
ifeq (alpha-linux,$(PHP5_HOST_GNU_TYPE))
CFLAGS += -mieee
endif
ifeq ($(PHP5_HOST_GNU_TYPE), $(findstring $(PHP5_HOST_GNU_TYPE), ia64-linux powerpc64-linux))
CFLAGS += -g
else
CFLAGS += -gstabs
endif
ifneq (nostrip, $(findstring nostrip, $(DEB_BUILD_OPTIONS)))
install_strip = -s
endif
# Old magic.mime location:
ifeq ($(wildcard /usr/share/misc/file/magic.mime), /usr/share/misc/file/magic.mime)
MAGIC_MIME = /usr/share/misc/file/magic.mime
endif
# New magic.mime location:
ifeq ($(wildcard /usr/share/file/magic.mime), /usr/share/file/magic.mime)
MAGIC_MIME = /usr/share/file/magic.mime
endif
# only enable interbase support for i386/amd64
ifneq (,$(filter $(DEB_BUILD_ARCH),amd64 i386))
IBFLAGS=--with-interbase=shared,/usr \
--with-pdo-firebird=shared,/usr
endif
COMMON_CONFIG=--build=$(PHP5_BUILD_GNU_TYPE)-gnu \
--host=$(PHP5_HOST_GNU_TYPE)-gnu \
--mandir=/usr/share/man \
--enable-memory-limit \
--disable-debug \
--with-regex=php \
--disable-rpath \
--disable-static \
--with-pic \
--with-layout=GNU \
--with-pear=/usr/share/php \
--enable-calendar \
--enable-sysvsem \
--enable-sysvshm \
--enable-sysvmsg \
--enable-track-vars \
--enable-trans-sid \
--enable-bcmath \
--with-bz2 \
--enable-ctype \
--with-db4 \
--without-gdbm \
--with-iconv \
--enable-exif \
--enable-filepro \
--enable-ftp \
--with-gettext \
--enable-mbstring \
--with-pcre-regex=/usr \
--enable-shmop \
--enable-sockets \
--enable-wddx \
--with-libxml-dir=/usr \
--with-zlib \
--with-kerberos=/usr \
--with-openssl=/usr \
--enable-dbx \
--enable-soap \
--enable-zip \
--with-mime-magic=$(MAGIC_MIME) \
--with-exec-dir=/usr/lib/php5/libexec \
--with-system-tzdata
BUILTIN_EXTENSION_CHECK=$$e=get_loaded_extensions(); natcasesort($$e); \
$$s="The following extensions are built in:"; \
foreach($$e as $$i) { $$s .= " $$i"; } \
echo("php:Extensions=" . wordwrap($$s . ".\n", 75, "\$${Newline} "));
patch: patch-stamp
patch-stamp:
dh_testdir
for patch in debian/patches/*.patch; do \
echo '->'`basename $$patch`:; \
if ! patch -p1 --ignore-whitespace --dry-run < $$patch; \
then \
exit 1; \
fi; \
patch -p1 --ignore-whitespace < $$patch; \
done
sed -i -e 's/EXTRA_VERSION=""/EXTRA_VERSION="-$(PHP5_DEBIAN_REVISION)"/' configure.in
./buildconf --force
touch patch-stamp
unpatch:
dh_testdir
sed -i -e 's/EXTRA_VERSION="-$(PHP5_DEBIAN_REVISION)"/EXTRA_VERSION=""/' configure.in
if [ -f patch-stamp ]; then \
for patch in `ls debian/patches/*.patch | sort -r`; do \
patch -p1 -R --ignore-whitespace < $$patch; \
done; \
rm -f aclocal.m4 config.sub config.guess ltmain.sh; \
./buildconf --force; \
fi
rm -f patch-stamp
build: build-apache-stamp build-apache2-stamp build-cgi-stamp build-cli-stamp build-pear-stamp
build-apache-stamp: configure-apache-stamp
dh_testdir
# Add here commands to compile the package.
cd apache-build && $(MAKE)
touch build-apache-stamp
build-apache2-stamp: configure-apache2-stamp
dh_testdir
cd apache2-build && $(MAKE)
touch build-apache2-stamp
build-cli-stamp: configure-cli-stamp
dh_testdir
cd cli-build && $(MAKE)
touch build-cli-stamp
build-cgi-stamp: configure-cgi-stamp
dh_testdir
cd cgi-build && $(MAKE) && mv sapi/cgi/php sapi/cgi/cgi-bin.php5
# Dirty hack to not rebuild everything twice
cd cgi-build/main && \
sed -i -e 's/FORCE_CGI_REDIRECT 1/FORCE_CGI_REDIRECT 0/' \
-e 's/DISCARD_PATH 0/DISCARD_PATH 1/' php_config.h && \
sed -i -e 's/--enable-force-cgi-redirect/--enable-discard-path/' build-defs.h && \
touch ../../ext/standard/info.c && \
touch ../../sapi/cgi/cgi_main.c
cd cgi-build && $(MAKE) && mv sapi/cgi/php sapi/cgi/usr.bin.php5-cgi
touch build-cgi-stamp
build-pear-stamp: build-cgi-stamp
dh_testdir
-mkdir pear-build
cd cgi-build && make install-pear PHP_PEAR_PHP_BIN=/usr/bin/php PHP_PEAR_INSTALL_DIR=/usr/share/php PHP_PEAR_SYSCONF_DIR=/etc/pear PHP_PEAR_SIG_BIN=/usr/bin/gpg INSTALL_ROOT=$(CURDIR)/pear-build
sed -i -e 's/-d output_buffering=1 -d open_basedir="" -d safe_mode=0/-d output_buffering=1 -d open_basedir="" -d safe_mode=0 -d memory_limit="-1"/' \
$(CURDIR)/pear-build/usr/bin/pear && \
sed -i -e 's/-d output_buffering=1 -d safe_mode=0/-d output_buffering=1 -d open_basedir="" -d safe_mode=0 -d memory_limit="-1"/' \
$(CURDIR)/pear-build/usr/bin/pecl && \
sed -i -e 's/-d memory_limit="-1"//' \
-e 's/-d output_buffering=1 -d open_basedir="" -d safe_mode=0/-d output_buffering=1 -d open_basedir="" -d safe_mode=0 -d memory_limit="-1"/' \
$(CURDIR)/pear-build/usr/bin/peardev
touch build-pear-stamp
configure: configure-apache-stamp configure-apache2-stamp configure-cli-stamp configure-cgi-stamp
configure-apache-stamp: patch-stamp
dh_testdir
if [ -d apache-build ]; then rm -rf apache-build; fi
-mkdir apache-build
cd apache-build && \
CFLAGS="$(CFLAGS)" PROG_SENDMAIL="$(PROG_SENDMAIL)" ../configure \
--prefix=/usr --with-apxs=/usr/bin/apxs \
--with-config-file-path=/etc/php5/apache \
--with-config-file-scan-dir=/etc/php5/apache/conf.d \
$(COMMON_CONFIG) \
--without-mm \
--disable-pdo \
--without-mysql --without-sybase-ct --without-sqlite
cd apache-build && \
cp ../Zend/zend_ini_scanner.c ../Zend/zend_language_scanner.c \
../Zend/zend_ini_parser.h ../Zend/zend_language_parser.h \
../Zend/zend_ini_parser.c ../Zend/zend_language_parser.c \
Zend/
touch configure-apache-stamp
configure-apache2-stamp: patch-stamp
dh_testdir
if [ -d apache2-build ]; then rm -rf apache2-build; fi
-mkdir apache2-build
cd apache2-build && \
CFLAGS="$(CFLAGS)" PROG_SENDMAIL="$(PROG_SENDMAIL)" ../configure \
--prefix=/usr --with-apxs2=/usr/bin/apxs2 \
--with-config-file-path=/etc/php5/apache2 \
--with-config-file-scan-dir=/etc/php5/apache2/conf.d \
$(COMMON_CONFIG) \
--without-mm \
--with-curl=shared,/usr \
--with-zlib-dir=/usr \
--with-gd=shared,/usr --enable-gd-native-ttf \
--with-jpeg-dir=shared,/usr \
--with-xpm-dir=shared,/usr/X11R6 \
--with-png-dir=shared,/usr \
--with-freetype-dir=shared,/usr \
--with-imap=shared,/usr \
--with-imap-ssl \
$(IBFLAGS) \
--with-ttf=shared,/usr \
--with-t1lib=shared,/usr \
--with-ldap=shared,/usr \
--with-mcrypt=shared,/usr \
--with-mhash=shared,/usr \
--with-mysql=shared,/usr \
--with-mysqli=shared,/usr/bin/mysql_config \
--with-pspell=shared,/usr \
--with-unixODBC=shared,/usr \
--with-recode=shared,/usr \
--with-xsl=shared,/usr \
--with-snmp=shared,/usr \
--with-sqlite=shared,/usr \
--with-sybase-ct=shared,/usr \
--with-tidy=shared,/usr \
--with-xmlrpc=shared \
--with-pgsql=shared,/usr PGSQL_INCLUDE=`pg_config --includedir` \
--enable-pdo=shared \
--without-pdo-dblib \
--with-pdo-mysql=shared,/usr \
--with-pdo-odbc=shared,unixODBC,/usr \
--with-pdo-pgsql=shared,/usr/bin/pg_config \
--with-pdo-sqlite=shared,/usr
cd apache2-build && \
cp ../Zend/zend_ini_scanner.c ../Zend/zend_language_scanner.c \
../Zend/zend_ini_parser.h ../Zend/zend_language_parser.h \
../Zend/zend_ini_parser.c ../Zend/zend_language_parser.c \
Zend/
touch configure-apache2-stamp
configure-cgi-stamp: patch-stamp
dh_testdir
if [ -d cgi-build ]; then rm -rf cgi-build; fi
-mkdir cgi-build
cd cgi-build && \
CFLAGS="$(CFLAGS)" PROG_SENDMAIL="$(PROG_SENDMAIL)" ../configure \
--prefix=/usr --enable-force-cgi-redirect --enable-fastcgi \
--with-config-file-path=/etc/php5/cgi \
--with-config-file-scan-dir=/etc/php5/cgi/conf.d \
$(COMMON_CONFIG) \
--without-mm \
--disable-pdo \
--without-mysql --without-sybase-ct --without-sqlite
cd cgi-build && \
cp ../Zend/zend_ini_scanner.c ../Zend/zend_language_scanner.c \
../Zend/zend_ini_parser.h ../Zend/zend_language_parser.h \
../Zend/zend_ini_parser.c ../Zend/zend_language_parser.c \
Zend/
touch configure-cgi-stamp
configure-cli-stamp: patch-stamp
dh_testdir
if [ -d cli-build ]; then rm -rf cli-build; fi
-mkdir cli-build
cd cli-build && \
CFLAGS="$(CFLAGS)" PROG_SENDMAIL="$(PROG_SENDMAIL)" ../configure \
--prefix=/usr --disable-cgi \
--with-config-file-path=/etc/php5/cli \
--with-config-file-scan-dir=/etc/php5/cli/conf.d \
$(COMMON_CONFIG) \
--without-mm \
--disable-pdo \
--without-mysql --without-sybase-ct --without-sqlite \
--enable-pcntl \
--with-ncurses=/usr
cd cli-build && \
cp ../Zend/zend_ini_scanner.c ../Zend/zend_language_scanner.c \
../Zend/zend_ini_parser.h ../Zend/zend_language_parser.h \
../Zend/zend_ini_parser.c ../Zend/zend_language_parser.c \
Zend/
touch configure-cli-stamp
clean: unpatch
dh_testdir
dh_testroot
rm -f configure-apache-stamp build-apache-stamp
rm -f configure-apache2-stamp build-apache2-stamp
rm -f configure-cgi-stamp build-cgi-stamp
rm -f configure-cli-stamp build-cli-stamp
rm -f build-pear-stamp
rm -f install-stamp
rm -rf apache-build
rm -rf apache2-build
rm -rf cgi-build
rm -rf cli-build
rm -rf pear-build
rm -f debian/copyright
dh_clean -Xorig
# clean up autogenerated cruft
cat debian/modulelist | while read package extname dsoname; do \
rm -f debian/php5-$$package.postinst; \
done
for sapi in libapache-mod-php5 libapache2-mod-php5 php5-cgi php5-cli; do \
for cruft in postrm links; do \
rm -f debian/$${sapi}.$${cruft}; \
done; \
done
install: DH_OPTIONS=
install: build
dh_testdir
dh_testroot
dh_clean -k
dh_installdirs
chmod 01733 debian/php5-common/var/lib/php5
# Add here commands to install the package into debian/php5.
# install apache DSO module
cp apache-build/.libs/libphp5.so debian/libapache-mod-php5/`apxs -q LIBEXECDIR`
cp debian/libapache-mod-php5.500mod_php5.info \
debian/libapache-mod-php5/`apxs -q LIBEXECDIR`/500mod_php5.info
cp debian/libapache-mod-php5.conf \
debian/libapache-mod-php5/etc/apache/conf.d/php5.conf
# install apache2 DSO module
cp apache2-build/.libs/libphp5.so \
debian/libapache2-mod-php5/`apxs2 -q LIBEXECDIR`/
cp debian/libapache2-mod-php5.load \
debian/libapache2-mod-php5/etc/apache2/mods-available/php5.load
cp debian/libapache2-mod-php5.conf \
debian/libapache2-mod-php5/etc/apache2/mods-available/php5.conf
# sanitize php.ini file
cat php.ini-dist | tr "\t" " " > debian/php5-common/usr/share/php5/php.ini-dist
cat php.ini-dist | tr "\t" " " | sed -e'/memory_limit =/ s/8M/32M/g' > debian/php5-common/usr/share/php5/php.ini-dist.cli
cat php.ini-dist | tr "\t" " " > debian/php5-common/usr/share/doc/php5-common/examples/php.ini-dist
cat php.ini-recommended | tr "\t" " " > debian/php5-common/usr/share/doc/php5-common/examples/php.ini-recommended
cat php.ini-paranoid | tr "\t" " " > debian/php5-common/usr/share/doc/php5-common/examples/php.ini-paranoid
# install the apache modules' files
cd apache2-build && make install-headers install-build install-modules install-programs INSTALL_ROOT=$(CURDIR)/debian/libapache2-mod-php5
# remove netware and win32 headers that we don't want
cd debian/libapache2-mod-php5/usr/include/php5/ && \
rm -f TSRM/readdir.h \
TSRM/tsrm_config.{nw,w32}.h \
TSRM/tsrm_{nw,win32}.h \
Zend/zend_config.{nw,w32}.h \
main/config.{nw,w32}.h \
main/win95nt.h
# install PEAR
cp -r pear-build/* debian/php-pear/
# install extensions
ext=`./debian/libapache2-mod-php5/usr/bin/php-config --extension-dir`;\
for i in libapache-mod-php5 libapache2-mod-php5 php5-cgi php5-cli; do \
mkdir -p debian/$$i/$${ext}; \
done; \
cat debian/modulelist debian/extramodulelist | while read package extname dsoname; do \
if [ -z "$$dsoname" ]; then dsoname=$$package; fi; \
mkdir -p debian/php5-$$package$${ext}; \
chrpath debian/libapache2-mod-php5/$${ext}/$$dsoname.so; \
chrpath -d debian/libapache2-mod-php5/$${ext}/$$dsoname.so; \
install ${install_strip} -m 644 -o root -g root \
debian/libapache2-mod-php5/$${ext}/$$dsoname.so \
debian/php5-$$package$${ext}/$$dsoname.so; \
rm debian/libapache2-mod-php5/$${ext}/$$dsoname.so; \
done
# install CGI
cp cgi-build/sapi/cgi/cgi-bin.php5 debian/php5-cgi/usr/lib/cgi-bin/php5
cp cgi-build/sapi/cgi/usr.bin.php5-cgi debian/php5-cgi/usr/bin/php5-cgi
cp cli-build/sapi/cli/php.1 debian/php5-cgi/usr/share/man/man1/php5-cgi.1
# install CLI
cp cli-build/sapi/cli/php debian/php5-cli/usr/bin/php5
cp cli-build/sapi/cli/php.1 debian/php5-cli/usr/share/man/man1/php5.1
# move and install -dev files
dh_movefiles --sourcedir=debian/libapache2-mod-php5
rm -rf debian/libapache2-mod-php5/usr/lib/php5/build/ \
debian/libapache2-mod-php5/usr/include/ \
debian/libapache2-mod-php5/usr/bin/
for i in Makefile.global acinclude.m4 mkdep.awk phpize.m4 scan_makefile_in.awk; do \
chmod 644 debian/php5-dev/usr/lib/php5/build/$$i; \
done
# shipping duplicate files from other packages is hell for security audits
rm debian/php5-dev/usr/lib/php5/build/config.guess && \
ln -s ../../../share/misc/config.guess debian/php5-dev/usr/lib/php5/build/config.guess
rm debian/php5-dev/usr/lib/php5/build/config.sub && \
ln -s ../../../share/misc/config.sub debian/php5-dev/usr/lib/php5/build/config.sub
rm debian/php5-dev/usr/lib/php5/build/libtool.m4 && \
ln -s ../../../share/libtool/libtool.m4 debian/php5-dev/usr/lib/php5/build/libtool.m4
rm debian/php5-dev/usr/lib/php5/build/ltmain.sh && \
ln -s ../../../share/libtool/ltmain.sh debian/php5-dev/usr/lib/php5/build/ltmain.sh
rm debian/php5-dev/usr/lib/php5/build/shtool && \
ln -s ../../../bin/shtool debian/php5-dev/usr/lib/php5/build/shtool
# make php-dev stuff versioned
for i in php-config phpize; do \
mv debian/php5-dev/usr/bin/$$i debian/php5-dev/usr/bin/"$$i"5; \
mv debian/php5-dev/usr/share/man/man1/"$$i".1 debian/php5-dev/usr/share/man/man1/"$$i"5.1; \
done
# install common files
install -m755 debian/maxlifetime debian/php5-common/usr/lib/php5
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_testdir
dh_testroot
cat debian/copyright.header LICENSE Zend/LICENSE > debian/copyright
dh_installdocs
for package in php5 php-pear; do \
rm -rf debian/$$package/usr/share/doc/$$package; \
ln -s php5-common debian/$$package/usr/share/doc/$$package; \
done
dh_link
dh_compress -Xphp.ini
dh_fixperms
dh_installdeb
dh_gencontrol
dh_md5sums
dh_builddeb
# Build architecture-dependent files here.
binary-arch: build install
# Need this version of debhelper for DH_OPTIONS to work.
dh_testdir
dh_testroot
# Do this first so we don't overwrite any debhelper-generated files
#
# generate the maintscripts for various php
# modules from the templates.
cat debian/modulelist | while read package extname dsoname; do \
if [ -z "$$dsoname" ]; then dsoname=$$package; fi; \
sed -e"s/@extname@/$$extname/g; s/@dsoname@/$$dsoname/g" \
< debian/php5-module.postinst \
> debian/php5-$${package}.postinst; \
done
# generate the config snippets for various php
# modules from the templates.
cat debian/modulelist debian/extramodulelist | while read package extname dsoname; do \
if [ -z "$$dsoname" ]; then dsoname=$$package; fi; \
mkdir -p debian/php5-$$package/etc/php5/conf.d; \
sed -e"s/@extname@/$$extname/g; s/@dsoname@/$$dsoname/g" \
< debian/php5-module.ini \
> debian/php5-$${package}/etc/php5/conf.d/$${dsoname}.ini; \
done
# likewise, for the different sapi implementations
for tmpl in postrm links; do \
for sapi in apache apache2 cgi cli; do \
sed -e "s/@sapi@/$$sapi/g" \
< debian/php5-sapi.$$tmpl \
> debian/php5-$${sapi}.$$tmpl; \
done; \
mv debian/php5-apache.$$tmpl debian/libapache-mod-php5.$$tmpl; \
mv debian/php5-apache2.$$tmpl debian/libapache2-mod-php5.$$tmpl; \
done
cat debian/copyright.header LICENSE Zend/LICENSE > debian/copyright
dh_installdocs -s
cat debian/modulelist | while read package extname dsoname; do \
rm -rf debian/php5-$$package/usr/share/doc/php5-$$package; \
ln -s php5-common debian/php5-$$package/usr/share/doc/php5-$$package; \
done
for package in php5-dev php5-cgi php5-cli libapache-mod-php5 libapache2-mod-php5; do \
rm -rf debian/$$package/usr/share/doc/$$package; \
ln -s php5-common debian/$$package/usr/share/doc/$$package; \
done
dh_installcron -pphp5-common --name=php5
dh_installchangelogs -pphp5-common NEWS
dh_strip -s
dh_link -s
dh_compress -s -Xphp.ini
dh_fixperms -s -X /var/lib/php5
mkdir -p debian/php5-common/usr/share/lintian/overrides
echo "php5-common: non-standard-dir-perm var/lib/php5/ 1733 != 0755" >> debian/php5-common/usr/share/lintian/overrides/php5-common
mkdir -p debian/php5-common/usr/share/linda/overrides
echo "Tag: non-standard-dir-perm" >> debian/php5-common/usr/share/linda/overrides/php5-common
echo "Data: /var/lib/php5.*" >> debian/php5-common/usr/share/linda/overrides/php5-common
dh_installdeb -s
dh_shlibdeps -s
phpapi=`./debian/php5-dev/usr/bin/php-config5 --phpapi`; \
for i in libapache-mod-php5 libapache2-mod-php5 php5-cgi php5-cli; do \
echo "php:Provides=phpapi-$${phpapi}" >> debian/$$i.substvars; \
done; \
cat debian/modulelist | while read package extname dsoname; do \
echo "php:Depends=phpapi-$${phpapi}" >> debian/php5-$$package.substvars; \
done
for i in cgi cli; do \
"$$i"-build/sapi/cli/php -n -r '$(BUILTIN_EXTENSION_CHECK)' \
>> debian/php5-"$$i".substvars; \
done
for i in apache apache2; do \
"$$i"-build/sapi/cli/php -n -r '$(BUILTIN_EXTENSION_CHECK)' \
>> debian/lib"$$i"-mod-php5.substvars; \
done
echo "apache:Depends=apache-common (>= $(APACHE_VERSION))" >>debian/libapache-mod-php5.substvars
echo "apache2:Depends=apache2-mpm-prefork (>> 2.0.52) | apache2-mpm-itk, apache2.2-common" >>debian/libapache2-mod-php5.substvars
dh_gencontrol -s
dh_md5sums -s
dh_builddeb -s
binary: binary-arch binary-indep
.PHONY: build clean binary-indep binary-arch binary install configure
|