diff options
Diffstat (limited to 'meta-oe/recipes-devtools/php/php.inc')
-rw-r--r-- | meta-oe/recipes-devtools/php/php.inc | 133 |
1 files changed, 133 insertions, 0 deletions
diff --git a/meta-oe/recipes-devtools/php/php.inc b/meta-oe/recipes-devtools/php/php.inc new file mode 100644 index 0000000000..d5e53c0e59 --- /dev/null +++ b/meta-oe/recipes-devtools/php/php.inc | |||
@@ -0,0 +1,133 @@ | |||
1 | DESCRIPTION = "A server-side, HTML-embedded scripting language. This package provides the CGI." | ||
2 | HOMEPAGE = "http://www.php.net" | ||
3 | SECTION = "console/network" | ||
4 | LICENSE = "PHP-3.0" | ||
5 | BBCLASSEXTEND = "native" | ||
6 | DEPENDS = "zlib libxml2 virtual/libiconv php-native lemon-native \ | ||
7 | libc-client openssl" | ||
8 | DEPENDS_virtclass-native = "zlib-native libxml2-native" | ||
9 | |||
10 | INC_PR = "r5" | ||
11 | |||
12 | # The new PHP downloads server groups PHP releases by major version so find | ||
13 | # the major version of the PHP recipe. | ||
14 | PHP_MAJVER = "${@d.getVar('PV',1).split('.')[0]}" | ||
15 | |||
16 | SRC_URI = "http://museum.php.net/php${PHP_MAJVER}/php-${PV}.tar.bz2" | ||
17 | |||
18 | S = "${WORKDIR}/php-${PV}" | ||
19 | |||
20 | inherit autotools pkgconfig pythonnative gettext | ||
21 | |||
22 | SSTATE_SCAN_FILES += "build-defs.h" | ||
23 | |||
24 | # Common EXTRA_OECONF | ||
25 | COMMON_EXTRA_OECONF = "--enable-sockets --enable-pcntl --enable-shared" | ||
26 | EXTRA_OECONF = "--enable-mbstring \ | ||
27 | --enable-wddx \ | ||
28 | --enable-fpm \ | ||
29 | --with-imap=${STAGING_DIR_HOST} \ | ||
30 | --with-gettext=${STAGING_LIBDIR}/.. \ | ||
31 | --with-imap-ssl=${STAGING_DIR_HOST} \ | ||
32 | --with-zlib=${STAGING_LIBDIR}/.. \ | ||
33 | --with-iconv=${STAGING_LIBDIR}/.. \ | ||
34 | --with-libxml-dir=${STAGING_BINDIR_CROSS} \ | ||
35 | ${COMMON_EXTRA_OECONF} \ | ||
36 | " | ||
37 | EXTRA_OECONF_virtclass-native = " \ | ||
38 | --with-zlib=${STAGING_LIBDIR_NATIVE}/.. \ | ||
39 | --with-libxml-dir=${STAGING_BINDIR_NATIVE} \ | ||
40 | ${COMMON_EXTRA_OECONF} \ | ||
41 | " | ||
42 | |||
43 | PACKAGECONFIG ??= "mysql sqlite3" | ||
44 | PACKAGECONFIG_class-native = "" | ||
45 | |||
46 | PACKAGECONFIG[mysql] = "--with-mysql=${STAGING_DIR_TARGET}${prefix} \ | ||
47 | --with-mysqli=${STAGING_BINDIR_CROSS}/mysql_config \ | ||
48 | --with-pdo-mysql=${STAGING_BINDIR_CROSS}/mysql_config \ | ||
49 | , \ | ||
50 | ,mysql5" | ||
51 | |||
52 | PACKAGECONFIG[sqlite3] = "--with-sqlite3=${STAGING_LIBDIR}/.. \ | ||
53 | --with-pdo-sqlite=${STAGING_LIBDIR}/.. \ | ||
54 | , \ | ||
55 | ,sqlite3" | ||
56 | |||
57 | export PHP_NATIVE_DIR = "${STAGING_BINDIR_NATIVE}" | ||
58 | export PHP_PEAR_PHP_BIN = "${STAGING_BINDIR_NATIVE}/php" | ||
59 | CFLAGS += " -D_GNU_SOURCE" | ||
60 | |||
61 | EXTRA_OEMAKE = "INSTALL_ROOT=${D}" | ||
62 | |||
63 | acpaths = "" | ||
64 | |||
65 | do_install_append_pn-php-native() { | ||
66 | rm -rf ${D}/${libdir}/php/.registry | ||
67 | rm -rf ${D}/${libdir}/php/.channels | ||
68 | rm -rf ${D}/${libdir}/php/.[a-z]* | ||
69 | } | ||
70 | |||
71 | # fixme | ||
72 | do_install_append_pn-php() { | ||
73 | install -d ${D}/${sysconfdir}/ | ||
74 | if [ -d ${D}/${STAGING_DIR_NATIVE}/${sysconfdir} ];then | ||
75 | mv ${D}/${STAGING_DIR_NATIVE}/${sysconfdir}/* ${D}/${sysconfdir}/ | ||
76 | fi | ||
77 | rm -rf ${D}/${TMPDIR} | ||
78 | rm -rf ${D}/.registry | ||
79 | rm -rf ${D}/.channels | ||
80 | rm -rf ${D}/.[a-z]* | ||
81 | rm -rf ${D}/var | ||
82 | rm -f ${D}/${sysconfdir}/php-fpm.conf.default | ||
83 | sed -i 's:${STAGING_DIR_NATIVE}::g' ${D}/${sysconfdir}/pear.conf | ||
84 | install -m 0644 ${WORKDIR}/php-fpm.conf ${D}/${sysconfdir}/php-fpm.conf | ||
85 | install -d ${D}/${sysconfdir}/apache2/conf.d | ||
86 | install -m 0644 ${WORKDIR}/php-fpm-apache.conf ${D}/${sysconfdir}/apache2/conf.d/php-fpm.conf | ||
87 | install -d ${D}${sysconfdir}/init.d | ||
88 | sed -i 's:=/usr/sbin:=${sbindir}:g' ${S}/sapi/fpm/init.d.php-fpm | ||
89 | sed -i 's:=/etc:=${sysconfdir}:g' ${S}/sapi/fpm/init.d.php-fpm | ||
90 | sed -i 's:=/var:=${localstatedir}:g' ${S}/sapi/fpm/init.d.php-fpm | ||
91 | install -m 0755 ${S}/sapi/fpm/init.d.php-fpm ${D}${sysconfdir}/init.d/php-fpm | ||
92 | TMP=`dirname ${D}/${TMPDIR}` | ||
93 | while test ${TMP} != ${D}; do | ||
94 | rmdir ${TMP} | ||
95 | TMP=`dirname ${TMP}`; | ||
96 | done | ||
97 | } | ||
98 | |||
99 | PACKAGES = "${PN}-dbg ${PN}-cli ${PN}-cgi ${PN}-fpm ${PN}-fpm-apache2 ${PN}-pear ${PN}-dev ${PN}-staticdev ${PN}-doc ${PN}" | ||
100 | |||
101 | RDEPENDS_${PN}-pear = "${PN}" | ||
102 | RDEPENDS_${PN}-cli = "${PN}" | ||
103 | RDEPENDS_${PN}-dev = "${PN}" | ||
104 | |||
105 | INITSCRIPT_PACKAGES = "${PN}-fpm" | ||
106 | inherit update-rc.d | ||
107 | |||
108 | FILES_${PN}-dbg =+ "${bindir}/.debug" | ||
109 | FILES_${PN}-doc += "${libdir}/php/doc" | ||
110 | FILES_${PN}-cli = "${bindir}/php" | ||
111 | FILES_${PN}-cgi = "${bindir}/php-cgi" | ||
112 | FILES_${PN}-fpm = "${sbindir}/php-fpm ${sysconfdir}/php-fpm.conf ${datadir}/fpm ${sysconfdir}/init.d/php-fpm" | ||
113 | FILES_${PN}-fpm-apache2 = "${sysconfdir}/apache2/conf.d/php-fpm.conf" | ||
114 | CONFFILES_${PN}-fpm = "${sysconfdir}/php-fpm.conf" | ||
115 | CONFFILES_${PN}-fpm-apache2 = "${sysconfdir}/apache2/conf.d/php-fpm.conf" | ||
116 | INITSCRIPT_NAME_${PN}-fpm = "php-fpm" | ||
117 | INITSCRIPT_PARAMS_${PN}-fpm = "defaults 60" | ||
118 | FILES_${PN}-pear = "${bindir}/pear* ${bindir}/pecl ${libdir}/php/PEAR \ | ||
119 | ${libdir}/php/PEAR.php ${libdir}/php/System.php \ | ||
120 | ${libdir}php/peclcmd.php ${libdir}/php/pearcmd.php \ | ||
121 | ${libdir}/php/.channels ${libdir}/php/.channels/.alias \ | ||
122 | ${libdir}/php/.channels\__uri.reg \ | ||
123 | ${libdir}/php/.channels\pear.php.net.reg \ | ||
124 | ${libdir}/php/.channels/pecl.php.net.reg \ | ||
125 | ${libdir}/php/.registry ${libdir}/php/Archive/Tar.php \ | ||
126 | ${libdir}/php/Console/Getopt.php ${libdir}/php/OS/Guess.php \ | ||
127 | ${sysconfdir}/pear.conf" | ||
128 | FILES_${PN}-dev = "${includedir}/php ${libdir}/build ${bindir}/phpize \ | ||
129 | ${bindir}/php-config ${libdir}/php/.depdb \ | ||
130 | ${libdir}/php/.depdblock ${libdir}/php/.filemap \ | ||
131 | ${libdir}/php/.lock ${libdir}/php/test" | ||
132 | FILES_${PN} = "${libdir}/php" | ||
133 | FILES_${PN} += "${bindir}" | ||