apache-php.spec 17 KB

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