apache.spec 42 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306
  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.18-1.3.31
  36. %define V_mod_perl 1.29
  37. %define V_mod_php 4.3.7
  38. %define V_mod_php_hardened 0.1.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 20030510
  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.2
  53. %define V_mod_dosevasive 1.9
  54. %define V_suphp 0.5.1
  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: 20040623
  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_pdflib}" == "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/sourceforge/modauthmysql/mod_auth_mysql.tgz
  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. Patch0: apache.patch
  200. Patch1: apache.patch.modowa
  201. Patch2: http://www.hardened-php.net/hardened-php-%{V_mod_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: libcrack
  341. PreReq: libcrack
  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://sourceforge.net/projects/modauthmysql/
  390. regex = release_id=\d+[^\d]+(\d+)
  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_fastcgi = {
  403. version = %{V_mod_fastcgi}
  404. url = http://www.fastcgi.com/dist/
  405. regex = mod_fastcgi-(__VER__)\.tar\.gz
  406. }
  407. prog apache:mod_layout = {
  408. version = %{V_mod_layout}
  409. url = http://download.tangent.org/
  410. regex = mod_layout-(3\.[\d.]+)\.tar\.gz
  411. }
  412. prog apache:mod_macro = {
  413. disabled
  414. comment = "rse: permission denied on URL, no new URL available"
  415. version = %{V_mod_macro}
  416. url = http://www.cri.ensmp.fr/~coelho/mod_macro/
  417. regex = mod_macro-(__VER__)\.tar\.gz
  418. }
  419. prog apache:mod_perl = {
  420. version = %{V_mod_perl}
  421. url = http://perl.apache.org/dist/
  422. regex = mod_perl-(1\.[2-8]\d+)\.tar\.gz
  423. }
  424. prog apache:mod_php = {
  425. version = %{V_mod_php}
  426. url = http://www.php.net/downloads.php
  427. regex = php-(\d+\.\d+\.\d+)\.tar\.gz
  428. }
  429. prog apache:mod_php_hardened = {
  430. version = %{V_mod_php_hardened}
  431. url = http://www.hardened-php.net/download.php
  432. regex = hardened-php-%{V_mod_php}-(\d+(\.\d+)+).patch.gz
  433. }
  434. prog apache:mod_relocate = {
  435. version = %{V_mod_relocate}
  436. url = http://software.tangent.org/download/
  437. regex = mod_relocate-(__VER__)\.tar\.gz
  438. }
  439. prog apache:mod_roaming = {
  440. version = %{V_mod_roaming}
  441. url = http://www.klomp.org/mod_roaming/
  442. regex = mod_roaming-(1\.\d+\.\d+)\.tar\.gz
  443. }
  444. prog apache:mod_ssl = {
  445. version = %{V_mod_ssl}
  446. url = http://www.modssl.org/source/
  447. regex = mod_ssl-(__VER__)\.tar\.gz
  448. }
  449. prog apache:mod_throttle = {
  450. version = %{V_mod_throttle}
  451. url = http://www.snert.com/Software/mod_throttle/
  452. regex = mod_throttle(__VER__)\.tgz
  453. }
  454. prog apache:suphp = {
  455. version = %{V_suphp}
  456. url = http://www.suphp.org/Download.html
  457. regex = suphp-(__VER__).tar.gz
  458. }
  459. prog apache:mod_security = {
  460. version = %{V_mod_security}
  461. url = http://www.modsecurity.org/download/
  462. regex = mod_security-(__VER__).tar.gz
  463. }
  464. prog apache:mod_dosevasive = {
  465. version = %{V_mod_dosevasive}
  466. url = http://www.nuclearelephant.com/projects/dosevasive/
  467. regex = mod_dosevasive.(__VER__).tar.gz
  468. }
  469. %prep
  470. # unpack Apache distribution
  471. %setup -q -c
  472. %patch -p0
  473. %{l_shtool} subst \
  474. -e 's;"Unix";"%{l_openpkg_release -F "OpenPKG/%%s"}";g' \
  475. apache_%{V_apache}/src/os/unix/os.h
  476. # beautify printenv output
  477. %{l_shtool} subst \
  478. -e 's;"\\n";"<br>\\n";g' \
  479. apache_%{V_apache}/cgi-bin/printenv
  480. # unpack optional extension modules
  481. %if "%{with_mod_ssl}" == "yes"
  482. %setup -q -T -D -a 1
  483. %endif
  484. %if "%{with_mod_perl}" == "yes"
  485. %setup -q -T -D -a 2
  486. %endif
  487. %if "%{with_mod_php}" == "yes"
  488. %setup -q -T -D -a 3
  489. ( cd php-%{V_mod_php}
  490. %{l_shtool} subst \
  491. -e 's;\(/include\)/freetype2;\1;' \
  492. configure \
  493. ext/gd/config.m4
  494. %if "%{with_mod_php_mssql}" == "yes"
  495. %{l_shtool} subst \
  496. -e 's;\($PHP_MSSQL/include/\)\(tds.h\);\1freetds/\2;g' \
  497. -e 's;\($FREETDS_INSTALLATION_DIR/lib/\)\(libtds.a\);\1freetds/\2;g' \
  498. -e 's;\(MSSQL_INCDIR=$FREETDS_INSTALLATION_DIR/include\);\1/freetds;' \
  499. -e 's;\(MSSQL_LIBDIR=$FREETDS_INSTALLATION_DIR/lib\);\1/freetds;' \
  500. configure
  501. %{l_shtool} subst \
  502. -e 's;^typedef short SHORT\;;;' \
  503. ext/mssql/php_mssql.h
  504. %endif
  505. ) || exit $?
  506. %if "%{with_mod_php_hardened}" == "yes"
  507. %patch -p0 -P 2
  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. %endif
  546. %if "%{with_suphp}" == "yes"
  547. %setup -q -T -D -a 17
  548. %endif
  549. %if "%{with_mod_security}" == "yes"
  550. %setup -q -T -D -a 18
  551. %endif
  552. %if "%{with_mod_dosevasive}" == "yes"
  553. %setup -q -T -D -a 19
  554. %endif
  555. %if "%{with_mod_owa}" == "yes"
  556. %setup -q -T -D -a 20
  557. sed <%{PATCH apache.patch.modowa} \
  558. -e "s;@l_oracle_cflags@;`%{l_prefix}/etc/rc --query oracle_cflags`;g" |\
  559. %{l_patch} -p0
  560. %endif
  561. %build
  562. # prepare environment
  563. rm -rf $RPM_BUILD_ROOT
  564. %{l_shtool} mkdir -f -p -m 755 $RPM_BUILD_ROOT%{l_prefix}
  565. # optionally prepare mod_ssl
  566. %if "%{with_mod_ssl}" == "yes"
  567. ( cd mod_ssl-%{V_mod_ssl}
  568. ./configure \
  569. --with-apache=../apache_%{V_apache} \
  570. --expert --force
  571. ) || exit $?
  572. %endif
  573. # optionally pre-configure Apache for mod_php and mod_dav
  574. %if "%{with_mod_php}" == "yes" || "%{with_mod_dav}" == "yes"
  575. ( cd apache_%{V_apache}
  576. CC="%{l_cc}" \
  577. %if "%{with_debug}" == "yes"
  578. CFLAGS="%{l_cflags} -g" \
  579. %else
  580. CFLAGS="%{l_cflags -O}" \
  581. %endif
  582. ./configure \
  583. %if "%{with_mod_ssl}" == "yes"
  584. --enable-rule=EAPI \
  585. %endif
  586. %if "%{with_shared_core}" == "yes"
  587. --enable-rule=SHARED_CORE \
  588. %endif
  589. %if "%{with_shared_chain}" == "yes"
  590. --enable-rule=SHARED_CHAIN \
  591. %endif
  592. --target=apache \
  593. --with-layout=GNU \
  594. --prefix=%{l_prefix} \
  595. --sbindir=%{l_prefix}/sbin \
  596. --sysconfdir=%{l_prefix}/etc/apache \
  597. --libexecdir=%{l_prefix}/lib/apache \
  598. --datadir=%{l_prefix}/share/apache \
  599. --localstatedir=%{l_prefix}/var/apache
  600. ) || exit $?
  601. %endif
  602. # optionally prepare mod_perl
  603. %if "%{with_mod_perl}" == "yes"
  604. ( cd mod_perl-%{V_mod_perl}
  605. eval `%{l_prefix}/bin/perl -V:archname`
  606. eval `%{l_prefix}/bin/perl -V:version`
  607. eval `%{l_prefix}/bin/perl -V:installarchlib -V:installprivlib -V:installsitearch -V:installsitelib`
  608. %{l_shtool} mkdir -f -p -m 755 $RPM_BUILD_ROOT%{l_prefix}/bin
  609. perl=$RPM_BUILD_ROOT%{l_prefix}/bin/perl
  610. echo "#!/bin/sh" >$perl
  611. echo "exec %{l_prefix}/bin/perl \\" >>$perl
  612. echo " -I${RPM_BUILD_ROOT}${installarchlib} \\" >>$perl
  613. echo " -I${RPM_BUILD_ROOT}${installprivlib} \\" >>$perl
  614. echo " -I${RPM_BUILD_ROOT}${installsitearch} \\" >>$perl
  615. echo " -I${RPM_BUILD_ROOT}${installsitelib} \\" >>$perl
  616. echo " \"\$@\"" >>$perl
  617. chmod a+x $perl
  618. $perl Makefile.PL \
  619. PREFIX=$RPM_BUILD_ROOT%{l_prefix} \
  620. APACHE_SRC=../apache_%{V_apache}/src \
  621. DO_HTTPD=1 \
  622. USE_APACI=1 \
  623. PREP_HTTPD=1 \
  624. EVERYTHING=1 \
  625. PERL_TIE_TABLES=1 \
  626. PERL_DIRECTIVE_HANDLERS=1
  627. %{l_make} %{l_mflags}
  628. %{l_make} %{l_mflags} install
  629. rm -rf $RPM_BUILD_ROOT%{l_prefix}/man/man3
  630. %{l_shtool} subst -e "s;^\\(PERL = \\).*;\\1 $perl;" \
  631. ../apache_%{V_apache}/src/modules/perl/mod_perl.config
  632. ) || exit $?
  633. %endif
  634. # optionally prepare mod_php
  635. %if "%{with_mod_php}" == "yes"
  636. ( cd php-%{V_mod_php}
  637. CC="%{l_cc}"; export CC
  638. %if "%{with_debug}" == "yes"
  639. CFLAGS="%{l_cflags} -g %{l_cppflags}"; export CFLAGS
  640. CPPFLAGS="%{l_cflags} -g %{l_cppflags}"; export CPPFLAGS
  641. LDFLAGS="%{l_cflags} -g %{l_ldflags}"; export LDFLAGS
  642. %else
  643. CFLAGS="%{l_cflags -O} %{l_cppflags}"; export CFLAGS
  644. CPPFLAGS="%{l_cflags -O} %{l_cppflags}"; export CPPFLAGS
  645. LDFLAGS="%{l_cflags -O} %{l_ldflags}"; export LDFLAGS
  646. %endif
  647. LIBS=""; export LIBS
  648. %if "%{with_mod_ssl}" == "yes"
  649. CFLAGS="$CFLAGS -DEAPI"
  650. %endif
  651. %if "%{with_mod_php_gd}" == "yes"
  652. LIBS="$LIBS -lpng -lz"
  653. %endif
  654. %if "%{with_mod_php_gettext}" == "yes" || "%{with_mod_php_mssql}" == "yes"
  655. LIBS="$LIBS -liconv"
  656. %endif
  657. %if "%{with_mod_php_openldap}" == "yes" && "%{with_mod_php_openldapsasl}" == "yes"
  658. LIBS="$LIBS -lsasl2"
  659. %endif
  660. %if "%{with_mod_php_imap}" == "yes"
  661. LIBS="$LIBS -lssl -lcrypto"
  662. %endif
  663. %if "%{with_mod_php_bdb}" == "yes"
  664. LIBS="$LIBS -ldb"
  665. %endif
  666. %if "%{with_mod_php_oci7}" == "yes" || "%{with_mod_php_oci8}" == "yes"
  667. ORACLE_HOME="`%{l_prefix}/etc/rc --query oracle_home`"
  668. export ORACLE_HOME
  669. oracle_libdir="`%{l_prefix}/etc/rc --query oracle_libdir`"
  670. case "$oracle_libdir" in
  671. */lib32 )
  672. %{l_shtool} subst \
  673. -e 's;OCI8_DIR/lib;OCI8_DIR/lib32;' \
  674. configure
  675. ;;
  676. esac
  677. %endif
  678. %if "%{with_mod_php_sendmail}" == "yes"
  679. PROG_SENDMAIL="%{l_prefix}/sbin/sendmail" \
  680. %else
  681. PROG_SENDMAIL="`%{l_shtool} path false`" \
  682. %endif
  683. export PROG_SENDMAIL
  684. ./configure \
  685. --prefix=%{l_prefix} \
  686. --with-apache=../apache_%{V_apache} \
  687. --with-config-file-path=%{l_prefix}/etc/apache \
  688. %if "%{with_mod_php_mbregex}" == "yes"
  689. --enable-mbregex \
  690. %endif
  691. %if "%{with_mod_php_mbstring}" == "yes"
  692. --enable-mbstring \
  693. %endif
  694. %if "%{with_mod_php_calendar}" == "yes"
  695. --enable-calendar \
  696. %endif
  697. %if "%{with_mod_php_mssql}" == "yes"
  698. --with-mssql=%{l_prefix} \
  699. %else
  700. --without-mssql \
  701. %endif
  702. %if "%{with_mod_php_mysql}" == "yes"
  703. --with-mysql=%{l_prefix} \
  704. %else
  705. --without-mysql \
  706. %endif
  707. %if "%{with_mod_php_pgsql}" == "yes"
  708. --with-pgsql=%{l_prefix} \
  709. %else
  710. --without-pgsql \
  711. %endif
  712. %if "%{with_mod_php_gd}" == "yes"
  713. --with-gd=%{l_prefix} \
  714. --with-jpeg-dir=%{l_prefix} \
  715. --with-png-dir=%{l_prefix} \
  716. %endif
  717. %if "%{with_mod_php_freetype}" == "yes"
  718. --enable-gd-imgstrttf \
  719. --enable-gd-native-ttf \
  720. --with-freetype-dir=%{l_prefix} \
  721. %endif
  722. %if "%{with_mod_php_t1lib}" == "yes"
  723. --with-t1lib=%{l_prefix} \
  724. %endif
  725. %if "%{with_mod_php_bdb}" == "yes"
  726. --with-db4=%{l_prefix} \
  727. %endif
  728. %if "%{with_mod_php_debug}" == "yes"
  729. --with-debug=yes \
  730. %else
  731. --with-debug=no \
  732. %endif
  733. %if "%{with_mod_php_zlib}" == "yes"
  734. --with-zlib=%{l_prefix} \
  735. --with-zlib-dir=%{l_prefix} \
  736. %endif
  737. %if "%{with_mod_php_bzip2}" == "yes"
  738. --with-bz2=%{l_prefix} \
  739. %endif
  740. %if "%{with_mod_php_pdflib}" == "yes"
  741. --with-pdflib=%{l_prefix} \
  742. --with-jpeg-dir=%{l_prefix} \
  743. --with-png-dir=%{l_prefix} \
  744. %endif
  745. %if "%{with_mod_php_ssl}" == "yes" || "%{with_mod_php_openldap}" == "yes"
  746. --with-openssl=%{l_prefix} \
  747. %endif
  748. %if "%{with_mod_php_openldap}" == "yes"
  749. --with-ldap=%{l_prefix} \
  750. %endif
  751. %if "%{with_mod_php_mm}" == "yes"
  752. --with-mm=%{l_prefix} \
  753. --enable-session \
  754. %endif
  755. %if "%{with_mod_php_pcre}" == "yes"
  756. --with-pcre=%{l_prefix} \
  757. %endif
  758. %if "%{with_mod_php_ftp}" == "yes"
  759. --enable-ftp \
  760. %endif
  761. %if "%{with_mod_php_java}" == "yes"
  762. --with-java=%{l_prefix}/libexec/j2se \
  763. %endif
  764. %if "%{with_mod_php_oci7}" == "yes"
  765. --with-oracle \
  766. %endif
  767. %if "%{with_mod_php_oci8}" == "yes"
  768. --with-oci8 \
  769. --enable-sigchld \
  770. %endif
  771. %if "%{with_mod_php_gettext}" == "yes"
  772. --with-gettext=%{l_prefix} \
  773. %endif
  774. %if "%{with_mod_php_imap}" == "yes"
  775. --with-imap=%{l_prefix} \
  776. --with-imap-ssl=%{l_prefix} \
  777. %endif
  778. %if "%{with_mod_php_xml}" == "yes"
  779. --enable-xml \
  780. --with-expat-dir=%{l_prefix} \
  781. %else
  782. --disable-xml \
  783. %endif
  784. %if "%{with_mod_php_dom}" == "yes"
  785. --with-dom=%{l_prefix} \
  786. --with-dom-xslt=%{l_prefix} \
  787. --with-dom-exslt=%{l_prefix} \
  788. %endif
  789. %if "%{with_mod_php_wddx}" == "yes"
  790. --enable-wddx \
  791. %endif
  792. %if "%{with_mod_php_bc}" == "yes"
  793. --enable-bcmath \
  794. %endif
  795. %if "%{with_mod_php_transsid}" == "yes"
  796. --enable-trans-sid \
  797. %endif
  798. %if "%{with_mod_php_mhash}" == "yes"
  799. --with-mhash=%{l_prefix} \
  800. %endif
  801. %if "%{with_mod_php_mcrypt}" == "yes"
  802. --with-mcrypt=%{l_prefix} \
  803. %endif
  804. %if "%{with_mod_php_curl}" == "yes"
  805. --with-curl=%{l_prefix} \
  806. %endif
  807. %if "%{with_mod_php_gdbm}" == "yes"
  808. --with-gdbm=%{l_prefix} \
  809. %endif
  810. %if "%{with_mod_php_versioning}" == "yes"
  811. --enable-versioning \
  812. %endif
  813. %if "%{with_mod_php_odbc}" == "yes"
  814. --with-unixODBC=%{l_prefix} \
  815. %endif
  816. %if "%{with_mod_php_snmp}" == "yes"
  817. --with-snmp=%{l_prefix} \
  818. %endif
  819. %if "%{with_mod_php_exif}" == "yes"
  820. --with-exif \
  821. %endif
  822. %if "%{with_mod_php_iconv}" == "yes"
  823. --with-iconv=%{l_prefix} \
  824. %endif
  825. %if "%{with_mod_php_crack}" == "yes"
  826. --with-crack=%{l_prefix} \
  827. %endif
  828. --disable-cli \
  829. --without-pear \
  830. --disable-shared \
  831. --enable-inline-optimization \
  832. --enable-track-vars
  833. %{l_make} %{l_mflags}
  834. %{l_make} %{l_mflags} install \
  835. INSTALL_ROOT=$RPM_BUILD_ROOT
  836. ) || exit $?
  837. %endif
  838. # optionally prepare mod_dav
  839. %if "%{with_mod_dav}" == "yes"
  840. ( cd mod_dav-%{V_mod_dav}
  841. CC="%{l_cc}" \
  842. %if "%{with_debug}" == "yes"
  843. %if "%{with_mod_ssl}" == "yes"
  844. CFLAGS="%{l_cflags} -g" \
  845. %else
  846. CFLAGS="%{l_cflags} -g -DEAPI" \
  847. %endif
  848. %else
  849. %if "%{with_mod_ssl}" == "yes"
  850. CFLAGS="%{l_cflags -O}" \
  851. %else
  852. CFLAGS="%{l_cflags -O} -DEAPI" \
  853. %endif
  854. %endif
  855. LDFLAGS="%{l_cflags -O}" \
  856. ./configure \
  857. --with-apache=../apache_%{V_apache} \
  858. --with-expat=%{l_prefix}
  859. %{l_make} %{l_mflags}
  860. %{l_make} %{l_mflags} install
  861. ) || exit $?
  862. %endif
  863. # optionally prepare mod_layout
  864. %if "%{with_mod_layout}" == "yes"
  865. ( cd mod_layout-%{V_mod_layout}
  866. mkdir ../apache_%{V_apache}/src/modules/layout
  867. cp * ../apache_%{V_apache}/src/modules/layout/ 2>/dev/null || true
  868. chmod -R u+w ../apache_%{V_apache}/src/modules/layout
  869. ) || exit $?
  870. %endif
  871. # optionally prepare mod_macro
  872. %if "%{with_mod_macro}" == "yes"
  873. ( cd mod_macro-%{V_mod_macro}
  874. cp mod_macro.c ../apache_%{V_apache}/src/modules/extra/
  875. ) || exit $?
  876. %endif
  877. # optionally prepare mod_auth_pam
  878. %if "%{with_mod_auth_pam}" == "yes"
  879. ( cd mod_auth_pam-%{V_mod_auth_pam}
  880. sed -e '234N;s/\n//' -e '239N;s/\n//' <mod_auth_pam.c \
  881. >../apache_%{V_apache}/src/modules/extra/mod_auth_pam.c
  882. ) || exit $?
  883. %endif
  884. # optionally prepare mod_auth_ldap
  885. %if "%{with_mod_auth_ldap}" == "yes"
  886. ( cd mod_auth_ldap
  887. cp mod_auth_ldap.c ../apache_%{V_apache}/src/modules/extra/
  888. ) || exit $?
  889. %endif
  890. # optionally prepare mod_auth_radius
  891. %if "%{with_mod_auth_radius}" == "yes"
  892. ( cd mod_auth_radius-%{V_mod_auth_radius}
  893. sed -e 's;#endif DEBUG_RADIUS;#endif;' \
  894. <mod_auth_radius.c \
  895. >../apache_%{V_apache}/src/modules/extra/mod_auth_radius.c
  896. ) || exit $?
  897. %endif
  898. # optionally prepare mod_auth_mysql
  899. %if "%{with_mod_auth_mysql}" == "yes"
  900. %{l_shtool} install -c -m 644 \
  901. -e 's;^[ ]*MYSQL_LIB=.*$;;' \
  902. mod_auth_mysql/mod_auth_mysql.c \
  903. apache_%{V_apache}/src/modules/extra/
  904. %endif
  905. # optionally prepare mod_gzip
  906. %if "%{with_mod_gzip}" == "yes"
  907. cp %{SOURCE mod_gzip.c} apache_%{V_apache}/src/modules/extra/
  908. %endif
  909. # optionally prepare mod_fastcgi
  910. %if "%{with_mod_fastcgi}" == "yes"
  911. ( cd mod_fastcgi-%{V_mod_fastcgi}
  912. mkdir ../apache_%{V_apache}/src/modules/fastcgi
  913. cp -rp * ../apache_%{V_apache}/src/modules/fastcgi/
  914. ) || exit $?
  915. %endif
  916. # optionally prepare mod_throttle
  917. %if "%{with_mod_throttle}" == "yes"
  918. ( cd mod_throttle-*
  919. cp mod_throttle.c ../apache_%{V_apache}/src/modules/extra/
  920. ) || exit $?
  921. %endif
  922. # optionally prepare mod_access_referer
  923. %if "%{with_mod_access_referer}" == "yes"
  924. ( cd mod_access_referer-%{V_mod_access_referer}
  925. cp mod_access_referer.c ../apache_%{V_apache}/src/modules/extra/
  926. ) || exit $?
  927. %endif
  928. # optionally prepare mod_roaming
  929. %if "%{with_mod_roaming}" == "yes"
  930. ( cd mod_roaming-%{V_mod_roaming}
  931. cp mod_roaming.c ../apache_%{V_apache}/src/modules/extra/
  932. ) || exit $?
  933. %endif
  934. # optionally prepare mod_owa
  935. %if "%{with_mod_owa}" == "yes"
  936. ( cd modowa
  937. mkdir ../apache_%{V_apache}/src/modules/owa/
  938. cp src/*.{c,h} src/Makefile.{libdir,tmpl} \
  939. ../apache_%{V_apache}/src/modules/owa/
  940. ) || exit $?
  941. %endif
  942. # optionally prepare mod_relocate
  943. %if "%{with_mod_relocate}" == "yes"
  944. ( cd mod_relocate-%{V_mod_relocate}
  945. cp mod_relocate.c ../apache_%{V_apache}/src/modules/extra/
  946. ) || exit $?
  947. %endif
  948. # optionally prepare mod_suphp
  949. %if "%{with_suphp}" == "yes"
  950. ( cd suphp-%{V_suphp}
  951. cp src/apache/mod_suphp.c ../apache_%{V_apache}/src/modules/extra/
  952. chmod +rx configure
  953. CC="%{l_cc}" \
  954. CFLAGS="%{l_cflags -O}" \
  955. ./configure \
  956. --prefix=%{l_prefix} \
  957. --with-apxs="" \
  958. --with-apache-user=%{with_suphp_caller} \
  959. --with-php=%{with_suphp_phpcgi} \
  960. --with-logfile=%{l_prefix}/var/apache/log/suphp.log
  961. %{l_make} %{l_mflags -O}
  962. ) || exit $?
  963. %endif
  964. # optionally prepare mod_security
  965. %if "%{with_mod_security}" == "yes"
  966. ( cd mod_security-%{V_mod_security}/apache1
  967. cp mod_security.c ../../apache_%{V_apache}/src/modules/extra/
  968. ) || exit $?
  969. %endif
  970. # optionally prepare mod_dosevasive
  971. %if "%{with_mod_dosevasive}" == "yes"
  972. ( cd mod_dosevasive
  973. cp mod_dosevasive.c ../apache_%{V_apache}/src/modules/extra/
  974. ) || exit $?
  975. %endif
  976. # configure Apache
  977. ( cd apache_%{V_apache}
  978. %if "%{with_debug}" == "yes"
  979. cflags="%{l_cflags} -g"
  980. %else
  981. cflags="%{l_cflags -O}"
  982. %endif
  983. ldflags=""
  984. libs=""
  985. %if "%{with_mod_auth_pam}" == "yes"
  986. pam_incdir=`%{l_prefix}/etc/rc --query pam_incdir`
  987. if [ ".$pam_incdir" != "./usr/include" -a ".$pam_incdir" != "./include" ]; then
  988. cflags="$cflags -I$pam_incdir"
  989. fi
  990. pam_libdir=`%{l_prefix}/etc/rc --query pam_libdir`
  991. if [ ".$pam_libdir" != "./usr/lib" -a ".$pam_libdir" != "./lib" ]; then
  992. ldflags="$ldflags -L$pam_libdir"
  993. fi
  994. libs="$libs -lpam"
  995. %endif
  996. %if "%{with_mod_auth_ldap}" == "yes"
  997. cflags="$cflags %{l_cppflags}"
  998. ldflags="$ldflags %{l_ldflags}"
  999. libs="$libs -lldap -llber -lssl -lcrypto"
  1000. case "%{l_platform -t}" in
  1001. *-sunos* )
  1002. libs="$libs -lresolv"
  1003. ;;
  1004. esac
  1005. %endif
  1006. %if "%{with_mod_auth_mysql}" == "yes"
  1007. cflags="$cflags %{l_cppflags} -DAPACHE1"
  1008. ldflags="$ldflags %{l_ldflags mysql}"
  1009. libs="$libs -lmysqlclient"
  1010. %endif
  1011. %if "%{with_mod_owa}" == "yes"
  1012. cflags="$cflags `%{l_prefix}/etc/rc --query oracle_cflags`"
  1013. ldflags="$ldflags `%{l_prefix}/etc/rc --query oracle_ldflags`"
  1014. libs="$libs `%{l_prefix}/etc/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_prefix}/etc/rc --query oracle_ldflags`"
  1025. libs="$libs `%{l_prefix}/etc/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. --enable-rule=EXPAT \
  1075. %else
  1076. --disable-rule=EXPAT \
  1077. %endif
  1078. %if "%{with_shared_core}" == "yes"
  1079. --enable-rule=SHARED_CORE \
  1080. %endif
  1081. %if "%{with_shared_chain}" == "yes"
  1082. --enable-rule=SHARED_CHAIN \
  1083. %endif
  1084. %if "%{with_mod_layout}" == "yes"
  1085. --activate-module=src/modules/layout/liblayout.a \
  1086. %endif
  1087. %if "%{with_mod_macro}" == "yes"
  1088. --activate-module=src/modules/extra/mod_macro.o \
  1089. %endif
  1090. %if "%{with_mod_auth_pam}" == "yes"
  1091. --activate-module=src/modules/extra/mod_auth_pam.o \
  1092. %endif
  1093. %if "%{with_mod_auth_ldap}" == "yes"
  1094. --activate-module=src/modules/extra/mod_auth_ldap.o \
  1095. %endif
  1096. %if "%{with_mod_auth_radius}" == "yes"
  1097. --activate-module=src/modules/extra/mod_auth_radius.c \
  1098. %endif
  1099. %if "%{with_mod_auth_mysql}" == "yes"
  1100. --activate-module=src/modules/extra/mod_auth_mysql.o \
  1101. %endif
  1102. %if "%{with_mod_gzip}" == "yes"
  1103. --activate-module=src/modules/extra/mod_gzip.o \
  1104. %endif
  1105. %if "%{with_mod_fastcgi}" == "yes"
  1106. --activate-module=src/modules/fastcgi/libfastcgi.a \
  1107. %endif
  1108. %if "%{with_mod_throttle}" == "yes"
  1109. --activate-module=src/modules/extra/mod_throttle.o \
  1110. %endif
  1111. %if "%{with_mod_access_referer}" == "yes"
  1112. --activate-module=src/modules/extra/mod_access_referer.o \
  1113. %endif
  1114. %if "%{with_mod_owa}" == "yes"
  1115. --activate-module=src/modules/owa/libowa.a \
  1116. %endif
  1117. %if "%{with_mod_roaming}" == "yes"
  1118. --activate-module=src/modules/extra/mod_roaming.o \
  1119. %endif
  1120. %if "%{with_mod_relocate}" == "yes"
  1121. --activate-module=src/modules/extra/mod_relocate.o \
  1122. %endif
  1123. %if "%{with_suphp}" == "yes"
  1124. --activate-module=src/modules/extra/mod_suphp.o \
  1125. %endif
  1126. %if "%{with_mod_security}" == "yes"
  1127. --activate-module=src/modules/extra/mod_security.o \
  1128. %endif
  1129. %if "%{with_mod_dosevasive}" == "yes"
  1130. --activate-module=src/modules/extra/mod_dosevasive.o \
  1131. %endif
  1132. --enable-module=so
  1133. %{l_make} %{l_mflags -O} build-quiet
  1134. ) || exit $?
  1135. %install
  1136. # install Apache
  1137. ( cd apache_%{V_apache}
  1138. # perform standard Apache installation procedure
  1139. %{l_make} %{l_mflags} install root=$RPM_BUILD_ROOT
  1140. # post-adjustments to installation tree
  1141. mv $RPM_BUILD_ROOT%{l_prefix}/share/apache/icons/small/* \
  1142. $RPM_BUILD_ROOT%{l_prefix}/share/apache/icons/
  1143. rm -rf $RPM_BUILD_ROOT%{l_prefix}/share/apache/icons/small
  1144. rm -f $RPM_BUILD_ROOT%{l_prefix}/share/apache/icons/README*
  1145. rm -f $RPM_BUILD_ROOT%{l_prefix}/etc/apache/*.default
  1146. rm -f $RPM_BUILD_ROOT%{l_prefix}/etc/apache/srm.conf
  1147. rm -f $RPM_BUILD_ROOT%{l_prefix}/etc/apache/access.conf
  1148. mv $RPM_BUILD_ROOT%{l_prefix}/share/apache/htdocs/index.html.en \
  1149. $RPM_BUILD_ROOT%{l_prefix}/share/apache/htdocs/index.html
  1150. rm -f $RPM_BUILD_ROOT%{l_prefix}/share/apache/htdocs/index.html.*
  1151. chmod a+rx $RPM_BUILD_ROOT%{l_prefix}/share/apache/cgi-bin/*
  1152. mv $RPM_BUILD_ROOT%{l_prefix}/share/apache/cgi-bin \
  1153. $RPM_BUILD_ROOT%{l_prefix}/cgi/
  1154. rm -rf $RPM_BUILD_ROOT%{l_prefix}/cgi/test-cgi
  1155. ) || exit $?
  1156. # install shell environment script
  1157. %{l_shtool} install -c -m 644 \
  1158. -e 's;@l_path@;%{l_build_path};' \
  1159. -e 's;@l_ld_library_path@;%{l_build_ldlp};' \
  1160. %{SOURCE apache.sh} \
  1161. $RPM_BUILD_ROOT%{l_prefix}/etc/apache/
  1162. %if "%{with_mod_perl}" == "yes"
  1163. # cleanup for mod_perl
  1164. rm -f $RPM_BUILD_ROOT%{l_prefix}/bin/perl
  1165. # provide mod_perl init script
  1166. %{l_shtool} install -c -m 644 \
  1167. %{SOURCE apache.pl} \
  1168. $RPM_BUILD_ROOT%{l_prefix}/etc/apache/
  1169. %endif
  1170. # optionally make PHP happy
  1171. %if "%{with_mod_php}" == "yes"
  1172. %{l_shtool} install -c -m 644 /dev/null \
  1173. $RPM_BUILD_ROOT%{l_prefix}/etc/apache/php.ini
  1174. rm -rf $RPM_BUILD_ROOT%{l_prefix}/include/php
  1175. rm -rf $RPM_BUILD_ROOT%{l_prefix}/lib/php/build
  1176. rmdir $RPM_BUILD_ROOT%{l_prefix}/lib/php >/dev/null 2>&1 || true
  1177. rm -f $RPM_BUILD_ROOT%{l_prefix}/bin/{php-config,phpextdist,phpize}
  1178. %endif
  1179. # optionally install suPHP wrapper binary
  1180. %if "%{with_suphp}" == "yes"
  1181. ( cd suphp-%{V_suphp}
  1182. %{l_shtool} install -c -s -m 711 \
  1183. src/suphp $RPM_BUILD_ROOT%{l_prefix}/sbin/
  1184. ) || exit $?
  1185. %endif
  1186. # create default configuration
  1187. l_hostname=`%{l_shtool} echo -e %h`
  1188. l_domainname=`%{l_shtool} echo -e %d | cut -c2-`
  1189. %{l_shtool} install -c -m 644 %{l_value -s -a} \
  1190. -e "s;@l_hostname@;$l_hostname;g" \
  1191. -e "s;@l_domainname@;$l_domainname;g" \
  1192. %{SOURCE apache.base} \
  1193. %{SOURCE apache.conf} \
  1194. %{SOURCE apache.vhost} \
  1195. $RPM_BUILD_ROOT%{l_prefix}/etc/apache/
  1196. mv $RPM_BUILD_ROOT%{l_prefix}/etc/apache/magic $RPM_BUILD_ROOT%{l_prefix}/etc/apache/mime.magic
  1197. find $RPM_BUILD_ROOT%{l_prefix} -name perllocal.pod -print | xargs rm -f
  1198. # create run-command script
  1199. %{l_shtool} mkdir -f -p -m 755 $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d
  1200. %{l_shtool} install -c -m 755 %{l_value -s -a} \
  1201. %{SOURCE rc.apache} $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d/
  1202. # strip installation binaries
  1203. %if "%{with_debug}" != "yes"
  1204. strip $RPM_BUILD_ROOT%{l_prefix}/bin/* 2>/dev/null || true
  1205. strip $RPM_BUILD_ROOT%{l_prefix}/sbin/* 2>/dev/null || true
  1206. %endif
  1207. # determine installation tree files
  1208. %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
  1209. %{l_files_std} \
  1210. %if "%{with_suexec}" == "yes"
  1211. '%attr(4755,%{l_susr},%{l_mgrp}) %{l_prefix}/sbin/suexec' \
  1212. %endif
  1213. %if "%{with_suphp}" == "yes"
  1214. '%attr(4755,%{l_susr},%{l_mgrp}) %{l_prefix}/sbin/suphp' \
  1215. %endif
  1216. '%config %{l_prefix}/etc/apache/*' \
  1217. %if "%{with_mod_ssl}" == "yes"
  1218. '%config %{l_prefix}/etc/apache/ssl.crl/*.crl' \
  1219. '%config %{l_prefix}/etc/apache/ssl.crt/*.crt' \
  1220. '%config %{l_prefix}/etc/apache/ssl.csr/*.csr' \
  1221. '%config %{l_prefix}/etc/apache/ssl.key/*.key' \
  1222. '%config %{l_prefix}/etc/apache/ssl.prm/*.prm' \
  1223. %endif
  1224. '%config %attr(444,%{l_musr},%{l_mgrp}) %{l_prefix}/etc/apache/apache.base' \
  1225. '%config(noreplace) %attr(444,%{l_musr},%{l_mgrp}) %{l_prefix}/etc/apache/apache.vhost'
  1226. %files -f files
  1227. %clean
  1228. rm -rf $RPM_BUILD_ROOT
  1229. %post
  1230. %if "%{with_mod_auth_pam}" == "yes"
  1231. # add PAM configuration entry
  1232. if [ $1 -eq 1 ]; then
  1233. $RPM_INSTALL_PREFIX/sbin/pamtool --add --smart --name=apache
  1234. fi
  1235. %endif
  1236. # after upgrade, restart service
  1237. [ $1 -eq 2 ] || exit 0
  1238. eval `%{l_rc} apache status 2>/dev/null`
  1239. [ ".$apache_active" = .yes ] && %{l_rc} apache restart
  1240. exit 0
  1241. %preun
  1242. # before erase, stop service and remove log files
  1243. [ $1 -eq 0 ] || exit 0
  1244. %{l_rc} apache stop 2>/dev/null
  1245. rm -rf $RPM_INSTALL_PREFIX/var/apache/log/ >/dev/null 2>&1 || true
  1246. %if "%{with_mod_auth_pam}" == "yes"
  1247. # remove PAM configuration entry
  1248. $RPM_INSTALL_PREFIX/sbin/pamtool --remove --smart --name=apache
  1249. %endif
  1250. exit 0