summaryrefslogtreecommitdiffstats
path: root/meta-webserver/recipes-php/modphp/modphp5.inc
diff options
context:
space:
mode:
Diffstat (limited to 'meta-webserver/recipes-php/modphp/modphp5.inc')
-rw-r--r--meta-webserver/recipes-php/modphp/modphp5.inc112
1 files changed, 112 insertions, 0 deletions
diff --git a/meta-webserver/recipes-php/modphp/modphp5.inc b/meta-webserver/recipes-php/modphp/modphp5.inc
new file mode 100644
index 000000000..f60c7bbfc
--- /dev/null
+++ b/meta-webserver/recipes-php/modphp/modphp5.inc
@@ -0,0 +1,112 @@
1SECTION = "console/network"
2DESCRIPTION = "A server-side, HTML-embedded scripting language. This package provides the apache php module."
3LICENSE = "PHP-3.0"
4INC_PR = "r1"
5DEPENDS = "apache2-native apache2 zlib bzip2 libmcrypt"
6
7SRC_URI = "http://www.php.net/distributions/php-${PV}.tar.bz2 \
8 file://configure.patch \
9 file://pthread-check-threads-m4.patch \
10 file://70_mod_php5.conf \
11 file://0001-using-pkgconfig-to-check-libxml.patch \
12 file://php-CVE-2014-5120.patch \
13 file://php-CVE-2014-3587.patch \
14 file://php-CVE-2014-3597.patch \
15"
16
17S = "${WORKDIR}/php-${PV}"
18
19LIC_FILES_CHKSUM = "file://LICENSE;md5=52dd90569008fee5bcdbb22d945b1108"
20
21inherit autotools pkgconfig
22
23PNBLACKLIST[modphp] ?= "CONFLICT: 466 header files conflict with php"
24# e.g. sysroots/qemux86-64/usr/include/php/main/win95nt.h
25
26CFLAGS += " -g -DPTYS_ARE_GETPT -DPTYS_ARE_SEARCHED -I${STAGING_INCDIR}/apache2"
27
28EXTRA_OECONF = "--with-apxs2=${STAGING_BINDIR_CROSS}/apxs \
29 --with-pic \
30 --enable-maintainer-zts \
31 --without-mysql \
32 --disable-cgi \
33 --disable-cli \
34 --disable-pdo \
35 --without-pear \
36 --without-iconv \
37 --disable-ipv6 \
38 --disable-xml \
39 --disable-xmlreader \
40 --disable-xmlwriter \
41 --disable-simplexml \
42 --disable-dom \
43 --disable-rpath \
44 --libdir=${libdir}/php5 \
45 --with-zlib --with-zlib-dir=${STAGING_DIR_TARGET}${exec_prefix} \
46 --with-bz2=${STAGING_DIR_TARGET}${exec_prefix} \
47 --with-mcrypt=${STAGING_DIR_TARGET}${exec_prefix} \
48 --enable-zip \
49 --enable-mbstring \
50 --with-config-file-path=${sysconfdir}/php/apache2-php5 \
51 ${@base_conditional('SITEINFO_ENDIANNESS', 'le', 'ac_cv_c_bigendian_php=no', 'ac_cv_c_bigendian_php=yes', d)}"
52
53PACKAGECONFIG ??= "mysql"
54PACKAGECONFIG[mysql] = "--with-mysqli=${STAGING_BINDIR_CROSS}/mysql_config,--without-mysqli,mysql5"
55PACKAGECONFIG[pgsql] = "--with-pgsql=${STAGING_DIR_TARGET}${exec_prefix},--without-pgsql,mysql5"
56PACKAGECONFIG[libxml] = "--enable-libxml,--disable-libxml,libxml2"
57PACKAGECONFIG[soap] = "--enable-libxml --enable-soap, --disable-soap, libxml2"
58
59acpaths = ""
60
61do_configure_prepend () {
62 rm -f ${S}/build/libtool.m4 ${S}/ltmain.sh ${S}/aclocal.m4
63 find ${S} -name config.m4 | xargs -n1 sed -i 's!APXS_HTTPD=.*!APXS_HTTPD=${STAGING_BINDIR_NATIVE}/httpd!'
64}
65
66do_configure_append() {
67 # No libtool, we really don't want rpath set...
68 sed -i 's|^hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=""|g' ${HOST_SYS}-libtool
69 sed -i 's|^runpath_var=LD_RUN_PATH|runpath_var=DIE_RPATH_DIE|g' ${HOST_SYS}-libtool
70}
71
72do_install () {
73 install -d ${D}${libdir}/apache2/modules
74 install -d ${D}${sysconfdir}/apache2/modules.d
75 install -d ${D}${sysconfdir}/php/apache2-php5
76 install -m 755 libs/libphp5.so ${D}${libdir}/apache2/modules
77 install -m 644 ${WORKDIR}/70_mod_php5.conf ${D}${sysconfdir}/apache2/modules.d
78 sed -i s,lib/,${libdir}/, ${D}${sysconfdir}/apache2/modules.d/70_mod_php5.conf
79 cat ${S}/php.ini-production | \
80 sed -e 's,extension_dir = \"\./\",extension_dir = \"/usr/lib/extensions\",' \
81 > ${D}${sysconfdir}/php/apache2-php5/php.ini
82
83 install -d ${D}${bindir}
84 install -m 755 scripts/phpize ${D}${bindir}
85 install -m 755 scripts/php-config ${D}${bindir}
86 cat aclocal-copy/libtool.m4 aclocal-copy/lt~obsolete.m4 aclocal-copy/ltoptions.m4 \
87 aclocal-copy/ltsugar.m4 aclocal-copy/ltversion.m4 > ${S}/build/libtool.m4
88
89 oe_runmake install-build install-headers INSTALL_ROOT=${D}
90}
91
92SYSROOT_PREPROCESS_FUNCS += "php_sysroot_preprocess"
93
94php_sysroot_preprocess () {
95 install -d ${SYSROOT_DESTDIR}${bindir_crossscripts}/
96 install -m 755 ${D}${bindir}/phpize ${SYSROOT_DESTDIR}${bindir_crossscripts}/
97 install -m 755 ${D}${bindir}/php-config ${SYSROOT_DESTDIR}${bindir_crossscripts}/
98
99 sed -i 's!eval echo /!eval echo ${STAGING_DIR_HOST}/!' ${SYSROOT_DESTDIR}${bindir_crossscripts}/phpize
100 sed -i 's!^include_dir=.*!include_dir=${STAGING_INCDIR}/php!' ${SYSROOT_DESTDIR}${bindir_crossscripts}/php-config
101}
102
103# phpize is not scanned for absolute paths by default (but php-config is).
104#
105SSTATE_SCAN_FILES += "phpize"
106
107RDEPENDS_${PN} = "apache2"
108
109FILES_${PN} = "${libdir}/apache2 ${sysconfdir}"
110FILES_${PN}-dev += "${bindir}/phpize ${bindir}/php-config ${libdir}/php5"
111FILES_${PN}-dbg += "${libdir}/apache2/modules/.debug"
112