apache.spec 30 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917
  1. ##
  2. ## apache.spec -- OpenPKG RPM Specification
  3. ## Copyright (c) 2000-2003 Cable & Wireless Deutschland GmbH
  4. ## Copyright (c) 2000-2003 The OpenPKG Project <http://www.openpkg.org/>
  5. ## Copyright (c) 2000-2003 Ralf S. Engelschall <rse@engelschall.com>
  6. ##
  7. ## Permission to use, copy, modify, and distribute this software for
  8. ## any purpose with or without fee is hereby granted, provided that
  9. ## the above copyright notice and this permission notice appear in all
  10. ## copies.
  11. ##
  12. ## THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
  13. ## WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
  14. ## MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
  15. ## IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
  16. ## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  17. ## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  18. ## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
  19. ## USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
  20. ## ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
  21. ## OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
  22. ## OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  23. ## SUCH DAMAGE.
  24. ##
  25. ## ATTENTION: This package specification is a cruel one. It allows
  26. ## one to build an Apache package in hundreds of variants with just
  27. ## a single specification through the use of lots of condition
  28. ## variables. The reason for this attempt is that it was born out of
  29. ## the needs from the daily practice at an ISP. So do not treat this
  30. ## specification as a reference example of any kind, except perhaps as
  31. ## a example of what is maximum possible with RPM and how far one can
  32. ## go with the macro mechanism. But do not try to repeat this!
  33. # package component versions
  34. %define V_apache 1.3.27
  35. %define V_mod_ssl 2.8.14-1.3.27
  36. %define V_mod_perl 1.28
  37. %define V_mod_php 4.3.2
  38. %define V_mod_php3 3.0.18
  39. %define V_mod_dav 1.0.3-1.3.6
  40. %define V_mod_layout 3.2
  41. %define V_mod_macro 1.1.2
  42. %define V_mod_auth_pam 1.1.1
  43. %define V_mod_auth_ldap 2.4.1
  44. %define V_mod_gzip 1.3.19.1a
  45. %define V_mod_fastcgi 2.4.0
  46. %define V_mod_throttle 312
  47. %define V_mod_access_referer 1.0.2
  48. %define V_mod_roaming 1.0.2
  49. %define V_mod_relocate 1.0
  50. # package information
  51. Name: apache
  52. Summary: Apache HTTP Server
  53. URL: http://httpd.apache.org/
  54. Vendor: Apache Software Foundation
  55. Packager: The OpenPKG Project
  56. Distribution: OpenPKG [BASE]
  57. Group: Web
  58. License: ASF
  59. Version: %{V_apache}
  60. Release: 20030703
  61. # package options (suexec related)
  62. %option with_suexec yes
  63. %option with_suexec_caller %{l_nusr}
  64. %option with_suexec_userdir public_html
  65. # package options (additionally used Apache modules; can be enabled without thinking)
  66. %option with_mod_ssl no
  67. %option with_mod_perl no
  68. %option with_mod_php no
  69. %option with_mod_php3 no
  70. %option with_mod_dav no
  71. %option with_mod_layout no
  72. %option with_mod_macro no
  73. # package options (additionally used Apache modules; you have to know what you do)
  74. %option with_mod_auth_ldap no
  75. %option with_mod_auth_pam no
  76. %option with_mod_gzip no
  77. %option with_mod_fastcgi no
  78. %option with_mod_throttle no
  79. %option with_mod_access_referer no
  80. %option with_mod_roaming no
  81. %option with_mod_relocate no
  82. # package options (optional PHP4 specific settings; requires "with_mod_php")
  83. %option with_mod_php_calendar no
  84. %option with_mod_php_mysql no
  85. %option with_mod_php_gd no
  86. %option with_mod_php_db no
  87. %option with_mod_php_debug no
  88. %option with_mod_php_pdflib no
  89. %option with_mod_php_zlib no
  90. %option with_mod_php_bzip2 no
  91. %option with_mod_php_openssl no
  92. %option with_mod_php_openldap no
  93. %option with_mod_php_openldapsasl no
  94. %option with_mod_php_mm no
  95. %option with_mod_php_pcre no
  96. %option with_mod_php_ftp no
  97. %option with_mod_php_java no
  98. %option with_mod_php_oci7 no
  99. %option with_mod_php_oci8 no
  100. %option with_mod_php_freetype no
  101. %option with_mod_php_gettext no
  102. %option with_mod_php_imap no
  103. %option with_mod_php_xml no
  104. %option with_mod_php_dom no
  105. %option with_mod_php_bc no
  106. %option with_mod_php_transsid no
  107. %option with_mod_php_curl no
  108. %option with_mod_php_mhash no
  109. %option with_mod_php_wddx no
  110. %option with_mod_php_gdbm no
  111. %option with_mod_php_versioning no
  112. # package options (optional PHP3 specific settings; requires "with_mod_php3")
  113. %option with_mod_php3_ftp no
  114. %option with_mod_php3_gd no
  115. %option with_mod_php3_jpeg no
  116. %option with_mod_php3_mysql no
  117. %option with_mod_php3_openssl no
  118. %option with_mod_php3_zlib no
  119. # package options (braindead ones only)
  120. %option with_gdbm_ndbm no
  121. # fixing implicit inter-module dependencies and correlations
  122. %if "%{with_mod_php}" == "yes"
  123. %if "%{with_mod_php3}" == "yes"
  124. RPM ERROR: with_mod_php conflicts with with_mod_php3
  125. %endif
  126. %if "%{with_mod_ssl}" == "yes"
  127. %undefine with_mod_php_openssl
  128. %undefine with_mod_php_mm
  129. %define with_mod_php_openssl yes
  130. %define with_mod_php_mm yes
  131. %endif
  132. %if "%{with_mod_php_freetype}" == "yes"
  133. %undefine with_mod_php_gd
  134. %define with_mod_php_gd yes
  135. %endif
  136. %if "%{with_mod_php_mysql}" == "yes" || "%{with_mod_php_pdflib}" == "yes" || "%{with_mod_php_gd}" == "yes" || "%{with_mod_php_dom}" == "yes"
  137. %undefine with_mod_php_zlib
  138. %define with_mod_php_zlib yes
  139. %endif
  140. %endif
  141. %if "%{with_mod_php3}" == "yes"
  142. %if "%{with_mod_ssl}" == "yes"
  143. %undefine with_mod_php3_openssl
  144. %define with_mod_php3_openssl yes
  145. %endif
  146. %if "%{with_mod_php3_mysql}" == "yes"
  147. %undefine with_mod_php3_zlib
  148. %define with_mod_php3_zlib yes
  149. %endif
  150. %endif
  151. %if "%{with_mod_php_gdbm}" == "yes"
  152. %undefine with_gdbm_ndbm
  153. %define with_gdbm_ndbm yes
  154. %endif
  155. # list of sources
  156. Source0: http://www.apache.org/dist/httpd/apache_%{V_apache}.tar.gz
  157. Source1: http://www.modssl.org/source/mod_ssl-%{V_mod_ssl}.tar.gz
  158. Source2: http://perl.apache.org/dist/mod_perl-%{V_mod_perl}.tar.gz
  159. Source3: http://www.php.net/distributions/php-%{V_mod_php}.tar.gz
  160. Source4: http://www.webdav.org/mod_dav/mod_dav-%{V_mod_dav}.tar.gz
  161. Source5: http://software.tangent.org/download/mod_layout-%{V_mod_layout}.tar.gz
  162. Source6: http://www.cri.ensmp.fr/~coelho/mod_macro/mod_macro-%{V_mod_macro}.tar.gz
  163. Source7: http://pam.sourceforge.net/mod_auth_pam/dist/mod_auth_pam.tar.gz
  164. Source8: http://www.remotecommunications.com/apache/mod_gzip/src/%{V_mod_gzip}/mod_gzip.c
  165. Source9: http://www.fastcgi.com/dist/mod_fastcgi-%{V_mod_fastcgi}.tar.gz
  166. Source10: http://www.snert.com/Software/mod_throttle/mod_throttle%{V_mod_throttle}.tgz
  167. Source11: http://download.sourceforge.net/accessreferer/mod_access_referer-%{V_mod_access_referer}.tar.gz
  168. Source12: http://www.klomp.org/mod_roaming/mod_roaming-%{V_mod_roaming}.tar.gz
  169. Source13: http://software.tangent.org/download/mod_relocate-%{V_mod_relocate}.tar.gz
  170. Source14: http://www.php.net/distributions/php-%{V_mod_php3}.tar.gz
  171. Source15: http://www.muquit.com/muquit/software/mod_auth_ldap/mod_auth_ldap.tar.gz
  172. Source20: apache.conf
  173. Source21: apache.base
  174. Source22: apache.vhost
  175. Source23: apache.pl
  176. Source24: rc.apache
  177. Patch0: apache.patch
  178. Patch1: php.patch
  179. # build information
  180. Prefix: %{l_prefix}
  181. BuildRoot: %{l_buildroot}
  182. BuildPreReq: OpenPKG, openpkg >= 20030103
  183. PreReq: OpenPKG, openpkg >= 20030103
  184. %if "%{with_mod_ssl}" == "yes"
  185. BuildPreReq: openssl, mm
  186. %endif
  187. %if "%{with_mod_perl}" == "yes"
  188. BuildPreReq: perl
  189. PreReq: perl
  190. %endif
  191. %if "%{with_mod_php}" == "yes"
  192. BuildPreReq: gcc, sed, flex, bison
  193. %if "%{with_mod_php_mysql}" == "yes"
  194. BuildPreReq: MYSQL
  195. %endif
  196. %if "%{with_mod_php_gd}" == "yes"
  197. BuildPreReq: gd, jpeg, png
  198. %endif
  199. %if "%{with_mod_php_db}" == "yes"
  200. BuildPreReq: db
  201. %endif
  202. %if "%{with_mod_php_pdflib}" == "yes"
  203. BuildPreReq: pdflib, jpeg, png
  204. %endif
  205. %if "%{with_mod_php_zlib}" == "yes"
  206. BuildPreReq: zlib
  207. %endif
  208. %if "%{with_mod_php_bzip2}" == "yes"
  209. BuildPreReq: bzip2
  210. %endif
  211. %if "%{with_mod_php_openssl}" == "yes"
  212. BuildPreReq: openssl
  213. %endif
  214. %if "%{with_mod_php_openldap}" == "yes"
  215. BuildPreReq: openldap, openssl
  216. %if "%{with_mod_php_openldapsasl}" == "yes"
  217. BuildPreReq: openldap::with_sasl = yes
  218. %else
  219. BuildPreReq: openldap::with_sasl = no
  220. %endif
  221. %endif
  222. %if "%{with_mod_php_mm}" == "yes"
  223. BuildPreReq: mm
  224. %endif
  225. %if "%{with_mod_php_pcre}" == "yes"
  226. BuildPreReq: pcre
  227. %endif
  228. %if "%{with_mod_php_java}" == "yes"
  229. BuildPreReq: j2se
  230. %endif
  231. %if "%{with_mod_php_freetype}" == "yes"
  232. BuildPreReq: freetype
  233. %endif
  234. %if "%{with_mod_php_gettext}" == "yes"
  235. BuildPreReq: gettext, libiconv
  236. %endif
  237. %if "%{with_mod_php_imap}" == "yes"
  238. BuildPreReq: imap, openssl
  239. %endif
  240. %if "%{with_mod_php_xml}" == "yes"
  241. BuildPreReq: expat
  242. %endif
  243. %if "%{with_mod_php_dom}" == "yes"
  244. BuildPreReq: libxml, libxslt
  245. %endif
  246. %if "%{with_mod_php_curl}" == "yes"
  247. BuildPreReq: curl
  248. %endif
  249. %if "%{with_mod_php_mhash}" == "yes"
  250. BuildPreReq: mhash
  251. %endif
  252. %if "%{with_mod_php_gdbm}" == "yes"
  253. BuildPreReq: gdbm
  254. %endif
  255. %if "%{with_mod_php_oci7}" == "yes" || "%{with_mod_php_oci8}" == "yes"
  256. BuildPreReq: ORACLE
  257. %endif
  258. %endif
  259. %if "%{with_mod_php3}" == "yes"
  260. BuildPreReq: make, bison, flex
  261. %if "%{with_mod_php3_gd}" == "yes"
  262. BuildPreReq: gd
  263. %endif
  264. %if "%{with_mod_php3_jpeg}" == "yes"
  265. BuildPreReq: jpeg
  266. %endif
  267. %if "%{with_mod_php3_mysql}" == "yes"
  268. BuildPreReq: MYSQL
  269. %endif
  270. %if "%{with_mod_php3_openssl}" == "yes"
  271. BuildPreReq: openssl
  272. %endif
  273. %if "%{with_mod_php3_zlib}" == "yes"
  274. BuildPreReq: zlib
  275. %endif
  276. %endif
  277. %if "%{with_mod_auth_ldap}" == "yes"
  278. BuildPreReq: openldap, openssl
  279. %endif
  280. %if "%{with_mod_auth_pam}" == "yes"
  281. BuildPreReq: PAM
  282. PreReq: PAM
  283. %endif
  284. %if "%{with_gdbm_ndbm}" == "yes"
  285. BuildPreReq: gdbm, gdbm::with_ndbm = yes
  286. %endif
  287. AutoReq: no
  288. AutoReqProv: no
  289. %description
  290. The Apache Project is a collaborative software development effort
  291. aimed at creating a robust, commercial-grade, featureful, and
  292. freely-available source code implementation of an HTTP (Web) server.
  293. The project is jointly managed by a group of volunteers located
  294. around the world, using the Internet and the Web to communicate,
  295. plan, and develop the server and its related documentation. These
  296. volunteers are known as the Apache Group. In addition, hundreds
  297. of users have contributed ideas, code, and documentation to the
  298. project.
  299. %prep
  300. # unpack Apache distribution
  301. %setup0 -q -c
  302. %patch0 -p0
  303. # unpack optional extension modules
  304. %if "%{with_mod_ssl}" == "yes"
  305. %setup1 -q -T -D -a 1
  306. %endif
  307. %if "%{with_mod_perl}" == "yes"
  308. %setup2 -q -T -D -a 2
  309. %endif
  310. %if "%{with_mod_php}" == "yes"
  311. %setup3 -q -T -D -a 3
  312. %patch1 -p0
  313. %endif
  314. %if "%{with_mod_dav}" == "yes"
  315. %setup4 -q -T -D -a 4
  316. %endif
  317. %if "%{with_mod_layout}" == "yes"
  318. %setup5 -q -T -D -a 5
  319. %endif
  320. %if "%{with_mod_macro}" == "yes"
  321. %setup6 -q -T -D -a 6
  322. %endif
  323. %if "%{with_mod_auth_pam}" == "yes"
  324. %setup7 -q -T -D -a 7
  325. %endif
  326. %if "%{with_mod_fastcgi}" == "yes"
  327. %setup9 -q -T -D -a 9
  328. %endif
  329. %if "%{with_mod_throttle}" == "yes"
  330. %setup10 -q -T -D -a 10
  331. %endif
  332. %if "%{with_mod_access_referer}" == "yes"
  333. %setup11 -q -T -D -a 11
  334. %endif
  335. %if "%{with_mod_roaming}" == "yes"
  336. %setup12 -q -T -D -a 12
  337. %endif
  338. %if "%{with_mod_relocate}" == "yes"
  339. %setup13 -q -T -D -a 13
  340. %endif
  341. %if "%{with_mod_php3}" == "yes"
  342. %setup14 -q -T -D -a 14
  343. %endif
  344. %if "%{with_mod_auth_ldap}" == "yes"
  345. %setup15 -q -T -D -a 15
  346. %endif
  347. %build
  348. # prepare environment
  349. rm -rf $RPM_BUILD_ROOT
  350. %{l_shtool} mkdir -f -p -m 755 $RPM_BUILD_ROOT%{l_prefix}
  351. # optionally prepare mod_ssl
  352. %if "%{with_mod_ssl}" == "yes"
  353. ( cd mod_ssl-%{V_mod_ssl}
  354. ./configure \
  355. --with-apache=../apache_%{V_apache} \
  356. --expert --force
  357. )
  358. %endif
  359. # optionally pre-configure Apache for mod_php, mod_php3 and mod_dav
  360. %if "%{with_mod_php}" == "yes" || "%{with_mod_php3}" == "yes" || "%{with_mod_dav}" == "yes"
  361. ( cd apache_%{V_apache}
  362. CC="%{l_cc}" \
  363. CFLAGS="%{l_cflags -O}" \
  364. ./configure \
  365. %if "%{with_mod_ssl}" == "yes"
  366. --enable-rule=EAPI \
  367. %endif
  368. --target=apache \
  369. --with-layout=GNU \
  370. --prefix=%{l_prefix} \
  371. --sbindir=%{l_prefix}/sbin \
  372. --sysconfdir=%{l_prefix}/etc/apache \
  373. --libexecdir=%{l_prefix}/lib/apache \
  374. --datadir=%{l_prefix}/share/apache \
  375. --localstatedir=%{l_prefix}/var/apache
  376. )
  377. %endif
  378. # optionally prepare mod_perl
  379. %if "%{with_mod_perl}" == "yes"
  380. ( cd mod_perl-%{V_mod_perl}
  381. eval `%{l_prefix}/bin/perl -V:archname`
  382. eval `%{l_prefix}/bin/perl -V:version`
  383. eval `%{l_prefix}/bin/perl -V:installarchlib -V:installprivlib -V:installsitearch -V:installsitelib`
  384. %{l_shtool} mkdir -f -p -m 755 $RPM_BUILD_ROOT%{l_prefix}/bin
  385. perl=$RPM_BUILD_ROOT%{l_prefix}/bin/perl
  386. echo "#!/bin/sh" >$perl
  387. echo "exec %{l_prefix}/bin/perl \\" >>$perl
  388. echo " -I${RPM_BUILD_ROOT}${installarchlib} \\" >>$perl
  389. echo " -I${RPM_BUILD_ROOT}${installprivlib} \\" >>$perl
  390. echo " -I${RPM_BUILD_ROOT}${installsitearch} \\" >>$perl
  391. echo " -I${RPM_BUILD_ROOT}${installsitelib} \\" >>$perl
  392. echo " \"\$@\"" >>$perl
  393. chmod a+x $perl
  394. $perl Makefile.PL \
  395. PREFIX=$RPM_BUILD_ROOT%{l_prefix} \
  396. APACHE_SRC=../apache_%{V_apache}/src \
  397. DO_HTTPD=1 \
  398. USE_APACI=1 \
  399. PREP_HTTPD=1 \
  400. EVERYTHING=1 \
  401. PERL_TIE_TABLES=1 \
  402. PERL_DIRECTIVE_HANDLERS=1
  403. %{l_make} %{l_mflags}
  404. %{l_make} %{l_mflags} install
  405. rm -rf $RPM_BUILD_ROOT%{l_prefix}/man/man3
  406. %{l_shtool} subst -e "s;^\\(PERL = \\).*;\\1 $perl;" \
  407. ../apache_%{V_apache}/src/modules/perl/mod_perl.config
  408. )
  409. %endif
  410. # optionally prepare mod_php
  411. %if "%{with_mod_php}" == "yes"
  412. ( cd php-%{V_mod_php}
  413. CC="%{l_cc}"; export CC
  414. CFLAGS="%{l_cflags -O} %{l_cppflags}"; export CFLAGS
  415. CPPFLAGS="%{l_cflags -O} %{l_cppflags}"; export CPPFLAGS
  416. LDFLAGS="%{l_cflags -O} %{l_ldflags}"; export LDFLAGS
  417. LIBS=""; export LIBS
  418. %if "%{with_mod_ssl}" == "yes"
  419. CFLAGS="$CFLAGS -DEAPI"
  420. %endif
  421. %if "%{with_mod_php_gd}" == "yes"
  422. LIBS="$LIBS -lpng -lz"
  423. %endif
  424. %if "%{with_mod_php_gettext}" == "yes"
  425. LIBS="$LIBS -liconv"
  426. %endif
  427. %if "%{with_mod_php_openldap}" == "yes" && "%{with_mod_php_openldapsasl}" == "yes"
  428. LIBS="$LIBS -lsasl2"
  429. %endif
  430. %if "%{with_mod_php_imap}" == "yes"
  431. LIBS="$LIBS -lssl -lcrypto"
  432. %endif
  433. %if "%{with_mod_php_db}" == "yes"
  434. LIBS="$LIBS -ldb"
  435. %endif
  436. %if "%{with_mod_php_oci7}" == "yes" || "%{with_mod_php_oci8}" == "yes"
  437. ORACLE_HOME="`%{l_prefix}/etc/rc --query oracle_home`"
  438. export ORACLE_HOME
  439. %endif
  440. ./configure \
  441. --prefix=%{l_prefix} \
  442. --with-apache=../apache_%{V_apache} \
  443. --with-config-file-path=%{l_prefix}/etc/apache \
  444. %if "%{with_mod_php_calendar}" == "yes"
  445. --enable-calendar \
  446. %endif
  447. %if "%{with_mod_php_mysql}" == "yes"
  448. --with-mysql=%{l_prefix} \
  449. %else
  450. --without-mysql \
  451. %endif
  452. %if "%{with_mod_php_gd}" == "yes"
  453. --with-gd=%{l_prefix} \
  454. --with-jpeg-dir=%{l_prefix} \
  455. --with-png-dir=%{l_prefix} \
  456. %endif
  457. %if "%{with_mod_php_freetype}" == "yes"
  458. --enable-gd-imgstrttf \
  459. --enable-gd-native-ttf \
  460. --with-freetype-dir=%{l_prefix} \
  461. %endif
  462. %if "%{with_mod_php_db}" == "yes"
  463. --with-db4=%{l_prefix} \
  464. %endif
  465. %if "%{with_mod_php_debug}" == "yes"
  466. --with-debug=yes \
  467. %else
  468. --with-debug=no \
  469. %endif
  470. %if "%{with_mod_php_zlib}" == "yes"
  471. --with-zlib=%{l_prefix} \
  472. --with-zlib-dir=%{l_prefix} \
  473. %endif
  474. %if "%{with_mod_php_bzip2}" == "yes"
  475. --with-bz2=%{l_prefix} \
  476. %endif
  477. %if "%{with_mod_php_pdflib}" == "yes"
  478. --with-pdflib=%{l_prefix} \
  479. --with-jpeg-dir=%{l_prefix} \
  480. --with-png-dir=%{l_prefix} \
  481. %endif
  482. %if "%{with_mod_php_openssl}" == "yes" || "%{with_mod_php_openldap}" == "yes"
  483. --with-openssl=%{l_prefix} \
  484. %endif
  485. %if "%{with_mod_php_openldap}" == "yes"
  486. --with-ldap=%{l_prefix} \
  487. %endif
  488. %if "%{with_mod_php_mm}" == "yes"
  489. --with-mm=%{l_prefix} \
  490. --enable-session \
  491. %endif
  492. %if "%{with_mod_php_pcre}" == "yes"
  493. --with-pcre=%{l_prefix} \
  494. %endif
  495. %if "%{with_mod_php_ftp}" == "yes"
  496. --enable-ftp \
  497. %endif
  498. %if "%{with_mod_php_java}" == "yes"
  499. --with-java=%{l_prefix}/libexec/j2se \
  500. %endif
  501. %if "%{with_mod_php_oci7}" == "yes"
  502. --with-oracle \
  503. %endif
  504. %if "%{with_mod_php_oci8}" == "yes"
  505. --with-oci8 \
  506. %endif
  507. %if "%{with_mod_php_gettext}" == "yes"
  508. --with-gettext=%{l_prefix} \
  509. %endif
  510. %if "%{with_mod_php_imap}" == "yes"
  511. --with-imap=%{l_prefix} \
  512. --with-imap-ssl=%{l_prefix} \
  513. %endif
  514. %if "%{with_mod_php_xml}" == "yes"
  515. --with-xml=%{l_prefix} \
  516. %endif
  517. %if "%{with_mod_php_dom}" == "yes"
  518. --with-dom=%{l_prefix} \
  519. --with-dom-xslt=%{l_prefix} \
  520. --with-dom-exslt=%{l_prefix} \
  521. %endif
  522. %if "%{with_mod_php_wddx}" == "yes"
  523. --enable-wddx \
  524. %endif
  525. %if "%{with_mod_php_bc}" == "yes"
  526. --enable-bcmath \
  527. %endif
  528. %if "%{with_mod_php_transsid}" == "yes"
  529. --enable-trans-sid \
  530. %endif
  531. %if "%{with_mod_php_mhash}" == "yes"
  532. --with-mhash=%{l_prefix} \
  533. %endif
  534. %if "%{with_mod_php_curl}" == "yes"
  535. --with-curl=%{l_prefix} \
  536. %endif
  537. %if "%{with_mod_php_gdbm}" == "yes"
  538. --with-gdbm=%{l_prefix} \
  539. %endif
  540. %if "%{with_mod_php_versioning}" == "yes"
  541. --enable-versioning \
  542. %endif
  543. --disable-cli \
  544. --without-pear \
  545. --disable-shared \
  546. --enable-inline-optimization \
  547. --enable-track-vars
  548. %{l_make} %{l_mflags}
  549. %{l_shtool} subst \
  550. -e "s;^\\(EXTENSION_DIR = \\)\\(%{l_prefix}\\);\\1$RPM_BUILD_ROOT\\2;" \
  551. -e "s;^\\(PEAR_INSTALLDIR = \\)\\(%{l_prefix}\\);\\1$RPM_BUILD_ROOT\\2;" \
  552. config_vars.mk
  553. %{l_make} %{l_mflags} install \
  554. prefix=$RPM_BUILD_ROOT%{l_prefix}
  555. )
  556. %endif
  557. # optionally prepare mod_php3
  558. %if "%{with_mod_php3}" == "yes"
  559. ( cd php-%{V_mod_php3}
  560. CC="%{l_cc}" \
  561. %if "%{with_mod_ssl}" == "yes"
  562. CFLAGS="%{l_cflags -O} %{l_cppflags} -DEAPI" \
  563. %else
  564. CFLAGS="%{l_cflags -O} %{l_cppflags}" \
  565. %endif
  566. CPPFLAGS="%{l_cflags -O} %{l_cppflags}" \
  567. LDFLAGS="%{l_cflags -O} %{l_ldflags}" \
  568. ./configure \
  569. --prefix=%{l_prefix} \
  570. --with-apache=../apache_%{V_apache} \
  571. --with-config-file-path=%{l_prefix}/etc/apache \
  572. %if "%{with_mod_php3_ftp}" == "yes"
  573. --with-ftp \
  574. %endif
  575. %if "%{with_mod_php3_mysql}" == "yes"
  576. --with-mysql=%{l_prefix} \
  577. %else
  578. --without-mysql \
  579. %endif
  580. %if "%{with_mod_php3_zlib}" == "yes"
  581. --with-zlib=%{l_prefix} \
  582. %endif
  583. %if "%{with_mod_php3_jpeg}" == "yes"
  584. --with-jpeg=%{l_prefix} \
  585. %endif
  586. %if "%{with_mod_php3_gd}" == "yes"
  587. --with-gd=%{l_prefix} \
  588. %endif
  589. %if "%{with_mod_php3_openssl}" == "yes"
  590. --with-openssl=%{l_prefix} \
  591. %endif
  592. --disable-shared \
  593. --enable-track-vars
  594. %{l_make} %{l_mflags}
  595. %{l_make} %{l_mflags} install \
  596. prefix=$RPM_BUILD_ROOT%{l_prefix}
  597. )
  598. %endif
  599. # optionally prepare mod_dav
  600. %if "%{with_mod_dav}" == "yes"
  601. ( cd mod_dav-%{V_mod_dav}
  602. CC="%{l_cc}" \
  603. %if "%{with_mod_ssl}" == "yes"
  604. CFLAGS="%{l_cflags -O}" \
  605. %else
  606. CFLAGS="%{l_cflags -O} -DEAPI" \
  607. %endif
  608. LDFLAGS="%{l_cflags -O}" \
  609. ./configure \
  610. --with-apache=../apache_%{V_apache}
  611. %{l_make} %{l_mflags}
  612. %{l_make} %{l_mflags} install
  613. )
  614. %endif
  615. # optionally prepare mod_layout
  616. %if "%{with_mod_layout}" == "yes"
  617. ( cd mod_layout-%{V_mod_layout}
  618. mkdir ../apache_%{V_apache}/src/modules/layout
  619. cp * ../apache_%{V_apache}/src/modules/layout/ 2>/dev/null || true
  620. chmod -R u+w ../apache_%{V_apache}/src/modules/layout
  621. )
  622. %endif
  623. # optionally prepare mod_macro
  624. %if "%{with_mod_macro}" == "yes"
  625. ( cd mod_macro-%{V_mod_macro}
  626. cp mod_macro.c ../apache_%{V_apache}/src/modules/extra/
  627. )
  628. %endif
  629. # optionally prepare mod_auth_pam
  630. %if "%{with_mod_auth_pam}" == "yes"
  631. ( cd mod_auth_pam-%{V_mod_auth_pam}
  632. sed -e '234N;s/\n//' -e '239N;s/\n//' <mod_auth_pam.c \
  633. >../apache_%{V_apache}/src/modules/extra/mod_auth_pam.c
  634. )
  635. %endif
  636. # optionally prepare mod_auth_ldap
  637. %if "%{with_mod_auth_ldap}" == "yes"
  638. ( cd modauthldap
  639. cp mod_auth_ldap.c ../apache_%{V_apache}/src/modules/extra/
  640. )
  641. %endif
  642. # optionally prepare mod_gzip
  643. %if "%{with_mod_gzip}" == "yes"
  644. cp %{SOURCE mod_gzip.c} apache_%{V_apache}/src/modules/extra/
  645. %endif
  646. # optionally prepare mod_fastcgi
  647. %if "%{with_mod_fastcgi}" == "yes"
  648. ( cd mod_fastcgi-%{V_mod_fastcgi}
  649. mkdir ../apache_%{V_apache}/src/modules/fastcgi
  650. cp -rp * ../apache_%{V_apache}/src/modules/fastcgi/
  651. )
  652. %endif
  653. # optionally prepare mod_throttle
  654. %if "%{with_mod_throttle}" == "yes"
  655. ( cd mod_throttle-*
  656. cp mod_throttle.c ../apache_%{V_apache}/src/modules/extra/
  657. )
  658. %endif
  659. # optionally prepare mod_access_referer
  660. %if "%{with_mod_access_referer}" == "yes"
  661. ( cd mod_access_referer-%{V_mod_access_referer}
  662. cp mod_access_referer.c ../apache_%{V_apache}/src/modules/extra/
  663. )
  664. %endif
  665. # optionally prepare mod_roaming
  666. %if "%{with_mod_roaming}" == "yes"
  667. ( cd mod_roaming-%{V_mod_roaming}
  668. cp mod_roaming.c ../apache_%{V_apache}/src/modules/extra/
  669. )
  670. %endif
  671. # optionally prepare mod_relocate
  672. %if "%{with_mod_relocate}" == "yes"
  673. ( cd mod_relocate-%{V_mod_relocate}
  674. cp mod_relocate.c ../apache_%{V_apache}/src/modules/extra/
  675. )
  676. %endif
  677. # configure Apache
  678. ( cd apache_%{V_apache}
  679. cflags="%{l_cflags -O}"
  680. ldflags=""
  681. libs=""
  682. %if "%{with_mod_auth_pam}" == "yes"
  683. pam_incdir=`%{l_prefix}/etc/rc --query pam_incdir`
  684. if [ ".$pam_incdir" != "./usr/include" -a ".$pam_incdir" != "./include" ]; then
  685. cflags="$cflags -I$pam_incdir"
  686. fi
  687. pam_libdir=`%{l_prefix}/etc/rc --query pam_libdir`
  688. if [ ".$pam_libdir" != "./usr/lib" -a ".$pam_libdir" != "./lib" ]; then
  689. ldflags="$ldflags -L$pam_libdir"
  690. fi
  691. libs="$libs -lpam"
  692. %endif
  693. %if "%{with_mod_auth_ldap}" == "yes"
  694. cflags="$cflags %{l_cppflags}"
  695. ldflags="$ldflags %{l_ldflags}"
  696. libs="$libs -lldap -llber -lssl -lcrypto"
  697. %endif
  698. %if "%{with_gdbm_ndbm}" == "yes"
  699. cflags="$cflags %{l_cppflags}"
  700. ldflags="$ldflags %{l_ldflags}"
  701. libs="$libs -lndbm -lgdbm"
  702. %endif
  703. CC="%{l_cc}" \
  704. CFLAGS="$cflags" \
  705. LDFLAGS="$ldflags" \
  706. LIBS="$libs" \
  707. %if "%{with_mod_ssl}" == "yes"
  708. EAPI_MM="%{l_prefix}" \
  709. SSL_BASE="%{l_prefix}" \
  710. %endif
  711. ./configure \
  712. --target=apache \
  713. --with-layout=GNU \
  714. --prefix=%{l_prefix} \
  715. --sbindir=%{l_prefix}/sbin \
  716. --sysconfdir=%{l_prefix}/etc/apache \
  717. --libexecdir=%{l_prefix}/lib/apache \
  718. --datadir=%{l_prefix}/share/apache \
  719. --localstatedir=%{l_prefix}/var/apache \
  720. %if "%{with_suexec}" == "yes"
  721. --enable-suexec \
  722. --suexec-caller=%{with_suexec_caller} \
  723. --suexec-userdir=%{with_suexec_userdir} \
  724. %endif
  725. --enable-module=most \
  726. --with-perl=%{l_prefix}/bin/perl \
  727. %if "%{with_mod_ssl}" == "yes"
  728. --enable-rule=EAPI \
  729. --enable-module=ssl \
  730. %endif
  731. %if "%{with_mod_perl}" == "yes"
  732. --activate-module=src/modules/perl/libperl.a \
  733. %endif
  734. %if "%{with_mod_php}" == "yes"
  735. --activate-module=src/modules/php4/libphp4.a \
  736. %endif
  737. %if "%{with_mod_php3}" == "yes"
  738. --activate-module=src/modules/php3/libphp3.a \
  739. %endif
  740. %if "%{with_mod_dav}" == "yes"
  741. --activate-module=src/modules/dav/libdav.a \
  742. --enable-rule=EXPAT \
  743. %else
  744. --disable-rule=EXPAT \
  745. %endif
  746. %if "%{with_mod_layout}" == "yes"
  747. --activate-module=src/modules/layout/liblayout.a \
  748. %endif
  749. %if "%{with_mod_macro}" == "yes"
  750. --activate-module=src/modules/extra/mod_macro.o \
  751. %endif
  752. %if "%{with_mod_auth_pam}" == "yes"
  753. --activate-module=src/modules/extra/mod_auth_pam.o \
  754. %endif
  755. %if "%{with_mod_auth_ldap}" == "yes"
  756. --activate-module=src/modules/extra/mod_auth_ldap.c \
  757. %endif
  758. %if "%{with_mod_gzip}" == "yes"
  759. --activate-module=src/modules/extra/mod_gzip.o \
  760. %endif
  761. %if "%{with_mod_fastcgi}" == "yes"
  762. --activate-module=src/modules/fastcgi/libfastcgi.a \
  763. %endif
  764. %if "%{with_mod_throttle}" == "yes"
  765. --activate-module=src/modules/extra/mod_throttle.o \
  766. %endif
  767. %if "%{with_mod_access_referer}" == "yes"
  768. --activate-module=src/modules/extra/mod_access_referer.o \
  769. %endif
  770. %if "%{with_mod_roaming}" == "yes"
  771. --activate-module=src/modules/extra/mod_roaming.o \
  772. %endif
  773. %if "%{with_mod_relocate}" == "yes"
  774. --activate-module=src/modules/extra/mod_relocate.o \
  775. %endif
  776. --enable-module=so
  777. %{l_make} %{l_mflags -O} build-quiet
  778. )
  779. %install
  780. # install Apache
  781. ( cd apache_%{V_apache}
  782. # perform standard Apache installation procedure
  783. %{l_make} %{l_mflags} install root=$RPM_BUILD_ROOT
  784. # post-adjustments to installation tree
  785. mv $RPM_BUILD_ROOT%{l_prefix}/share/apache/icons/small/* \
  786. $RPM_BUILD_ROOT%{l_prefix}/share/apache/icons/
  787. rm -rf $RPM_BUILD_ROOT%{l_prefix}/share/apache/icons/small
  788. rm -f $RPM_BUILD_ROOT%{l_prefix}/share/apache/icons/README*
  789. rm -f $RPM_BUILD_ROOT%{l_prefix}/etc/apache/*.default
  790. rm -f $RPM_BUILD_ROOT%{l_prefix}/etc/apache/srm.conf
  791. rm -f $RPM_BUILD_ROOT%{l_prefix}/etc/apache/access.conf
  792. mv $RPM_BUILD_ROOT%{l_prefix}/share/apache/htdocs/index.html.en \
  793. $RPM_BUILD_ROOT%{l_prefix}/share/apache/htdocs/index.html
  794. rm -f $RPM_BUILD_ROOT%{l_prefix}/share/apache/htdocs/index.html.*
  795. chmod a+rx $RPM_BUILD_ROOT%{l_prefix}/share/apache/cgi-bin/*
  796. mv $RPM_BUILD_ROOT%{l_prefix}/share/apache/cgi-bin \
  797. $RPM_BUILD_ROOT%{l_prefix}/cgi/
  798. rm -rf $RPM_BUILD_ROOT%{l_prefix}/cgi/test-cgi
  799. )
  800. %if "%{with_mod_perl}" == "yes"
  801. # cleanup for mod_perl
  802. rm -f $RPM_BUILD_ROOT%{l_prefix}/bin/perl
  803. # provide mod_perl init script
  804. %{l_shtool} install -c -m 644 \
  805. %{SOURCE apache.pl} \
  806. $RPM_BUILD_ROOT%{l_prefix}/etc/apache/
  807. %endif
  808. # optionally make PHP happy
  809. %if "%{with_mod_php}" == "yes"
  810. %{l_shtool} install -c -m 644 /dev/null \
  811. $RPM_BUILD_ROOT%{l_prefix}/etc/apache/php.ini
  812. rm -rf $RPM_BUILD_ROOT%{l_prefix}/include/php
  813. rm -rf $RPM_BUILD_ROOT%{l_prefix}/lib/php/build
  814. %endif
  815. # create default configuration
  816. l_hostname=`%{l_shtool} echo -e %h`
  817. l_domainname=`%{l_shtool} echo -e %d | cut -c2-`
  818. %{l_shtool} install -c -m 644 \
  819. -e 's;@l_prefix@;%{l_prefix};g' \
  820. -e "s;@l_hostname@;$l_hostname;g" \
  821. -e "s;@l_domainname@;$l_domainname;g" \
  822. -e 's;@l_nusr@;%{l_nusr};g' \
  823. -e 's;@l_ngrp@;%{l_ngrp};g' \
  824. %{SOURCE apache.base} \
  825. %{SOURCE apache.conf} \
  826. %{SOURCE apache.vhost} \
  827. $RPM_BUILD_ROOT%{l_prefix}/etc/apache/
  828. mv $RPM_BUILD_ROOT%{l_prefix}/etc/apache/magic $RPM_BUILD_ROOT%{l_prefix}/etc/apache/mime.magic
  829. find $RPM_BUILD_ROOT%{l_prefix} -name perllocal.pod -print | xargs rm -f
  830. # create run-command script
  831. %{l_shtool} mkdir -f -p -m 755 $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d
  832. %{l_shtool} install -c -m 755 -e 's;@l_prefix@;%{l_prefix};g' \
  833. -e 's;@l_susr@;%{l_susr};g' -e 's;@l_sgrp@;%{l_sgrp};g' \
  834. -e 's;@l_musr@;%{l_musr};g' -e 's;@l_mgrp@;%{l_mgrp};g' \
  835. %{SOURCE rc.apache} $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d/
  836. # strip installation binaries
  837. strip $RPM_BUILD_ROOT%{l_prefix}/bin/* 2>/dev/null || true
  838. strip $RPM_BUILD_ROOT%{l_prefix}/sbin/* 2>/dev/null || true
  839. # determine installation tree files
  840. %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
  841. %{l_files_std} \
  842. %if "%{with_suexec}" == "yes"
  843. '%attr(4755,root,%{l_mgrp}) %{l_prefix}/sbin/suexec' \
  844. %endif
  845. '%config %{l_prefix}/etc/apache/*' \
  846. %if "%{with_mod_ssl}" == "yes"
  847. '%config %{l_prefix}/etc/apache/ssl.crl/*.crl' \
  848. '%config %{l_prefix}/etc/apache/ssl.crt/*.crt' \
  849. '%config %{l_prefix}/etc/apache/ssl.csr/*.csr' \
  850. '%config %{l_prefix}/etc/apache/ssl.key/*.key' \
  851. '%config %{l_prefix}/etc/apache/ssl.prm/*.prm' \
  852. %endif
  853. '%config %attr(444,%{l_musr},%{l_mgrp}) %{l_prefix}/etc/apache/apache.base' \
  854. '%config(noreplace) %attr(444,%{l_musr},%{l_mgrp}) %{l_prefix}/etc/apache/apache.vhost'
  855. %files -f files
  856. %clean
  857. rm -rf $RPM_BUILD_ROOT
  858. %post
  859. %if "%{with_mod_auth_pam}" == "yes"
  860. # add PAM configuration entry
  861. if [ $1 -eq 1 ]; then
  862. $RPM_INSTALL_PREFIX/sbin/pamtool --add --smart --name=apache
  863. fi
  864. %endif
  865. %preun
  866. %if "%{with_mod_auth_pam}" == "yes"
  867. # remove PAM configuration entry
  868. if [ $1 -eq 0 ]; then
  869. $RPM_INSTALL_PREFIX/sbin/pamtool --remove --smart --name=apache
  870. fi
  871. %endif