1 # This file is part of the OpenADK project. OpenADK is copyrighted
2 # material, please see the LICENCE file in the top-level directory.
4 include $(ADK_TOPDIR
)/rules.mk
9 PKG_HASH
:= 4c417387b88e100ca306adeda8051eb9fad93dae8da983f962dabf91a14b2b7b
10 PKG_DESCR
:= php language interpreter
11 PKG_SECTION
:= dev
/lang
12 PKG_DEPENDS
:= libpthread librt
13 PHP_URL
:= http
://www.php.net
/
14 PKG_SITES
:= http
://de.php.net
/distributions
/
16 PKG_SUBPKGS
:= PHP PHP_CLI PHP_CGI PHP_FPM
17 PKGSD_PHP_CGI
:= php for fastcgi usage
19 PKGSD_PHP_FPM
:= php for fastcgi process manager usage
21 PKGSD_PHP_CLI
:= php cli
24 PKG_FLAVOURS_PHP
:= MOD_BZ2 MOD_CURL MOD_FTP MOD_GD MOD_GMP MOD_MYSQL
25 PKG_FLAVOURS_PHP
+= MOD_OPENSSL MOD_PGSQL MOD_SESSION MOD_SNMP MOD_SQLITE
26 PKG_FLAVOURS_PHP
+= MOD_SOCKETS MOD_XML MOD_SIMPLEXML MOD_ZLIB MOD_JSON
27 PKG_FLAVOURS_PHP
+= MOD_LDAP MOD_PCNTL
29 PKGFD_MOD_BZ2
:= bzip2 support
32 PKGFD_MOD_CURL
:= curl support
34 PKGFS_MOD_CURL
:= libcurl
35 PKGFD_MOD_FTP
:= ftp support
36 PKGFD_MOD_GD
:= gd support
37 PKGFB_MOD_GD
:= libgd libpng libjpeg-turbo libXpm
38 PKGFS_MOD_GD
:= libgd libpng libjpeg-turbo libxpm
39 PKGFD_MOD_GMP
:= gmp support
41 PKGFS_MOD_GMP
:= libgmp
42 PKGFD_MOD_JSON
:= json support
43 PKGFD_MOD_LDAP
:= ldap support
44 PKGFB_MOD_LDAP
:= openldap
45 PKGFS_MOD_LDAP
:= libopenldap
46 PKGFD_MOD_MYSQL
:= mysql support
47 PKGFS_MOD_MYSQL
:= libmysqlclient
48 PKGFB_MOD_MYSQL
:= mysql
49 PKGFD_MOD_OPENSSL
:= openssl support
50 PKGFB_MOD_OPENSSL
:= openssl
51 PKGFS_MOD_OPENSSL
:= libopenssl
52 PKGFD_MOD_PCNTL
:= process control support
53 PKGFD_MOD_PGSQL
:= pgsql support
54 PKGFB_MOD_PGSQL
:= postgresql
55 PKGFS_MOD_PGSQL
:= libpq
56 PKGFD_MOD_SESSION
:= session support
57 PKGFD_MOD_SNMP
:= snmp support
58 PKGFB_MOD_SNMP
:= net-snmp
59 PKGFS_MOD_SNMP
:= libnetsnmp
60 PKGFD_MOD_SQLITE
:= sqlite support
61 PKGFB_MOD_SQLITE
:= sqlite
62 PKGFS_MOD_SQLITE
:= libsqlite
63 PKGFD_MOD_SOCKETS
:= socket support
64 PKGFD_MOD_XML
:= xml support
66 PKGFS_MOD_XML
:= libexpat
67 PKGFD_MOD_SIMPLEXML
:= simple xml support
68 PKGFB_MOD_SIMPLEXML
:= libxml2
69 PKGFS_MOD_SIMPLEXML
:= libxml2
70 PKGFD_MOD_ZLIB
:= zlib support
74 include $(ADK_TOPDIR
)/mk
/package.mk
76 $(eval
$(call PKG_template
,PHP
,php
,${PKG_VERSION}-${PKG_RELEASE},${PKG_DEPENDS},${PKG_DESCR},${PKG_SECTION}))
77 $(eval
$(call PKG_template
,PHP_CLI
,php-cli
,${PKG_VERSION}-${PKG_RELEASE},${PKG_DEPENDS},${PKGSD_PHP_CLI},${PKG_SECTION}))
78 $(eval
$(call PKG_template
,PHP_CGI
,php-cgi
,${PKG_VERSION}-${PKG_RELEASE},${PKG_DEPENDS},${PKGSD_PHP_CGI},${PKG_SECTION}))
79 $(eval
$(call PKG_template
,PHP_FPM
,php-fpm
,${PKG_VERSION}-${PKG_RELEASE},${PKG_DEPENDS},${PKGSD_PHP_FPM},${PKG_SECTION}))
81 define PKG_mod_template
83 INSTALL_MODS_
$${ADK_PACKAGE_
${1}}+= ${2}-install
86 ${INSTALL_DIR} $$(IDIR_
$(1))/usr
/lib
/php
88 ${INSTALL_DATA} $(WRKBUILD
)/modules
/$$$${m}.so
$$(IDIR_
$(1))/usr
/lib
/php
;\
92 PKG_CONFIGURE_OPTS
:= \
93 --with-config-file-path
=/etc \
102 --disable-short-tags \
106 --disable-tokenizer \
108 --disable-xmlreader \
109 --disable-xmlwriter \
114 --with-pcre-regex
=no \
117 ifneq ($(ADK_PACKAGE_PHP_MOD_BZ2
),)
118 PKG_CONFIGURE_OPTS
+= --with-bz2
=shared
,"$(STAGING_TARGET_DIR)/usr"
120 PKG_CONFIGURE_OPTS
+= --without-bz2
122 ifneq ($(ADK_PACKAGE_PHP_MOD_CURL
),)
123 PKG_CONFIGURE_OPTS
+= --with-curl
=shared
,"$(STAGING_TARGET_DIR)/usr"
125 PKG_CONFIGURE_OPTS
+= --without-curl
127 ifneq ($(ADK_PACKAGE_PHP_MOD_FTP
),)
128 PKG_CONFIGURE_OPTS
+= --enable-ftp
=shared
130 PKG_CONFIGURE_OPTS
+= --disable-ftp
132 ifneq ($(ADK_PACKAGE_PHP_MOD_GD
),)
133 PKG_CONFIGURE_OPTS
+= --with-gd
=shared
,"$(STAGING_TARGET_DIR)/usr" \
134 --with-png-dir
="$(STAGING_TARGET_DIR)/usr" \
135 --with-jpeg-dir
="$(STAGING_TARGET_DIR)/usr" \
136 --without-freetype-dir \
138 --enable-gd-native-ttf \
139 --disable-gd-jis-conv
141 PKG_CONFIGURE_OPTS
+= --without-gd
143 ifneq ($(ADK_PACKAGE_PHP_MOD_GMP
),)
144 PKG_CONFIGURE_OPTS
+= --with-gmp
=shared
,"$(STAGING_TARGET_DIR)/usr"
146 PKG_CONFIGURE_OPTS
+= --without-gmp
148 ifneq ($(ADK_PACKAGE_PHP_MOD_JSON
),)
149 PKG_CONFIGURE_OPTS
+= --enable-json
=shared
,"$(STAGING_TARGET_DIR)/usr"
151 PKG_CONFIGURE_OPTS
+= --disable-json
153 ifneq ($(ADK_PACKAGE_PHP_MOD_LDAP
),)
154 PKG_CONFIGURE_OPTS
+= --with-ldap
=shared
,"$(STAGING_TARGET_DIR)/usr" \
155 --with-ldap-sasl
="$(STAGING_TARGET_DIR)/usr"
157 PKG_CONFIGURE_OPTS
+= --without-ldap
159 ifneq ($(ADK_PACKAGE_PHP_MOD_MYSQL
),)
160 PKG_CONFIGURE_OPTS
+= --with-mysql
=shared
,"$(STAGING_TARGET_DIR)/usr"
162 PKG_CONFIGURE_OPTS
+= --without-mysql
164 ifneq ($(ADK_PACKAGE_PHP_MOD_OPENSSL
),)
165 PKG_CONFIGURE_OPTS
+= --with-openssl
=shared
,"$(STAGING_TARGET_DIR)/usr" \
166 --with-openssl-dir
="$(STAGING_TARGET_DIR)/usr"
168 PKG_CONFIGURE_OPTS
+= --without-openssl
170 ifneq ($(ADK_PACKAGE_PHP_MOD_PCNTL
),)
171 PKG_CONFIGURE_OPTS
+= --enable-pcntl
173 PKG_CONFIGURE_OPTS
+= --disable-pcntl
175 ifneq ($(ADK_PACKAGE_PHP_MOD_PGSQL
),)
176 PKG_CONFIGURE_OPTS
+= --with-pgsql
=shared
,"$(STAGING_TARGET_DIR)/usr"
178 PKG_CONFIGURE_OPTS
+= --without-pgsql
180 ifneq ($(ADK_PACKAGE_PHP_MOD_SESSION
),)
181 PKG_CONFIGURE_OPTS
+= --enable-session
=shared
183 PKG_CONFIGURE_OPTS
+= --disable-session
185 ifneq ($(ADK_PACKAGE_PHP_MOD_SNMP
),)
186 PKG_CONFIGURE_OPTS
+= --with-snmp
=shared
,"$(STAGING_TARGET_DIR)/usr"
187 CONFIGURE_ENV
+= LIBS
="-lnetsnmpmibs"
189 PKG_CONFIGURE_OPTS
+= --without-snmp
191 ifneq ($(ADK_PACKAGE_PHP_MOD_SQLITE
),)
192 PKG_CONFIGURE_OPTS
+= --with-sqlite3
="$(STAGING_TARGET_DIR)/usr"
193 PKG_CONFIGURE_OPTS
+= --with-pdo-sqlite
=shared
,"$(STAGING_TARGET_DIR)/usr"
194 PKG_CONFIGURE_OPTS
+= --enable-pdo
=shared
196 PKG_CONFIGURE_OPTS
+= --without-sqlite3
--without-pdo-sqlite
198 ifneq ($(ADK_PACKAGE_PHP_MOD_SOCKETS
),)
199 PKG_CONFIGURE_OPTS
+= --enable-sockets
=shared
201 PKG_CONFIGURE_OPTS
+= --enable-sockets
=no
203 ifneq ($(ADK_PACKAGE_PHP_MOD_XML
),)
204 PKG_CONFIGURE_OPTS
+= --enable-xml
=shared
,"$(STAGING_TARGET_DIR)/usr" \
205 --with-libexpat-dir
="$(STAGING_TARGET_DIR)/usr"
207 PKG_CONFIGURE_OPTS
+= --disable-xml
209 ifneq ($(ADK_PACKAGE_PHP_MOD_SIMPLEXML
),)
210 PKG_CONFIGURE_OPTS
+= --enable-simplexml
=shared
--enable-libxml
--with-libxml-dir
="$(STAGING_TARGET_DIR)/usr"
212 PKG_CONFIGURE_OPTS
+= --disable-simplexml
--disable-libxml
214 ifneq ($(ADK_PACKAGE_PHP_MOD_ZLIB
),)
215 PKG_CONFIGURE_OPTS
+= --with-zlib
=shared
,"$(STAGING_TARGET_DIR)/usr"
217 PKG_CONFIGURE_OPTS
+= --without-zlib
220 $(eval
$(call PKG_template
,PHP_MOD_BZ2
,php-mod-bz2
,$(PKG_VERSION
)-${PKG_RELEASE},${PKG_DEPENDS},${PKG_DESCR},${PKG_SECTION}))
221 $(eval
$(call PKG_template
,PHP_MOD_CURL
,php-mod-curl
,$(PKG_VERSION
)-${PKG_RELEASE},${PKG_DEPENDS},${PKG_DESCR},${PKG_SECTION}))
222 $(eval
$(call PKG_template
,PHP_MOD_FTP
,php-mod-ftp
,$(PKG_VERSION
)-${PKG_RELEASE},${PKG_DEPENDS},${PKG_DESCR},${PKG_SECTION}))
223 $(eval
$(call PKG_template
,PHP_MOD_GD
,php-mod-gd
,$(PKG_VERSION
)-${PKG_RELEASE},${PKG_DEPENDS},${PKG_DESCR},${PKG_SECTION}))
224 $(eval
$(call PKG_template
,PHP_MOD_GMP
,php-mod-gmp
,$(PKG_VERSION
)-${PKG_RELEASE},${PKG_DEPENDS},${PKG_DESCR},${PKG_SECTION}))
225 $(eval
$(call PKG_template
,PHP_MOD_JSON
,php-mod-json
,$(PKG_VERSION
)-${PKG_RELEASE},${PKG_DEPENDS},${PKG_DESCR},${PKG_SECTION}))
226 $(eval
$(call PKG_template
,PHP_MOD_LDAP
,php-mod-ldap
,$(PKG_VERSION
)-${PKG_RELEASE},${PKG_DEPENDS},${PKG_DESCR},${PKG_SECTION}))
227 $(eval
$(call PKG_template
,PHP_MOD_MYSQL
,php-mod-mysql
,$(PKG_VERSION
)-${PKG_RELEASE},${PKG_DEPENDS},${PKG_DESCR},${PKG_SECTION}))
228 $(eval
$(call PKG_template
,PHP_MOD_OPENSSL
,php-mod-openssl
,$(PKG_VERSION
)-${PKG_RELEASE},${PKG_DEPENDS},${PKG_DESCR},${PKG_SECTION}))
229 $(eval
$(call PKG_template
,PHP_MOD_PGSQL
,php-mod-pgsql
,$(PKG_VERSION
)-${PKG_RELEASE},${PKG_DEPENDS},${PKG_DESCR},${PKG_SECTION}))
230 $(eval
$(call PKG_template
,PHP_MOD_SESSION
,php-mod-session
,$(PKG_VERSION
)-${PKG_RELEASE},${PKG_DEPENDS},${PKG_DESCR},${PKG_SECTION}))
231 $(eval
$(call PKG_template
,PHP_MOD_SNMP
,php-mod-snmp
,$(PKG_VERSION
)-${PKG_RELEASE},${PKG_DEPENDS},${PKG_DESCR},${PKG_SECTION}))
232 $(eval
$(call PKG_template
,PHP_MOD_SOCKETS
,php-mod-sockets
,$(PKG_VERSION
)-${PKG_RELEASE},${PKG_DEPENDS},${PKG_DESCR},${PKG_SECTION}))
233 $(eval
$(call PKG_template
,PHP_MOD_SQLITE
,php-mod-sqlite
,$(PKG_VERSION
)-${PKG_RELEASE},${PKG_DEPENDS},${PKG_DESCR},${PKG_SECTION}))
234 $(eval
$(call PKG_template
,PHP_MOD_XML
,php-mod-xml
,$(PKG_VERSION
)-${PKG_RELEASE},${PKG_DEPENDS},${PKG_DESCR},${PKG_SECTION}))
235 $(eval
$(call PKG_template
,PHP_MOD_SIMPLEXML
,php-mod-simplexml
,$(PKG_VERSION
)-${PKG_RELEASE},${PKG_DEPENDS},${PKG_DESCR},${PKG_SECTION}))
236 $(eval
$(call PKG_template
,PHP_MOD_ZLIB
,php-mod-zlib
,$(PKG_VERSION
)-${PKG_RELEASE},${PKG_DEPENDS},${PKG_DESCR},${PKG_SECTION}))
238 $(eval
$(call PKG_mod_template
,PHP_MOD_BZ2
,bz2
))
239 $(eval
$(call PKG_mod_template
,PHP_MOD_CURL
,curl
))
240 $(eval
$(call PKG_mod_template
,PHP_MOD_FTP
,ftp
))
241 $(eval
$(call PKG_mod_template
,PHP_MOD_GD
,gd
))
242 $(eval
$(call PKG_mod_template
,PHP_MOD_GMP
,gmp
))
243 $(eval
$(call PKG_mod_template
,PHP_MOD_JSON
,json
))
244 $(eval
$(call PKG_mod_template
,PHP_MOD_LDAP
,ldap
))
245 $(eval
$(call PKG_mod_template
,PHP_MOD_MYSQL
,mysql
))
246 $(eval
$(call PKG_mod_template
,PHP_MOD_OPENSSL
,openssl
))
247 $(eval
$(call PKG_mod_template
,PHP_MOD_PGSQL
,pgsql
))
248 $(eval
$(call PKG_mod_template
,PHP_MOD_SESSION
,session
))
249 $(eval
$(call PKG_mod_template
,PHP_MOD_SOCKETS
,sockets
))
250 $(eval
$(call PKG_mod_template
,PHP_MOD_SNMP
,snmp
))
251 $(eval
$(call PKG_mod_template
,PHP_MOD_SQLITE
,pdo pdo_sqlite
))
252 $(eval
$(call PKG_mod_template
,PHP_MOD_XML
,xml
))
253 $(eval
$(call PKG_mod_template
,PHP_MOD_SIMPLEXML
,simplexml
))
254 $(eval
$(call PKG_mod_template
,PHP_MOD_ZLIB
,zlib
))
256 INSTALL_STYLE
:= manual
257 TARGET_LDFLAGS
+= -L
$(STAGING_TARGET_DIR
)/usr
/lib
/mysql
258 CONFIGURE_ENV
+= LIBS
="-ldl"
259 CONFIGURE_ARGS
+= $(PKG_CONFIGURE_OPTS
)
261 do-install
: ${INSTALL_MODS_y} ${INSTALL_MODS_m}
262 ${INSTALL_DIR} $(IDIR_PHP
)/etc
263 ${INSTALL_DATA} .
/files
/php.ini
$(IDIR_PHP
)/etc
264 ${INSTALL_DIR} $(IDIR_PHP_CLI
)/usr
/bin
265 ${INSTALL_BIN} $(WRKBUILD
)/sapi
/cli
/php \
266 $(IDIR_PHP_CLI
)/usr
/bin
267 ${INSTALL_DIR} $(IDIR_PHP_CGI
)/usr
/bin
268 ${INSTALL_BIN} $(WRKBUILD
)/sapi
/cgi
/php-cgi \
269 $(IDIR_PHP_CGI
)/usr
/bin
270 ${INSTALL_DIR} $(IDIR_PHP_FPM
)/etc
271 $(CP
) .
/files
/php-fpm.conf
$(IDIR_PHP_FPM
)/etc
272 ${INSTALL_DIR} $(IDIR_PHP_FPM
)/usr
/bin
273 ${INSTALL_BIN} $(WRKBUILD
)/sapi
/fpm
/php-fpm \
274 $(IDIR_PHP_FPM
)/usr
/bin
/php
276 include ${ADK_TOPDIR}/mk
/pkg-bottom.mk