apache.spec 36 KB

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