1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/apache-php/apache-php.spec Thu Aug 09 19:06:57 2012 +0200 1.3 @@ -0,0 +1,552 @@ 1.4 +## 1.5 +## apache-php.spec -- OpenPKG RPM Package Specification 1.6 +## Copyright (c) 2000-2012 OpenPKG Foundation e.V. <http://openpkg.net/> 1.7 +## 1.8 +## Permission to use, copy, modify, and distribute this software for 1.9 +## any purpose with or without fee is hereby granted, provided that 1.10 +## the above copyright notice and this permission notice appear in all 1.11 +## copies. 1.12 +## 1.13 +## THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED 1.14 +## WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 1.15 +## MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 1.16 +## IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR 1.17 +## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 1.18 +## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 1.19 +## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF 1.20 +## USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 1.21 +## ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 1.22 +## OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT 1.23 +## OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 1.24 +## SUCH DAMAGE. 1.25 +## 1.26 + 1.27 +# package information 1.28 +Name: apache-php 1.29 +Summary: Apache Extension: PHP Scripting Language 1.30 +URL: http://www.php.net/ 1.31 +Vendor: The PHP Project 1.32 +Packager: OpenPKG Foundation e.V. 1.33 +Distribution: OpenPKG Community 1.34 +Class: BASE 1.35 +Group: Web 1.36 +License: PHP 1.37 +Version: 5.4.5 1.38 +Release: 20120723 1.39 + 1.40 +# package options 1.41 +%option with_bc no 1.42 +%option with_bdb no 1.43 +%option with_bzip2 no 1.44 +%option with_calendar no 1.45 +%option with_ctype no 1.46 +%option with_curl no 1.47 +%option with_debug no 1.48 +%option with_dom no 1.49 +%option with_exif no 1.50 +%option with_freetype no 1.51 +%option with_ftp no 1.52 +%option with_gd no 1.53 +%option with_gdbm no 1.54 +%option with_gettext no 1.55 +%option with_iconv no 1.56 +%option with_imap no 1.57 +%option with_json no 1.58 +%option with_tokenizer no 1.59 +%option with_mbregex no 1.60 +%option with_mbstring no 1.61 +%option with_mcrypt no 1.62 +%option with_mhash no 1.63 +%option with_mm no 1.64 +%option with_mysql no 1.65 +%option with_mysqlnd no 1.66 +%option with_oci8 no 1.67 +%option with_odbc no 1.68 +%option with_openldap no 1.69 +%option with_openldapsasl no 1.70 +%option with_pear no 1.71 +%option with_pgsql no 1.72 +%option with_posix no 1.73 +%option with_sendmail no 1.74 +%option with_session no 1.75 +%option with_simplexml no 1.76 +%option with_snmp no 1.77 +%option with_soap no 1.78 +%option with_sqlite no 1.79 +%option with_ssl no 1.80 +%option with_tidy no 1.81 +%option with_versioning no 1.82 +%option with_wddx no 1.83 +%option with_xml no 1.84 +%option with_xslt no 1.85 +%option with_zlib no 1.86 +%option with_zip no 1.87 + 1.88 +# fixing implicit extension dependencies and correlations 1.89 +%if "%{with_mm}" == "yes" 1.90 +%undefine with_session 1.91 +%define with_session yes 1.92 +%endif 1.93 +%if "%{with_pear}" == "yes" 1.94 +%undefine with_xml 1.95 +%define with_xml yes 1.96 +%endif 1.97 +%if "%{with_freetype}" == "yes" 1.98 +%undefine with_gd 1.99 +%define with_gd yes 1.100 +%endif 1.101 +%if "%{with_mysql}" == "yes" || "%{with_gd}" == "yes" || "%{with_dom}" == "yes" || "%{with_zip}" == "yes" 1.102 +%undefine with_zlib 1.103 +%define with_zlib yes 1.104 +%endif 1.105 +%if "%{with_xslt}" == "yes" 1.106 +%undefine with_dom 1.107 +%define with_dom yes 1.108 +%endif 1.109 +%if "%{with_dom}" == "yes" 1.110 +%undefine with_xml 1.111 +%define with_xml yes 1.112 +%endif 1.113 +%if "%{with_soap}" == "yes" 1.114 +%undefine with_xml 1.115 +%define with_xml yes 1.116 +%endif 1.117 +%if "%{with_pgsql}" == "yes" 1.118 +%undefine with_ssl 1.119 +%define with_ssl yes 1.120 +%endif 1.121 + 1.122 +# list of sources 1.123 +Source0: http://static.php.net/www.php.net/distributions/php-%{version}.tar.bz2 1.124 +Source1: apache-php.ini 1.125 +Source2: apache-php.conf 1.126 +Patch0: apache-php.patch 1.127 + 1.128 +# build information 1.129 +BuildPreReq: OpenPKG, openpkg >= 20120101, gcc, flex, bison 1.130 +PreReq: OpenPKG, openpkg >= 20120101 1.131 +BuildPreReq: apache 1.132 +PreReq: apache 1.133 +BuildPreReq: pcre 1.134 +PreReq: pcre 1.135 +%if "%{with_sqlite}" == "yes" 1.136 +BuildPreReq: sqlite 1.137 +PreReq: sqlite 1.138 +%endif 1.139 +%if "%{with_mysql}" == "yes" 1.140 +BuildPreReq: mysql 1.141 +PreReq: mysql 1.142 +%endif 1.143 +%if "%{with_pgsql}" == "yes" 1.144 +BuildPreReq: postgresql 1.145 +PreReq: postgresql 1.146 +%endif 1.147 +%if "%{with_gd}" == "yes" 1.148 +BuildPreReq: gd >= 2.0.20, jpeg, png 1.149 +PreReq: gd >= 2.0.20, jpeg, png 1.150 +%endif 1.151 +%if "%{with_bdb}" == "yes" 1.152 +BuildPreReq: db 1.153 +PreReq: db 1.154 +%endif 1.155 +%if "%{with_zlib}" == "yes" 1.156 +BuildPreReq: zlib 1.157 +PreReq: zlib 1.158 +%endif 1.159 +%if "%{with_bzip2}" == "yes" 1.160 +BuildPreReq: bzip2 1.161 +PreReq: bzip2 1.162 +%endif 1.163 +%if "%{with_ssl}" == "yes" 1.164 +BuildPreReq: openssl 1.165 +PreReq: openssl 1.166 +%endif 1.167 +%if "%{with_openldap}" == "yes" 1.168 +BuildPreReq: openldap 1.169 +PreReq: openldap 1.170 +%if "%{with_openldapsasl}" == "yes" 1.171 +BuildPreReq: openldap::with_sasl = yes 1.172 +PreReq: openldap::with_sasl = yes 1.173 +%else 1.174 +BuildPreReq: openldap::with_sasl = no 1.175 +PreReq: openldap::with_sasl = no 1.176 +%endif 1.177 +%endif 1.178 +%if "%{with_mm}" == "yes" 1.179 +BuildPreReq: mm 1.180 +PreReq: mm 1.181 +%endif 1.182 +%if "%{with_freetype}" == "yes" 1.183 +BuildPreReq: freetype 1.184 +PreReq: freetype 1.185 +%endif 1.186 +%if "%{with_gettext}" == "yes" 1.187 +BuildPreReq: gettext, libiconv 1.188 +PreReq: gettext, libiconv 1.189 +%endif 1.190 +%if "%{with_iconv}" == "yes" 1.191 +BuildPreReq: libiconv 1.192 +PreReq: libiconv 1.193 +%endif 1.194 +%if "%{with_imap}" == "yes" 1.195 +BuildPreReq: imap, openssl 1.196 +PreReq: imap, openssl 1.197 +%endif 1.198 +%if "%{with_xml}" == "yes" 1.199 +BuildPreReq: libxml 1.200 +PreReq: libxml 1.201 +%endif 1.202 +%if "%{with_xslt}" == "yes" 1.203 +BuildPreReq: libxslt 1.204 +PreReq: libxslt 1.205 +%endif 1.206 +%if "%{with_dom}" == "yes" 1.207 +BuildPreReq: libxml, libxslt 1.208 +PreReq: libxml, libxslt 1.209 +%endif 1.210 +%if "%{with_curl}" == "yes" 1.211 +BuildPreReq: curl 1.212 +PreReq: curl 1.213 +%endif 1.214 +%if "%{with_mhash}" == "yes" 1.215 +BuildPreReq: mhash 1.216 +PreReq: mhash 1.217 +%endif 1.218 +%if "%{with_mcrypt}" == "yes" 1.219 +BuildPreReq: libmcrypt 1.220 +PreReq: libmcrypt 1.221 +%endif 1.222 +%if "%{with_gdbm}" == "yes" 1.223 +BuildPreReq: gdbm, gdbm::with_ndbm = yes 1.224 +PreReq: gdbm, gdbm::with_ndbm = yes 1.225 +%endif 1.226 +%if "%{with_oci8}" == "yes" 1.227 +BuildPreReq: oracle 1.228 +PreReq: oracle 1.229 +%endif 1.230 +%if "%{with_snmp}" == "yes" 1.231 +BuildPreReq: snmp 1.232 +PreReq: snmp 1.233 +%endif 1.234 +%if "%{with_odbc}" == "yes" 1.235 +BuildPreReq: unixodbc 1.236 +PreReq: unixodbc 1.237 +%endif 1.238 +%if "%{with_sendmail}" == "yes" 1.239 +BuildPreReq: MTA 1.240 +PreReq: MTA 1.241 +%endif 1.242 +%if "%{with_simplexml}" == "yes" 1.243 +BuildPreReq: libxml 1.244 +PreReq: libxml 1.245 +%endif 1.246 +%if "%{with_tidy}" == "yes" 1.247 +BuildPreReq: tidy 1.248 +PreReq: tidy 1.249 +%endif 1.250 + 1.251 +%description 1.252 + PHP is an HTML-embedded scripting language. Much of its syntax is 1.253 + borrowed from C, Java and Perl with a couple of unique PHP-specific 1.254 + features thrown in. The goal of the language is to allow web 1.255 + developers to write dynamically generated pages quickly. 1.256 + 1.257 + This package provides a Dynamic Shared Object (DSO) for the Apache 1.258 + HTTP 2.2 web server. In general speaking, this module is also known 1.259 + as mod_php. 1.260 + 1.261 +%track 1.262 + prog apache-php = { 1.263 + version = %{version} 1.264 + url = http://www.php.net/downloads.php 1.265 + regex = php-(5\.\d+\.\d+)\.tar\.(bz2|gz) 1.266 + } 1.267 + 1.268 +%prep 1.269 + %setup -q -n php-%{version} 1.270 + %{l_shtool} subst \ 1.271 + -e 's;-i -a -n php5;-i -n php5;' \ 1.272 + configure 1.273 + %{l_shtool} subst \ 1.274 + -e 's;\(/include\)/freetype2;\1;' \ 1.275 + configure \ 1.276 + ext/gd/config.m4 1.277 + %patch -p0 1.278 + 1.279 +%build 1.280 + # configure package 1.281 + case "%{l_platform -t}" in 1.282 + *-sunos5.10 ) cflags="%{l_cflags}" ;; 1.283 + * ) cflags="%{l_cflags -O}" ;; 1.284 + esac 1.285 + cppflags="%{l_cppflags}" 1.286 + ldflags="%{l_ldflags}" 1.287 + libs="" 1.288 +%if "%{with_gdbm}" == "yes" 1.289 + libs="$libs -lndbm -lgdbm" 1.290 +%endif 1.291 +%if "%{with_gd}" == "yes" 1.292 + libs="$libs -lpng -lz" 1.293 +%endif 1.294 +%if "%{with_gettext}" == "yes" 1.295 + libs="$libs -liconv" 1.296 +%endif 1.297 +%if "%{with_openldap}" == "yes" && "%{with_openldapsasl}" == "yes" 1.298 + libs="$libs -lsasl2" 1.299 +%endif 1.300 +%if "%{with_imap}" == "yes" 1.301 + libs="$libs -lssl -lcrypto" 1.302 +%endif 1.303 +%if "%{with_bdb}" == "yes" 1.304 + libs="$libs -ldb" 1.305 +%endif 1.306 +%if "%{with_pgsql}" == "yes" 1.307 + libs="$libs `pg_config --libs`" 1.308 +%endif 1.309 +%if "%{with_oci8}" == "yes" 1.310 + ORACLE_HOME="`%{l_rc} --query oracle_home`" 1.311 + export ORACLE_HOME 1.312 +%endif 1.313 + CC="%{l_cc}" \ 1.314 + CFLAGS="$cflags" \ 1.315 + CPPFLAGS="$cppflags" \ 1.316 + LDFLAGS="$ldflags" \ 1.317 + LIBS="$libs" \ 1.318 +%if "%{with_sendmail}" == "yes" 1.319 + PROG_SENDMAIL="%{l_prefix}/sbin/sendmail" \ 1.320 +%else 1.321 + PROG_SENDMAIL="`%{l_shtool} path false`" \ 1.322 +%endif 1.323 + ./configure \ 1.324 + --prefix=%{l_prefix} \ 1.325 + --sysconfdir=%{l_prefix}/etc/apache \ 1.326 + --with-config-file-path=%{l_prefix}/etc/apache \ 1.327 + --libdir=%{l_prefix}/lib/php \ 1.328 + --disable-all \ 1.329 + --enable-pdo \ 1.330 + --enable-filter \ 1.331 + --with-pcre-regex=%{l_prefix} \ 1.332 +%if "%{with_calendar}" == "yes" 1.333 + --enable-calendar \ 1.334 +%endif 1.335 +%if "%{with_sqlite}" == "yes" 1.336 + --with-sqlite3=%{l_prefix} \ 1.337 + --with-pdo-sqlite=%{l_prefix} \ 1.338 +%else 1.339 + --without-pdo-sqlite \ 1.340 +%endif 1.341 +%if "%{with_mysql}" == "yes" || "%{with_mysqlnd}" == "yes" 1.342 +%if "%{with_mysqlnd}" == "yes" 1.343 + --with-mysql=mysqlnd \ 1.344 + --with-pdo-mysql=mysqlnd \ 1.345 +%else 1.346 + --with-mysql=%{l_prefix} \ 1.347 + --with-pdo-mysql=%{l_prefix} \ 1.348 +%endif 1.349 + --with-mysqli=mysqlnd \ 1.350 + --with-mysql-sock=%{l_prefix}/var/mysql/mysql.sock \ 1.351 +%else 1.352 + --without-mysql \ 1.353 + --without-pdo-mysql \ 1.354 +%endif 1.355 +%if "%{with_pgsql}" == "yes" 1.356 + --with-pgsql=%{l_prefix} \ 1.357 + --with-pdo-pgsql=%{l_prefix} \ 1.358 +%else 1.359 + --without-pgsql \ 1.360 +%endif 1.361 +%if "%{with_posix}" == "yes" 1.362 + --enable-posix \ 1.363 +%endif 1.364 +%if "%{with_gd}" == "yes" 1.365 + --with-gd=yes \ 1.366 + --with-jpeg-dir=%{l_prefix} \ 1.367 + --with-png-dir=%{l_prefix} \ 1.368 +%endif 1.369 +%if "%{with_freetype}" == "yes" 1.370 + --enable-gd-native-ttf \ 1.371 + --with-freetype-dir=%{l_prefix} \ 1.372 +%endif 1.373 +%if "%{with_bdb}" == "yes" 1.374 + --with-db4=%{l_prefix} \ 1.375 +%endif 1.376 +%if "%{with_debug}" == "yes" 1.377 + --enable-debug \ 1.378 +%else 1.379 + --disable-debug \ 1.380 +%endif 1.381 +%if "%{with_zlib}" == "yes" 1.382 + --with-zlib=%{l_prefix} \ 1.383 + --with-zlib-dir=%{l_prefix} \ 1.384 +%endif 1.385 +%if "%{with_bzip2}" == "yes" 1.386 + --with-bz2=%{l_prefix} \ 1.387 +%endif 1.388 +%if "%{with_ssl}" == "yes" || "%{with_openldap}" == "yes" 1.389 + --with-openssl=%{l_prefix} \ 1.390 +%endif 1.391 +%if "%{with_openldap}" == "yes" 1.392 + --with-ldap=%{l_prefix} \ 1.393 +%endif 1.394 +%if "%{with_session}" == "yes" 1.395 + --enable-session \ 1.396 +%endif 1.397 +%if "%{with_mm}" == "yes" 1.398 + --with-mm=%{l_prefix} \ 1.399 +%endif 1.400 +%if "%{with_ftp}" == "yes" 1.401 + --enable-ftp \ 1.402 +%endif 1.403 +%if "%{with_oci8}" == "yes" 1.404 + --with-oci8 \ 1.405 +%endif 1.406 +%if "%{with_gettext}" == "yes" 1.407 + --with-gettext=%{l_prefix} \ 1.408 +%endif 1.409 +%if "%{with_imap}" == "yes" 1.410 + --with-imap=%{l_prefix} \ 1.411 + --with-imap-ssl=%{l_prefix} \ 1.412 +%endif 1.413 +%if "%{with_json}" == "yes" 1.414 + --enable-json \ 1.415 +%else 1.416 + --disable-json \ 1.417 +%endif 1.418 +%if "%{with_tokenizer}" == "yes" 1.419 + --enable-tokenizer \ 1.420 +%else 1.421 + --disable-tokenizer \ 1.422 +%endif 1.423 +%if "%{with_xml}" == "yes" 1.424 + --enable-xml \ 1.425 + --enable-xmlreader \ 1.426 + --enable-libxml \ 1.427 + --with-libxml-dir=%{l_prefix} \ 1.428 +%else 1.429 + --disable-xml \ 1.430 +%endif 1.431 +%if "%{with_xslt}" == "yes" 1.432 + --with-xsl=%{l_prefix} \ 1.433 +%else 1.434 + --without-xsl \ 1.435 +%endif 1.436 +%if "%{with_dom}" == "yes" 1.437 + --enable-dom \ 1.438 +%else 1.439 + --disable-dom \ 1.440 +%endif 1.441 +%if "%{with_wddx}" == "yes" 1.442 + --enable-wddx \ 1.443 +%endif 1.444 +%if "%{with_soap}" == "yes" 1.445 + --enable-soap \ 1.446 +%endif 1.447 +%if "%{with_bc}" == "yes" 1.448 + --enable-bcmath \ 1.449 +%endif 1.450 +%if "%{with_mhash}" == "yes" 1.451 + --with-mhash=%{l_prefix} \ 1.452 +%endif 1.453 +%if "%{with_mcrypt}" == "yes" 1.454 + --with-mcrypt=%{l_prefix} \ 1.455 +%endif 1.456 +%if "%{with_ctype}" == "yes" 1.457 + --enable-ctype \ 1.458 +%endif 1.459 +%if "%{with_curl}" == "yes" 1.460 + --with-curl=%{l_prefix} \ 1.461 +%endif 1.462 +%if "%{with_gdbm}" == "yes" 1.463 + --with-gdbm=%{l_prefix} \ 1.464 +%endif 1.465 +%if "%{with_versioning}" == "yes" 1.466 + --enable-versioning \ 1.467 +%endif 1.468 +%if "%{with_pear}" == "yes" 1.469 + --with-pear=%{l_prefix}/lib/php \ 1.470 +%else 1.471 + --without-pear \ 1.472 +%endif 1.473 +%if "%{with_simplexml}" == "yes" 1.474 + --enable-simplexml \ 1.475 + --enable-libxml \ 1.476 + --with-libxml-dir=%{l_prefix} \ 1.477 +%else 1.478 + --disable-simplexml \ 1.479 +%endif 1.480 +%if "%{with_snmp}" == "yes" 1.481 + --with-snmp=%{l_prefix} \ 1.482 + --with-openssl-dir=%{l_prefix} \ 1.483 +%endif 1.484 +%if "%{with_odbc}" == "yes" 1.485 + --with-unixODBC=%{l_prefix} \ 1.486 + --with-pdo-odbc=unixODBC,%{l_prefix} \ 1.487 +%endif 1.488 +%if "%{with_mbregex}" == "yes" 1.489 + --enable-mbregex \ 1.490 +%endif 1.491 +%if "%{with_mbstring}" == "yes" 1.492 + --enable-mbstring \ 1.493 +%endif 1.494 +%if "%{with_exif}" == "yes" 1.495 + --with-exif \ 1.496 +%endif 1.497 +%if "%{with_iconv}" == "yes" 1.498 + --with-iconv=%{l_prefix} \ 1.499 +%endif 1.500 +%if "%{with_tidy}" == "yes" 1.501 + --with-tidy=%{l_prefix} \ 1.502 +%else 1.503 + --without-tidy \ 1.504 +%endif 1.505 +%if "%{with_zip}" == "yes" 1.506 + --enable-zip \ 1.507 +%endif 1.508 + --with-apxs2=%{l_prefix}/sbin/apxs \ 1.509 + --disable-cli \ 1.510 + --disable-cgi 1.511 + 1.512 + # build package 1.513 + %{l_make} %{l_mflags} 1.514 + 1.515 +%install 1.516 + # install package 1.517 + %{l_make} %{l_mflags} install-sapi INSTALL_ROOT=$RPM_BUILD_ROOT 1.518 + mv $RPM_BUILD_ROOT%{l_prefix}/libexec/apache/libphp5.so \ 1.519 + $RPM_BUILD_ROOT%{l_prefix}/libexec/apache/mod_php.so 1.520 + 1.521 + # install default configuration file 1.522 + %{l_shtool} mkdir -f -p -m 755 \ 1.523 + $RPM_BUILD_ROOT%{l_prefix}/etc/apache/apache.d 1.524 + %{l_shtool} install -c -m 644 %{l_value -s -a} \ 1.525 + %{SOURCE apache-php.ini} \ 1.526 + $RPM_BUILD_ROOT%{l_prefix}/etc/apache/ 1.527 + %{l_shtool} install -c -m 644 %{l_value -s -a} \ 1.528 + %{SOURCE apache-php.conf} \ 1.529 + $RPM_BUILD_ROOT%{l_prefix}/etc/apache/apache.d/ 1.530 + 1.531 + # create session storage directory 1.532 +%if "%{with_session}" == "yes" 1.533 + %{l_shtool} mkdir -f -p -m 755 \ 1.534 + $RPM_BUILD_ROOT%{l_prefix}/var/apache/run/apache-php.session 1.535 +%endif 1.536 + 1.537 + # determine installation files 1.538 + %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT %{l_files_std} \ 1.539 +%if "%{with_session}" == "yes" 1.540 + '%attr(0750,%{l_nusr},%{l_ngrp}) %{l_prefix}/var/apache/run/apache-php.session' \ 1.541 +%endif 1.542 + '%config %{l_prefix}/etc/apache/apache-php.ini' \ 1.543 + '%config %{l_prefix}/etc/apache/apache.d/apache-php.conf' 1.544 + 1.545 +%files -f files 1.546 + 1.547 +%clean 1.548 + 1.549 +%post 1.550 + # after upgrade, restart service 1.551 + [ $1 -eq 2 ] || exit 0 1.552 + eval `%{l_rc} apache status 2>/dev/null` 1.553 + [ ".$apache_active" = .yes ] && %{l_rc} apache restart 1.554 + exit 0 1.555 +