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.inc90
1 files changed, 90 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..82b5ce1a6
--- /dev/null
+++ b/meta-webserver/recipes-php/modphp/modphp5.inc
@@ -0,0 +1,90 @@
1SECTION = "console/network"
2DESCRIPTION = "A server-side, HTML-embedded scripting language. This package provides the apache php module."
3LICENSE = "PHP"
4DEPENDS = "apache2-native apache2 zlib"
5
6SRC_URI = "http://www.php.net/distributions/php-${PV}.tar.bz2 \
7 file://configure.patch \
8 file://pthread-check.patch \
9 file://70_mod_php5.conf \
10 "
11
12S = "${WORKDIR}/php-${PV}"
13
14LIC_FILES_CHKSUM = "file://LICENSE;md5=cb564efdf78cce8ea6e4b5a4f7c05d97"
15
16inherit autotools
17
18CFLAGS += " -g -DPTYS_ARE_GETPT -DPTYS_ARE_SEARCHED -I${STAGING_INCDIR}/apache2"
19
20EXTRA_OECONF = "--with-apxs2=${STAGING_BINDIR_CROSS}/apxs \
21 --enable-maintainer-zts \
22 --without-mysql \
23 --enable-force-cgi-redirect \
24 --disable-cgi \
25 --disable-cli \
26 --disable-pdo \
27 --without-pear \
28 --without-iconv \
29 --disable-ipv6 \
30 --disable-xml \
31 --disable-xmlreader \
32 --disable-xmlwriter \
33 --disable-simplexml \
34 --disable-libxml \
35 --disable-dom \
36 --disable-rpath \
37 --libdir=${libdir}/php5 \
38 --with-zlib --with-zlib-dir=${STAGING_DIR_TARGET}${exec_prefix} \
39 --with-config-file-path=${sysconfdir}/php/apache2-php5"
40
41# to get postgres support, add it to the DEPENDS above
42# and uncomment this line. similar for mysql
43#EXTRA_OECONF += " --with-pgsql=${STAGING_DIR_HOST}${layout_exec_prefix}"
44
45acpaths = ""
46
47#
48# override the autotools do_configure, which runs autoconf,
49# which breaks everything...
50#
51do_configure() {
52 find . -name config.m4 -o -name configure | xargs -n1 sed -i 's!APXS_HTTPD=.*!APXS_HTTPD=${STAGING_BINDIR_NATIVE}/httpd!'
53 export PHP_LIBXML_DIR=${STAGING_DIR_NATIVE}${layout_exec_prefix}
54 oe_runconf
55}
56
57do_install () {
58 install -d ${D}${libdir}/apache2/modules
59 install -d ${D}${sysconfdir}/apache2/modules.d
60 install -d ${D}${sysconfdir}/php/apache2-php5
61 install -m 755 libs/libphp5.so ${D}${libdir}/apache2/modules
62 install -m 644 ${WORKDIR}/70_mod_php5.conf ${D}${sysconfdir}/apache2/modules.d
63 cat ${S}/php.ini-dist | \
64 sed -e 's,extension_dir = \"\./\",extension_dir = \"/usr/lib/extensions\",' \
65 > ${D}${sysconfdir}/php/apache2-php5/php.ini
66
67 install -d ${D}${bindir}
68 install -m 755 scripts/phpize ${D}${bindir}
69 install -m 755 scripts/php-config ${D}${bindir}
70
71 oe_runmake install-build install-headers INSTALL_ROOT=${D}
72}
73
74SYSROOT_PREPROCESS_FUNCS += "php_sysroot_preprocess"
75
76php_sysroot_preprocess () {
77 install -d ${SYSROOT_DESTDIR}${bindir_crossscripts}/
78 install -m 755 ${D}${bindir}/phpize ${SYSROOT_DESTDIR}${bindir_crossscripts}/
79 install -m 755 ${D}${bindir}/php-config ${SYSROOT_DESTDIR}${bindir_crossscripts}/
80
81 sed -i 's!eval echo /!eval echo ${STAGING_DIR_HOST}/!' ${SYSROOT_DESTDIR}${bindir_crossscripts}/phpize
82 sed -i 's!^include_dir=.*!include_dir=${STAGING_INCDIR}/php!' ${SYSROOT_DESTDIR}${bindir_crossscripts}/php-config
83}
84
85RDEPENDS_${PN} = "apache2"
86
87FILES_${PN} = "${libdir}/apache2 ${sysconfdir}"
88FILES_${PN}-dev += "${bindir}/phpize ${bindir}/php-config ${libdir}/php5"
89FILES_${PN}-dbg += "${libdir}/apache2/modules/.debug"
90