Makefile 7.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203
  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 $(TOPDIR)/rules.mk
  4. PKG_NAME:= php
  5. PKG_VERSION:= 5.3.2
  6. PKG_RELEASE:= 1
  7. PKG_MD5SUM:= 4480d7c6d6b4a86de7b8ec8f0c2d1871
  8. PKG_DESCR:= PHP CLI
  9. PKG_SECTION:= net
  10. PKG_MULTI:= 1
  11. PKG_DEPENDS:= libopenssl zlib
  12. PKG_BUILDDEP+= openssl zlib
  13. ifneq ($(ADK_PACKAGE_PHP_MOD_CURL),)
  14. PKG_BUILDDEP+= curl
  15. endif
  16. ifneq ($(ADK_PACKAGE_PHP_MOD_GD),)
  17. PKG_BUILDDEP+= libgd libpng
  18. endif
  19. ifneq ($(ADK_PACKAGE_PHP_MOD_GMP),)
  20. PKG_BUILDDEP+= gmp
  21. endif
  22. ifneq ($(ADK_PACKAGE_PHP_MOD_LDAP),)
  23. PKG_BUILDDEP+= openldap
  24. endif
  25. ifneq ($(ADK_PACKAGE_PHP_MOD_MYSQL),)
  26. PKG_BUILDDEP+= mysql
  27. endif
  28. ifneq ($(ADK_PACKAGE_PHP_MOD_PCRE),)
  29. PKG_BUILDDEP+= pcre
  30. endif
  31. ifneq ($(ADK_PACKAGE_PHP_MOD_PGSQL),)
  32. PKG_BUILDDEP+= postgresql
  33. endif
  34. ifneq ($(ADK_PACKAGE_PHP_MOD_SQLITE),)
  35. PKG_BUILDDEP+= sqlite
  36. endif
  37. ifneq ($(ADK_PACKAGE_PHP_MOD_XML),)
  38. PKG_BUILDDEP+= expat
  39. endif
  40. PHP_URL:= http://www.php.net
  41. PKG_SITES:= http://de.php.net/distributions/
  42. PKG_DESCR_FCGI:= PHP for FastCGI usage
  43. # FIX PKG_DEPENDS
  44. include $(TOPDIR)/mk/package.mk
  45. $(eval $(call PKG_template,PHP,php,${PKG_VERSION}-${PKG_RELEASE},${PKG_DEPENDS},${PKG_DESCR},${PKG_SECTION}))
  46. $(eval $(call PKG_template,PHP_CLI,php-cli,${PKG_VERSION}-${PKG_RELEASE},${PKG_DEPENDS},${PKG_DESCR},${PKG_SECTION}))
  47. $(eval $(call PKG_template,PHP_FASTCGI,php-fastcgi,${PKG_VERSION}-${PKG_RELEASE},${PKG_DEPENDS},${PKG_DESCR_FCGI},${PKG_SECTION}))
  48. define PKG_mod_template
  49. INSTALL_MODS_$${ADK_PACKAGE_${1}}+= ${2}-install
  50. ${2}-install:
  51. ${INSTALL_DIR} $$(IDIR_$(1))/usr/lib/php
  52. ${INSTALL_DATA} $(WRKBUILD)/modules/$(2).so $$(IDIR_$(1))/usr/lib/php
  53. endef
  54. PKG_CONFIGURE_OPTS:= \
  55. --without-pear \
  56. --disable-spl \
  57. --with-config-file-path=/etc \
  58. --enable-magic-quotes \
  59. --disable-short-tags \
  60. --disable-ctype \
  61. --disable-dom \
  62. --enable-ftp=shared \
  63. --without-gettext \
  64. --without-iconv \
  65. --disable-libxml \
  66. --without-libxml-dir \
  67. --disable-mbstring \
  68. --disable-mbregex \
  69. --disable-phar \
  70. --with-openssl=shared,"$(STAGING_DIR)/usr" \
  71. --with-kerberos=no \
  72. --with-openssl-dir="$(STAGING_DIR)/usr" \
  73. --enable-session=shared \
  74. --disable-simplexml \
  75. --disable-soap \
  76. --disable-fileinfo \
  77. --enable-sockets=shared \
  78. --disable-tokenizer \
  79. --disable-filter \
  80. --disable-xmlreader \
  81. --disable-xmlwriter \
  82. --with-zlib="$(STAGING_DIR)/usr" \
  83. --with-zlib-dir="$(STAGING_DIR)/usr" \
  84. --enable-cli \
  85. --enable-cgi \
  86. --enable-fastcgi \
  87. --enable-force-cgi-redirect \
  88. --enable-discard-path \
  89. ifneq ($(ADK_PACKAGE_PHP_MOD_CURL),)
  90. PKG_CONFIGURE_OPTS+= --with-curl=shared,"$(STAGING_DIR)/usr"
  91. else
  92. PKG_CONFIGURE_OPTS+= --without-curl
  93. endif
  94. ifneq ($(ADK_PACKAGE_PHP_MOD_GD),)
  95. PKG_CONFIGURE_OPTS+= --with-gd=shared,"$(STAGING_DIR)/usr" \
  96. --without-freetype-dir \
  97. --with-jpeg-dir="$(STAGING_DIR)/usr" \
  98. --with-png-dir="$(STAGING_DIR)/usr" \
  99. --without-xpm-dir \
  100. --without-ttf \
  101. --without-t1lib \
  102. --enable-gd-native-ttf \
  103. --disable-gd-jis-conv
  104. else
  105. PKG_CONFIGURE_OPTS+= --without-gd
  106. endif
  107. ifneq ($(ADK_PACKAGE_PHP_MOD_GMP),)
  108. PKG_CONFIGURE_OPTS+= --with-gmp=shared,"$(STAGING_DIR)/usr"
  109. else
  110. PKG_CONFIGURE_OPTS+= --without-gmp
  111. endif
  112. ifneq ($(ADK_PACKAGE_PHP_MOD_LDAP),)
  113. PKG_CONFIGURE_OPTS+= --with-ldap=shared,"$(STAGING_DIR)/usr" \
  114. --with-ldap-sasl="$(STAGING_DIR)/usr"
  115. else
  116. PKG_CONFIGURE_OPTS+= --without-ldap
  117. endif
  118. ifneq ($(ADK_PACKAGE_PHP_MOD_MYSQL),)
  119. PKG_CONFIGURE_OPTS+= --with-mysql=shared,"$(STAGING_DIR)/usr"
  120. else
  121. PKG_CONFIGURE_OPTS+= --without-mysql
  122. endif
  123. ifneq ($(ADK_PACKAGE_PHP_MOD_PCRE),)
  124. PKG_CONFIGURE_OPTS+= --with-pcre-dir=shared,"$(STAGING_DIR)/usr"
  125. else
  126. PKG_CONFIGURE_OPTS+= --without-pcre-dir
  127. endif
  128. ifneq ($(ADK_PACKAGE_PHP_MOD_PGSQL),)
  129. PKG_CONFIGURE_OPTS+= --with-pgsql=shared,"$(STAGING_DIR)/usr"
  130. else
  131. PKG_CONFIGURE_OPTS+= --without-pgsql
  132. endif
  133. ifneq ($(ADK_PACKAGE_PHP_MOD_SQLITE),)
  134. PKG_CONFIGURE_OPTS+= --without-sqlite
  135. PKG_CONFIGURE_OPTS+= --with-pdo-sqlite=shared,"$(STAGING_DIR)/usr"
  136. PKG_CONFIGURE_OPTS+= --enable-pdo=shared
  137. else
  138. PKG_CONFIGURE_OPTS+= --without-sqlite
  139. endif
  140. ifneq ($(ADK_PACKAGE_PHP_MOD_XML),)
  141. PKG_CONFIGURE_OPTS+= --enable-xml=shared,"$(STAGING_DIR)/usr" \
  142. --with-libexpat-dir="$(STAGING_DIR)/usr"
  143. else
  144. PKG_CONFIGURE_OPTS+= --disable-xml
  145. endif
  146. $(eval $(call PKG_template,PHP_MOD_CURL,php-mod-curl,$(PKG_VERSION)-${PKG_RELEASE},${PKG_DEPENDS},${PKG_DESCR},${PKG_SECTION}))
  147. $(eval $(call PKG_template,PHP_MOD_FTP,php-mod-ftp,$(PKG_VERSION)-${PKG_RELEASE},${PKG_DEPENDS},${PKG_DESCR},${PKG_SECTION}))
  148. $(eval $(call PKG_template,PHP_MOD_GD,php-mod-gd,$(PKG_VERSION)-${PKG_RELEASE},${PKG_DEPENDS},${PKG_DESCR},${PKG_SECTION}))
  149. $(eval $(call PKG_template,PHP_MOD_GMP,php-mod-gmp,$(PKG_VERSION)-${PKG_RELEASE},${PKG_DEPENDS},${PKG_DESCR},${PKG_SECTION}))
  150. $(eval $(call PKG_template,PHP_MOD_LDAP,php-mod-ldap,$(PKG_VERSION)-${PKG_RELEASE},${PKG_DEPENDS},${PKG_DESCR},${PKG_SECTION}))
  151. $(eval $(call PKG_template,PHP_MOD_MYSQL,php-mod-mysql,$(PKG_VERSION)-${PKG_RELEASE},${PKG_DEPENDS},${PKG_DESCR},${PKG_SECTION}))
  152. $(eval $(call PKG_template,PHP_MOD_OPENSSL,php-mod-openssl,$(PKG_VERSION)-${PKG_RELEASE},${PKG_DEPENDS},${PKG_DESCR},${PKG_SECTION}))
  153. #$(eval $(call PKG_template,PHP_MOD_PCRE,php-mod-pcre,$(PKG_VERSION)-${PKG_RELEASE},${PKG_DEPENDS},${PKG_DESCR},${PKG_SECTION}))
  154. $(eval $(call PKG_template,PHP_MOD_PGSQL,php-mod-pgsql,$(PKG_VERSION)-${PKG_RELEASE},${PKG_DEPENDS},${PKG_DESCR},${PKG_SECTION}))
  155. $(eval $(call PKG_template,PHP_MOD_SESSION,php-mod-session,$(PKG_VERSION)-${PKG_RELEASE},${PKG_DEPENDS},${PKG_DESCR},${PKG_SECTION}))
  156. $(eval $(call PKG_template,PHP_MOD_SOCKETS,php-mod-sockets,$(PKG_VERSION)-${PKG_RELEASE},${PKG_DEPENDS},${PKG_DESCR},${PKG_SECTION}))
  157. $(eval $(call PKG_template,PHP_MOD_SQLITE,php-mod-sqlite,$(PKG_VERSION)-${PKG_RELEASE},${PKG_DEPENDS},${PKG_DESCR},${PKG_SECTION}))
  158. $(eval $(call PKG_template,PHP_MOD_XML,php-mod-xml,$(PKG_VERSION)-${PKG_RELEASE},${PKG_DEPENDS},${PKG_DESCR},${PKG_SECTION}))
  159. $(eval $(call PKG_mod_template,PHP_MOD_CURL,curl))
  160. $(eval $(call PKG_mod_template,PHP_MOD_FTP,ftp))
  161. $(eval $(call PKG_mod_template,PHP_MOD_GD,gd))
  162. $(eval $(call PKG_mod_template,PHP_MOD_GMP,gmp))
  163. $(eval $(call PKG_mod_template,PHP_MOD_LDAP,ldap))
  164. $(eval $(call PKG_mod_template,PHP_MOD_MYSQL,mysql))
  165. $(eval $(call PKG_mod_template,PHP_MOD_OPENSSL,openssl))
  166. $(eval $(call PKG_mod_template,PHP_MOD_PGSQL,pgsql))
  167. $(eval $(call PKG_mod_template,PHP_MOD_SESSION,session))
  168. $(eval $(call PKG_mod_template,PHP_MOD_SOCKETS,sockets))
  169. $(eval $(call PKG_mod_template,PHP_MOD_SQLITE,pdo))
  170. $(eval $(call PKG_mod_template,PHP_MOD_XML,xml))
  171. INSTALL_STYLE:= manual
  172. TLDFLAGS+= -L$(STAGING_DIR)/usr/lib/mysql
  173. CONFIGURE_ENV+= LIBS="-ldl"
  174. CONFIGURE_ARGS+= $(PKG_CONFIGURE_OPTS)
  175. do-install: ${INSTALL_MODS_y} ${INSTALL_MODS_m}
  176. ${INSTALL_DIR} $(IDIR_PHP)/etc
  177. ${INSTALL_DATA} ./files/php.ini $(IDIR_PHP)/etc/
  178. ${INSTALL_DIR} $(IDIR_PHP_CLI)/usr/bin
  179. ${INSTALL_BIN} $(WRKBUILD)/sapi/cli/php $(IDIR_PHP_CLI)/usr/bin/php
  180. ${INSTALL_DIR} $(IDIR_PHP_FASTCGI)/etc
  181. ${INSTALL_DATA} ./files/php.ini $(IDIR_PHP_FASTCGI)/etc/
  182. ${INSTALL_DIR} $(IDIR_PHP_FASTCGI)/usr/sbin
  183. ${INSTALL_BIN} $(WRKBUILD)/sapi/cgi/php-cgi \
  184. $(IDIR_PHP_FASTCGI)/usr/sbin/php
  185. include ${TOPDIR}/mk/pkg-bottom.mk