apache.spec 42 KB

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