Makefile 6.9 KB

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