apache-php.spec 17 KB

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