apache.spec 43 KB

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