apache.spec 33 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042
  1. ##
  2. ## apache.spec -- OpenPKG RPM Specification
  3. ## Copyright (c) 2000-2003 The OpenPKG Project <http://www.openpkg.org/>
  4. ## Copyright (c) 2000-2003 Ralf S. Engelschall <rse@engelschall.com>
  5. ## Copyright (c) 2000-2003 Cable & Wireless <http://www.cw.com/>
  6. ##
  7. ## Permission to use, copy, modify, and distribute this software for
  8. ## any purpose with or without fee is hereby granted, provided that
  9. ## the above copyright notice and this permission notice appear in all
  10. ## copies.
  11. ##
  12. ## THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
  13. ## WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
  14. ## MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
  15. ## IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
  16. ## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  17. ## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  18. ## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
  19. ## USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
  20. ## ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
  21. ## OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
  22. ## OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  23. ## SUCH DAMAGE.
  24. ##
  25. ## ATTENTION: This package specification is a cruel one. It allows
  26. ## one to build an Apache package in hundreds of variants with just
  27. ## a single specification through the use of lots of condition
  28. ## variables. The reason for this attempt is that it was born out of
  29. ## the needs from the daily practice at an ISP. So do not treat this
  30. ## specification as a reference example of any kind, except perhaps as
  31. ## a example of what is maximum possible with RPM and how far one can
  32. ## go with the macro mechanism. But do not try to repeat this!
  33. # package component versions
  34. %define V_apache 1.3.29
  35. %define V_mod_ssl 2.8.16-1.3.29
  36. %define V_mod_perl 1.29
  37. %define V_mod_php 4.3.3
  38. %define V_mod_php3 3.0.18
  39. %define V_mod_dav 1.0.3-1.3.6
  40. %define V_mod_layout 3.2.1
  41. %define V_mod_macro 1.1.2
  42. %define V_mod_auth_pam 1.1.1
  43. %define V_mod_auth_ldap 2.4.1
  44. %define V_mod_gzip 1.3.19.1a
  45. %define V_mod_fastcgi 2.4.0
  46. %define V_mod_throttle 312
  47. %define V_mod_access_referer 1.0.2
  48. %define V_mod_roaming 1.0.2
  49. %define V_mod_relocate 1.0
  50. # package information
  51. Name: apache
  52. Summary: Apache HTTP Server
  53. URL: http://httpd.apache.org/
  54. Vendor: Apache Software Foundation
  55. Packager: The OpenPKG Project
  56. Distribution: OpenPKG [BASE]
  57. Group: Web
  58. License: ASF
  59. Version: %{V_apache}
  60. Release: 20031101
  61. # package options (suexec related)
  62. %option with_suexec yes
  63. %option with_suexec_caller %{l_nusr}
  64. %option with_suexec_userdir public_html
  65. # package options (additionally used Apache modules; can be enabled without thinking)
  66. %option with_mod_ssl no
  67. %option with_mod_perl no
  68. %option with_mod_php no
  69. %option with_mod_php3 no
  70. %option with_mod_dav no
  71. %option with_mod_layout no
  72. %option with_mod_macro no
  73. # package options (additionally used Apache modules; you have to know what you do)
  74. %option with_mod_auth_ldap no
  75. %option with_mod_auth_pam no
  76. %option with_mod_gzip no
  77. %option with_mod_fastcgi no
  78. %option with_mod_throttle no
  79. %option with_mod_access_referer no
  80. %option with_mod_roaming no
  81. %option with_mod_relocate no
  82. # package options (optional PHP4 specific settings; requires "with_mod_php")
  83. %option with_mod_php_calendar no
  84. %option with_mod_php_mysql no
  85. %option with_mod_php_pgsql no
  86. %option with_mod_php_gd no
  87. %option with_mod_php_db no
  88. %option with_mod_php_debug no
  89. %option with_mod_php_pdflib no
  90. %option with_mod_php_zlib no
  91. %option with_mod_php_bzip2 no
  92. %option with_mod_php_openssl no
  93. %option with_mod_php_openldap no
  94. %option with_mod_php_openldapsasl no
  95. %option with_mod_php_mm no
  96. %option with_mod_php_pcre no
  97. %option with_mod_php_ftp no
  98. %option with_mod_php_java no
  99. %option with_mod_php_oci7 no
  100. %option with_mod_php_oci8 no
  101. %option with_mod_php_freetype no
  102. %option with_mod_php_gettext no
  103. %option with_mod_php_imap no
  104. %option with_mod_php_xml no
  105. %option with_mod_php_dom no
  106. %option with_mod_php_bc no
  107. %option with_mod_php_transsid no
  108. %option with_mod_php_curl no
  109. %option with_mod_php_mhash no
  110. %option with_mod_php_wddx no
  111. %option with_mod_php_gdbm no
  112. %option with_mod_php_versioning no
  113. %option with_mod_php_snmp no
  114. %option with_mod_php_unixodbc no
  115. %option with_mod_php_mbregex no
  116. %option with_mod_php_mbstring no
  117. # package options (optional PHP3 specific settings; requires "with_mod_php3")
  118. %option with_mod_php3_ftp no
  119. %option with_mod_php3_gd no
  120. %option with_mod_php3_jpeg no
  121. %option with_mod_php3_mysql no
  122. %option with_mod_php3_openssl no
  123. %option with_mod_php3_zlib no
  124. # package options (braindead ones only)
  125. %option with_gdbm_ndbm no
  126. %option with_shared_core no
  127. %option with_shared_chain no
  128. # package options (debugging)
  129. %option with_debug no
  130. # fixing implicit inter-module dependencies and correlations
  131. %if "%{with_mod_php}" == "yes"
  132. %if "%{with_mod_php3}" == "yes"
  133. %{error:build-time options 'with_mod_php' and 'with_mod_php3' conflict}
  134. %endif
  135. %if "%{with_mod_ssl}" == "yes"
  136. %undefine with_mod_php_openssl
  137. %undefine with_mod_php_mm
  138. %define with_mod_php_openssl yes
  139. %define with_mod_php_mm yes
  140. %endif
  141. %if "%{with_mod_php_freetype}" == "yes"
  142. %undefine with_mod_php_gd
  143. %define with_mod_php_gd yes
  144. %endif
  145. %if "%{with_mod_php_mysql}" == "yes" || "%{with_mod_php_pdflib}" == "yes" || "%{with_mod_php_gd}" == "yes" || "%{with_mod_php_dom}" == "yes"
  146. %undefine with_mod_php_zlib
  147. %define with_mod_php_zlib yes
  148. %endif
  149. %if "%{with_mod_php_pgsql}" == "yes"
  150. %undefine with_mod_php_openssl
  151. %define with_mod_php_openssl yes
  152. %endif
  153. %endif
  154. %if "%{with_mod_php3}" == "yes"
  155. %if "%{with_mod_ssl}" == "yes"
  156. %undefine with_mod_php3_openssl
  157. %define with_mod_php3_openssl yes
  158. %endif
  159. %if "%{with_mod_php3_mysql}" == "yes"
  160. %undefine with_mod_php3_zlib
  161. %define with_mod_php3_zlib yes
  162. %endif
  163. %endif
  164. %if "%{with_mod_php_gdbm}" == "yes"
  165. %undefine with_gdbm_ndbm
  166. %define with_gdbm_ndbm yes
  167. %endif
  168. # list of sources
  169. Source0: http://www.apache.org/dist/httpd/apache_%{V_apache}.tar.gz
  170. Source1: http://www.modssl.org/source/mod_ssl-%{V_mod_ssl}.tar.gz
  171. Source2: http://perl.apache.org/dist/mod_perl-%{V_mod_perl}.tar.gz
  172. Source3: http://www.php.net/distributions/php-%{V_mod_php}.tar.gz
  173. Source4: http://www.webdav.org/mod_dav/mod_dav-%{V_mod_dav}.tar.gz
  174. Source5: http://software.tangent.org/download/mod_layout-%{V_mod_layout}.tar.gz
  175. Source6: http://www.cri.ensmp.fr/~coelho/mod_macro/mod_macro-%{V_mod_macro}.tar.gz
  176. Source7: http://pam.sourceforge.net/mod_auth_pam/dist/mod_auth_pam.tar.gz
  177. Source8: http://www.remotecommunications.com/apache/mod_gzip/src/%{V_mod_gzip}/mod_gzip.c
  178. Source9: http://www.fastcgi.com/dist/mod_fastcgi-%{V_mod_fastcgi}.tar.gz
  179. Source10: http://www.snert.com/Software/mod_throttle/mod_throttle%{V_mod_throttle}.tgz
  180. Source11: http://download.sourceforge.net/accessreferer/mod_access_referer-%{V_mod_access_referer}.tar.gz
  181. Source12: http://www.klomp.org/mod_roaming/mod_roaming-%{V_mod_roaming}.tar.gz
  182. Source13: http://software.tangent.org/download/mod_relocate-%{V_mod_relocate}.tar.gz
  183. Source14: http://www.php.net/distributions/php-%{V_mod_php3}.tar.gz
  184. Source15: http://www.muquit.com/muquit/software/mod_auth_ldap/mod_auth_ldap.tar.gz
  185. Source20: apache.conf
  186. Source21: apache.base
  187. Source22: apache.vhost
  188. Source23: apache.pl
  189. Source24: rc.apache
  190. Patch0: apache.patch
  191. # build information
  192. Prefix: %{l_prefix}
  193. BuildRoot: %{l_buildroot}
  194. BuildPreReq: OpenPKG, openpkg >= 20030927
  195. PreReq: OpenPKG, openpkg >= 20030927
  196. %if "%{with_mod_ssl}" == "yes"
  197. BuildPreReq: openssl, mm
  198. PreReq: openssl, mm
  199. %endif
  200. %if "%{with_mod_perl}" == "yes"
  201. BuildPreReq: perl
  202. PreReq: perl
  203. %endif
  204. %if "%{with_mod_php}" == "yes"
  205. BuildPreReq: gcc, sed, flex, bison
  206. PreReq: MTA
  207. %if "%{with_mod_php_mysql}" == "yes"
  208. BuildPreReq: mysql
  209. PreReq: mysql
  210. %endif
  211. %if "%{with_mod_php_pgsql}" == "yes"
  212. BuildPreReq: postgresql, openssl
  213. PreReq: postgresql, openssl
  214. %endif
  215. %if "%{with_mod_php_gd}" == "yes"
  216. BuildPreReq: gd, jpeg, png
  217. PreReq: gd, jpeg, png
  218. %endif
  219. %if "%{with_mod_php_db}" == "yes"
  220. BuildPreReq: db
  221. PreReq: db
  222. %endif
  223. %if "%{with_mod_php_pdflib}" == "yes"
  224. BuildPreReq: pdflib, jpeg, png
  225. PreReq: pdflib, jpeg, png
  226. %endif
  227. %if "%{with_mod_php_zlib}" == "yes"
  228. BuildPreReq: zlib
  229. PreReq: zlib
  230. %endif
  231. %if "%{with_mod_php_bzip2}" == "yes"
  232. BuildPreReq: bzip2
  233. PreReq: bzip2
  234. %endif
  235. %if "%{with_mod_php_openssl}" == "yes"
  236. BuildPreReq: openssl
  237. PreReq: openssl
  238. %endif
  239. %if "%{with_mod_php_openldap}" == "yes"
  240. BuildPreReq: openldap, openssl
  241. PreReq: openldap, openssl
  242. %if "%{with_mod_php_openldapsasl}" == "yes"
  243. BuildPreReq: openldap::with_sasl = yes
  244. PreReq: openldap::with_sasl = yes
  245. %else
  246. BuildPreReq: openldap::with_sasl = no
  247. PreReq: openldap::with_sasl = no
  248. %endif
  249. %endif
  250. %if "%{with_mod_php_mm}" == "yes"
  251. BuildPreReq: mm
  252. PreReq: mm
  253. %endif
  254. %if "%{with_mod_php_pcre}" == "yes"
  255. BuildPreReq: pcre
  256. PreReq: pcre
  257. %endif
  258. %if "%{with_mod_php_java}" == "yes"
  259. BuildPreReq: j2se
  260. PreReq: j2se
  261. %endif
  262. %if "%{with_mod_php_freetype}" == "yes"
  263. BuildPreReq: freetype
  264. PreReq: freetype
  265. %endif
  266. %if "%{with_mod_php_gettext}" == "yes"
  267. BuildPreReq: gettext, libiconv
  268. PreReq: gettext, libiconv
  269. %endif
  270. %if "%{with_mod_php_imap}" == "yes"
  271. BuildPreReq: imap, openssl
  272. PreReq: imap, openssl
  273. %endif
  274. %if "%{with_mod_dav}" == "yes" || "%{with_mod_php_xml}" == "yes"
  275. BuildPreReq: expat
  276. PreReq: expat
  277. %endif
  278. %if "%{with_mod_php_dom}" == "yes"
  279. BuildPreReq: libxml, libxslt
  280. PreReq: libxml, libxslt
  281. %endif
  282. %if "%{with_mod_php_curl}" == "yes"
  283. BuildPreReq: curl
  284. PreReq: curl
  285. %endif
  286. %if "%{with_mod_php_mhash}" == "yes"
  287. BuildPreReq: mhash
  288. PreReq: mhash
  289. %endif
  290. %if "%{with_mod_php_gdbm}" == "yes"
  291. BuildPreReq: gdbm
  292. PreReq: gdbm
  293. %endif
  294. %if "%{with_mod_php_oci7}" == "yes" || "%{with_mod_php_oci8}" == "yes"
  295. BuildPreReq: ORACLE
  296. %endif
  297. %if "%{with_mod_php_snmp}" == "yes"
  298. BuildPreReq: snmp
  299. PreReq: snmp
  300. %endif
  301. %if "%{with_mod_php_unixodbc}" == "yes"
  302. BuildPreReq: unixodbc
  303. PreReq: unixodbc
  304. %endif
  305. %endif
  306. %if "%{with_mod_php3}" == "yes"
  307. BuildPreReq: make, bison, flex
  308. %if "%{with_mod_php3_gd}" == "yes"
  309. BuildPreReq: gd
  310. PreReq: gd
  311. %endif
  312. %if "%{with_mod_php3_jpeg}" == "yes"
  313. BuildPreReq: jpeg
  314. PreReq: jpeg
  315. %endif
  316. %if "%{with_mod_php3_mysql}" == "yes"
  317. BuildPreReq: mysql
  318. PreReq: mysql
  319. %endif
  320. %if "%{with_mod_php3_openssl}" == "yes"
  321. BuildPreReq: openssl
  322. PreReq: openssl
  323. %endif
  324. %if "%{with_mod_php3_zlib}" == "yes"
  325. BuildPreReq: zlib
  326. PreReq: zlib
  327. %endif
  328. %endif
  329. %if "%{with_mod_auth_ldap}" == "yes"
  330. BuildPreReq: openldap, openssl
  331. PreReq: openldap, openssl
  332. %endif
  333. %if "%{with_mod_auth_pam}" == "yes"
  334. BuildPreReq: PAM
  335. PreReq: PAM
  336. %endif
  337. %if "%{with_gdbm_ndbm}" == "yes"
  338. BuildPreReq: gdbm, gdbm::with_ndbm = yes
  339. PreReq: gdbm, gdbm::with_ndbm = yes
  340. %endif
  341. AutoReq: no
  342. AutoReqProv: no
  343. %description
  344. The Apache Project is a collaborative software development effort
  345. aimed at creating a robust, commercial-grade, featureful, and
  346. freely-available source code implementation of an HTTP (Web) server.
  347. The project is jointly managed by a group of volunteers located
  348. around the world, using the Internet and the Web to communicate,
  349. plan, and develop the server and its related documentation. These
  350. volunteers are known as the Apache Group. In addition, hundreds
  351. of users have contributed ideas, code, and documentation to the
  352. project.
  353. %prep
  354. # unpack Apache distribution
  355. %setup0 -q -c
  356. %patch0 -p0
  357. %{l_shtool} subst \
  358. -e 's;"Unix";"%{l_openpkg_release -F "OpenPKG/%%s"}";g' \
  359. apache_%{V_apache}/src/os/unix/os.h
  360. # unpack optional extension modules
  361. %if "%{with_mod_ssl}" == "yes"
  362. %setup1 -q -T -D -a 1
  363. %endif
  364. %if "%{with_mod_perl}" == "yes"
  365. %setup2 -q -T -D -a 2
  366. %endif
  367. %if "%{with_mod_php}" == "yes"
  368. %setup3 -q -T -D -a 3
  369. %endif
  370. %if "%{with_mod_dav}" == "yes"
  371. %setup4 -q -T -D -a 4
  372. %endif
  373. %if "%{with_mod_layout}" == "yes"
  374. %setup5 -q -T -D -a 5
  375. %endif
  376. %if "%{with_mod_macro}" == "yes"
  377. %setup6 -q -T -D -a 6
  378. %endif
  379. %if "%{with_mod_auth_pam}" == "yes"
  380. %setup7 -q -T -D -a 7
  381. %endif
  382. %if "%{with_mod_fastcgi}" == "yes"
  383. %setup9 -q -T -D -a 9
  384. %endif
  385. %if "%{with_mod_throttle}" == "yes"
  386. %setup10 -q -T -D -a 10
  387. %endif
  388. %if "%{with_mod_access_referer}" == "yes"
  389. %setup11 -q -T -D -a 11
  390. %endif
  391. %if "%{with_mod_roaming}" == "yes"
  392. %setup12 -q -T -D -a 12
  393. %endif
  394. %if "%{with_mod_relocate}" == "yes"
  395. %setup13 -q -T -D -a 13
  396. %endif
  397. %if "%{with_mod_php3}" == "yes"
  398. %setup14 -q -T -D -a 14
  399. %endif
  400. %if "%{with_mod_auth_ldap}" == "yes"
  401. %setup15 -q -T -D -a 15
  402. %endif
  403. %build
  404. # prepare environment
  405. rm -rf $RPM_BUILD_ROOT
  406. %{l_shtool} mkdir -f -p -m 755 $RPM_BUILD_ROOT%{l_prefix}
  407. # optionally prepare mod_ssl
  408. %if "%{with_mod_ssl}" == "yes"
  409. ( cd mod_ssl-%{V_mod_ssl}
  410. ./configure \
  411. --with-apache=../apache_%{V_apache} \
  412. --expert --force
  413. ) || exit $?
  414. %endif
  415. # optionally pre-configure Apache for mod_php, mod_php3 and mod_dav
  416. %if "%{with_mod_php}" == "yes" || "%{with_mod_php3}" == "yes" || "%{with_mod_dav}" == "yes"
  417. ( cd apache_%{V_apache}
  418. CC="%{l_cc}" \
  419. %if "%{with_debug}" == "yes"
  420. CFLAGS="%{l_cflags} -g" \
  421. %else
  422. CFLAGS="%{l_cflags -O}" \
  423. %endif
  424. ./configure \
  425. %if "%{with_mod_ssl}" == "yes"
  426. --enable-rule=EAPI \
  427. %endif
  428. %if "%{with_shared_core}" == "yes"
  429. --enable-rule=SHARED_CORE \
  430. %endif
  431. %if "%{with_shared_chain}" == "yes"
  432. --enable-rule=SHARED_CHAIN \
  433. %endif
  434. --target=apache \
  435. --with-layout=GNU \
  436. --prefix=%{l_prefix} \
  437. --sbindir=%{l_prefix}/sbin \
  438. --sysconfdir=%{l_prefix}/etc/apache \
  439. --libexecdir=%{l_prefix}/lib/apache \
  440. --datadir=%{l_prefix}/share/apache \
  441. --localstatedir=%{l_prefix}/var/apache
  442. ) || exit $?
  443. %endif
  444. # optionally prepare mod_perl
  445. %if "%{with_mod_perl}" == "yes"
  446. ( cd mod_perl-%{V_mod_perl}
  447. eval `%{l_prefix}/bin/perl -V:archname`
  448. eval `%{l_prefix}/bin/perl -V:version`
  449. eval `%{l_prefix}/bin/perl -V:installarchlib -V:installprivlib -V:installsitearch -V:installsitelib`
  450. %{l_shtool} mkdir -f -p -m 755 $RPM_BUILD_ROOT%{l_prefix}/bin
  451. perl=$RPM_BUILD_ROOT%{l_prefix}/bin/perl
  452. echo "#!/bin/sh" >$perl
  453. echo "exec %{l_prefix}/bin/perl \\" >>$perl
  454. echo " -I${RPM_BUILD_ROOT}${installarchlib} \\" >>$perl
  455. echo " -I${RPM_BUILD_ROOT}${installprivlib} \\" >>$perl
  456. echo " -I${RPM_BUILD_ROOT}${installsitearch} \\" >>$perl
  457. echo " -I${RPM_BUILD_ROOT}${installsitelib} \\" >>$perl
  458. echo " \"\$@\"" >>$perl
  459. chmod a+x $perl
  460. $perl Makefile.PL \
  461. PREFIX=$RPM_BUILD_ROOT%{l_prefix} \
  462. APACHE_SRC=../apache_%{V_apache}/src \
  463. DO_HTTPD=1 \
  464. USE_APACI=1 \
  465. PREP_HTTPD=1 \
  466. EVERYTHING=1 \
  467. PERL_TIE_TABLES=1 \
  468. PERL_DIRECTIVE_HANDLERS=1
  469. %{l_make} %{l_mflags}
  470. %{l_make} %{l_mflags} install
  471. rm -rf $RPM_BUILD_ROOT%{l_prefix}/man/man3
  472. %{l_shtool} subst -e "s;^\\(PERL = \\).*;\\1 $perl;" \
  473. ../apache_%{V_apache}/src/modules/perl/mod_perl.config
  474. ) || exit $?
  475. %endif
  476. # optionally prepare mod_php
  477. %if "%{with_mod_php}" == "yes"
  478. ( cd php-%{V_mod_php}
  479. CC="%{l_cc}"; export CC
  480. %if "%{with_debug}" == "yes"
  481. CFLAGS="%{l_cflags -O} %{l_cppflags}"; export CFLAGS
  482. CPPFLAGS="%{l_cflags -O} %{l_cppflags}"; export CPPFLAGS
  483. LDFLAGS="%{l_cflags -O} %{l_ldflags}"; export LDFLAGS
  484. %else
  485. CFLAGS="%{l_cflags} -g %{l_cppflags}"; export CFLAGS
  486. CPPFLAGS="%{l_cflags} -g %{l_cppflags}"; export CPPFLAGS
  487. LDFLAGS="%{l_cflags} -g %{l_ldflags}"; export LDFLAGS
  488. %endif
  489. LIBS=""; export LIBS
  490. %if "%{with_mod_ssl}" == "yes"
  491. CFLAGS="$CFLAGS -DEAPI"
  492. %endif
  493. %if "%{with_mod_php_gd}" == "yes"
  494. LIBS="$LIBS -lpng -lz"
  495. %endif
  496. %if "%{with_mod_php_gettext}" == "yes"
  497. LIBS="$LIBS -liconv"
  498. %endif
  499. %if "%{with_mod_php_openldap}" == "yes" && "%{with_mod_php_openldapsasl}" == "yes"
  500. LIBS="$LIBS -lsasl2"
  501. %endif
  502. %if "%{with_mod_php_imap}" == "yes"
  503. LIBS="$LIBS -lssl -lcrypto"
  504. %endif
  505. %if "%{with_mod_php_db}" == "yes"
  506. LIBS="$LIBS -ldb"
  507. %endif
  508. %if "%{with_mod_php_oci7}" == "yes" || "%{with_mod_php_oci8}" == "yes"
  509. ORACLE_HOME="`%{l_prefix}/etc/rc --query oracle_home`"
  510. export ORACLE_HOME
  511. %endif
  512. PROG_SENDMAIL="%{l_prefix}/sbin/sendmail"
  513. export PROG_SENDMAIL
  514. ./configure \
  515. --prefix=%{l_prefix} \
  516. --with-apache=../apache_%{V_apache} \
  517. --with-config-file-path=%{l_prefix}/etc/apache \
  518. %if "%{with_mod_php_mbregex}" == "yes"
  519. --enable-mbregex \
  520. %endif
  521. %if "%{with_mod_php_mbstring}" == "yes"
  522. --enable-mbstring \
  523. %endif
  524. %if "%{with_mod_php_calendar}" == "yes"
  525. --enable-calendar \
  526. %endif
  527. %if "%{with_mod_php_mysql}" == "yes"
  528. --with-mysql=%{l_prefix} \
  529. %else
  530. --without-mysql \
  531. %endif
  532. %if "%{with_mod_php_pgsql}" == "yes"
  533. --with-pgsql=%{l_prefix} \
  534. %else
  535. --without-pgsql \
  536. %endif
  537. %if "%{with_mod_php_gd}" == "yes"
  538. --with-gd=%{l_prefix} \
  539. --with-jpeg-dir=%{l_prefix} \
  540. --with-png-dir=%{l_prefix} \
  541. %endif
  542. %if "%{with_mod_php_freetype}" == "yes"
  543. --enable-gd-imgstrttf \
  544. --enable-gd-native-ttf \
  545. --with-freetype-dir=%{l_prefix} \
  546. %endif
  547. %if "%{with_mod_php_db}" == "yes"
  548. --with-db4=%{l_prefix} \
  549. %endif
  550. %if "%{with_mod_php_debug}" == "yes"
  551. --with-debug=yes \
  552. %else
  553. --with-debug=no \
  554. %endif
  555. %if "%{with_mod_php_zlib}" == "yes"
  556. --with-zlib=%{l_prefix} \
  557. --with-zlib-dir=%{l_prefix} \
  558. %endif
  559. %if "%{with_mod_php_bzip2}" == "yes"
  560. --with-bz2=%{l_prefix} \
  561. %endif
  562. %if "%{with_mod_php_pdflib}" == "yes"
  563. --with-pdflib=%{l_prefix} \
  564. --with-jpeg-dir=%{l_prefix} \
  565. --with-png-dir=%{l_prefix} \
  566. %endif
  567. %if "%{with_mod_php_openssl}" == "yes" || "%{with_mod_php_openldap}" == "yes"
  568. --with-openssl=%{l_prefix} \
  569. %endif
  570. %if "%{with_mod_php_openldap}" == "yes"
  571. --with-ldap=%{l_prefix} \
  572. %endif
  573. %if "%{with_mod_php_mm}" == "yes"
  574. --with-mm=%{l_prefix} \
  575. --enable-session \
  576. %endif
  577. %if "%{with_mod_php_pcre}" == "yes"
  578. --with-pcre=%{l_prefix} \
  579. %endif
  580. %if "%{with_mod_php_ftp}" == "yes"
  581. --enable-ftp \
  582. %endif
  583. %if "%{with_mod_php_java}" == "yes"
  584. --with-java=%{l_prefix}/libexec/j2se \
  585. %endif
  586. %if "%{with_mod_php_oci7}" == "yes"
  587. --with-oracle \
  588. %endif
  589. %if "%{with_mod_php_oci8}" == "yes"
  590. --with-oci8 \
  591. %endif
  592. %if "%{with_mod_php_gettext}" == "yes"
  593. --with-gettext=%{l_prefix} \
  594. %endif
  595. %if "%{with_mod_php_imap}" == "yes"
  596. --with-imap=%{l_prefix} \
  597. --with-imap-ssl=%{l_prefix} \
  598. %endif
  599. %if "%{with_mod_php_xml}" == "yes"
  600. --enable-xml \
  601. --with-expat-dir=%{l_prefix} \
  602. %else
  603. --disable-xml \
  604. %endif
  605. %if "%{with_mod_php_dom}" == "yes"
  606. --with-dom=%{l_prefix} \
  607. --with-dom-xslt=%{l_prefix} \
  608. --with-dom-exslt=%{l_prefix} \
  609. %endif
  610. %if "%{with_mod_php_wddx}" == "yes"
  611. --enable-wddx \
  612. %endif
  613. %if "%{with_mod_php_bc}" == "yes"
  614. --enable-bcmath \
  615. %endif
  616. %if "%{with_mod_php_transsid}" == "yes"
  617. --enable-trans-sid \
  618. %endif
  619. %if "%{with_mod_php_mhash}" == "yes"
  620. --with-mhash=%{l_prefix} \
  621. %endif
  622. %if "%{with_mod_php_curl}" == "yes"
  623. --with-curl=%{l_prefix} \
  624. %endif
  625. %if "%{with_mod_php_gdbm}" == "yes"
  626. --with-gdbm=%{l_prefix} \
  627. %endif
  628. %if "%{with_mod_php_versioning}" == "yes"
  629. --enable-versioning \
  630. %endif
  631. %if "%{with_mod_php_unixodbc}" == "yes"
  632. --with-unixODBC=%{l_prefix} \
  633. %endif
  634. %if "%{with_mod_php_snmp}" == "yes"
  635. --with-snmp=%{l_prefix} \
  636. %endif
  637. --disable-cli \
  638. --without-pear \
  639. --disable-shared \
  640. --enable-inline-optimization \
  641. --enable-track-vars
  642. %{l_make} %{l_mflags}
  643. %{l_shtool} subst \
  644. -e "s;^\\(EXTENSION_DIR = \\)\\(%{l_prefix}\\);\\1$RPM_BUILD_ROOT\\2;" \
  645. -e "s;^\\(PEAR_INSTALLDIR = \\)\\(%{l_prefix}\\);\\1$RPM_BUILD_ROOT\\2;" \
  646. config_vars.mk
  647. %{l_make} %{l_mflags} install \
  648. prefix=$RPM_BUILD_ROOT%{l_prefix}
  649. ) || exit $?
  650. %endif
  651. # optionally prepare mod_php3
  652. %if "%{with_mod_php3}" == "yes"
  653. ( cd php-%{V_mod_php3}
  654. CC="%{l_cc}" \
  655. %if "%{with_mod_ssl}" == "yes"
  656. CFLAGS="%{l_cflags -O} %{l_cppflags} -DEAPI" \
  657. %else
  658. CFLAGS="%{l_cflags -O} %{l_cppflags}" \
  659. %endif
  660. CPPFLAGS="%{l_cflags -O} %{l_cppflags}" \
  661. LDFLAGS="%{l_cflags -O} %{l_ldflags}" \
  662. ./configure \
  663. --prefix=%{l_prefix} \
  664. --with-apache=../apache_%{V_apache} \
  665. --with-config-file-path=%{l_prefix}/etc/apache \
  666. %if "%{with_mod_php3_ftp}" == "yes"
  667. --with-ftp \
  668. %endif
  669. %if "%{with_mod_php3_mysql}" == "yes"
  670. --with-mysql=%{l_prefix} \
  671. %else
  672. --without-mysql \
  673. %endif
  674. %if "%{with_mod_php3_zlib}" == "yes"
  675. --with-zlib=%{l_prefix} \
  676. %endif
  677. %if "%{with_mod_php3_jpeg}" == "yes"
  678. --with-jpeg=%{l_prefix} \
  679. %endif
  680. %if "%{with_mod_php3_gd}" == "yes"
  681. --with-gd=%{l_prefix} \
  682. %endif
  683. %if "%{with_mod_php3_openssl}" == "yes"
  684. --with-openssl=%{l_prefix} \
  685. %endif
  686. --disable-shared \
  687. --enable-track-vars
  688. %{l_make} %{l_mflags}
  689. %{l_make} %{l_mflags} install \
  690. prefix=$RPM_BUILD_ROOT%{l_prefix}
  691. ) || exit $?
  692. %endif
  693. # optionally prepare mod_dav
  694. %if "%{with_mod_dav}" == "yes"
  695. ( cd mod_dav-%{V_mod_dav}
  696. CC="%{l_cc}" \
  697. %if "%{with_debug}" == "yes"
  698. %if "%{with_mod_ssl}" == "yes"
  699. CFLAGS="%{l_cflags} -g" \
  700. %else
  701. CFLAGS="%{l_cflags} -g -DEAPI" \
  702. %endif
  703. %else
  704. %if "%{with_mod_ssl}" == "yes"
  705. CFLAGS="%{l_cflags -O}" \
  706. %else
  707. CFLAGS="%{l_cflags -O} -DEAPI" \
  708. %endif
  709. %endif
  710. LDFLAGS="%{l_cflags -O}" \
  711. ./configure \
  712. --with-apache=../apache_%{V_apache} \
  713. --with-expat=%{l_prefix}
  714. %{l_make} %{l_mflags}
  715. %{l_make} %{l_mflags} install
  716. ) || exit $?
  717. %endif
  718. # optionally prepare mod_layout
  719. %if "%{with_mod_layout}" == "yes"
  720. ( cd mod_layout-%{V_mod_layout}
  721. mkdir ../apache_%{V_apache}/src/modules/layout
  722. cp * ../apache_%{V_apache}/src/modules/layout/ 2>/dev/null || true
  723. chmod -R u+w ../apache_%{V_apache}/src/modules/layout
  724. ) || exit $?
  725. %endif
  726. # optionally prepare mod_macro
  727. %if "%{with_mod_macro}" == "yes"
  728. ( cd mod_macro-%{V_mod_macro}
  729. cp mod_macro.c ../apache_%{V_apache}/src/modules/extra/
  730. ) || exit $?
  731. %endif
  732. # optionally prepare mod_auth_pam
  733. %if "%{with_mod_auth_pam}" == "yes"
  734. ( cd mod_auth_pam-%{V_mod_auth_pam}
  735. sed -e '234N;s/\n//' -e '239N;s/\n//' <mod_auth_pam.c \
  736. >../apache_%{V_apache}/src/modules/extra/mod_auth_pam.c
  737. ) || exit $?
  738. %endif
  739. # optionally prepare mod_auth_ldap
  740. %if "%{with_mod_auth_ldap}" == "yes"
  741. ( cd modauthldap
  742. cp mod_auth_ldap.c ../apache_%{V_apache}/src/modules/extra/
  743. ) || exit $?
  744. %endif
  745. # optionally prepare mod_gzip
  746. %if "%{with_mod_gzip}" == "yes"
  747. cp %{SOURCE mod_gzip.c} apache_%{V_apache}/src/modules/extra/
  748. %endif
  749. # optionally prepare mod_fastcgi
  750. %if "%{with_mod_fastcgi}" == "yes"
  751. ( cd mod_fastcgi-%{V_mod_fastcgi}
  752. mkdir ../apache_%{V_apache}/src/modules/fastcgi
  753. cp -rp * ../apache_%{V_apache}/src/modules/fastcgi/
  754. ) || exit $?
  755. %endif
  756. # optionally prepare mod_throttle
  757. %if "%{with_mod_throttle}" == "yes"
  758. ( cd mod_throttle-*
  759. cp mod_throttle.c ../apache_%{V_apache}/src/modules/extra/
  760. ) || exit $?
  761. %endif
  762. # optionally prepare mod_access_referer
  763. %if "%{with_mod_access_referer}" == "yes"
  764. ( cd mod_access_referer-%{V_mod_access_referer}
  765. cp mod_access_referer.c ../apache_%{V_apache}/src/modules/extra/
  766. ) || exit $?
  767. %endif
  768. # optionally prepare mod_roaming
  769. %if "%{with_mod_roaming}" == "yes"
  770. ( cd mod_roaming-%{V_mod_roaming}
  771. cp mod_roaming.c ../apache_%{V_apache}/src/modules/extra/
  772. ) || exit $?
  773. %endif
  774. # optionally prepare mod_relocate
  775. %if "%{with_mod_relocate}" == "yes"
  776. ( cd mod_relocate-%{V_mod_relocate}
  777. cp mod_relocate.c ../apache_%{V_apache}/src/modules/extra/
  778. ) || exit $?
  779. %endif
  780. # configure Apache
  781. ( cd apache_%{V_apache}
  782. %if "%{with_debug}" == "yes"
  783. cflags="%{l_cflags} -g"
  784. %else
  785. cflags="%{l_cflags -O}"
  786. %endif
  787. ldflags=""
  788. libs=""
  789. %if "%{with_mod_auth_pam}" == "yes"
  790. pam_incdir=`%{l_prefix}/etc/rc --query pam_incdir`
  791. if [ ".$pam_incdir" != "./usr/include" -a ".$pam_incdir" != "./include" ]; then
  792. cflags="$cflags -I$pam_incdir"
  793. fi
  794. pam_libdir=`%{l_prefix}/etc/rc --query pam_libdir`
  795. if [ ".$pam_libdir" != "./usr/lib" -a ".$pam_libdir" != "./lib" ]; then
  796. ldflags="$ldflags -L$pam_libdir"
  797. fi
  798. libs="$libs -lpam"
  799. %endif
  800. %if "%{with_mod_auth_ldap}" == "yes"
  801. cflags="$cflags %{l_cppflags}"
  802. ldflags="$ldflags %{l_ldflags}"
  803. libs="$libs -lldap -llber -lssl -lcrypto"
  804. %endif
  805. %if "%{with_gdbm_ndbm}" == "yes"
  806. cflags="$cflags %{l_cppflags}"
  807. ldflags="$ldflags %{l_ldflags}"
  808. libs="$libs -lndbm -lgdbm"
  809. %endif
  810. CC="%{l_cc}" \
  811. CFLAGS="$cflags" \
  812. LDFLAGS="$ldflags" \
  813. LIBS="$libs" \
  814. LD_SHLIB="%{l_cc}" \
  815. %if "%{with_mod_ssl}" == "yes"
  816. EAPI_MM="%{l_prefix}" \
  817. SSL_BASE="%{l_prefix}" \
  818. %endif
  819. ./configure \
  820. --target=apache \
  821. --with-layout=GNU \
  822. --prefix=%{l_prefix} \
  823. --sbindir=%{l_prefix}/sbin \
  824. --sysconfdir=%{l_prefix}/etc/apache \
  825. --libexecdir=%{l_prefix}/lib/apache \
  826. --datadir=%{l_prefix}/share/apache \
  827. --localstatedir=%{l_prefix}/var/apache \
  828. %if "%{with_debug}" == "yes"
  829. --without-execstrip \
  830. %endif
  831. %if "%{with_suexec}" == "yes"
  832. --enable-suexec \
  833. --suexec-caller=%{with_suexec_caller} \
  834. --suexec-userdir=%{with_suexec_userdir} \
  835. --suexec-logfile=%{l_prefix}/var/apache/log/suexec.log \
  836. %endif
  837. --enable-module=most \
  838. --with-perl=%{l_prefix}/bin/perl \
  839. %if "%{with_mod_ssl}" == "yes"
  840. --enable-rule=EAPI \
  841. --enable-module=ssl \
  842. %endif
  843. %if "%{with_mod_perl}" == "yes"
  844. --activate-module=src/modules/perl/libperl.a \
  845. %endif
  846. %if "%{with_mod_php}" == "yes"
  847. --activate-module=src/modules/php4/libphp4.a \
  848. %endif
  849. %if "%{with_mod_php3}" == "yes"
  850. --activate-module=src/modules/php3/libphp3.a \
  851. %endif
  852. %if "%{with_mod_dav}" == "yes"
  853. --activate-module=src/modules/dav/libdav.a \
  854. --enable-rule=EXPAT \
  855. %else
  856. --disable-rule=EXPAT \
  857. %endif
  858. %if "%{with_shared_core}" == "yes"
  859. --enable-rule=SHARED_CORE \
  860. %endif
  861. %if "%{with_shared_chain}" == "yes"
  862. --enable-rule=SHARED_CHAIN \
  863. %endif
  864. %if "%{with_mod_layout}" == "yes"
  865. --activate-module=src/modules/layout/liblayout.a \
  866. %endif
  867. %if "%{with_mod_macro}" == "yes"
  868. --activate-module=src/modules/extra/mod_macro.o \
  869. %endif
  870. %if "%{with_mod_auth_pam}" == "yes"
  871. --activate-module=src/modules/extra/mod_auth_pam.o \
  872. %endif
  873. %if "%{with_mod_auth_ldap}" == "yes"
  874. --activate-module=src/modules/extra/mod_auth_ldap.c \
  875. %endif
  876. %if "%{with_mod_gzip}" == "yes"
  877. --activate-module=src/modules/extra/mod_gzip.o \
  878. %endif
  879. %if "%{with_mod_fastcgi}" == "yes"
  880. --activate-module=src/modules/fastcgi/libfastcgi.a \
  881. %endif
  882. %if "%{with_mod_throttle}" == "yes"
  883. --activate-module=src/modules/extra/mod_throttle.o \
  884. %endif
  885. %if "%{with_mod_access_referer}" == "yes"
  886. --activate-module=src/modules/extra/mod_access_referer.o \
  887. %endif
  888. %if "%{with_mod_roaming}" == "yes"
  889. --activate-module=src/modules/extra/mod_roaming.o \
  890. %endif
  891. %if "%{with_mod_relocate}" == "yes"
  892. --activate-module=src/modules/extra/mod_relocate.o \
  893. %endif
  894. --enable-module=so
  895. %{l_make} %{l_mflags -O} build-quiet
  896. ) || exit $?
  897. %install
  898. # install Apache
  899. ( cd apache_%{V_apache}
  900. # perform standard Apache installation procedure
  901. %{l_make} %{l_mflags} install root=$RPM_BUILD_ROOT
  902. # post-adjustments to installation tree
  903. mv $RPM_BUILD_ROOT%{l_prefix}/share/apache/icons/small/* \
  904. $RPM_BUILD_ROOT%{l_prefix}/share/apache/icons/
  905. rm -rf $RPM_BUILD_ROOT%{l_prefix}/share/apache/icons/small
  906. rm -f $RPM_BUILD_ROOT%{l_prefix}/share/apache/icons/README*
  907. rm -f $RPM_BUILD_ROOT%{l_prefix}/etc/apache/*.default
  908. rm -f $RPM_BUILD_ROOT%{l_prefix}/etc/apache/srm.conf
  909. rm -f $RPM_BUILD_ROOT%{l_prefix}/etc/apache/access.conf
  910. mv $RPM_BUILD_ROOT%{l_prefix}/share/apache/htdocs/index.html.en \
  911. $RPM_BUILD_ROOT%{l_prefix}/share/apache/htdocs/index.html
  912. rm -f $RPM_BUILD_ROOT%{l_prefix}/share/apache/htdocs/index.html.*
  913. chmod a+rx $RPM_BUILD_ROOT%{l_prefix}/share/apache/cgi-bin/*
  914. mv $RPM_BUILD_ROOT%{l_prefix}/share/apache/cgi-bin \
  915. $RPM_BUILD_ROOT%{l_prefix}/cgi/
  916. rm -rf $RPM_BUILD_ROOT%{l_prefix}/cgi/test-cgi
  917. ) || exit $?
  918. %if "%{with_mod_perl}" == "yes"
  919. # cleanup for mod_perl
  920. rm -f $RPM_BUILD_ROOT%{l_prefix}/bin/perl
  921. # provide mod_perl init script
  922. %{l_shtool} install -c -m 644 \
  923. %{SOURCE apache.pl} \
  924. $RPM_BUILD_ROOT%{l_prefix}/etc/apache/
  925. %endif
  926. # optionally make PHP happy
  927. %if "%{with_mod_php}" == "yes"
  928. %{l_shtool} install -c -m 644 /dev/null \
  929. $RPM_BUILD_ROOT%{l_prefix}/etc/apache/php.ini
  930. rm -rf $RPM_BUILD_ROOT%{l_prefix}/include/php
  931. rm -rf $RPM_BUILD_ROOT%{l_prefix}/lib/php/build
  932. %endif
  933. # create default configuration
  934. l_hostname=`%{l_shtool} echo -e %h`
  935. l_domainname=`%{l_shtool} echo -e %d | cut -c2-`
  936. %{l_shtool} install -c -m 644 %{l_value -s -a} \
  937. -e "s;@l_hostname@;$l_hostname;g" \
  938. -e "s;@l_domainname@;$l_domainname;g" \
  939. %{SOURCE apache.base} \
  940. %{SOURCE apache.conf} \
  941. %{SOURCE apache.vhost} \
  942. $RPM_BUILD_ROOT%{l_prefix}/etc/apache/
  943. mv $RPM_BUILD_ROOT%{l_prefix}/etc/apache/magic $RPM_BUILD_ROOT%{l_prefix}/etc/apache/mime.magic
  944. find $RPM_BUILD_ROOT%{l_prefix} -name perllocal.pod -print | xargs rm -f
  945. # create run-command script
  946. %{l_shtool} mkdir -f -p -m 755 $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d
  947. %{l_shtool} install -c -m 755 %{l_value -s -a} \
  948. %{SOURCE rc.apache} $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d/
  949. # strip installation binaries
  950. %if "%{with_debug}" != "yes"
  951. strip $RPM_BUILD_ROOT%{l_prefix}/bin/* 2>/dev/null || true
  952. strip $RPM_BUILD_ROOT%{l_prefix}/sbin/* 2>/dev/null || true
  953. %endif
  954. # determine installation tree files
  955. %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
  956. %{l_files_std} \
  957. %if "%{with_suexec}" == "yes"
  958. '%attr(4755,%{l_susr},%{l_mgrp}) %{l_prefix}/sbin/suexec' \
  959. %endif
  960. '%config %{l_prefix}/etc/apache/*' \
  961. %if "%{with_mod_ssl}" == "yes"
  962. '%config %{l_prefix}/etc/apache/ssl.crl/*.crl' \
  963. '%config %{l_prefix}/etc/apache/ssl.crt/*.crt' \
  964. '%config %{l_prefix}/etc/apache/ssl.csr/*.csr' \
  965. '%config %{l_prefix}/etc/apache/ssl.key/*.key' \
  966. '%config %{l_prefix}/etc/apache/ssl.prm/*.prm' \
  967. %endif
  968. '%config %attr(444,%{l_musr},%{l_mgrp}) %{l_prefix}/etc/apache/apache.base' \
  969. '%config(noreplace) %attr(444,%{l_musr},%{l_mgrp}) %{l_prefix}/etc/apache/apache.vhost'
  970. %files -f files
  971. %clean
  972. rm -rf $RPM_BUILD_ROOT
  973. %post
  974. %if "%{with_mod_auth_pam}" == "yes"
  975. # add PAM configuration entry
  976. if [ $1 -eq 1 ]; then
  977. $RPM_INSTALL_PREFIX/sbin/pamtool --add --smart --name=apache
  978. fi
  979. %endif
  980. # after upgrade, restart service
  981. [ $1 -eq 2 ] || exit 0
  982. eval `%{l_rc} apache status 2>/dev/null`
  983. [ ".$apache_active" = .yes ] && %{l_rc} apache restart
  984. exit 0
  985. %preun
  986. # before erase, stop service and remove log files
  987. [ $1 -eq 0 ] || exit 0
  988. %{l_rc} apache stop 2>/dev/null
  989. rm -rf $RPM_INSTALL_PREFIX/var/apache/log/ >/dev/null 2>&1 || true
  990. %if "%{with_mod_auth_pam}" == "yes"
  991. # remove PAM configuration entry
  992. $RPM_INSTALL_PREFIX/sbin/pamtool --remove --smart --name=apache
  993. %endif
  994. exit 0