apache.spec 33 KB

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