apache-php.spec 18 KB

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