Magellan Linux

Annotation of /smage/branches/alx07x-stable/include/php.sminc

Parent Directory Parent Directory | Revision Log Revision Log


Revision 10124 - (hide annotations) (download)
Thu Aug 3 14:58:15 2017 UTC (6 years, 9 months ago) by niro
File size: 1939 byte(s)
-release branches/alx07x-stable
1 niro 7082 # $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 niro 10124 # but do not include on the php pkg itself
17     if [[ ${PNAME} != php ]]
18     then
19     DEPEND="${DEPEND}
20     >= dev-lang/php-5.4"
21     fi
22 niro 7082
23     SDEPEND="${SDEPEND}
24     >= sys-dev/m4-1.4
25     >= sys-dev/libtool-1.5"
26    
27     # default SRCFILE SRCDIR and SRC_URI
28     : ${SRCFILE="${PNAME/#php-/}-${PVER}.tar.bz2"}
29     : ${SRCDIR="${BUILDDIR}/${PNAME/#php-/}-${PVER}"}
30     : ${SRC_URI=( mirror://${PNAME}/${SRCFILE} )}
31    
32     php_phpize()
33     {
34     phpize || die
35    
36     # regen aclocal, libtoolize etc to fix libtool-2 issues
37     if [ -f aclocal.m4 ]
38     then
39     rm aclocal.m4 || die
40     fi
41     mautoreconf || die
42     mlibtoolize || die
43     }
44    
45     php_src_prepare()
46     {
47     munpack ${SRCFILE} || die
48     cd ${SRCDIR}
49    
50     php_phpize || die
51     }
52    
53     php_src_configure()
54     {
55     local configure_opts="$@"
56    
57     mconfigure \
58     --with-php-config=/usr/bin/php-config \
59     ${configure_opts} \
60     || die
61     }
62    
63     php_src_compile()
64     {
65     cd ${SRCDIR}
66     php_src_configure || die
67     mmake || die
68     }
69    
70     php_src_check()
71     {
72     cd ${SRCDIR}
73     mmake -k check || die
74     }
75    
76     php_src_install()
77     {
78     cd ${SRCDIR}
79    
80     # needed directories
81     minstalldir ${PHP_CONFIG_SCAN_DIR} || die
82     minstalldir $(php-config --extension-dir) || die
83    
84     # install extensions and the config ini
85     minstallexec modules/${PHP_EXTENSION}.so $(php-config --extension-dir) || die
86     local MCONFIG="${PHP_CONFIG_SCAN_DIR}/${PHP_EXTENSION}.ini"
87     mclearconfig || die
88     maddconfig "extension=${PHP_EXTENSION}.so" || die
89    
90     # install docs
91     local i
92     for i in ABOUT-NLS AUTHORS BUGS CHANGES ChangeLog COPYING \
93     FAQ LICENSE NEWS README TODO
94     do
95     if [ -f ${SRCDIR}/${i} ]
96     then
97     minstalldocs ${i} || die
98     fi
99     done
100     }
101    
102     export_inherits php src_prepare src_compile src_check src_install