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
:= b862b098a08ab9bf4b36ed12c7d0d9f65353656b36fb0e3c5344093aceb35802
10 PKG_DESCR
:= php language interpreter
11 PKG_SECTION
:= dev
/lang
13 PHP_URL
:= http
://www.php.net
/
14 PKG_SITES
:= http
://de2.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_MARIADB
25 PKG_FLAVOURS_PHP
+= MOD_SSL MOD_SESSION MOD_SNMP MOD_SQLITE
26 PKG_FLAVOURS_PHP
+= MOD_SOCKETS MOD_XML MOD_SIMPLEXML MOD_ZLIB
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
39 PKGFD_MOD_GMP
:= gmp support
41 PKGFS_MOD_GMP
:= libgmp
42 PKGFD_MOD_LDAP
:= ldap support
43 PKGFB_MOD_LDAP
:= openldap
44 PKGFS_MOD_LDAP
:= libopenldap
45 PKGFD_MOD_MARIADB
:= mariadb support
46 PKGFS_MOD_MARIADB
:= libmariadbclient
47 PKGFB_MOD_MARIADB
:= mariadb
48 PKGFD_MOD_SSL
:= ssl support
49 PKGFB_MOD_SSL
:= openssl
50 PKGFS_MOD_SSL
:= libopenssl
51 PKGFD_MOD_PCNTL
:= process control support
52 PKGFD_MOD_SESSION
:= session support
53 PKGFD_MOD_SNMP
:= snmp support
54 PKGFB_MOD_SNMP
:= net-snmp
55 PKGFS_MOD_SNMP
:= libnetsnmp
56 PKGFD_MOD_SQLITE
:= sqlite support
57 PKGFB_MOD_SQLITE
:= sqlite
58 PKGFS_MOD_SQLITE
:= libsqlite
59 PKGFD_MOD_SOCKETS
:= socket support
60 PKGFD_MOD_XML
:= xml support
62 PKGFS_MOD_XML
:= libexpat
63 PKGFD_MOD_SIMPLEXML
:= simple xml support
64 PKGFB_MOD_SIMPLEXML
:= libxml2
65 PKGFS_MOD_SIMPLEXML
:= libxml2
66 PKGFD_MOD_ZLIB
:= zlib support
70 include $(ADK_TOPDIR
)/mk
/package.mk
72 $(eval
$(call PKG_template
,PHP
,php
,${PKG_VERSION}-${PKG_RELEASE},${PKG_DEPENDS},${PKG_DESCR},${PKG_SECTION}))
73 $(eval
$(call PKG_template
,PHP_CLI
,php-cli
,${PKG_VERSION}-${PKG_RELEASE},${PKG_DEPENDS},${PKGSD_PHP_CLI},${PKG_SECTION}))
74 $(eval
$(call PKG_template
,PHP_CGI
,php-cgi
,${PKG_VERSION}-${PKG_RELEASE},${PKG_DEPENDS},${PKGSD_PHP_CGI},${PKG_SECTION}))
75 $(eval
$(call PKG_template
,PHP_FPM
,php-fpm
,${PKG_VERSION}-${PKG_RELEASE},${PKG_DEPENDS},${PKGSD_PHP_FPM},${PKG_SECTION}))
77 define PKG_mod_template
79 INSTALL_MODS_
$${ADK_PACKAGE_
${1}}+= ${2}-install
82 ${INSTALL_DIR} $$(IDIR_
$(1))/usr
/lib
/php
84 ${INSTALL_DATA} $(WRKBUILD
)/modules
/$$$${m}.so
$$(IDIR_
$(1))/usr
/lib
/php
;\
88 PKG_CONFIGURE_OPTS
:= \
89 --with-config-file-path
=/etc \
97 --disable-short-tags \
101 --disable-tokenizer \
103 --disable-xmlreader \
104 --disable-xmlwriter \
112 ifneq ($(ADK_PACKAGE_PHP_MOD_BZ2
),)
113 PKG_CONFIGURE_OPTS
+= --with-bz2
=shared
,"$(STAGING_TARGET_DIR)/usr"
115 PKG_CONFIGURE_OPTS
+= --without-bz2
117 ifneq ($(ADK_PACKAGE_PHP_MOD_CURL
),)
118 PKG_CONFIGURE_OPTS
+= --with-curl
=shared
,"$(STAGING_TARGET_DIR)/usr"
120 PKG_CONFIGURE_OPTS
+= --without-curl
122 ifneq ($(ADK_PACKAGE_PHP_MOD_FTP
),)
123 PKG_CONFIGURE_OPTS
+= --enable-ftp
=shared
125 PKG_CONFIGURE_OPTS
+= --disable-ftp
127 ifneq ($(ADK_PACKAGE_PHP_MOD_GD
),)
128 PKG_CONFIGURE_OPTS
+= --enable-gd
=shared
130 PKG_CONFIGURE_OPTS
+= --disable-gd
132 ifneq ($(ADK_PACKAGE_PHP_MOD_GMP
),)
133 PKG_CONFIGURE_OPTS
+= --with-gmp
=shared
,"$(STAGING_TARGET_DIR)/usr"
135 PKG_CONFIGURE_OPTS
+= --without-gmp
137 ifneq ($(ADK_PACKAGE_PHP_MOD_LDAP
),)
138 PKG_CONFIGURE_OPTS
+= --with-ldap
=shared
,"$(STAGING_TARGET_DIR)/usr" \
139 --with-ldap-sasl
="$(STAGING_TARGET_DIR)/usr"
141 PKG_CONFIGURE_OPTS
+= --without-ldap
143 ifneq ($(ADK_PACKAGE_PHP_MOD_MARIADB
),)
144 PKG_CONFIGURE_OPTS
+= --with-pdo-mysql
=shared
,"$(STAGING_TARGET_DIR)/usr"
145 TARGET_CFLAGS
+= -I
$(STAGING_TARGET_DIR
)/usr
/include/mysql
147 PKG_CONFIGURE_OPTS
+= --without-pdo-mysql
149 ifneq ($(ADK_PACKAGE_PHP_MOD_OPENSSL
),)
150 PKG_CONFIGURE_OPTS
+= --with-openssl
=shared
,"$(STAGING_TARGET_DIR)/usr" \
151 --with-openssl-dir
="$(STAGING_TARGET_DIR)/usr"
153 PKG_CONFIGURE_OPTS
+= --without-openssl
155 ifneq ($(ADK_PACKAGE_PHP_MOD_PCNTL
),)
156 PKG_CONFIGURE_OPTS
+= --enable-pcntl
158 PKG_CONFIGURE_OPTS
+= --disable-pcntl
160 ifneq ($(ADK_PACKAGE_PHP_MOD_SESSION
),)
161 PKG_CONFIGURE_OPTS
+= --enable-session
=shared
163 PKG_CONFIGURE_OPTS
+= --disable-session
165 ifneq ($(ADK_PACKAGE_PHP_MOD_SNMP
),)
166 PKG_CONFIGURE_OPTS
+= --with-snmp
=shared
,"$(STAGING_TARGET_DIR)/usr"
167 CONFIGURE_ENV
+= LIBS
="-lnetsnmpmibs"
169 PKG_CONFIGURE_OPTS
+= --without-snmp
171 ifneq ($(ADK_PACKAGE_PHP_MOD_SQLITE
),)
172 PKG_CONFIGURE_OPTS
+= --with-sqlite3
="$(STAGING_TARGET_DIR)/usr"
173 PKG_CONFIGURE_OPTS
+= --with-pdo-sqlite
=shared
,"$(STAGING_TARGET_DIR)/usr"
174 PKG_CONFIGURE_OPTS
+= --enable-pdo
=shared
176 PKG_CONFIGURE_OPTS
+= --without-sqlite3
--without-pdo-sqlite
178 ifneq ($(ADK_PACKAGE_PHP_MOD_SOCKETS
),)
179 PKG_CONFIGURE_OPTS
+= --enable-sockets
=shared
181 PKG_CONFIGURE_OPTS
+= --enable-sockets
=no
183 ifneq ($(ADK_PACKAGE_PHP_MOD_XML
),)
184 PKG_CONFIGURE_OPTS
+= --enable-xml
=shared
,"$(STAGING_TARGET_DIR)/usr" \
185 --with-libexpat-dir
="$(STAGING_TARGET_DIR)/usr"
187 PKG_CONFIGURE_OPTS
+= --disable-xml
189 ifneq ($(ADK_PACKAGE_PHP_MOD_SIMPLEXML
),)
190 PKG_CONFIGURE_OPTS
+= --enable-simplexml
=shared
192 PKG_CONFIGURE_OPTS
+= --disable-simplexml
194 ifneq ($(ADK_PACKAGE_PHP_MOD_ZLIB
),)
195 PKG_CONFIGURE_OPTS
+= --with-zlib
=shared
,"$(STAGING_TARGET_DIR)/usr"
197 PKG_CONFIGURE_OPTS
+= --without-zlib
200 $(eval
$(call PKG_template
,PHP_MOD_BZ2
,php-mod-bz2
,$(PKG_VERSION
)-${PKG_RELEASE},${PKG_DEPENDS},${PKG_DESCR},${PKG_SECTION}))
201 $(eval
$(call PKG_template
,PHP_MOD_CURL
,php-mod-curl
,$(PKG_VERSION
)-${PKG_RELEASE},${PKG_DEPENDS},${PKG_DESCR},${PKG_SECTION}))
202 $(eval
$(call PKG_template
,PHP_MOD_FTP
,php-mod-ftp
,$(PKG_VERSION
)-${PKG_RELEASE},${PKG_DEPENDS},${PKG_DESCR},${PKG_SECTION}))
203 $(eval
$(call PKG_template
,PHP_MOD_GD
,php-mod-gd
,$(PKG_VERSION
)-${PKG_RELEASE},${PKG_DEPENDS},${PKG_DESCR},${PKG_SECTION}))
204 $(eval
$(call PKG_template
,PHP_MOD_GMP
,php-mod-gmp
,$(PKG_VERSION
)-${PKG_RELEASE},${PKG_DEPENDS},${PKG_DESCR},${PKG_SECTION}))
205 $(eval
$(call PKG_template
,PHP_MOD_LDAP
,php-mod-ldap
,$(PKG_VERSION
)-${PKG_RELEASE},${PKG_DEPENDS},${PKG_DESCR},${PKG_SECTION}))
206 $(eval
$(call PKG_template
,PHP_MOD_MARIADB
,php-mod-mariadb
,$(PKG_VERSION
)-${PKG_RELEASE},${PKG_DEPENDS},${PKG_DESCR},${PKG_SECTION}))
207 $(eval
$(call PKG_template
,PHP_MOD_OPENSSL
,php-mod-openssl
,$(PKG_VERSION
)-${PKG_RELEASE},${PKG_DEPENDS},${PKG_DESCR},${PKG_SECTION}))
208 $(eval
$(call PKG_template
,PHP_MOD_SESSION
,php-mod-session
,$(PKG_VERSION
)-${PKG_RELEASE},${PKG_DEPENDS},${PKG_DESCR},${PKG_SECTION}))
209 $(eval
$(call PKG_template
,PHP_MOD_SNMP
,php-mod-snmp
,$(PKG_VERSION
)-${PKG_RELEASE},${PKG_DEPENDS},${PKG_DESCR},${PKG_SECTION}))
210 $(eval
$(call PKG_template
,PHP_MOD_SOCKETS
,php-mod-sockets
,$(PKG_VERSION
)-${PKG_RELEASE},${PKG_DEPENDS},${PKG_DESCR},${PKG_SECTION}))
211 $(eval
$(call PKG_template
,PHP_MOD_SQLITE
,php-mod-sqlite
,$(PKG_VERSION
)-${PKG_RELEASE},${PKG_DEPENDS},${PKG_DESCR},${PKG_SECTION}))
212 $(eval
$(call PKG_template
,PHP_MOD_XML
,php-mod-xml
,$(PKG_VERSION
)-${PKG_RELEASE},${PKG_DEPENDS},${PKG_DESCR},${PKG_SECTION}))
213 $(eval
$(call PKG_template
,PHP_MOD_SIMPLEXML
,php-mod-simplexml
,$(PKG_VERSION
)-${PKG_RELEASE},${PKG_DEPENDS},${PKG_DESCR},${PKG_SECTION}))
214 $(eval
$(call PKG_template
,PHP_MOD_ZLIB
,php-mod-zlib
,$(PKG_VERSION
)-${PKG_RELEASE},${PKG_DEPENDS},${PKG_DESCR},${PKG_SECTION}))
216 $(eval
$(call PKG_mod_template
,PHP_MOD_BZ2
,bz2
))
217 $(eval
$(call PKG_mod_template
,PHP_MOD_CURL
,curl
))
218 $(eval
$(call PKG_mod_template
,PHP_MOD_FTP
,ftp
))
219 $(eval
$(call PKG_mod_template
,PHP_MOD_GD
,gd
))
220 $(eval
$(call PKG_mod_template
,PHP_MOD_GMP
,gmp
))
221 $(eval
$(call PKG_mod_template
,PHP_MOD_LDAP
,ldap
))
222 $(eval
$(call PKG_mod_template
,PHP_MOD_MARIADB
,pdo_mysql
))
223 $(eval
$(call PKG_mod_template
,PHP_MOD_OPENSSL
,openssl
))
224 $(eval
$(call PKG_mod_template
,PHP_MOD_SESSION
,session
))
225 $(eval
$(call PKG_mod_template
,PHP_MOD_SOCKETS
,sockets
))
226 $(eval
$(call PKG_mod_template
,PHP_MOD_SNMP
,snmp
))
227 $(eval
$(call PKG_mod_template
,PHP_MOD_SQLITE
,pdo pdo_sqlite
))
228 $(eval
$(call PKG_mod_template
,PHP_MOD_XML
,xml
))
229 $(eval
$(call PKG_mod_template
,PHP_MOD_SIMPLEXML
,simplexml
))
230 $(eval
$(call PKG_mod_template
,PHP_MOD_ZLIB
,zlib
))
232 INSTALL_STYLE
:= manual
233 TARGET_LDFLAGS
+= -L
$(STAGING_TARGET_DIR
)/usr
/lib
/mysql
234 CONFIGURE_ENV
+= LIBS
="-ldl"
235 CONFIGURE_ARGS
+= $(PKG_CONFIGURE_OPTS
)
237 do-install
: ${INSTALL_MODS_y} ${INSTALL_MODS_m}
238 ${INSTALL_DIR} $(IDIR_PHP
)/etc
239 ${INSTALL_DATA} .
/files
/php.ini
$(IDIR_PHP
)/etc
240 ${INSTALL_DIR} $(IDIR_PHP_CLI
)/usr
/bin
241 ${INSTALL_BIN} $(WRKBUILD
)/sapi
/cli
/php \
242 $(IDIR_PHP_CLI
)/usr
/bin
243 ${INSTALL_DIR} $(IDIR_PHP_CGI
)/usr
/bin
244 ${INSTALL_BIN} $(WRKBUILD
)/sapi
/cgi
/php-cgi \
245 $(IDIR_PHP_CGI
)/usr
/bin
246 ${INSTALL_DIR} $(IDIR_PHP_FPM
)/etc
247 $(CP
) .
/files
/php-fpm.conf
$(IDIR_PHP_FPM
)/etc
248 ${INSTALL_DIR} $(IDIR_PHP_FPM
)/usr
/bin
249 ${INSTALL_BIN} $(WRKBUILD
)/sapi
/fpm
/php-fpm \
250 $(IDIR_PHP_FPM
)/usr
/bin
/php
252 include ${ADK_TOPDIR}/mk
/pkg-bottom.mk