apache.spec 29 KB

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