Makefile 9.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267
  1. # This file is part of the OpenADK project. OpenADK is copyrighted
  2. # material, please see the LICENCE file in the top-level directory.
  3. include $(ADK_TOPDIR)/rules.mk
  4. PKG_NAME:= php
  5. PKG_VERSION:= 5.6.25
  6. PKG_RELEASE:= 1
  7. PKG_HASH:= 7535cd6e20040ccec4594cc386c6f15c3f2c88f24163294a31068cf7dfe7f644
  8. PKG_DESCR:= php language interpreter
  9. PKG_SECTION:= dev/lang
  10. PKG_NEEDS:= threads
  11. PHP_URL:= http://www.php.net/
  12. PKG_SITES:= http://de.php.net/distributions/
  13. PKG_SUBPKGS:= PHP PHP_CLI PHP_CGI PHP_FPM
  14. PKGSD_PHP_CGI:= php for fastcgi usage
  15. PKGSN_PHP_CGI:= php
  16. PKGSD_PHP_FPM:= php for fastcgi process manager usage
  17. PKGSN_PHP_FPM:= php
  18. PKGSD_PHP_CLI:= php cli
  19. PKGSN_PHP_CLI:= php
  20. PKG_FLAVOURS_PHP:= MOD_BZ2 MOD_CURL MOD_FTP MOD_GD MOD_GMP MOD_MYSQL
  21. PKG_FLAVOURS_PHP+= MOD_SSL MOD_SESSION MOD_SNMP MOD_SQLITE
  22. PKG_FLAVOURS_PHP+= MOD_SOCKETS MOD_XML MOD_SIMPLEXML MOD_ZLIB MOD_JSON
  23. PKG_FLAVOURS_PHP+= MOD_LDAP MOD_PCNTL
  24. PKGFD_MOD_BZ2:= bzip2 support
  25. PKGFB_MOD_BZ2:= bzip2
  26. PKGFS_MOD_BZ2:= bzip2
  27. PKGFD_MOD_CURL:= curl support
  28. PKGFB_MOD_CURL:= curl
  29. PKGFS_MOD_CURL:= libcurl
  30. PKGFD_MOD_FTP:= ftp support
  31. PKGFD_MOD_GD:= gd support
  32. PKGFB_MOD_GD:= libgd libpng libjpeg-turbo libXpm
  33. PKGFS_MOD_GD:= libgd libpng libjpeg-turbo libxpm
  34. PKGFD_MOD_GMP:= gmp support
  35. PKGFB_MOD_GMP:= gmp
  36. PKGFS_MOD_GMP:= libgmp
  37. PKGFD_MOD_JSON:= json support
  38. PKGFD_MOD_LDAP:= ldap support
  39. PKGFB_MOD_LDAP:= openldap
  40. PKGFS_MOD_LDAP:= libopenldap
  41. PKGFD_MOD_MYSQL:= mysql support
  42. PKGFS_MOD_MYSQL:= libmysqlclient
  43. PKGFB_MOD_MYSQL:= mysql
  44. PKGFD_MOD_SSL:= ssl support
  45. PKGFB_MOD_SSL:= libressl
  46. PKGFS_MOD_SSL:= libressl
  47. PKGFD_MOD_PCNTL:= process control support
  48. PKGFD_MOD_SESSION:= session support
  49. PKGFD_MOD_SNMP:= snmp support
  50. PKGFB_MOD_SNMP:= net-snmp
  51. PKGFS_MOD_SNMP:= libnetsnmp
  52. PKGFD_MOD_SQLITE:= sqlite support
  53. PKGFB_MOD_SQLITE:= sqlite
  54. PKGFS_MOD_SQLITE:= libsqlite
  55. PKGFD_MOD_SOCKETS:= socket support
  56. PKGFD_MOD_XML:= xml support
  57. PKGFB_MOD_XML:= expat
  58. PKGFS_MOD_XML:= libexpat
  59. PKGFD_MOD_SIMPLEXML:= simple xml support
  60. PKGFB_MOD_SIMPLEXML:= libxml2
  61. PKGFS_MOD_SIMPLEXML:= libxml2
  62. PKGFD_MOD_ZLIB:= zlib support
  63. PKGFB_MOD_ZLIB:= zlib
  64. PKGFS_MOD_ZLIB:= zlib
  65. include $(ADK_TOPDIR)/mk/package.mk
  66. $(eval $(call PKG_template,PHP,php,${PKG_VERSION}-${PKG_RELEASE},${PKG_DEPENDS},${PKG_DESCR},${PKG_SECTION}))
  67. $(eval $(call PKG_template,PHP_CLI,php-cli,${PKG_VERSION}-${PKG_RELEASE},${PKG_DEPENDS},${PKGSD_PHP_CLI},${PKG_SECTION}))
  68. $(eval $(call PKG_template,PHP_CGI,php-cgi,${PKG_VERSION}-${PKG_RELEASE},${PKG_DEPENDS},${PKGSD_PHP_CGI},${PKG_SECTION}))
  69. $(eval $(call PKG_template,PHP_FPM,php-fpm,${PKG_VERSION}-${PKG_RELEASE},${PKG_DEPENDS},${PKGSD_PHP_FPM},${PKG_SECTION}))
  70. define PKG_mod_template
  71. INSTALL_MODS_$${ADK_PACKAGE_${1}}+= ${2}-install
  72. ${2}-install:
  73. ${INSTALL_DIR} $$(IDIR_$(1))/usr/lib/php
  74. for m in ${2}; do \
  75. ${INSTALL_DATA} $(WRKBUILD)/modules/$$$${m}.so $$(IDIR_$(1))/usr/lib/php ;\
  76. done
  77. endef
  78. PKG_CONFIGURE_OPTS:= \
  79. --with-config-file-path=/etc \
  80. --enable-cli \
  81. --enable-cgi \
  82. --enable-fpm \
  83. --enable-opcache=no \
  84. --disable-hash \
  85. --disable-mbstring \
  86. --disable-mbregex \
  87. --disable-phar \
  88. --disable-short-tags \
  89. --disable-ctype \
  90. --disable-soap \
  91. --disable-fileinfo \
  92. --disable-tokenizer \
  93. --disable-filter \
  94. --disable-xmlreader \
  95. --disable-xmlwriter \
  96. --disable-dom \
  97. --without-pear \
  98. --without-gettext \
  99. --without-pgsql \
  100. --without-iconv \
  101. --with-pcre-regex=no \
  102. --with-kerberos=no
  103. ifneq ($(ADK_PACKAGE_PHP_MOD_BZ2),)
  104. PKG_CONFIGURE_OPTS+= --with-bz2=shared,"$(STAGING_TARGET_DIR)/usr"
  105. else
  106. PKG_CONFIGURE_OPTS+= --without-bz2
  107. endif
  108. ifneq ($(ADK_PACKAGE_PHP_MOD_CURL),)
  109. PKG_CONFIGURE_OPTS+= --with-curl=shared,"$(STAGING_TARGET_DIR)/usr"
  110. else
  111. PKG_CONFIGURE_OPTS+= --without-curl
  112. endif
  113. ifneq ($(ADK_PACKAGE_PHP_MOD_FTP),)
  114. PKG_CONFIGURE_OPTS+= --enable-ftp=shared
  115. else
  116. PKG_CONFIGURE_OPTS+= --disable-ftp
  117. endif
  118. ifneq ($(ADK_PACKAGE_PHP_MOD_GD),)
  119. PKG_CONFIGURE_OPTS+= --with-gd=shared,"$(STAGING_TARGET_DIR)/usr" \
  120. --with-png-dir="$(STAGING_TARGET_DIR)/usr" \
  121. --with-jpeg-dir="$(STAGING_TARGET_DIR)/usr" \
  122. --without-freetype-dir \
  123. --without-t1lib \
  124. --enable-gd-native-ttf \
  125. --disable-gd-jis-conv
  126. else
  127. PKG_CONFIGURE_OPTS+= --without-gd
  128. endif
  129. ifneq ($(ADK_PACKAGE_PHP_MOD_GMP),)
  130. PKG_CONFIGURE_OPTS+= --with-gmp=shared,"$(STAGING_TARGET_DIR)/usr"
  131. else
  132. PKG_CONFIGURE_OPTS+= --without-gmp
  133. endif
  134. ifneq ($(ADK_PACKAGE_PHP_MOD_JSON),)
  135. PKG_CONFIGURE_OPTS+= --enable-json=shared,"$(STAGING_TARGET_DIR)/usr"
  136. else
  137. PKG_CONFIGURE_OPTS+= --disable-json
  138. endif
  139. ifneq ($(ADK_PACKAGE_PHP_MOD_LDAP),)
  140. PKG_CONFIGURE_OPTS+= --with-ldap=shared,"$(STAGING_TARGET_DIR)/usr" \
  141. --with-ldap-sasl="$(STAGING_TARGET_DIR)/usr"
  142. else
  143. PKG_CONFIGURE_OPTS+= --without-ldap
  144. endif
  145. ifneq ($(ADK_PACKAGE_PHP_MOD_MYSQL),)
  146. PKG_CONFIGURE_OPTS+= --with-mysql=shared,"$(STAGING_TARGET_DIR)/usr"
  147. else
  148. PKG_CONFIGURE_OPTS+= --without-mysql
  149. endif
  150. ifneq ($(ADK_PACKAGE_PHP_MOD_OPENSSL),)
  151. PKG_CONFIGURE_OPTS+= --with-openssl=shared,"$(STAGING_TARGET_DIR)/usr" \
  152. --with-openssl-dir="$(STAGING_TARGET_DIR)/usr"
  153. else
  154. PKG_CONFIGURE_OPTS+= --without-openssl
  155. endif
  156. ifneq ($(ADK_PACKAGE_PHP_MOD_PCNTL),)
  157. PKG_CONFIGURE_OPTS+= --enable-pcntl
  158. else
  159. PKG_CONFIGURE_OPTS+= --disable-pcntl
  160. endif
  161. ifneq ($(ADK_PACKAGE_PHP_MOD_SESSION),)
  162. PKG_CONFIGURE_OPTS+= --enable-session=shared
  163. else
  164. PKG_CONFIGURE_OPTS+= --disable-session
  165. endif
  166. ifneq ($(ADK_PACKAGE_PHP_MOD_SNMP),)
  167. PKG_CONFIGURE_OPTS+= --with-snmp=shared,"$(STAGING_TARGET_DIR)/usr"
  168. CONFIGURE_ENV+= LIBS="-lnetsnmpmibs"
  169. else
  170. PKG_CONFIGURE_OPTS+= --without-snmp
  171. endif
  172. ifneq ($(ADK_PACKAGE_PHP_MOD_SQLITE),)
  173. PKG_CONFIGURE_OPTS+= --with-sqlite3="$(STAGING_TARGET_DIR)/usr"
  174. PKG_CONFIGURE_OPTS+= --with-pdo-sqlite=shared,"$(STAGING_TARGET_DIR)/usr"
  175. PKG_CONFIGURE_OPTS+= --enable-pdo=shared
  176. else
  177. PKG_CONFIGURE_OPTS+= --without-sqlite3 --without-pdo-sqlite
  178. endif
  179. ifneq ($(ADK_PACKAGE_PHP_MOD_SOCKETS),)
  180. PKG_CONFIGURE_OPTS+= --enable-sockets=shared
  181. else
  182. PKG_CONFIGURE_OPTS+= --enable-sockets=no
  183. endif
  184. ifneq ($(ADK_PACKAGE_PHP_MOD_XML),)
  185. PKG_CONFIGURE_OPTS+= --enable-xml=shared,"$(STAGING_TARGET_DIR)/usr" \
  186. --with-libexpat-dir="$(STAGING_TARGET_DIR)/usr"
  187. else
  188. PKG_CONFIGURE_OPTS+= --disable-xml
  189. endif
  190. ifneq ($(ADK_PACKAGE_PHP_MOD_SIMPLEXML),)
  191. PKG_CONFIGURE_OPTS+= --enable-simplexml=shared --enable-libxml --with-libxml-dir="$(STAGING_TARGET_DIR)/usr"
  192. else
  193. PKG_CONFIGURE_OPTS+= --disable-simplexml --disable-libxml
  194. endif
  195. ifneq ($(ADK_PACKAGE_PHP_MOD_ZLIB),)
  196. PKG_CONFIGURE_OPTS+= --with-zlib=shared,"$(STAGING_TARGET_DIR)/usr"
  197. else
  198. PKG_CONFIGURE_OPTS+= --without-zlib
  199. 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_JSON,php-mod-json,$(PKG_VERSION)-${PKG_RELEASE},${PKG_DEPENDS},${PKG_DESCR},${PKG_SECTION}))
  206. $(eval $(call PKG_template,PHP_MOD_LDAP,php-mod-ldap,$(PKG_VERSION)-${PKG_RELEASE},${PKG_DEPENDS},${PKG_DESCR},${PKG_SECTION}))
  207. $(eval $(call PKG_template,PHP_MOD_MYSQL,php-mod-mysql,$(PKG_VERSION)-${PKG_RELEASE},${PKG_DEPENDS},${PKG_DESCR},${PKG_SECTION}))
  208. $(eval $(call PKG_template,PHP_MOD_OPENSSL,php-mod-openssl,$(PKG_VERSION)-${PKG_RELEASE},${PKG_DEPENDS},${PKG_DESCR},${PKG_SECTION}))
  209. $(eval $(call PKG_template,PHP_MOD_SESSION,php-mod-session,$(PKG_VERSION)-${PKG_RELEASE},${PKG_DEPENDS},${PKG_DESCR},${PKG_SECTION}))
  210. $(eval $(call PKG_template,PHP_MOD_SNMP,php-mod-snmp,$(PKG_VERSION)-${PKG_RELEASE},${PKG_DEPENDS},${PKG_DESCR},${PKG_SECTION}))
  211. $(eval $(call PKG_template,PHP_MOD_SOCKETS,php-mod-sockets,$(PKG_VERSION)-${PKG_RELEASE},${PKG_DEPENDS},${PKG_DESCR},${PKG_SECTION}))
  212. $(eval $(call PKG_template,PHP_MOD_SQLITE,php-mod-sqlite,$(PKG_VERSION)-${PKG_RELEASE},${PKG_DEPENDS},${PKG_DESCR},${PKG_SECTION}))
  213. $(eval $(call PKG_template,PHP_MOD_XML,php-mod-xml,$(PKG_VERSION)-${PKG_RELEASE},${PKG_DEPENDS},${PKG_DESCR},${PKG_SECTION}))
  214. $(eval $(call PKG_template,PHP_MOD_SIMPLEXML,php-mod-simplexml,$(PKG_VERSION)-${PKG_RELEASE},${PKG_DEPENDS},${PKG_DESCR},${PKG_SECTION}))
  215. $(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_JSON,json))
  222. $(eval $(call PKG_mod_template,PHP_MOD_LDAP,ldap))
  223. $(eval $(call PKG_mod_template,PHP_MOD_MYSQL,mysql))
  224. $(eval $(call PKG_mod_template,PHP_MOD_OPENSSL,openssl))
  225. $(eval $(call PKG_mod_template,PHP_MOD_SESSION,session))
  226. $(eval $(call PKG_mod_template,PHP_MOD_SOCKETS,sockets))
  227. $(eval $(call PKG_mod_template,PHP_MOD_SNMP,snmp))
  228. $(eval $(call PKG_mod_template,PHP_MOD_SQLITE,pdo pdo_sqlite))
  229. $(eval $(call PKG_mod_template,PHP_MOD_XML,xml))
  230. $(eval $(call PKG_mod_template,PHP_MOD_SIMPLEXML,simplexml))
  231. $(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)
  236. do-install: ${INSTALL_MODS_y} ${INSTALL_MODS_m}
  237. ${INSTALL_DIR} $(IDIR_PHP)/etc
  238. ${INSTALL_DATA} ./files/php.ini $(IDIR_PHP)/etc
  239. ${INSTALL_DIR} $(IDIR_PHP_CLI)/usr/bin
  240. ${INSTALL_BIN} $(WRKBUILD)/sapi/cli/php \
  241. $(IDIR_PHP_CLI)/usr/bin
  242. ${INSTALL_DIR} $(IDIR_PHP_CGI)/usr/bin
  243. ${INSTALL_BIN} $(WRKBUILD)/sapi/cgi/php-cgi \
  244. $(IDIR_PHP_CGI)/usr/bin
  245. ${INSTALL_DIR} $(IDIR_PHP_FPM)/etc
  246. $(CP) ./files/php-fpm.conf $(IDIR_PHP_FPM)/etc
  247. ${INSTALL_DIR} $(IDIR_PHP_FPM)/usr/bin
  248. ${INSTALL_BIN} $(WRKBUILD)/sapi/fpm/php-fpm \
  249. $(IDIR_PHP_FPM)/usr/bin/php
  250. include ${ADK_TOPDIR}/mk/pkg-bottom.mk