summaryrefslogtreecommitdiffstats
path: root/meta-oe/recipes-devtools
diff options
context:
space:
mode:
authorPaul Eggleton <paul.eggleton@linux.intel.com>2014-12-31 15:26:44 +0000
committerMartin Jansa <Martin.Jansa@gmail.com>2015-01-08 12:04:26 +0100
commit18a97c00b77bfc5eff2214f81934e0dd4d4954b9 (patch)
tree1381e2dd536fd1206c8eb4f53021c5d7a80061ee /meta-oe/recipes-devtools
parentad6e0184266241e28216681f6fa0b7dc48f79344 (diff)
downloadmeta-openembedded-18a97c00b77bfc5eff2214f81934e0dd4d4954b9.tar.gz
php: integrate modphp
Build the mod_php Apache module within the main php recipe; this avoids files in the sysroot from stepping on eachother and therefore avoids the resulting build failure. Changes made: * Add an "apache2" PACKAGECONFIG, default disabled. This means that if you previously used the modphp recipe you now need to set PACKAGECONFIG for php to include "apache2". * Bring in most patches and configure options from the modphp recipe. * Specify ${libdir}/php5 as libdir. This avoids the PHP extensions directory being /usr/lib/extensions by default which is ugly. * Tidy up some superfluous/malformed entries in FILES_${PN}-pear * Drop obsolete PHP_MAJVER * Replace virtclass- override with class- Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Diffstat (limited to 'meta-oe/recipes-devtools')
-rw-r--r--meta-oe/recipes-devtools/php/php/70_mod_php5.conf12
-rw-r--r--meta-oe/recipes-devtools/php/php/configure.patch11
-rw-r--r--meta-oe/recipes-devtools/php/php/pthread-check-threads-m4.patch30
-rw-r--r--meta-oe/recipes-devtools/php/php_5.5.15.bb142
4 files changed, 163 insertions, 32 deletions
diff --git a/meta-oe/recipes-devtools/php/php/70_mod_php5.conf b/meta-oe/recipes-devtools/php/php/70_mod_php5.conf
new file mode 100644
index 000000000..1de6fb11a
--- /dev/null
+++ b/meta-oe/recipes-devtools/php/php/70_mod_php5.conf
@@ -0,0 +1,12 @@
1# vim: ft=apache sw=4 ts=4
2<IfDefine PHP5>
3 # Load the module first
4 <IfModule !sapi_apache2.c>
5 LoadModule php5_module lib/apache2/modules/libphp5.so
6 </IfModule>
7
8 # Set it to handle the files
9 AddHandler php5-script .php .phtml .php3 .php4 .php5
10 AddType application/x-httpd-php-source .phps
11 DirectoryIndex index.html index.html.var index.php index.phtml
12</IfDefine>
diff --git a/meta-oe/recipes-devtools/php/php/configure.patch b/meta-oe/recipes-devtools/php/php/configure.patch
new file mode 100644
index 000000000..c5334c706
--- /dev/null
+++ b/meta-oe/recipes-devtools/php/php/configure.patch
@@ -0,0 +1,11 @@
1--- php-5.1.6/configure.old 2006-09-12 07:54:14.000000000 -0700
2+++ php-5.1.6/configure 2006-09-12 07:54:37.000000000 -0700
3@@ -14715,8 +14715,6 @@
4
5
6
7- unset ac_cv_func_dlopen
8- unset ac_cv_func___dlopen
9 unset found
10
11 echo $ac_n "checking for dlopen""... $ac_c" 1>&6
diff --git a/meta-oe/recipes-devtools/php/php/pthread-check-threads-m4.patch b/meta-oe/recipes-devtools/php/php/pthread-check-threads-m4.patch
new file mode 100644
index 000000000..0c564cd88
--- /dev/null
+++ b/meta-oe/recipes-devtools/php/php/pthread-check-threads-m4.patch
@@ -0,0 +1,30 @@
1From d8067ceacbf54e79c9c6b68675332c09eaa0b55d Mon Sep 17 00:00:00 2001
2From: Jackie Huang <jackie.huang@windriver.com>
3Date: Mon, 8 Apr 2013 14:29:51 +0800
4Subject: [PATCH] pthread-check
5
6Enable pthreads support when cross-compiling
7
8Upstream-Status: Inapproprate [config]
9
10Signed-off-by: Jackie Huang <jackie.huang@windriver.com>
11---
12 TSRM/threads.m4 | 2 +-
13 1 files changed, 1 insertions(+), 1 deletions(-)
14
15diff --git a/TSRM/threads.m4 b/TSRM/threads.m4
16index 38494ce..15d9454 100644
17--- a/TSRM/threads.m4
18+++ b/TSRM/threads.m4
19@@ -86,7 +86,7 @@ int main() {
20 pthreads_working=no
21 ], [
22 dnl For cross compiling running this test is of no use. NetWare supports pthreads
23- pthreads_working=no
24+ pthreads_working=yes
25 case $host_alias in
26 *netware*)
27 pthreads_working=yes
28--
291.7.4.1
30
diff --git a/meta-oe/recipes-devtools/php/php_5.5.15.bb b/meta-oe/recipes-devtools/php/php_5.5.15.bb
index ff81aee82..1e53a326c 100644
--- a/meta-oe/recipes-devtools/php/php_5.5.15.bb
+++ b/meta-oe/recipes-devtools/php/php_5.5.15.bb
@@ -1,4 +1,4 @@
1DESCRIPTION = "A server-side, HTML-embedded scripting language. This package provides the CGI." 1SUMMARY = "A server-side, HTML-embedded scripting language"
2HOMEPAGE = "http://www.php.net" 2HOMEPAGE = "http://www.php.net"
3SECTION = "console/network" 3SECTION = "console/network"
4 4
@@ -6,13 +6,9 @@ LICENSE = "PHP-3.0"
6LIC_FILES_CHKSUM = "file://LICENSE;md5=52dd90569008fee5bcdbb22d945b1108" 6LIC_FILES_CHKSUM = "file://LICENSE;md5=52dd90569008fee5bcdbb22d945b1108"
7 7
8BBCLASSEXTEND = "native" 8BBCLASSEXTEND = "native"
9DEPENDS = "zlib libxml2 virtual/libiconv php-native lemon-native \ 9DEPENDS = "zlib bzip2 libxml2 virtual/libiconv php-native lemon-native \
10 libc-client openssl libmcrypt" 10 uw-imap openssl libmcrypt"
11DEPENDS_virtclass-native = "zlib-native libxml2-native" 11DEPENDS_class-native = "zlib-native libxml2-native"
12
13# The new PHP downloads server groups PHP releases by major version so find
14# the major version of the PHP recipe.
15PHP_MAJVER = "${@d.getVar('PV',1).split('.')[0]}"
16 12
17SRC_URI = "http://php.net/distributions/php-${PV}.tar.bz2 \ 13SRC_URI = "http://php.net/distributions/php-${PV}.tar.bz2 \
18 file://acinclude-xml2-config.patch \ 14 file://acinclude-xml2-config.patch \
@@ -28,6 +24,9 @@ SRC_URI_append_class-target += " \
28 file://php_exec_native.patch \ 24 file://php_exec_native.patch \
29 file://php-fpm.conf \ 25 file://php-fpm.conf \
30 file://php-fpm-apache.conf \ 26 file://php-fpm-apache.conf \
27 file://configure.patch \
28 file://pthread-check-threads-m4.patch \
29 file://70_mod_php5.conf \
31 " 30 "
32 31
33SRC_URI[md5sum] = "5cb5f2ed9099299f8a4c952d59d93812" 32SRC_URI[md5sum] = "5cb5f2ed9099299f8a4c952d59d93812"
@@ -37,22 +36,38 @@ S = "${WORKDIR}/php-${PV}"
37 36
38inherit autotools pkgconfig pythonnative gettext 37inherit autotools pkgconfig pythonnative gettext
39 38
39# phpize is not scanned for absolute paths by default (but php-config is).
40#
41SSTATE_SCAN_FILES += "phpize"
40SSTATE_SCAN_FILES += "build-defs.h" 42SSTATE_SCAN_FILES += "build-defs.h"
41 43
44PHP_LIBDIR = "${libdir}/php5"
45
42# Common EXTRA_OECONF 46# Common EXTRA_OECONF
43COMMON_EXTRA_OECONF = "--enable-sockets --enable-pcntl --enable-shared --disable-opcache" 47COMMON_EXTRA_OECONF = "--enable-sockets \
48 --enable-pcntl \
49 --enable-shared \
50 --disable-opcache \
51 --disable-rpath \
52 --with-pic \
53 --libdir=${PHP_LIBDIR} \
54"
44EXTRA_OECONF = "--enable-mbstring \ 55EXTRA_OECONF = "--enable-mbstring \
45 --enable-wddx \ 56 --enable-wddx \
46 --enable-fpm \ 57 --enable-fpm \
58 --enable-zip \
47 --with-imap=${STAGING_DIR_HOST} \ 59 --with-imap=${STAGING_DIR_HOST} \
48 --with-gettext=${STAGING_LIBDIR}/.. \ 60 --with-gettext=${STAGING_LIBDIR}/.. \
49 --with-imap-ssl=${STAGING_DIR_HOST} \ 61 --with-imap-ssl=${STAGING_DIR_HOST} \
50 --with-zlib=${STAGING_LIBDIR}/.. \ 62 --with-zlib=${STAGING_LIBDIR}/.. \
51 --with-iconv=${STAGING_LIBDIR}/.. \ 63 --with-iconv=${STAGING_LIBDIR}/.. \
52 --with-mcrypt=${STAGING_DIR_TARGET}${exec_prefix} \ 64 --with-mcrypt=${STAGING_DIR_TARGET}${exec_prefix} \
65 --with-bz2=${STAGING_DIR_TARGET}${exec_prefix} \
66 --with-config-file-path=${sysconfdir}/php/apache2-php5 \
67 ${@base_conditional('SITEINFO_ENDIANNESS', 'le', 'ac_cv_c_bigendian_php=no', 'ac_cv_c_bigendian_php=yes', d)} \
53 ${COMMON_EXTRA_OECONF} \ 68 ${COMMON_EXTRA_OECONF} \
54" 69"
55EXTRA_OECONF_virtclass-native = " \ 70EXTRA_OECONF_class-native = " \
56 --with-zlib=${STAGING_LIBDIR_NATIVE}/.. \ 71 --with-zlib=${STAGING_LIBDIR_NATIVE}/.. \
57 --without-iconv \ 72 --without-iconv \
58 ${COMMON_EXTRA_OECONF} \ 73 ${COMMON_EXTRA_OECONF} \
@@ -64,26 +79,54 @@ PACKAGECONFIG_class-native = ""
64PACKAGECONFIG[mysql] = "--with-mysql=${STAGING_DIR_TARGET}${prefix} \ 79PACKAGECONFIG[mysql] = "--with-mysql=${STAGING_DIR_TARGET}${prefix} \
65 --with-mysqli=${STAGING_BINDIR_CROSS}/mysql_config \ 80 --with-mysqli=${STAGING_BINDIR_CROSS}/mysql_config \
66 --with-pdo-mysql=${STAGING_BINDIR_CROSS}/mysql_config \ 81 --with-pdo-mysql=${STAGING_BINDIR_CROSS}/mysql_config \
67 , \ 82 ,--without-mysql --without-mysqli --without-pdo-mysql \
68 ,mysql5" 83 ,mysql5"
69 84
70PACKAGECONFIG[sqlite3] = "--with-sqlite3=${STAGING_LIBDIR}/.. \ 85PACKAGECONFIG[sqlite3] = "--with-sqlite3=${STAGING_LIBDIR}/.. \
71 --with-pdo-sqlite=${STAGING_LIBDIR}/.. \ 86 --with-pdo-sqlite=${STAGING_LIBDIR}/.. \
72 , \ 87 , \
73 ,sqlite3" 88 ,sqlite3"
89PACKAGECONFIG[pgsql] = "--with-pgsql=${STAGING_DIR_TARGET}${exec_prefix},--without-pgsql,postgresql"
90PACKAGECONFIG[soap] = "--enable-libxml --enable-soap, --disable-soap, libxml2"
91PACKAGECONFIG[apache2] = "--with-apxs2=${STAGING_BINDIR_CROSS}/apxs,,apache2-native apache2"
92
74 93
75export PHP_NATIVE_DIR = "${STAGING_BINDIR_NATIVE}" 94export PHP_NATIVE_DIR = "${STAGING_BINDIR_NATIVE}"
76export PHP_PEAR_PHP_BIN = "${STAGING_BINDIR_NATIVE}/php" 95export PHP_PEAR_PHP_BIN = "${STAGING_BINDIR_NATIVE}/php"
77CFLAGS += " -D_GNU_SOURCE" 96CFLAGS += " -D_GNU_SOURCE -g -DPTYS_ARE_GETPT -DPTYS_ARE_SEARCHED -I${STAGING_INCDIR}/apache2"
78 97
79EXTRA_OEMAKE = "INSTALL_ROOT=${D}" 98EXTRA_OEMAKE = "INSTALL_ROOT=${D}"
80 99
81acpaths = "" 100acpaths = ""
82 101
102do_configure_prepend () {
103 rm -f ${S}/build/libtool.m4 ${S}/ltmain.sh ${S}/aclocal.m4
104 find ${S} -name config.m4 | xargs -n1 sed -i 's!APXS_HTTPD=.*!APXS_HTTPD=${STAGING_BINDIR_NATIVE}/httpd!'
105}
106
107do_configure_append() {
108 # No, libtool, we really don't want rpath set...
109 sed -i 's|^hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=""|g' ${HOST_SYS}-libtool
110 sed -i 's|^runpath_var=LD_RUN_PATH|runpath_var=DIE_RPATH_DIE|g' ${HOST_SYS}-libtool
111}
112
83do_install_append_class-native() { 113do_install_append_class-native() {
84 rm -rf ${D}/${libdir}/php/.registry 114 rm -rf ${D}/${PHP_LIBDIR}/php/.registry
85 rm -rf ${D}/${libdir}/php/.channels 115 rm -rf ${D}/${PHP_LIBDIR}/php/.channels
86 rm -rf ${D}/${libdir}/php/.[a-z]* 116 rm -rf ${D}/${PHP_LIBDIR}/php/.[a-z]*
117}
118
119do_install_prepend() {
120 cat aclocal-copy/libtool.m4 aclocal-copy/lt~obsolete.m4 aclocal-copy/ltoptions.m4 \
121 aclocal-copy/ltsugar.m4 aclocal-copy/ltversion.m4 > ${S}/build/libtool.m4
122}
123
124do_install_prepend_class-target() {
125 if ${@bb.utils.contains('PACKAGECONFIG', 'apache2', 'true', 'false', d)}; then
126 # Install dummy config file so apxs doesn't fail
127 install -d ${D}${sysconfdir}/apache2
128 printf "\nLoadModule dummy_module modules/mod_dummy.so\n" > ${D}${sysconfdir}/apache2/httpd.conf
129 fi
87} 130}
88 131
89# fixme 132# fixme
@@ -112,19 +155,47 @@ do_install_append_class-target() {
112 rmdir ${TMP} 155 rmdir ${TMP}
113 TMP=`dirname ${TMP}`; 156 TMP=`dirname ${TMP}`;
114 done 157 done
158
159 if ${@bb.utils.contains('PACKAGECONFIG', 'apache2', 'true', 'false', d)}; then
160 install -d ${D}${libdir}/apache2/modules
161 install -d ${D}${sysconfdir}/apache2/modules.d
162 install -d ${D}${sysconfdir}/php/apache2-php5
163 install -m 755 libs/libphp5.so ${D}${libdir}/apache2/modules
164 install -m 644 ${WORKDIR}/70_mod_php5.conf ${D}${sysconfdir}/apache2/modules.d
165 sed -i s,lib/,${libdir}/, ${D}${sysconfdir}/apache2/modules.d/70_mod_php5.conf
166 cat ${S}/php.ini-production | \
167 sed -e 's,extension_dir = \"\./\",extension_dir = \"/usr/lib/extensions\",' \
168 > ${D}${sysconfdir}/php/apache2-php5/php.ini
169 rm -f ${D}${sysconfdir}/apache2/httpd.conf*
170 fi
115} 171}
116 172
117PACKAGES = "${PN}-dbg ${PN}-cli ${PN}-cgi ${PN}-fpm ${PN}-fpm-apache2 ${PN}-pear ${PN}-dev ${PN}-staticdev ${PN}-doc ${PN}" 173SYSROOT_PREPROCESS_FUNCS += "php_sysroot_preprocess"
174
175php_sysroot_preprocess () {
176 install -d ${SYSROOT_DESTDIR}${bindir_crossscripts}/
177 install -m 755 ${D}${bindir}/phpize ${SYSROOT_DESTDIR}${bindir_crossscripts}/
178 install -m 755 ${D}${bindir}/php-config ${SYSROOT_DESTDIR}${bindir_crossscripts}/
179
180 sed -i 's!eval echo /!eval echo ${STAGING_DIR_HOST}/!' ${SYSROOT_DESTDIR}${bindir_crossscripts}/phpize
181 sed -i 's!^include_dir=.*!include_dir=${STAGING_INCDIR}/php!' ${SYSROOT_DESTDIR}${bindir_crossscripts}/php-config
182}
183
184MODPHP_PACKAGE = "${@bb.utils.contains('PACKAGECONFIG', 'apache2', '${PN}-modphp', '', d)}"
185
186PACKAGES = "${PN}-dbg ${PN}-cli ${PN}-cgi ${PN}-fpm ${PN}-fpm-apache2 ${PN}-pear ${MODPHP_PACKAGE} ${PN}-dev ${PN}-staticdev ${PN}-doc ${PN}"
118 187
119RDEPENDS_${PN}-pear = "${PN}" 188RDEPENDS_${PN}-pear = "${PN}"
120RDEPENDS_${PN}-cli = "${PN}" 189RDEPENDS_${PN}-cli = "${PN}"
190RDEPENDS_${PN}-modphp = "${PN} apache2"
121RDEPENDS_${PN}-dev = "${PN}" 191RDEPENDS_${PN}-dev = "${PN}"
122 192
123INITSCRIPT_PACKAGES = "${PN}-fpm" 193INITSCRIPT_PACKAGES = "${PN}-fpm"
124inherit update-rc.d 194inherit update-rc.d
125 195
126FILES_${PN}-dbg =+ "${bindir}/.debug" 196FILES_${PN}-dbg =+ "${bindir}/.debug \
127FILES_${PN}-doc += "${libdir}/php/doc" 197 ${libdir}/apache2/modules/.debug"
198FILES_${PN}-doc += "${PHP_LIBDIR}/php/doc"
128FILES_${PN}-cli = "${bindir}/php" 199FILES_${PN}-cli = "${bindir}/php"
129FILES_${PN}-cgi = "${bindir}/php-cgi" 200FILES_${PN}-cgi = "${bindir}/php-cgi"
130FILES_${PN}-fpm = "${sbindir}/php-fpm ${sysconfdir}/php-fpm.conf ${datadir}/fpm ${sysconfdir}/init.d/php-fpm" 201FILES_${PN}-fpm = "${sbindir}/php-fpm ${sysconfdir}/php-fpm.conf ${datadir}/fpm ${sysconfdir}/init.d/php-fpm"
@@ -133,19 +204,26 @@ CONFFILES_${PN}-fpm = "${sysconfdir}/php-fpm.conf"
133CONFFILES_${PN}-fpm-apache2 = "${sysconfdir}/apache2/conf.d/php-fpm.conf" 204CONFFILES_${PN}-fpm-apache2 = "${sysconfdir}/apache2/conf.d/php-fpm.conf"
134INITSCRIPT_NAME_${PN}-fpm = "php-fpm" 205INITSCRIPT_NAME_${PN}-fpm = "php-fpm"
135INITSCRIPT_PARAMS_${PN}-fpm = "defaults 60" 206INITSCRIPT_PARAMS_${PN}-fpm = "defaults 60"
136FILES_${PN}-pear = "${bindir}/pear* ${bindir}/pecl ${libdir}/php/PEAR \ 207FILES_${PN}-pear = "${bindir}/pear* ${bindir}/pecl ${PHP_LIBDIR}/php/PEAR \
137 ${libdir}/php/PEAR.php ${libdir}/php/System.php \ 208 ${PHP_LIBDIR}/php/PEAR*.php ${PHP_LIBDIR}/php/System.php \
138 ${libdir}php/peclcmd.php ${libdir}/php/pearcmd.php \ 209 ${PHP_LIBDIR}/php/peclcmd.php ${PHP_LIBDIR}/php/pearcmd.php \
139 ${libdir}/php/.channels ${libdir}/php/.channels/.alias \ 210 ${PHP_LIBDIR}/php/.channels ${PHP_LIBDIR}/php/.channels/.alias \
140 ${libdir}/php/.channels\__uri.reg \ 211 ${PHP_LIBDIR}/php/.registry ${PHP_LIBDIR}/php/Archive/Tar.php \
141 ${libdir}/php/.channels\pear.php.net.reg \ 212 ${PHP_LIBDIR}/php/Console/Getopt.php ${PHP_LIBDIR}/php/OS/Guess.php \
142 ${libdir}/php/.channels/pecl.php.net.reg \ 213 ${PHP_LIBDIR}/php/data/PEAR \
143 ${libdir}/php/.registry ${libdir}/php/Archive/Tar.php \
144 ${libdir}/php/Console/Getopt.php ${libdir}/php/OS/Guess.php \
145 ${sysconfdir}/pear.conf" 214 ${sysconfdir}/pear.conf"
146FILES_${PN}-dev = "${includedir}/php ${libdir}/build ${bindir}/phpize \ 215FILES_${PN}-dev = "${includedir}/php ${PHP_LIBDIR}/build ${bindir}/phpize \
147 ${bindir}/php-config ${libdir}/php/.depdb \ 216 ${bindir}/php-config ${PHP_LIBDIR}/php/.depdb \
148 ${libdir}/php/.depdblock ${libdir}/php/.filemap \ 217 ${PHP_LIBDIR}/php/.depdblock ${PHP_LIBDIR}/php/.filemap \
149 ${libdir}/php/.lock ${libdir}/php/test" 218 ${PHP_LIBDIR}/php/.lock ${PHP_LIBDIR}/php/test"
150FILES_${PN} = "${libdir}/php" 219FILES_${PN} = "${PHP_LIBDIR}/php"
151FILES_${PN} += "${bindir}" 220FILES_${PN} += "${bindir}"
221
222SUMMARY_${PN}-modphp = "PHP module for the Apache HTTP server"
223FILES_${PN}-modphp = "${libdir}/apache2 ${sysconfdir}"
224
225MODPHP_OLDPACKAGE = "${@bb.utils.contains('PACKAGECONFIG', 'apache2', 'modphp', '', d)}"
226RPROVIDES_${PN}-modphp = "${MODPHP_OLDPACKAGE}"
227RREPLACES_${PN}-modphp = "${MODPHP_OLDPACKAGE}"
228RCONFLICTS_${PN}-modphp = "${MODPHP_OLDPACKAGE}"
229