wok-next view php/receipt @ rev 7705

openssl: disable MAKEFLAGS & change configure options
author Antoine Bodin <gokhlayeh@slitaz.org>
date Sun Dec 19 13:52:20 2010 +0100 (2010-12-19)
parents 79688ff060bd
children 48880e2d195b
line source
1 # SliTaz package receipt.
3 PACKAGE="php"
4 VERSION="5.2.16"
5 CATEGORY="development"
6 SHORT_DESC="PHP web programming language."
7 MAINTAINER="pankso@slitaz.org"
8 DEPENDS="php-common lighttpd zlib libxml2 sqlite libssl"
9 BUILD_DEPENDS="sqlite-dev libxml2-dev zlib zlib-dev libmysqlclient mysql-dev net-snmp-dev \
10 postgresql postgresql-dev gettext openssl-dev apache-dev apache apr-util-dev \
11 c-client mhash mhash-dev libpng libpng-dev libunixODBC unixODBC-dev openldap-dev libldap apr-dev libmcrypt-dev curl curl-dev cyrus-sasl-dev perl pkg-config jpeg-dev jpeg"
12 TARBALL="$PACKAGE-$VERSION.tar.bz2"
13 WEB_SITE="http://www.php.net/"
14 WGET_URL="http://us2.php.net/distributions/$TARBALL"
15 PROVIDE="php:lighttpd"
17 # Rules to configure and make the package.
18 compile_rules()
19 {
20 cd $src
21 COMMON_ARGS="\
22 --prefix=/usr \
23 --sysconfdir=/etc \
24 --infodir=/usr/share/info \
25 --mandir=/usr/share/man \
26 --enable-fastcgi \
27 --enable-discard-path \
28 --enable-force-cgi-redirect \
29 --enable-mbstring \
30 --enable-sockets \
31 --enable-ftp \
32 --enable-zip \
33 --enable-calendar \
34 --enable-exif \
35 --enable-dba=shared \
36 --enable-dbase=shared \
37 --with-config-file-path=/etc \
38 --with-zlib \
39 --with-gettext \
40 --with-mcrypt=shared,/usr \
41 --with-mysql=shared,/usr \
42 --with-pgsql=shared,/usr \
43 --with-snmp=shared,/usr \
44 --with-ldap=shared \
45 --with-imap=shared --with-imap-ssl \
46 --with-mhash=shared \
47 --with-gd=shared \
48 --with-jpeg-dir=/usr \
49 --with-png-dir=/usr \
50 --with-openssl=shared \
51 --with-unixODBC=shared,/usr \
52 --with-pear=/usr/share/php \
53 --with-pdo-mysql=shared \
54 --with-pdo-pgsql=shared \
55 --with-curl=shared \
56 "
57 sed -i 's/pam_start/pam_nostart/' configure
58 ./configure $COMMON_ARGS $CONFIGURE_ARGS && \
59 make -j 4 && make INSTALL_ROOT=$PWD/_pkg install
60 ./configure $COMMON_ARGS --with-apxs2=/usr/bin/apxs $CONFIGURE_ARGS && \
61 make -j 4 && {
62 mkdir -p _pkg/etc/apache
63 cp /etc/apache/httpd.conf _pkg/etc/apache/httpd.conf
64 make INSTALL_ROOT=$PWD/_pkg install
65 }
66 # Recommended config file and phpinfo.
67 cp php.ini-recommended _pkg/etc/php.ini
68 sed -e 's|extension_dir = "./"|extension_dir = "/usr/share/php/"|' \
69 -i _pkg/etc/php.ini
70 cp -a ../stuff/phpinfo _pkg/usr/share
71 mkdir _pkg/usr/share/applications _pkg/usr/share/pixmaps
72 cp ../stuff/php.desktop _pkg/usr/share/applications
73 cp ../stuff/php.png _pkg/usr/share/pixmaps
74 }
76 # Rules to gen a SliTaz package suitable for Tazpkg.
77 genpkg_rules()
78 {
79 mkdir -p $fs/usr/bin $fs/etc $fs/usr/share
80 cp -a $src/sapi/cgi/php-cgi $fs/usr/bin
81 for i in $(cd $WOK; ls -d php-*)
82 do
83 tazwok cook $i
84 done
85 }
87 # Post and pre install commands to stop
88 # and restart Web server if needed.
89 pre_install()
90 {
91 if [ -f "$1/var/run/lighttpd.pid" ]; then
92 /etc/init.d/lighttpd stop
93 fi
94 }
95 post_install()
96 {
97 # Enable php
98 if [ -f $1/etc/lighttpd/lighttpd.conf ]; then
99 [ -f $1/usr/lib/lighttpd/mod_fastcgi.so ] || \
100 tazpkg get-install lighttpd-modules --root=$1/
101 sed -e 's|#fastcgi.server = ( ".php"|fastcgi.server = ( ".php"|' \
102 -e 's|#"bin-path" => "/usr/bin/php-cgi"|"bin-path" => "/usr/bin/php-cgi"|' \
103 -e 's|#"socket" => "/tmp/php.socket"|"socket" => "/tmp/php.socket"\n )))|' \
104 -i $1/etc/lighttpd/lighttpd.conf
105 grep -q mod_fastcgi $1/etc/lighttpd/lighttpd.conf || \
106 sed -e 's|server.modules = (|server.modules = (\n "mod_fastcgi",|' \
107 -i $1/etc/lighttpd/lighttpd.conf
108 grep -q php3 $1/etc/lighttpd/lighttpd.conf || \
109 sed -e 's|for PHP.*|for PHP.\nfastcgi.map-extensions = ( ".php3" => ".php", ".php4" => ".php", ".php5" => ".php" )|' \
110 -i $1/etc/lighttpd/lighttpd.conf
111 fi
112 # Start Web server.
113 if [ -z "$1" -a ! -f "/var/run/lighttpd.pid" ]; then
114 /etc/init.d/lighttpd start
115 fi
116 }