rev |
line source |
pankso@18
|
1 # SliTaz package receipt.
|
pankso@18
|
2
|
pankso@18
|
3 PACKAGE="php"
|
shann@25629
|
4 VERSION="7.4.33"
|
pankso@204
|
5 CATEGORY="development"
|
pankso@18
|
6 SHORT_DESC="PHP web programming language."
|
pankso@18
|
7 MAINTAINER="pankso@slitaz.org"
|
pascal@15198
|
8 LICENSE="BSD"
|
Hans-G?nter@23426
|
9 WEB_SITE="https://www.php.net/"
|
Hans-G?nter@23426
|
10
|
pankso@18
|
11 TARBALL="$PACKAGE-$VERSION.tar.bz2"
|
pascal@22388
|
12 WGET_URL="https://www.php.net/distributions/$TARBALL"
|
Hans-G?nter@23426
|
13
|
pascal@1315
|
14 PROVIDE="php:lighttpd"
|
shann@25693
|
15 DEPENDS="libssl11 libzip libxml2 lighttpd php-common sqlite"
|
Hans-G?nter@23426
|
16 BUILD_DEPENDS="apache apache-dev apr-dev apr-util-dev c-client
|
Hans-G?nter@23426
|
17 coreutils-conditions curl-dev cyrus-sasl-dev gettext
|
Hans-G?nter@23426
|
18 jpeg-dev libldap libmcrypt-dev libmysqlclient libpng-dev
|
Hans-G?nter@23426
|
19 libtool libunixODBC libvpx-dev libxml2-dev libzip-dev
|
shann@25693
|
20 mhash-dev mysql-dev net-snmp-dev openldap-dev openssl11-dev
|
Hans-G?nter@23426
|
21 perl pkg-config postgresql-dev re2c sed sqlite-dev
|
Hans-G?nter@23426
|
22 unixODBC-dev"
|
Hans-G?nter@23426
|
23
|
pankso@16079
|
24 #HOST_ARCH="i486 arm"
|
pankso@18
|
25
|
pascal@24102
|
26 current_version()
|
pascal@24102
|
27 {
|
pascal@24102
|
28 wget -O - $WEB_SITE 2>/dev/null | \
|
pascal@24102
|
29 sed '/Released/!d;s|.*PHP ||;s| Rel.*||' | sort -Vr | sed q
|
pascal@24102
|
30 }
|
pascal@24102
|
31
|
pankso@16079
|
32 case "$ARCH" in
|
pankso@16079
|
33 i?86)
|
Hans-G?nter@23426
|
34 # 7.4.4 unrecognised:
|
Hans-G?nter@23426
|
35 # --enable-zip
|
Hans-G?nter@23426
|
36 # --with-jpeg-dir=/usr
|
Hans-G?nter@23426
|
37 # --with-png-dir=/usr
|
Hans-G?nter@23426
|
38
|
shann@25629
|
39 # Add --with-pic, seem issue on x86, no really know
|
shann@25629
|
40 # see https://forum.tinycorelinux.net/index.php/topic,22397.0.html
|
shann@25629
|
41 # seem also slackware 15.0 use this flag for php 7.4.x
|
shann@25629
|
42
|
shann@25693
|
43 # Adjust path for use OpenSSL 1.1
|
shann@25693
|
44 export PHP_OPENSSL_DIR="/usr/lib/openssl-1.1"
|
shann@25693
|
45 export PKG_CONFIG_PATH="$PKG_CONFIG_PATH:/usr/lib/openssl-1.1/pkgconfig"
|
shann@25693
|
46
|
Hans-G?nter@23426
|
47 ARCH_ARGS=" \
|
Hans-G?nter@23426
|
48 --prefix=/usr \
|
Hans-G?nter@23426
|
49 --sysconfdir=/etc \
|
Hans-G?nter@23426
|
50 --infodir=/usr/share/info \
|
Hans-G?nter@23426
|
51 --mandir=/usr/share/man \
|
Hans-G?nter@23426
|
52 --config-cache \
|
shann@25693
|
53 --enable-calendar \
|
shann@25693
|
54 --enable-dba=shared \
|
shann@25693
|
55 --enable-exif \
|
shann@25693
|
56 --enable-ftp \
|
shann@25693
|
57 --enable-gd=shared \
|
shann@25693
|
58 --enable-maintainer-zts \
|
Hans-G?nter@23426
|
59 --disable-mbregex \
|
shann@25693
|
60 --enable-mbstring \
|
shann@25693
|
61 --enable-soap=shared,/usr \
|
shann@25693
|
62 --enable-sockets \
|
Hans-G?nter@23426
|
63 --with-config-file-path=/etc \
|
Hans-G?nter@23426
|
64 --with-curl=shared \
|
Hans-G?nter@23426
|
65 --with-gettext \
|
Hans-G?nter@23426
|
66 --with-imap=shared \
|
Hans-G?nter@23426
|
67 --with-imap-ssl \
|
Hans-G?nter@23426
|
68 --with-ldap=shared \
|
Hans-G?nter@23426
|
69 --with-mhash \
|
Hans-G?nter@23426
|
70 --with-mysql-sock=/var/run/mysqld/mysql.sock \
|
Hans-G?nter@23426
|
71 --with-mysqli=shared \
|
Hans-G?nter@23426
|
72 --with-openssl=shared \
|
Hans-G?nter@23426
|
73 --with-pdo-mysql=shared \
|
Hans-G?nter@23426
|
74 --with-pdo-pgsql=shared \
|
Hans-G?nter@23426
|
75 --with-pdo-sqlite=shared,/usr \
|
Hans-G?nter@23426
|
76 --with-pear=/usr/share/php \
|
Hans-G?nter@23426
|
77 --with-pgsql=shared,/usr \
|
Hans-G?nter@23426
|
78 --with-snmp=shared,/usr \
|
Hans-G?nter@23426
|
79 --with-sqlite3=shared,/usr \
|
Hans-G?nter@23426
|
80 --with-unixODBC=shared,/usr \
|
shann@25629
|
81 --with-pic \
|
Hans-G?nter@23426
|
82 --with-zlib" ;;
|
pankso@16079
|
83 arm*)
|
pankso@16079
|
84 BUILD_DEPENDS="sqlite-dev libxml2-dev zlib-dev curl-dev"
|
pankso@16079
|
85 ARCH_ARGS="\
|
pankso@16079
|
86 --prefix=/usr \
|
pankso@16079
|
87 --sysconfdir=/etc \
|
pankso@16079
|
88 --infodir=/usr/share/info \
|
pankso@16079
|
89 --mandir=/usr/share/man \
|
pankso@16079
|
90 --config-cache \
|
pankso@16079
|
91 --enable-mbstring \
|
pankso@16079
|
92 --enable-sockets \
|
pankso@16079
|
93 --enable-ftp \
|
pankso@16079
|
94 --enable-zip \
|
pankso@16079
|
95 --enable-calendar \
|
pankso@16079
|
96 --enable-exif \
|
pankso@16079
|
97 --enable-dba=shared \
|
pankso@16079
|
98 --enable-sqlite-utf8 \
|
pankso@16079
|
99 --with-mhash \
|
pankso@16079
|
100 --with-sqlite=shared \
|
pankso@16079
|
101 --with-config-file-path=/etc \
|
pankso@16079
|
102 --with-zlib \
|
pankso@16079
|
103 --with-gettext \
|
pankso@16079
|
104 --with-curl=shared \
|
pankso@16079
|
105 --with-openssl=shared \
|
pankso@16079
|
106 --with-jpeg-dir=/usr \
|
pankso@16079
|
107 --with-png-dir=/usr \
|
pankso@16079
|
108 --with-apxs2=/usr/bin/apxs" ;;
|
pankso@16079
|
109 esac
|
pankso@16079
|
110
|
pankso@18
|
111 # Rules to configure and make the package.
|
pankso@18
|
112 compile_rules()
|
pankso@18
|
113 {
|
pascal@2605
|
114 sed -i 's/pam_start/pam_nostart/' configure
|
Hans-G?nter@23426
|
115
|
Hans-G?nter@23426
|
116 ./configure $ARCH_ARGS $CONFIGURE_ARGS &&
|
Hans-G?nter@23426
|
117 make $MAKEFLAGS &&
|
Hans-G?nter@23426
|
118 make -j1 INSTALL_ROOT=$DESTDIR install &&
|
Hans-G?nter@23426
|
119 ./configure $ARCH_ARGS $CONFIGURE_ARGS --with-apxs2=/usr/bin/apxs &&
|
Hans-G?nter@23426
|
120 make $MAKEFLAGS &&
|
Hans-G?nter@23426
|
121 {
|
pankso@9862
|
122 mkdir -p $DESTDIR/etc/apache
|
Hans-G?nter@23426
|
123 cp /etc/apache/httpd.conf $DESTDIR/etc/apache/httpd.conf
|
slaxemulator@14614
|
124 make -j1 INSTALL_ROOT=$DESTDIR install
|
pascal@1315
|
125 }
|
Hans-G?nter@23426
|
126
|
Hans-G?nter@23426
|
127 # Production configuration file.
|
pankso@10819
|
128 mkdir -p $DESTDIR/etc
|
Hans-G?nter@23426
|
129 cp $src/php.ini-production $DESTDIR/etc/php.ini || exit 1
|
Hans-G?nter@23426
|
130 sed -i -e 's|extension_dir = "./"|extension_dir = "/usr/share/php/"|' \
|
Hans-G?nter@23426
|
131 $DESTDIR/etc/php.ini
|
pankso@18
|
132 }
|
pankso@18
|
133
|
pankso@18
|
134 # Rules to gen a SliTaz package suitable for Tazpkg.
|
pankso@18
|
135 genpkg_rules()
|
pankso@18
|
136 {
|
Hans-G?nter@23426
|
137 mkdir -p $fs/usr/bin
|
Hans-G?nter@23426
|
138 mkdir -p $fs/usr/share/php
|
Hans-G?nter@23426
|
139
|
Hans-G?nter@23426
|
140 cp -a $src/sapi/cgi/php-cgi $fs/usr/bin
|
pankso@18
|
141 }
|
pankso@18
|
142
|
slaxemulator@14614
|
143 # Post and pre install commands to stop
|
slaxemulator@14614
|
144 # and restart Web server if needed.
|
pankso@18
|
145 pre_install()
|
pankso@18
|
146 {
|
Hans-G?nter@23426
|
147 if [ -z "$1" -a ! -f "/var/run/lighttpd.pid" ]
|
Hans-G?nter@23426
|
148 then
|
pankso@18
|
149 /etc/init.d/lighttpd stop
|
pankso@18
|
150 fi
|
pankso@18
|
151 }
|
pankso@9861
|
152
|
pankso@18
|
153 post_install()
|
pankso@18
|
154 {
|
Hans-G?nter@23426
|
155 # Enable PHP
|
Hans-G?nter@23426
|
156 if [ -f "$1/etc/lighttpd/lighttpd.conf" ]
|
Hans-G?nter@23426
|
157 then
|
Hans-G?nter@23426
|
158 [ -f "$1/usr/lib/lighttpd/mod_fastcgi.so" ] ||
|
pascal@18730
|
159 tazpkg get-install lighttpd-modules --root="$1/"
|
Hans-G?nter@23426
|
160 sed -i -e 's|#fastcgi.server = ( ".php"|fastcgi.server = ( ".php"|' \
|
Hans-G?nter@23426
|
161 -e 's|#"bin-path" => "/usr/bin/php-cgi"|"bin-path" => "/usr/bin/php-cgi"|' \
|
Hans-G?nter@23426
|
162 -e 's|#"socket" => "/tmp/php.socket"|"socket" => "/tmp/php.socket"\n )))|' \
|
Hans-G?nter@23426
|
163 "$1/etc/lighttpd/lighttpd.conf"
|
Hans-G?nter@23426
|
164 grep -q mod_fastcgi "$1/etc/lighttpd/lighttpd.conf" ||
|
Hans-G?nter@23426
|
165 sed -e 's|server.modules = (|server.modules = (\n "mod_fastcgi",|' \
|
Hans-G?nter@23426
|
166 -i "$1/etc/lighttpd/lighttpd.conf"
|
Hans-G?nter@23426
|
167 grep -q php3 "$1/etc/lighttpd/lighttpd.conf" || \
|
Hans-G?nter@23426
|
168 sed -e 's|for PHP.*|for PHP.\nfastcgi.map-extensions = ( ".php3" => ".php", ".php4" => ".php", ".php5" => ".php" )|' \
|
Hans-G?nter@23426
|
169 -i "$1/etc/lighttpd/lighttpd.conf"
|
pascal@1143
|
170 fi
|
Hans-G?nter@23426
|
171
|
pankso@18
|
172 # Start Web server.
|
Hans-G?nter@23426
|
173 if [ -z "$1" -a ! -f /var/run/lighttpd.pid -a -f /etc/init.d/lighttpd ]
|
Hans-G?nter@23426
|
174 then
|
pankso@18
|
175 /etc/init.d/lighttpd start
|
pankso@18
|
176 fi
|
pankso@18
|
177 }
|