Contents of /branches/R11-unstable/include/php.sminc
Parent Directory | Revision Log
Revision 24893 -
(show annotations)
(download)
Tue Nov 25 02:21:44 2014 UTC (9 years, 11 months ago) by niro
File size: 1861 byte(s)
Tue Nov 25 02:21:44 2014 UTC (9 years, 11 months ago) by niro
File size: 1861 byte(s)
-release R11-unstable
1 | # $Id$ |
2 | |
3 | # default includes |
4 | sminclude mtools |
5 | |
6 | # default extension name if not already given |
7 | : ${PHP_EXTENSION="${PNAME/#php-/}"} |
8 | |
9 | # default config locations |
10 | : ${PHP_CONFIG_DIR="/etc/php"} |
11 | : ${PHP_CONFIG_SCAN_DIR="/etc/php/conf.d"} |
12 | : ${PHP_EXTENSIONS_DIR="/usr/$(mlibdir)/php/extensions"} |
13 | : ${PHP_PEAR_DIR="/usr/share/php/pear"} |
14 | |
15 | # some sane default dependencies |
16 | DEPEND="${DEPEND} |
17 | >= dev-lang/php-5.4" |
18 | |
19 | SDEPEND="${SDEPEND} |
20 | >= sys-dev/m4-1.4 |
21 | >= sys-dev/libtool-1.5" |
22 | |
23 | # default SRCFILE SRCDIR and SRC_URI |
24 | : ${SRCFILE="${PNAME/#php-/}-${PVER}.tar.bz2"} |
25 | : ${SRCDIR="${BUILDDIR}/${PNAME/#php-/}-${PVER}"} |
26 | : ${SRC_URI=( mirror://${PNAME}/${SRCFILE} )} |
27 | |
28 | php_phpize() |
29 | { |
30 | phpize || die |
31 | |
32 | # regen aclocal, libtoolize etc to fix libtool-2 issues |
33 | if [ -f aclocal.m4 ] |
34 | then |
35 | rm aclocal.m4 || die |
36 | fi |
37 | mautoreconf || die |
38 | mlibtoolize || die |
39 | } |
40 | |
41 | php_src_prepare() |
42 | { |
43 | munpack ${SRCFILE} || die |
44 | cd ${SRCDIR} |
45 | |
46 | php_phpize || die |
47 | } |
48 | |
49 | php_src_configure() |
50 | { |
51 | local configure_opts="$@" |
52 | |
53 | mconfigure \ |
54 | --with-php-config=/usr/bin/php-config \ |
55 | ${configure_opts} \ |
56 | || die |
57 | } |
58 | |
59 | php_src_compile() |
60 | { |
61 | cd ${SRCDIR} |
62 | php_src_configure || die |
63 | mmake || die |
64 | } |
65 | |
66 | php_src_check() |
67 | { |
68 | cd ${SRCDIR} |
69 | mmake -k check || die |
70 | } |
71 | |
72 | php_src_install() |
73 | { |
74 | cd ${SRCDIR} |
75 | |
76 | # needed directories |
77 | minstalldir ${PHP_CONFIG_SCAN_DIR} || die |
78 | minstalldir $(php-config --extension-dir) || die |
79 | |
80 | # install extensions and the config ini |
81 | minstallexec modules/${PHP_EXTENSION}.so $(php-config --extension-dir) || die |
82 | local MCONFIG="${PHP_CONFIG_SCAN_DIR}/${PHP_EXTENSION}.ini" |
83 | mclearconfig || die |
84 | maddconfig "extension=${PHP_EXTENSION}.so" || die |
85 | |
86 | # install docs |
87 | local i |
88 | for i in ABOUT-NLS AUTHORS BUGS CHANGES ChangeLog COPYING \ |
89 | FAQ LICENSE NEWS README TODO |
90 | do |
91 | if [ -f ${SRCDIR}/${i} ] |
92 | then |
93 | minstalldocs ${i} || die |
94 | fi |
95 | done |
96 | } |
97 | |
98 | export_inherits php src_prepare src_compile src_check src_install |