apache.spec 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650
  1. ##
  2. ## apache.spec -- RPM Specification for Apache
  3. ## Copyright (c) 2000-2002 Cable & Wireless Deutschland GmbH
  4. ## Copyright (c) 2000-2002 The OpenPKG Project <http://www.openpkg.org/>
  5. ## Copyright (c) 2000-2002 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. # the additionally used Apache modules (can be enabled without thinking)
  34. %ifndef mod_ssl
  35. %define mod_ssl no
  36. %endif
  37. %ifndef mod_perl
  38. %define mod_perl no
  39. %endif
  40. %ifndef mod_php
  41. %define mod_php no
  42. %endif
  43. %ifndef mod_dav
  44. %define mod_dav no
  45. %endif
  46. %ifndef mod_layout
  47. %define mod_layout no
  48. %endif
  49. %ifndef mod_macro
  50. %define mod_macro no
  51. %endif
  52. # the additionally used Apache modules (you have to know what you do)
  53. %ifndef mod_auth_pam
  54. %define mod_auth_pam no
  55. %endif
  56. %ifndef mod_gzip
  57. %define mod_gzip no
  58. %endif
  59. %ifndef mod_zmod
  60. %define mod_zmod no
  61. %endif
  62. %ifndef mod_fastcgi
  63. %define mod_fastcgi no
  64. %endif
  65. %ifndef mod_throttle
  66. %define mod_throttle no
  67. %endif
  68. %ifndef mod_access_referer
  69. %define mod_access_referer no
  70. %endif
  71. %ifndef mod_roaming
  72. %define mod_roaming no
  73. %endif
  74. %ifndef mod_relocate
  75. %define mod_relocate no
  76. %endif
  77. # more optional settings
  78. # (requires mod_php set to "yes" above)
  79. %define php_mysql no
  80. %define php_gd no
  81. %define php_db no
  82. %define php_pdflib no
  83. %define php_zlib no
  84. %define php_bzip2 no
  85. %define php_openssl no
  86. %define php_openldap no
  87. %define php_mm no
  88. %define php_pcre no
  89. %define php_ftp no
  90. %define php_java no
  91. %define php_oci8 no
  92. # the software versions
  93. %define V_apache 1.3.23
  94. %define V_mod_ssl 2.8.7
  95. %define V_mod_perl 1.26
  96. %define V_mod_php 4.1.2
  97. %define V_mod_dav 1.0.2-1.3.6
  98. %define V_mod_layout 3.0.4
  99. %define V_mod_macro 1.1.1
  100. %define V_mod_auth_pam 1.0a
  101. %define V_mod_gzip 1.3.19.1a
  102. %define V_mod_zmod 2_3
  103. %define V_mod_fastcgi 2.2.10
  104. %define V_mod_throttle 312
  105. %define V_mod_access_referer 1.0.2
  106. %define V_mod_roaming 1.0.2
  107. %define V_mod_relocate 1.0
  108. # fixing some implicit inter-module dependencies
  109. %if "%{php_mysql}" == "yes"
  110. %define php_zlib yes
  111. %endif
  112. # package information
  113. Name: apache
  114. Summary: Apache HTTP Server
  115. URL: http://httpd.apache.org/
  116. Vendor: Apache Software Foundation
  117. Packager: The OpenPKG Project
  118. Distribution: OpenPKG [REL]
  119. Group: Web
  120. License: ASF
  121. Version: %{V_apache}
  122. Release: 20020315
  123. # list of sources
  124. Source0: http://httpd.apache.org/dist/httpd/apache_%{V_apache}.tar.gz
  125. # %if "%{mod_ssl}" == "yes"
  126. Source1: http://www.modssl.org/source/mod_ssl-%{V_mod_ssl}-%{V_apache}.tar.gz
  127. # %endif
  128. # %if "%{mod_perl}" == "yes"
  129. Source2: http://perl.apache.org/dist/mod_perl-%{V_mod_perl}.tar.gz
  130. # %endif
  131. # %if "%{mod_php}" == "yes"
  132. Source3: http://www.php.net/distributions/php-%{V_mod_php}.tar.gz
  133. # %endif
  134. # %if "%{mod_dav}" == "yes"
  135. Source4: http://www.webdav.org/mod_dav/mod_dav-%{V_mod_dav}.tar.gz
  136. # %endif
  137. # %if "%{mod_layout}" == "yes"
  138. Source5: ftp://ftp.tangent.org/pub/apache/mod_layout-%{V_mod_layout}.tar.gz
  139. # %endif
  140. # %if "%{mod_macro}" == "yes"
  141. Source6: http://www.cri.ensmp.fr/~coelho/mod_macro/mod_macro-%{V_mod_macro}.tar.gz
  142. # %endif
  143. # %if "%{mod_auth_pam}" == "yes"
  144. Source7: http://pam.sourceforge.net/mod_auth_pam/mod_auth_pam.tar.gz
  145. # %endif
  146. # %if "%{mod_gzip}" == "yes"
  147. Source8: http://www.remotecommunications.com/apache/mod_gzip/src/%{V_mod_gzip}/mod_gzip.c
  148. # %endif
  149. # %if "%{mod_zmod}" == "yes"
  150. Source9: http://www.ivw.de/???/src.apapi.FIN%{V_mod_zmod}.tar.gz
  151. # %endif
  152. # %if "%{mod_fastcgi}" == "yes"
  153. Source10: http://www.fastcgi.com/dist/mod_fastcgi_%{V_mod_fastcgi}.tar.gz
  154. # %endif
  155. # %if "%{mod_throttle}" == "yes"
  156. Source11: http://www.snert.com/Software/mod_throttle/mod_throttle%{V_mod_throttle}.tgz
  157. # %endif
  158. # %if "%{mod_access_referer}" == "yes"
  159. Source12: http://download.sourceforge.net/accessreferer/mod_access_referer-%{V_mod_access_referer}.tar.gz
  160. # %endif
  161. # %if "%{mod_roaming}" == "yes"
  162. Source13: http://www.klomp.org/mod_roaming/mod_roaming-%{V_mod_roaming}.tar.gz
  163. # %endif
  164. # %if "%{mod_relocate}" == "yes"
  165. Source14: http://www.tangent.org/mod_relocate/mod_relocate-%{V_mod_relocate}.tar.gz
  166. # %endif
  167. Source20: apache.conf
  168. Source21: apache.base
  169. Source22: apache.vhost
  170. Source23: rc.apache
  171. # build information
  172. Prefix: %{l_prefix}
  173. BuildRoot: %{l_buildroot}
  174. BuildPreReq: openpkg >= 20020222
  175. PreReq: openpkg >= 20020222
  176. %if "%{mod_ssl}" == "yes"
  177. BuildPreReq: openssl, mm
  178. %endif
  179. %if "%{mod_perl}" == "yes"
  180. BuildPreReq: perl
  181. PreReq: perl
  182. %endif
  183. %if "%{mod_php}" == "yes"
  184. BuildPreReq: make, bison, flex
  185. %if "%{php_mysql}" == "yes"
  186. BuildPreReq: mysql
  187. %endif
  188. %if "%{php_gd}" == "yes"
  189. BuildPreReq: gd
  190. %endif
  191. %if "%{php_db}" == "yes"
  192. BuildPreReq: db
  193. %endif
  194. %if "%{php_pdflib}" == "yes"
  195. BuildPreReq: pdflib, zlib
  196. %endif
  197. %if "%{php_zlib}" == "yes"
  198. BuildPreReq: zlib
  199. %endif
  200. %if "%{php_bzip2}" == "yes"
  201. BuildPreReq: bzip2
  202. %endif
  203. %if "%{php_openssl}" == "yes"
  204. BuildPreReq: openssl
  205. %endif
  206. %if "%{php_openldap}" == "yes"
  207. BuildPreReq: openldap, openssl
  208. %endif
  209. %if "%{php_mm}" == "yes"
  210. BuildPreReq: mm
  211. %endif
  212. %if "%{php_pcre}" == "yes"
  213. BuildPreReq: pcre
  214. %endif
  215. %if "%{php_java}" == "yes"
  216. BuildPreReq: jdk-sun
  217. %endif
  218. %endif
  219. %if "%{mod_auth_pam}" == "yes"
  220. BuildPreReq: PAM
  221. PreReq: PAM
  222. %endif
  223. AutoReq: no
  224. AutoReqProv: no
  225. %description
  226. The Apache Project is a collaborative software development effort
  227. aimed at creating a robust, commercial-grade, featureful, and
  228. freely-available source code implementation of an HTTP (Web) server.
  229. The project is jointly managed by a group of volunteers located
  230. around the world, using the Internet and the Web to communicate,
  231. plan, and develop the server and its related documentation. These
  232. volunteers are known as the Apache Group. In addition, hundreds
  233. of users have contributed ideas, code, and documentation to the
  234. project.
  235. This Apache %{V_apache} package optionally can include:
  236. - mod_ssl %{V_mod_ssl} for HTTPS support.
  237. - mod_perl %{V_mod_perl} for dynamic Perl scripting.
  238. - mod_php %{V_mod_php} for dynamic PHP scripting.
  239. - mod_dav %{V_mod_dav} for WebDAV support.
  240. - mod_layout %{V_mod_layout} for header/footer support.
  241. - mod_macro %{V_mod_macro} for macro support in config files.
  242. - mod_auth_pam %{V_mod_auth_pam} for PAM-based authentication.
  243. - mod_gzip %{V_mod_gzip} for on-the-fly GZIP-based data compression.
  244. - mod_zmod %{V_mod_zmod} for IVW-compliant logfile writing.
  245. - mod_fastcgi %{V_mod_fastcgi} for FastCGI support.
  246. - mod_access_referer %{V_mod_access_referer} for access control via HTTP Referer.
  247. - mod_roaming %{V_mod_roaming} for Netscape Communicator roaming support.
  248. - mod_relocate %{V_mod_relocate} for external URL redirection with logging.
  249. %prep
  250. %setup0 -q -c
  251. %if "%{mod_ssl}" == "yes"
  252. %setup1 -q -T -D -a 1
  253. %endif
  254. %if "%{mod_perl}" == "yes"
  255. %setup2 -q -T -D -a 2
  256. %endif
  257. %if "%{mod_php}" == "yes"
  258. %setup3 -q -T -D -a 3
  259. %endif
  260. %if "%{mod_dav}" == "yes"
  261. %setup4 -q -T -D -a 4
  262. %endif
  263. %if "%{mod_layout}" == "yes"
  264. %setup5 -q -T -D -a 5
  265. %endif
  266. %if "%{mod_macro}" == "yes"
  267. %setup6 -q -T -D -a 6
  268. %endif
  269. %if "%{mod_auth_pam}" == "yes"
  270. %setup7 -q -T -D -a 7
  271. %endif
  272. %if "%{mod_zmod}" == "yes"
  273. %setup9 -q -T -D -a 9
  274. %endif
  275. %if "%{mod_fastcgi}" == "yes"
  276. %setup10 -q -T -D -a 10
  277. %endif
  278. %if "%{mod_throttle}" == "yes"
  279. %setup11 -q -T -D -a 11
  280. %endif
  281. %if "%{mod_access_referer}" == "yes"
  282. %setup12 -q -T -D -a 12
  283. %endif
  284. %if "%{mod_roaming}" == "yes"
  285. %setup13 -q -T -D -a 13
  286. %endif
  287. %if "%{mod_relocate}" == "yes"
  288. %setup14 -q -T -D -a 14
  289. %endif
  290. %build
  291. PATH="%{l_prefix}/bin:%{l_prefix}/sbin:$PATH"; export PATH
  292. rm -rf $RPM_BUILD_ROOT
  293. %{l_shtool} mkdir -f -p -m 755 $RPM_BUILD_ROOT%{l_prefix}
  294. %if "%{mod_ssl}" == "yes"
  295. ( cd mod_ssl-%{V_mod_ssl}-%{V_apache}
  296. ./configure \
  297. --with-apache=../apache_%{V_apache} \
  298. --expert
  299. )
  300. %endif
  301. %if "%{mod_php}" == "yes" || "%{mod_dav}" == "yes"
  302. ( cd apache_%{V_apache}
  303. CC="%{l_cc}" \
  304. CFLAGS="%{l_cflags -O}" \
  305. ./configure \
  306. %if "%{mod_ssl}" == "yes"
  307. --enable-rule=EAPI \
  308. %endif
  309. --target=apache \
  310. --with-layout=GNU \
  311. --prefix=%{l_prefix} \
  312. --sbindir=%{l_prefix}/sbin \
  313. --sysconfdir=%{l_prefix}/etc/apache \
  314. --libexecdir=%{l_prefix}/lib/apache \
  315. --datadir=%{l_prefix}/share/apache \
  316. --localstatedir=%{l_prefix}/var/apache
  317. )
  318. %endif
  319. %if "%{mod_perl}" == "yes"
  320. ( cd mod_perl-%{V_mod_perl}
  321. eval `%{l_prefix}/bin/perl -V:archname`
  322. eval `%{l_prefix}/bin/perl -V:version`
  323. %{l_shtool} mkdir -f -p -m 755 $RPM_BUILD_ROOT%{l_prefix}/bin
  324. perl=$RPM_BUILD_ROOT%{l_prefix}/bin/perl
  325. echo "#!/bin/sh" >$perl
  326. echo "exec %{l_prefix}/bin/perl \\" >>$perl
  327. echo " -I$RPM_BUILD_ROOT%{l_prefix}/lib/perl5/${version} \\" >>$perl
  328. echo " -I$RPM_BUILD_ROOT%{l_prefix}/lib/perl5/${version}/${archname} \\" >>$perl
  329. echo " -I$RPM_BUILD_ROOT%{l_prefix}/lib/perl5/site_perl \\" >>$perl
  330. echo " -I$RPM_BUILD_ROOT%{l_prefix}/lib/perl5/site_perl/${version} \\" >>$perl
  331. echo " -I$RPM_BUILD_ROOT%{l_prefix}/lib/perl5/site_perl/${version}/${archname} \\" >>$perl
  332. echo " \"\$@\"" >>$perl
  333. chmod a+x $perl
  334. $perl Makefile.PL \
  335. PREFIX=$RPM_BUILD_ROOT%{l_prefix} \
  336. APACHE_SRC=../apache_%{V_apache}/src \
  337. DO_HTTPD=1 \
  338. USE_APACI=1 \
  339. PREP_HTTPD=1 \
  340. EVERYTHING=1 \
  341. PERL_TIE_TABLES=1 \
  342. PERL_DIRECTIVE_HANDLERS=1
  343. %{l_make} %{l_mflags}
  344. %{l_make} %{l_mflags} install
  345. mkdir $RPM_BUILD_ROOT%{l_prefix}/perl5
  346. mv $RPM_BUILD_ROOT%{l_prefix}/lib/* $RPM_BUILD_ROOT%{l_prefix}/perl5/
  347. mv $RPM_BUILD_ROOT%{l_prefix}/perl5 $RPM_BUILD_ROOT%{l_prefix}/lib/
  348. %{l_shtool} subst -e "s;^\\(PERL = \\).*;\\1 $perl;" \
  349. ../apache_%{V_apache}/src/modules/perl/mod_perl.config
  350. )
  351. %endif
  352. %if "%{mod_php}" == "yes"
  353. ( cd php-%{V_mod_php}
  354. CC="%{l_cc}" \
  355. %if "%{mod_ssl}" == "yes"
  356. CFLAGS="%{l_cflags -O} -I%{l_prefix}/include -DEAPI" \
  357. %else
  358. CFLAGS="%{l_cflags -O} -I%{l_prefix}/include" \
  359. %endif
  360. CPPFLAGS="%{l_cflags -O} -I%{l_prefix}/include" \
  361. LDFLAGS="%{l_cflags -O} -L%{l_prefix}/lib" \
  362. %if "%{php_gd}" == "yes"
  363. LIBS="-lpng -lz" \
  364. %endif
  365. ./configure \
  366. --prefix=%{l_prefix} \
  367. --with-apache=../apache_%{V_apache} \
  368. --with-config-file-path=%{l_prefix}/etc/apache \
  369. %if "%{php_mysql}" == "yes"
  370. --with-mysql=%{l_prefix} \
  371. %endif
  372. %if "%{php_gd}" == "yes"
  373. --with-gd=%{l_prefix} \
  374. %endif
  375. %if "%{php_db}" == "yes"
  376. --with-db3=%{l_prefix} \
  377. %endif
  378. %if "%{php_zlib}" == "yes" || "%{php_pdflib}" == "yes"
  379. --with-zlib=%{l_prefix} \
  380. %endif
  381. %if "%{php_bzip2}" == "yes"
  382. --with-bz2=%{l_prefix} \
  383. %endif
  384. %if "%{php_pdflib}" == "yes"
  385. --with-pdflib=%{l_prefix} \
  386. %endif
  387. %if "%{php_openssl}" == "yes" || "%{php_openldap}" == "yes"
  388. --with-openssl=%{l_prefix} \
  389. %endif
  390. %if "%{php_openldap}" == "yes"
  391. --with-ldap=%{l_prefix} \
  392. %endif
  393. %if "%{php_mm}" == "yes"
  394. --with-mm=%{l_prefix} \
  395. --enable-session \
  396. %endif
  397. %if "%{php_pcre}" == "yes"
  398. --with-pcre=%{l_prefix} \
  399. %endif
  400. %if "%{php_ftp}" == "yes"
  401. --enable-ftp \
  402. %endif
  403. %if "%{php_java}" == "yes"
  404. --with-java=%{l_prefix}/libexec/jdk-sun \
  405. %endif
  406. %if "%{php_oci8}" == "yes"
  407. --with-oci8 \
  408. %endif
  409. --disable-shared \
  410. --enable-track-vars
  411. %{l_make} %{l_mflags}
  412. %{l_shtool} subst \
  413. -e "s;^\\(EXTENSION_DIR = \\)\\(%{l_prefix}\\);\\1$RPM_BUILD_ROOT\\2;" \
  414. -e "s;^\\(PEAR_INSTALLDIR = \\)\\(%{l_prefix}\\);\\1$RPM_BUILD_ROOT\\2;" \
  415. config_vars.mk
  416. %{l_make} %{l_mflags} install \
  417. prefix=$RPM_BUILD_ROOT%{l_prefix}
  418. )
  419. %endif
  420. %if "%{mod_dav}" == "yes"
  421. ( cd mod_dav-%{V_mod_dav}
  422. CC="%{l_cc}" \
  423. %if "%{mod_ssl}" == "yes"
  424. CFLAGS="%{l_cflags -O}" \
  425. %else
  426. CFLAGS="%{l_cflags -O} -DEAPI" \
  427. %endif
  428. LDFLAGS="%{l_cflags -O}" \
  429. ./configure \
  430. --with-apache=../apache_%{V_apache}
  431. %{l_make} %{l_mflags}
  432. %{l_make} %{l_mflags} install
  433. )
  434. %endif
  435. %if "%{mod_layout}" == "yes"
  436. ( cd mod_layout-%{V_mod_layout}
  437. mkdir ../apache_%{V_apache}/src/modules/layout
  438. cp * ../apache_%{V_apache}/src/modules/layout/ 2>/dev/null || true
  439. chmod -R u+w ../apache_%{V_apache}/src/modules/layout
  440. )
  441. %endif
  442. %if "%{mod_macro}" == "yes"
  443. ( cd mod_macro-%{V_mod_macro}
  444. cp mod_macro.c ../apache_%{V_apache}/src/modules/extra/
  445. )
  446. %endif
  447. %if "%{mod_auth_pam}" == "yes"
  448. ( cd mod_auth_pam-%{V_mod_auth_pam}
  449. cp mod_auth_pam.c ../apache_%{V_apache}/src/modules/extra/
  450. )
  451. %endif
  452. %if "%{mod_gzip}" == "yes"
  453. cp %{SOURCE mod_gzip.c} apache_%{V_apache}/src/modules/extra/
  454. %endif
  455. %if "%{mod_zmod}" == "yes"
  456. ( cd src
  457. mkdir ../apache_%{V_apache}/src/modules/zmod
  458. %{l_shtool} subst -e 's;"compat.h";"ap_compat.h";' modules/zmod/mod_zmod.c
  459. cp modules/zmod/* ../apache_%{V_apache}/src/modules/zmod/
  460. )
  461. %endif
  462. %if "%{mod_fastcgi}" == "yes"
  463. ( cd mod_fastcgi_%{V_mod_fastcgi}
  464. mkdir ../apache_%{V_apache}/src/modules/fastcgi
  465. cp -rp * ../apache_%{V_apache}/src/modules/fastcgi/
  466. )
  467. %endif
  468. %if "%{mod_throttle}" == "yes"
  469. ( cd mod_throttle-*
  470. cp mod_throttle.c ../apache_%{V_apache}/src/modules/extra/
  471. )
  472. %endif
  473. %if "%{mod_access_referer}" == "yes"
  474. ( cd mod_access_referer-%{V_mod_access_referer}
  475. cp mod_access_referer.c ../apache_%{V_apache}/src/modules/extra/
  476. )
  477. %endif
  478. %if "%{mod_roaming}" == "yes"
  479. ( cd mod_roaming-%{V_mod_roaming}
  480. cp mod_roaming.c ../apache_%{V_apache}/src/modules/extra/
  481. )
  482. %endif
  483. %if "%{mod_relocate}" == "yes"
  484. ( cd mod_relocate-%{V_mod_relocate}
  485. cp mod_relocate.c ../apache_%{V_apache}/src/modules/extra/
  486. )
  487. %endif
  488. ( cd apache_%{V_apache}
  489. cflags="%{l_cflags -O}"
  490. ldflags=""
  491. libs=""
  492. %if "%{with_pam}" == "yes"
  493. cflags="$cflags -I`%{l_prefix}/etc/rc --query pam_incdir`"
  494. ldflags="$ldflags -L`%{l_prefix}/etc/rc --query pam_libdir`"
  495. libs="$libs -lpam"
  496. %endif
  497. CC="%{l_cc}" \
  498. CFLAGS="$cflags" \
  499. LDFLAGS="$ldflags" \
  500. LIBS="$libs" \
  501. %if "%{mod_ssl}" == "yes"
  502. EAPI_MM="%{l_prefix}" \
  503. SSL_BASE="%{l_prefix}" \
  504. %endif
  505. ./configure \
  506. --target=apache \
  507. --with-layout=GNU \
  508. --prefix=%{l_prefix} \
  509. --sbindir=%{l_prefix}/sbin \
  510. --sysconfdir=%{l_prefix}/etc/apache \
  511. --libexecdir=%{l_prefix}/lib/apache \
  512. --datadir=%{l_prefix}/share/apache \
  513. --localstatedir=%{l_prefix}/var/apache \
  514. --enable-suexec \
  515. --suexec-caller=%{l_musr} \
  516. --suexec-userdir=.www \
  517. --enable-module=most \
  518. --with-perl=%{l_prefix}/bin/perl \
  519. %if "%{mod_ssl}" == "yes"
  520. --enable-rule=EAPI \
  521. --enable-module=ssl \
  522. %endif
  523. %if "%{mod_perl}" == "yes"
  524. --activate-module=src/modules/perl/libperl.a \
  525. %endif
  526. %if "%{mod_php}" == "yes"
  527. --activate-module=src/modules/php4/libphp4.a \
  528. %endif
  529. %if "%{mod_dav}" == "yes"
  530. --activate-module=src/modules/dav/libdav.a \
  531. %endif
  532. %if "%{mod_layout}" == "yes"
  533. --activate-module=src/modules/layout/liblayout.a \
  534. %endif
  535. %if "%{mod_macro}" == "yes"
  536. --activate-module=src/modules/extra/mod_macro.o \
  537. %endif
  538. %if "%{mod_auth_pam}" == "yes"
  539. --activate-module=src/modules/extra/mod_auth_pam.o \
  540. %endif
  541. %if "%{mod_gzip}" == "yes"
  542. --activate-module=src/modules/extra/mod_gzip.o \
  543. %endif
  544. %if "%{mod_zmod}" == "yes"
  545. --activate-module=src/modules/zmod/libzmod.a \
  546. %endif
  547. %if "%{mod_fastcgi}" == "yes"
  548. --activate-module=src/modules/fastcgi/libfastcgi.a \
  549. %endif
  550. %if "%{mod_throttle}" == "yes"
  551. --activate-module=src/modules/extra/mod_throttle.o \
  552. %endif
  553. %if "%{mod_access_referer}" == "yes"
  554. --activate-module=src/modules/extra/mod_access_referer.o \
  555. %endif
  556. %if "%{mod_roaming}" == "yes"
  557. --activate-module=src/modules/extra/mod_roaming.o \
  558. %endif
  559. %if "%{mod_relocate}" == "yes"
  560. --activate-module=src/modules/extra/mod_relocate.o \
  561. %endif
  562. --enable-module=so
  563. %{l_make} %{l_mflags -O} build-quiet
  564. )
  565. %install
  566. ( cd apache_%{V_apache}
  567. %{l_make} %{l_mflags} install root=$RPM_BUILD_ROOT
  568. mv $RPM_BUILD_ROOT%{l_prefix}/share/apache/icons/small/* \
  569. $RPM_BUILD_ROOT%{l_prefix}/share/apache/icons/
  570. rm -rf $RPM_BUILD_ROOT%{l_prefix}/share/apache/icons/small
  571. rm -f $RPM_BUILD_ROOT%{l_prefix}/share/apache/icons/README*
  572. rm -f $RPM_BUILD_ROOT%{l_prefix}/etc/apache/*.default
  573. rm -f $RPM_BUILD_ROOT%{l_prefix}/etc/apache/srm.conf
  574. rm -f $RPM_BUILD_ROOT%{l_prefix}/etc/apache/access.conf
  575. mv $RPM_BUILD_ROOT%{l_prefix}/share/apache/htdocs/index.html.en \
  576. $RPM_BUILD_ROOT%{l_prefix}/share/apache/htdocs/index.html
  577. rm -f $RPM_BUILD_ROOT%{l_prefix}/share/apache/htdocs/index.html.*
  578. chmod a+rx $RPM_BUILD_ROOT%{l_prefix}/share/apache/cgi-bin/*
  579. mv $RPM_BUILD_ROOT%{l_prefix}/share/apache/cgi-bin \
  580. $RPM_BUILD_ROOT%{l_prefix}/cgi/
  581. rm -rf $RPM_BUILD_ROOT%{l_prefix}/cgi/test-cgi
  582. )
  583. %if "%{mod_perl}" == "yes"
  584. rm -f $RPM_BUILD_ROOT%{l_prefix}/bin/perl
  585. %endif
  586. l_hostname=`%{l_shtool} echo -e %h`
  587. l_domainname=`%{l_shtool} echo -e %d | cut -c2-`
  588. %{l_shtool} install -c -m 644 \
  589. -e 's;@l_prefix@;%{l_prefix};g' \
  590. -e "s;@l_hostname@;$l_hostname;g" \
  591. -e "s;@l_domainname@;$l_domainname;g" \
  592. -e 's;@l_nusr@;%{l_nusr};g' \
  593. -e 's;@l_ngrp@;%{l_ngrp};g' \
  594. %{SOURCE apache.base} \
  595. %{SOURCE apache.conf} \
  596. %{SOURCE apache.vhost} \
  597. $RPM_BUILD_ROOT%{l_prefix}/etc/apache/
  598. mv $RPM_BUILD_ROOT%{l_prefix}/etc/apache/magic $RPM_BUILD_ROOT%{l_prefix}/etc/apache/mime.magic
  599. find $RPM_BUILD_ROOT%{l_prefix} -name perllocal.pod -print | xargs rm -f
  600. %{l_shtool} mkdir -f -p -m 755 $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d
  601. %{l_shtool} install -c -m 755 -e 's;@l_prefix@;%{l_prefix};g' \
  602. -e 's;@l_musr@;%{l_musr};g' -e 's;@l_mgrp@;%{l_mgrp};g' \
  603. %{SOURCE rc.apache} $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d/
  604. strip $RPM_BUILD_ROOT%{l_prefix}/bin/* 2> /dev/null || true
  605. strip $RPM_BUILD_ROOT%{l_prefix}/sbin/* 2> /dev/null || true
  606. %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
  607. %{l_files_std} \
  608. '%attr(4755,root,%{l_mgrp}) %{l_prefix}/sbin/suexec' \
  609. '%config %{l_prefix}/etc/apache/*' \
  610. '%config %attr(444,%{l_musr},%{l_mgrp}) %{l_prefix}/etc/apache/apache.base'
  611. %files -f files
  612. %clean
  613. rm -rf $RPM_BUILD_ROOT
  614. %post
  615. %if "%{mod_auth_pam}" == "yes"
  616. # add PAM configuration entry
  617. if [ $1 -eq 1 ]; then
  618. $RPM_INSTALL_PREFIX/sbin/pamtool -a -s -n "apache"
  619. fi
  620. %endif
  621. %preun
  622. %if "%{mod_auth_pam}" == "yes"
  623. # remove PAM configuration entry
  624. if [ $1 -eq 0 ]; then
  625. $RPM_INSTALL_PREFIX/sbin/pamtool -r -s -n "apache"
  626. fi
  627. %endif