python3: update to 3.11.10
[openadk.git] / package / php / Makefile
blob0c6fd238986901daeee4f83ab3920728e34f3d14
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
6 PKG_NAME:= php
7 PKG_VERSION:= 8.3.11
8 PKG_RELEASE:= 1
9 PKG_HASH:= b862b098a08ab9bf4b36ed12c7d0d9f65353656b36fb0e3c5344093aceb35802
10 PKG_DESCR:= php language interpreter
11 PKG_SECTION:= dev/lang
12 PKG_NEEDS:= threads
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
18 PKGSN_PHP_CGI:= php
19 PKGSD_PHP_FPM:= php for fastcgi process manager usage
20 PKGSN_PHP_FPM:= php
21 PKGSD_PHP_CLI:= php cli
22 PKGSN_PHP_CLI:= php
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
30 PKGFB_MOD_BZ2:= bzip2
31 PKGFS_MOD_BZ2:= bzip2
32 PKGFD_MOD_CURL:= curl support
33 PKGFB_MOD_CURL:= curl
34 PKGFS_MOD_CURL:= libcurl
35 PKGFD_MOD_FTP:= ftp support
36 PKGFD_MOD_GD:= gd support
37 PKGFB_MOD_GD:= libpng
38 PKGFS_MOD_GD:= libpng
39 PKGFD_MOD_GMP:= gmp support
40 PKGFB_MOD_GMP:= gmp
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
61 PKGFB_MOD_XML:= expat
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
67 PKGFB_MOD_ZLIB:= zlib
68 PKGFS_MOD_ZLIB:= zlib
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
81 ${2}-install:
82 ${INSTALL_DIR} $$(IDIR_$(1))/usr/lib/php
83 for m in ${2}; do \
84 ${INSTALL_DATA} $(WRKBUILD)/modules/$$$${m}.so $$(IDIR_$(1))/usr/lib/php ;\
85 done
86 endef
88 PKG_CONFIGURE_OPTS:= \
89 --with-config-file-path=/etc \
90 --enable-cli \
91 --enable-cgi \
92 --enable-fpm \
93 --enable-opcache=no \
94 --disable-mbstring \
95 --disable-mbregex \
96 --disable-phar \
97 --disable-short-tags \
98 --disable-ctype \
99 --disable-soap \
100 --disable-fileinfo \
101 --disable-tokenizer \
102 --disable-filter \
103 --disable-xmlreader \
104 --disable-xmlwriter \
105 --disable-dom \
106 --without-pear \
107 --without-gettext \
108 --without-pgsql \
109 --without-iconv \
110 --with-kerberos=no
112 ifneq ($(ADK_PACKAGE_PHP_MOD_BZ2),)
113 PKG_CONFIGURE_OPTS+= --with-bz2=shared,"$(STAGING_TARGET_DIR)/usr"
114 else
115 PKG_CONFIGURE_OPTS+= --without-bz2
116 endif
117 ifneq ($(ADK_PACKAGE_PHP_MOD_CURL),)
118 PKG_CONFIGURE_OPTS+= --with-curl=shared,"$(STAGING_TARGET_DIR)/usr"
119 else
120 PKG_CONFIGURE_OPTS+= --without-curl
121 endif
122 ifneq ($(ADK_PACKAGE_PHP_MOD_FTP),)
123 PKG_CONFIGURE_OPTS+= --enable-ftp=shared
124 else
125 PKG_CONFIGURE_OPTS+= --disable-ftp
126 endif
127 ifneq ($(ADK_PACKAGE_PHP_MOD_GD),)
128 PKG_CONFIGURE_OPTS+= --enable-gd=shared
129 else
130 PKG_CONFIGURE_OPTS+= --disable-gd
131 endif
132 ifneq ($(ADK_PACKAGE_PHP_MOD_GMP),)
133 PKG_CONFIGURE_OPTS+= --with-gmp=shared,"$(STAGING_TARGET_DIR)/usr"
134 else
135 PKG_CONFIGURE_OPTS+= --without-gmp
136 endif
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"
140 else
141 PKG_CONFIGURE_OPTS+= --without-ldap
142 endif
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
146 else
147 PKG_CONFIGURE_OPTS+= --without-pdo-mysql
148 endif
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"
152 else
153 PKG_CONFIGURE_OPTS+= --without-openssl
154 endif
155 ifneq ($(ADK_PACKAGE_PHP_MOD_PCNTL),)
156 PKG_CONFIGURE_OPTS+= --enable-pcntl
157 else
158 PKG_CONFIGURE_OPTS+= --disable-pcntl
159 endif
160 ifneq ($(ADK_PACKAGE_PHP_MOD_SESSION),)
161 PKG_CONFIGURE_OPTS+= --enable-session=shared
162 else
163 PKG_CONFIGURE_OPTS+= --disable-session
164 endif
165 ifneq ($(ADK_PACKAGE_PHP_MOD_SNMP),)
166 PKG_CONFIGURE_OPTS+= --with-snmp=shared,"$(STAGING_TARGET_DIR)/usr"
167 CONFIGURE_ENV+= LIBS="-lnetsnmpmibs"
168 else
169 PKG_CONFIGURE_OPTS+= --without-snmp
170 endif
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
175 else
176 PKG_CONFIGURE_OPTS+= --without-sqlite3 --without-pdo-sqlite
177 endif
178 ifneq ($(ADK_PACKAGE_PHP_MOD_SOCKETS),)
179 PKG_CONFIGURE_OPTS+= --enable-sockets=shared
180 else
181 PKG_CONFIGURE_OPTS+= --enable-sockets=no
182 endif
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"
186 else
187 PKG_CONFIGURE_OPTS+= --disable-xml
188 endif
189 ifneq ($(ADK_PACKAGE_PHP_MOD_SIMPLEXML),)
190 PKG_CONFIGURE_OPTS+= --enable-simplexml=shared
191 else
192 PKG_CONFIGURE_OPTS+= --disable-simplexml
193 endif
194 ifneq ($(ADK_PACKAGE_PHP_MOD_ZLIB),)
195 PKG_CONFIGURE_OPTS+= --with-zlib=shared,"$(STAGING_TARGET_DIR)/usr"
196 else
197 PKG_CONFIGURE_OPTS+= --without-zlib
198 endif
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