apache.spec 42 KB

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