apache-php4.spec 48 KB

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