Tue, 02 Apr 2013 20:44:50 +0200
Correct initial database generation and improve runcommand script logic.
michael@503 | 1 | ## |
michael@503 | 2 | ## apache-php.spec -- OpenPKG RPM Package Specification |
michael@503 | 3 | ## Copyright (c) 2000-2012 OpenPKG Foundation e.V. <http://openpkg.net/> |
michael@503 | 4 | ## |
michael@503 | 5 | ## Permission to use, copy, modify, and distribute this software for |
michael@503 | 6 | ## any purpose with or without fee is hereby granted, provided that |
michael@503 | 7 | ## the above copyright notice and this permission notice appear in all |
michael@503 | 8 | ## copies. |
michael@503 | 9 | ## |
michael@503 | 10 | ## THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED |
michael@503 | 11 | ## WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF |
michael@503 | 12 | ## MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. |
michael@503 | 13 | ## IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR |
michael@503 | 14 | ## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
michael@503 | 15 | ## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
michael@503 | 16 | ## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF |
michael@503 | 17 | ## USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND |
michael@503 | 18 | ## ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, |
michael@503 | 19 | ## OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT |
michael@503 | 20 | ## OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF |
michael@503 | 21 | ## SUCH DAMAGE. |
michael@503 | 22 | ## |
michael@503 | 23 | |
michael@503 | 24 | # package information |
michael@503 | 25 | Name: apache-php |
michael@503 | 26 | Summary: Apache Extension: PHP Scripting Language |
michael@503 | 27 | URL: http://www.php.net/ |
michael@503 | 28 | Vendor: The PHP Project |
michael@503 | 29 | Packager: OpenPKG Foundation e.V. |
michael@503 | 30 | Distribution: OpenPKG Community |
michael@503 | 31 | Class: BASE |
michael@503 | 32 | Group: Web |
michael@503 | 33 | License: PHP |
michael@749 | 34 | Version: 5.4.8 |
michael@504 | 35 | Release: 20120800 |
michael@503 | 36 | |
michael@503 | 37 | # package options |
michael@503 | 38 | %option with_bc no |
michael@503 | 39 | %option with_bdb no |
michael@503 | 40 | %option with_bzip2 no |
michael@503 | 41 | %option with_calendar no |
michael@503 | 42 | %option with_ctype no |
michael@503 | 43 | %option with_curl no |
michael@503 | 44 | %option with_debug no |
michael@503 | 45 | %option with_dom no |
michael@503 | 46 | %option with_exif no |
michael@503 | 47 | %option with_freetype no |
michael@503 | 48 | %option with_ftp no |
michael@503 | 49 | %option with_gd no |
michael@503 | 50 | %option with_gdbm no |
michael@503 | 51 | %option with_gettext no |
michael@503 | 52 | %option with_iconv no |
michael@503 | 53 | %option with_imap no |
michael@503 | 54 | %option with_json no |
michael@503 | 55 | %option with_tokenizer no |
michael@503 | 56 | %option with_mbregex no |
michael@503 | 57 | %option with_mbstring no |
michael@503 | 58 | %option with_mcrypt no |
michael@503 | 59 | %option with_mhash no |
michael@503 | 60 | %option with_mm no |
michael@503 | 61 | %option with_mysql no |
michael@503 | 62 | %option with_mysqlnd no |
michael@503 | 63 | %option with_oci8 no |
michael@503 | 64 | %option with_odbc no |
michael@503 | 65 | %option with_openldap no |
michael@503 | 66 | %option with_openldapsasl no |
michael@503 | 67 | %option with_pear no |
michael@503 | 68 | %option with_pgsql no |
michael@503 | 69 | %option with_posix no |
michael@503 | 70 | %option with_sendmail no |
michael@503 | 71 | %option with_session no |
michael@503 | 72 | %option with_simplexml no |
michael@503 | 73 | %option with_snmp no |
michael@503 | 74 | %option with_soap no |
michael@503 | 75 | %option with_sqlite no |
michael@503 | 76 | %option with_ssl no |
michael@503 | 77 | %option with_tidy no |
michael@503 | 78 | %option with_versioning no |
michael@503 | 79 | %option with_wddx no |
michael@503 | 80 | %option with_xml no |
michael@749 | 81 | %option with_xmlwriter no |
michael@503 | 82 | %option with_xslt no |
michael@503 | 83 | %option with_zlib no |
michael@503 | 84 | %option with_zip no |
michael@503 | 85 | |
michael@503 | 86 | # fixing implicit extension dependencies and correlations |
michael@503 | 87 | %if "%{with_mm}" == "yes" |
michael@503 | 88 | %undefine with_session |
michael@503 | 89 | %define with_session yes |
michael@503 | 90 | %endif |
michael@503 | 91 | %if "%{with_pear}" == "yes" |
michael@503 | 92 | %undefine with_xml |
michael@503 | 93 | %define with_xml yes |
michael@503 | 94 | %endif |
michael@503 | 95 | %if "%{with_freetype}" == "yes" |
michael@503 | 96 | %undefine with_gd |
michael@503 | 97 | %define with_gd yes |
michael@503 | 98 | %endif |
michael@503 | 99 | %if "%{with_mysql}" == "yes" || "%{with_gd}" == "yes" || "%{with_dom}" == "yes" || "%{with_zip}" == "yes" |
michael@503 | 100 | %undefine with_zlib |
michael@503 | 101 | %define with_zlib yes |
michael@503 | 102 | %endif |
michael@503 | 103 | %if "%{with_xslt}" == "yes" |
michael@503 | 104 | %undefine with_dom |
michael@503 | 105 | %define with_dom yes |
michael@503 | 106 | %endif |
michael@503 | 107 | %if "%{with_dom}" == "yes" |
michael@503 | 108 | %undefine with_xml |
michael@503 | 109 | %define with_xml yes |
michael@503 | 110 | %endif |
michael@503 | 111 | %if "%{with_soap}" == "yes" |
michael@503 | 112 | %undefine with_xml |
michael@503 | 113 | %define with_xml yes |
michael@503 | 114 | %endif |
michael@503 | 115 | %if "%{with_pgsql}" == "yes" |
michael@503 | 116 | %undefine with_ssl |
michael@503 | 117 | %define with_ssl yes |
michael@503 | 118 | %endif |
michael@503 | 119 | |
michael@503 | 120 | # list of sources |
michael@503 | 121 | Source0: http://static.php.net/www.php.net/distributions/php-%{version}.tar.bz2 |
michael@503 | 122 | Source1: apache-php.ini |
michael@503 | 123 | Source2: apache-php.conf |
michael@503 | 124 | Patch0: apache-php.patch |
michael@503 | 125 | |
michael@503 | 126 | # build information |
michael@671 | 127 | BuildPreReq: OpenPKG, openpkg >= 20100101, make, gcc, flex, bison |
michael@671 | 128 | PreReq: OpenPKG, openpkg >= 20100101 |
michael@503 | 129 | BuildPreReq: apache |
michael@503 | 130 | PreReq: apache |
michael@503 | 131 | BuildPreReq: pcre |
michael@503 | 132 | PreReq: pcre |
michael@503 | 133 | %if "%{with_sqlite}" == "yes" |
michael@503 | 134 | BuildPreReq: sqlite |
michael@503 | 135 | PreReq: sqlite |
michael@503 | 136 | %endif |
michael@503 | 137 | %if "%{with_mysql}" == "yes" |
michael@503 | 138 | BuildPreReq: mysql |
michael@503 | 139 | PreReq: mysql |
michael@503 | 140 | %endif |
michael@503 | 141 | %if "%{with_pgsql}" == "yes" |
michael@503 | 142 | BuildPreReq: postgresql |
michael@503 | 143 | PreReq: postgresql |
michael@503 | 144 | %endif |
michael@503 | 145 | %if "%{with_gd}" == "yes" |
michael@503 | 146 | BuildPreReq: gd >= 2.0.20, jpeg, png |
michael@503 | 147 | PreReq: gd >= 2.0.20, jpeg, png |
michael@503 | 148 | %endif |
michael@503 | 149 | %if "%{with_bdb}" == "yes" |
michael@503 | 150 | BuildPreReq: db |
michael@503 | 151 | PreReq: db |
michael@503 | 152 | %endif |
michael@503 | 153 | %if "%{with_zlib}" == "yes" |
michael@503 | 154 | BuildPreReq: zlib |
michael@503 | 155 | PreReq: zlib |
michael@503 | 156 | %endif |
michael@503 | 157 | %if "%{with_bzip2}" == "yes" |
michael@503 | 158 | BuildPreReq: bzip2 |
michael@503 | 159 | PreReq: bzip2 |
michael@503 | 160 | %endif |
michael@503 | 161 | %if "%{with_ssl}" == "yes" |
michael@503 | 162 | BuildPreReq: openssl |
michael@503 | 163 | PreReq: openssl |
michael@503 | 164 | %endif |
michael@503 | 165 | %if "%{with_openldap}" == "yes" |
michael@503 | 166 | BuildPreReq: openldap |
michael@503 | 167 | PreReq: openldap |
michael@503 | 168 | %if "%{with_openldapsasl}" == "yes" |
michael@503 | 169 | BuildPreReq: openldap::with_sasl = yes |
michael@503 | 170 | PreReq: openldap::with_sasl = yes |
michael@503 | 171 | %else |
michael@503 | 172 | BuildPreReq: openldap::with_sasl = no |
michael@503 | 173 | PreReq: openldap::with_sasl = no |
michael@503 | 174 | %endif |
michael@503 | 175 | %endif |
michael@503 | 176 | %if "%{with_mm}" == "yes" |
michael@503 | 177 | BuildPreReq: mm |
michael@503 | 178 | PreReq: mm |
michael@503 | 179 | %endif |
michael@503 | 180 | %if "%{with_freetype}" == "yes" |
michael@503 | 181 | BuildPreReq: freetype |
michael@503 | 182 | PreReq: freetype |
michael@503 | 183 | %endif |
michael@503 | 184 | %if "%{with_gettext}" == "yes" |
michael@503 | 185 | BuildPreReq: gettext, libiconv |
michael@503 | 186 | PreReq: gettext, libiconv |
michael@503 | 187 | %endif |
michael@503 | 188 | %if "%{with_iconv}" == "yes" |
michael@503 | 189 | BuildPreReq: libiconv |
michael@503 | 190 | PreReq: libiconv |
michael@503 | 191 | %endif |
michael@503 | 192 | %if "%{with_imap}" == "yes" |
michael@503 | 193 | BuildPreReq: imap, openssl |
michael@503 | 194 | PreReq: imap, openssl |
michael@503 | 195 | %endif |
michael@503 | 196 | %if "%{with_xml}" == "yes" |
michael@503 | 197 | BuildPreReq: libxml |
michael@503 | 198 | PreReq: libxml |
michael@503 | 199 | %endif |
michael@749 | 200 | %if "%{with_xmlwriter}" == "yes" |
michael@749 | 201 | %undefine with_xml |
michael@749 | 202 | %define with_xml yes |
michael@749 | 203 | %endif |
michael@503 | 204 | %if "%{with_xslt}" == "yes" |
michael@503 | 205 | BuildPreReq: libxslt |
michael@503 | 206 | PreReq: libxslt |
michael@503 | 207 | %endif |
michael@503 | 208 | %if "%{with_dom}" == "yes" |
michael@503 | 209 | BuildPreReq: libxml, libxslt |
michael@503 | 210 | PreReq: libxml, libxslt |
michael@503 | 211 | %endif |
michael@503 | 212 | %if "%{with_curl}" == "yes" |
michael@503 | 213 | BuildPreReq: curl |
michael@503 | 214 | PreReq: curl |
michael@503 | 215 | %endif |
michael@503 | 216 | %if "%{with_mhash}" == "yes" |
michael@503 | 217 | BuildPreReq: mhash |
michael@503 | 218 | PreReq: mhash |
michael@503 | 219 | %endif |
michael@503 | 220 | %if "%{with_mcrypt}" == "yes" |
michael@503 | 221 | BuildPreReq: libmcrypt |
michael@503 | 222 | PreReq: libmcrypt |
michael@503 | 223 | %endif |
michael@503 | 224 | %if "%{with_gdbm}" == "yes" |
michael@503 | 225 | BuildPreReq: gdbm, gdbm::with_ndbm = yes |
michael@503 | 226 | PreReq: gdbm, gdbm::with_ndbm = yes |
michael@503 | 227 | %endif |
michael@503 | 228 | %if "%{with_oci8}" == "yes" |
michael@503 | 229 | BuildPreReq: oracle |
michael@503 | 230 | PreReq: oracle |
michael@503 | 231 | %endif |
michael@503 | 232 | %if "%{with_snmp}" == "yes" |
michael@503 | 233 | BuildPreReq: snmp |
michael@503 | 234 | PreReq: snmp |
michael@503 | 235 | %endif |
michael@503 | 236 | %if "%{with_odbc}" == "yes" |
michael@503 | 237 | BuildPreReq: unixodbc |
michael@503 | 238 | PreReq: unixodbc |
michael@503 | 239 | %endif |
michael@503 | 240 | %if "%{with_sendmail}" == "yes" |
michael@503 | 241 | BuildPreReq: MTA |
michael@503 | 242 | PreReq: MTA |
michael@503 | 243 | %endif |
michael@503 | 244 | %if "%{with_simplexml}" == "yes" |
michael@503 | 245 | BuildPreReq: libxml |
michael@503 | 246 | PreReq: libxml |
michael@503 | 247 | %endif |
michael@503 | 248 | %if "%{with_tidy}" == "yes" |
michael@503 | 249 | BuildPreReq: tidy |
michael@503 | 250 | PreReq: tidy |
michael@503 | 251 | %endif |
michael@503 | 252 | |
michael@503 | 253 | %description |
michael@503 | 254 | PHP is an HTML-embedded scripting language. Much of its syntax is |
michael@503 | 255 | borrowed from C, Java and Perl with a couple of unique PHP-specific |
michael@503 | 256 | features thrown in. The goal of the language is to allow web |
michael@503 | 257 | developers to write dynamically generated pages quickly. |
michael@503 | 258 | |
michael@503 | 259 | This package provides a Dynamic Shared Object (DSO) for the Apache |
michael@503 | 260 | HTTP 2.2 web server. In general speaking, this module is also known |
michael@503 | 261 | as mod_php. |
michael@503 | 262 | |
michael@503 | 263 | %track |
michael@503 | 264 | prog apache-php = { |
michael@503 | 265 | version = %{version} |
michael@503 | 266 | url = http://www.php.net/downloads.php |
michael@503 | 267 | regex = php-(5\.\d+\.\d+)\.tar\.(bz2|gz) |
michael@503 | 268 | } |
michael@503 | 269 | |
michael@503 | 270 | %prep |
michael@503 | 271 | %setup -q -n php-%{version} |
michael@503 | 272 | %{l_shtool} subst \ |
michael@503 | 273 | -e 's;-i -a -n php5;-i -n php5;' \ |
michael@503 | 274 | configure |
michael@503 | 275 | %{l_shtool} subst \ |
michael@503 | 276 | -e 's;\(/include\)/freetype2;\1;' \ |
michael@503 | 277 | configure \ |
michael@503 | 278 | ext/gd/config.m4 |
michael@503 | 279 | %patch -p0 |
michael@503 | 280 | |
michael@503 | 281 | %build |
michael@503 | 282 | # configure package |
michael@503 | 283 | case "%{l_platform -t}" in |
michael@503 | 284 | *-sunos5.10 ) cflags="%{l_cflags}" ;; |
michael@503 | 285 | * ) cflags="%{l_cflags -O}" ;; |
michael@503 | 286 | esac |
michael@503 | 287 | cppflags="%{l_cppflags}" |
michael@503 | 288 | ldflags="%{l_ldflags}" |
michael@503 | 289 | libs="" |
michael@503 | 290 | %if "%{with_gdbm}" == "yes" |
michael@503 | 291 | libs="$libs -lndbm -lgdbm" |
michael@503 | 292 | %endif |
michael@503 | 293 | %if "%{with_gd}" == "yes" |
michael@503 | 294 | libs="$libs -lpng -lz" |
michael@503 | 295 | %endif |
michael@503 | 296 | %if "%{with_gettext}" == "yes" |
michael@503 | 297 | libs="$libs -liconv" |
michael@503 | 298 | %endif |
michael@503 | 299 | %if "%{with_openldap}" == "yes" && "%{with_openldapsasl}" == "yes" |
michael@503 | 300 | libs="$libs -lsasl2" |
michael@503 | 301 | %endif |
michael@503 | 302 | %if "%{with_imap}" == "yes" |
michael@503 | 303 | libs="$libs -lssl -lcrypto" |
michael@503 | 304 | %endif |
michael@503 | 305 | %if "%{with_bdb}" == "yes" |
michael@503 | 306 | libs="$libs -ldb" |
michael@503 | 307 | %endif |
michael@503 | 308 | %if "%{with_pgsql}" == "yes" |
michael@503 | 309 | libs="$libs `pg_config --libs`" |
michael@503 | 310 | %endif |
michael@503 | 311 | %if "%{with_oci8}" == "yes" |
michael@503 | 312 | ORACLE_HOME="`%{l_rc} --query oracle_home`" |
michael@503 | 313 | export ORACLE_HOME |
michael@503 | 314 | %endif |
michael@503 | 315 | CC="%{l_cc}" \ |
michael@503 | 316 | CFLAGS="$cflags" \ |
michael@503 | 317 | CPPFLAGS="$cppflags" \ |
michael@503 | 318 | LDFLAGS="$ldflags" \ |
michael@503 | 319 | LIBS="$libs" \ |
michael@503 | 320 | %if "%{with_sendmail}" == "yes" |
michael@503 | 321 | PROG_SENDMAIL="%{l_prefix}/sbin/sendmail" \ |
michael@503 | 322 | %else |
michael@503 | 323 | PROG_SENDMAIL="`%{l_shtool} path false`" \ |
michael@503 | 324 | %endif |
michael@503 | 325 | ./configure \ |
michael@503 | 326 | --prefix=%{l_prefix} \ |
michael@503 | 327 | --sysconfdir=%{l_prefix}/etc/apache \ |
michael@503 | 328 | --with-config-file-path=%{l_prefix}/etc/apache \ |
michael@503 | 329 | --libdir=%{l_prefix}/lib/php \ |
michael@503 | 330 | --disable-all \ |
michael@503 | 331 | --enable-pdo \ |
michael@503 | 332 | --enable-filter \ |
michael@503 | 333 | --with-pcre-regex=%{l_prefix} \ |
michael@503 | 334 | %if "%{with_calendar}" == "yes" |
michael@503 | 335 | --enable-calendar \ |
michael@503 | 336 | %endif |
michael@503 | 337 | %if "%{with_sqlite}" == "yes" |
michael@503 | 338 | --with-sqlite3=%{l_prefix} \ |
michael@503 | 339 | --with-pdo-sqlite=%{l_prefix} \ |
michael@503 | 340 | %else |
michael@503 | 341 | --without-pdo-sqlite \ |
michael@503 | 342 | %endif |
michael@503 | 343 | %if "%{with_mysql}" == "yes" || "%{with_mysqlnd}" == "yes" |
michael@503 | 344 | %if "%{with_mysqlnd}" == "yes" |
michael@503 | 345 | --with-mysql=mysqlnd \ |
michael@503 | 346 | --with-pdo-mysql=mysqlnd \ |
michael@503 | 347 | %else |
michael@503 | 348 | --with-mysql=%{l_prefix} \ |
michael@503 | 349 | --with-pdo-mysql=%{l_prefix} \ |
michael@503 | 350 | %endif |
michael@503 | 351 | --with-mysqli=mysqlnd \ |
michael@503 | 352 | --with-mysql-sock=%{l_prefix}/var/mysql/mysql.sock \ |
michael@503 | 353 | %else |
michael@503 | 354 | --without-mysql \ |
michael@503 | 355 | --without-pdo-mysql \ |
michael@503 | 356 | %endif |
michael@503 | 357 | %if "%{with_pgsql}" == "yes" |
michael@503 | 358 | --with-pgsql=%{l_prefix} \ |
michael@503 | 359 | --with-pdo-pgsql=%{l_prefix} \ |
michael@503 | 360 | %else |
michael@503 | 361 | --without-pgsql \ |
michael@503 | 362 | %endif |
michael@503 | 363 | %if "%{with_posix}" == "yes" |
michael@503 | 364 | --enable-posix \ |
michael@503 | 365 | %endif |
michael@503 | 366 | %if "%{with_gd}" == "yes" |
michael@503 | 367 | --with-gd=yes \ |
michael@503 | 368 | --with-jpeg-dir=%{l_prefix} \ |
michael@503 | 369 | --with-png-dir=%{l_prefix} \ |
michael@503 | 370 | %endif |
michael@503 | 371 | %if "%{with_freetype}" == "yes" |
michael@503 | 372 | --enable-gd-native-ttf \ |
michael@503 | 373 | --with-freetype-dir=%{l_prefix} \ |
michael@503 | 374 | %endif |
michael@503 | 375 | %if "%{with_bdb}" == "yes" |
michael@503 | 376 | --with-db4=%{l_prefix} \ |
michael@503 | 377 | %endif |
michael@503 | 378 | %if "%{with_debug}" == "yes" |
michael@503 | 379 | --enable-debug \ |
michael@503 | 380 | %else |
michael@503 | 381 | --disable-debug \ |
michael@503 | 382 | %endif |
michael@503 | 383 | %if "%{with_zlib}" == "yes" |
michael@503 | 384 | --with-zlib=%{l_prefix} \ |
michael@503 | 385 | --with-zlib-dir=%{l_prefix} \ |
michael@503 | 386 | %endif |
michael@503 | 387 | %if "%{with_bzip2}" == "yes" |
michael@503 | 388 | --with-bz2=%{l_prefix} \ |
michael@503 | 389 | %endif |
michael@503 | 390 | %if "%{with_ssl}" == "yes" || "%{with_openldap}" == "yes" |
michael@503 | 391 | --with-openssl=%{l_prefix} \ |
michael@503 | 392 | %endif |
michael@503 | 393 | %if "%{with_openldap}" == "yes" |
michael@503 | 394 | --with-ldap=%{l_prefix} \ |
michael@503 | 395 | %endif |
michael@503 | 396 | %if "%{with_session}" == "yes" |
michael@503 | 397 | --enable-session \ |
michael@503 | 398 | %endif |
michael@503 | 399 | %if "%{with_mm}" == "yes" |
michael@503 | 400 | --with-mm=%{l_prefix} \ |
michael@503 | 401 | %endif |
michael@503 | 402 | %if "%{with_ftp}" == "yes" |
michael@503 | 403 | --enable-ftp \ |
michael@503 | 404 | %endif |
michael@503 | 405 | %if "%{with_oci8}" == "yes" |
michael@503 | 406 | --with-oci8 \ |
michael@503 | 407 | %endif |
michael@503 | 408 | %if "%{with_gettext}" == "yes" |
michael@503 | 409 | --with-gettext=%{l_prefix} \ |
michael@503 | 410 | %endif |
michael@503 | 411 | %if "%{with_imap}" == "yes" |
michael@503 | 412 | --with-imap=%{l_prefix} \ |
michael@503 | 413 | --with-imap-ssl=%{l_prefix} \ |
michael@503 | 414 | %endif |
michael@503 | 415 | %if "%{with_json}" == "yes" |
michael@503 | 416 | --enable-json \ |
michael@503 | 417 | %else |
michael@503 | 418 | --disable-json \ |
michael@503 | 419 | %endif |
michael@503 | 420 | %if "%{with_tokenizer}" == "yes" |
michael@503 | 421 | --enable-tokenizer \ |
michael@503 | 422 | %else |
michael@503 | 423 | --disable-tokenizer \ |
michael@503 | 424 | %endif |
michael@503 | 425 | %if "%{with_xml}" == "yes" |
michael@503 | 426 | --enable-xml \ |
michael@503 | 427 | --enable-xmlreader \ |
michael@503 | 428 | --enable-libxml \ |
michael@503 | 429 | --with-libxml-dir=%{l_prefix} \ |
michael@503 | 430 | %else |
michael@503 | 431 | --disable-xml \ |
michael@503 | 432 | %endif |
michael@503 | 433 | %if "%{with_xslt}" == "yes" |
michael@503 | 434 | --with-xsl=%{l_prefix} \ |
michael@503 | 435 | %else |
michael@503 | 436 | --without-xsl \ |
michael@503 | 437 | %endif |
michael@503 | 438 | %if "%{with_dom}" == "yes" |
michael@503 | 439 | --enable-dom \ |
michael@503 | 440 | %else |
michael@503 | 441 | --disable-dom \ |
michael@503 | 442 | %endif |
michael@503 | 443 | %if "%{with_wddx}" == "yes" |
michael@503 | 444 | --enable-wddx \ |
michael@503 | 445 | %endif |
michael@503 | 446 | %if "%{with_soap}" == "yes" |
michael@503 | 447 | --enable-soap \ |
michael@503 | 448 | %endif |
michael@503 | 449 | %if "%{with_bc}" == "yes" |
michael@503 | 450 | --enable-bcmath \ |
michael@503 | 451 | %endif |
michael@503 | 452 | %if "%{with_mhash}" == "yes" |
michael@503 | 453 | --with-mhash=%{l_prefix} \ |
michael@503 | 454 | %endif |
michael@503 | 455 | %if "%{with_mcrypt}" == "yes" |
michael@503 | 456 | --with-mcrypt=%{l_prefix} \ |
michael@503 | 457 | %endif |
michael@503 | 458 | %if "%{with_ctype}" == "yes" |
michael@503 | 459 | --enable-ctype \ |
michael@503 | 460 | %endif |
michael@503 | 461 | %if "%{with_curl}" == "yes" |
michael@503 | 462 | --with-curl=%{l_prefix} \ |
michael@503 | 463 | %endif |
michael@503 | 464 | %if "%{with_gdbm}" == "yes" |
michael@503 | 465 | --with-gdbm=%{l_prefix} \ |
michael@503 | 466 | %endif |
michael@503 | 467 | %if "%{with_versioning}" == "yes" |
michael@503 | 468 | --enable-versioning \ |
michael@503 | 469 | %endif |
michael@503 | 470 | %if "%{with_pear}" == "yes" |
michael@503 | 471 | --with-pear=%{l_prefix}/lib/php \ |
michael@503 | 472 | %else |
michael@503 | 473 | --without-pear \ |
michael@503 | 474 | %endif |
michael@503 | 475 | %if "%{with_simplexml}" == "yes" |
michael@503 | 476 | --enable-simplexml \ |
michael@503 | 477 | --enable-libxml \ |
michael@503 | 478 | --with-libxml-dir=%{l_prefix} \ |
michael@503 | 479 | %else |
michael@503 | 480 | --disable-simplexml \ |
michael@503 | 481 | %endif |
michael@503 | 482 | %if "%{with_snmp}" == "yes" |
michael@503 | 483 | --with-snmp=%{l_prefix} \ |
michael@503 | 484 | --with-openssl-dir=%{l_prefix} \ |
michael@503 | 485 | %endif |
michael@503 | 486 | %if "%{with_odbc}" == "yes" |
michael@503 | 487 | --with-unixODBC=%{l_prefix} \ |
michael@503 | 488 | --with-pdo-odbc=unixODBC,%{l_prefix} \ |
michael@503 | 489 | %endif |
michael@503 | 490 | %if "%{with_mbregex}" == "yes" |
michael@503 | 491 | --enable-mbregex \ |
michael@503 | 492 | %endif |
michael@503 | 493 | %if "%{with_mbstring}" == "yes" |
michael@503 | 494 | --enable-mbstring \ |
michael@503 | 495 | %endif |
michael@503 | 496 | %if "%{with_exif}" == "yes" |
michael@503 | 497 | --with-exif \ |
michael@503 | 498 | %endif |
michael@503 | 499 | %if "%{with_iconv}" == "yes" |
michael@503 | 500 | --with-iconv=%{l_prefix} \ |
michael@503 | 501 | %endif |
michael@503 | 502 | %if "%{with_tidy}" == "yes" |
michael@503 | 503 | --with-tidy=%{l_prefix} \ |
michael@503 | 504 | %else |
michael@503 | 505 | --without-tidy \ |
michael@503 | 506 | %endif |
michael@503 | 507 | %if "%{with_zip}" == "yes" |
michael@503 | 508 | --enable-zip \ |
michael@503 | 509 | %endif |
michael@749 | 510 | %if "%{with_xmlwriter}" == "yes" |
michael@749 | 511 | --enable-xmlwriter \ |
michael@749 | 512 | %endif |
michael@503 | 513 | --with-apxs2=%{l_prefix}/sbin/apxs \ |
michael@503 | 514 | --disable-cli \ |
michael@503 | 515 | --disable-cgi |
michael@503 | 516 | |
michael@503 | 517 | # build package |
michael@504 | 518 | %{l_make} %{l_mflags -O} |
michael@503 | 519 | |
michael@503 | 520 | %install |
michael@503 | 521 | # install package |
michael@503 | 522 | %{l_make} %{l_mflags} install-sapi INSTALL_ROOT=$RPM_BUILD_ROOT |
michael@503 | 523 | mv $RPM_BUILD_ROOT%{l_prefix}/libexec/apache/libphp5.so \ |
michael@503 | 524 | $RPM_BUILD_ROOT%{l_prefix}/libexec/apache/mod_php.so |
michael@503 | 525 | |
michael@503 | 526 | # install default configuration file |
michael@503 | 527 | %{l_shtool} mkdir -f -p -m 755 \ |
michael@503 | 528 | $RPM_BUILD_ROOT%{l_prefix}/etc/apache/apache.d |
michael@503 | 529 | %{l_shtool} install -c -m 644 %{l_value -s -a} \ |
michael@503 | 530 | %{SOURCE apache-php.ini} \ |
michael@503 | 531 | $RPM_BUILD_ROOT%{l_prefix}/etc/apache/ |
michael@503 | 532 | %{l_shtool} install -c -m 644 %{l_value -s -a} \ |
michael@503 | 533 | %{SOURCE apache-php.conf} \ |
michael@503 | 534 | $RPM_BUILD_ROOT%{l_prefix}/etc/apache/apache.d/ |
michael@503 | 535 | |
michael@503 | 536 | # create session storage directory |
michael@503 | 537 | %if "%{with_session}" == "yes" |
michael@731 | 538 | %{l_shtool} mkdir -f -p -m 775 \ |
michael@503 | 539 | $RPM_BUILD_ROOT%{l_prefix}/var/apache/run/apache-php.session |
michael@503 | 540 | %endif |
michael@503 | 541 | |
michael@503 | 542 | # determine installation files |
michael@503 | 543 | %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT %{l_files_std} \ |
michael@503 | 544 | %if "%{with_session}" == "yes" |
michael@731 | 545 | '%attr(0770,%{l_rusr},%{l_ngrp}) %{l_prefix}/var/apache/run/apache-php.session' \ |
michael@503 | 546 | %endif |
michael@503 | 547 | '%config %{l_prefix}/etc/apache/apache-php.ini' \ |
michael@503 | 548 | '%config %{l_prefix}/etc/apache/apache.d/apache-php.conf' |
michael@503 | 549 | |
michael@503 | 550 | %files -f files |
michael@503 | 551 | |
michael@503 | 552 | %clean |
michael@503 | 553 | |
michael@503 | 554 | %post |
michael@503 | 555 | # after upgrade, restart service |
michael@503 | 556 | [ $1 -eq 2 ] || exit 0 |
michael@503 | 557 | eval `%{l_rc} apache status 2>/dev/null` |
michael@503 | 558 | [ ".$apache_active" = .yes ] && %{l_rc} apache restart |
michael@503 | 559 | exit 0 |
michael@503 | 560 |