apache.spec 39 KB

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