php5.spec 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439
  1. ##
  2. ## php5.spec -- OpenPKG RPM Specification
  3. ## Copyright (c) 2000-2003 The OpenPKG Project <http://www.openpkg.org/>
  4. ## Copyright (c) 2000-2003 Ralf S. Engelschall <rse@engelschall.com>
  5. ## Copyright (c) 2000-2003 Cable & Wireless <http://www.cw.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. # package information
  26. Name: php5
  27. Summary: Personal HomePage (PHP)
  28. URL: http://www.php.net/
  29. Vendor: The PHP Project
  30. Packager: The OpenPKG Project
  31. Distribution: OpenPKG [EVAL]
  32. Group: Language
  33. License: PHP
  34. Version: 5.0.0b2
  35. Release: 20031127
  36. # package options
  37. %option with_calendar no
  38. %option with_mysql no
  39. %option with_pgsql no
  40. %option with_gd no
  41. %option with_db no
  42. %option with_debug no
  43. %option with_pdflib no
  44. %option with_zlib no
  45. %option with_bzip2 no
  46. %option with_openssl no
  47. %option with_openldap no
  48. %option with_openldapsasl no
  49. %option with_mm no
  50. %option with_pcre no
  51. %option with_ftp no
  52. %option with_java no
  53. %option with_oci7 no
  54. %option with_oci8 no
  55. %option with_freetype no
  56. %option with_gettext no
  57. %option with_imap no
  58. %option with_xml no
  59. %option with_xslt no
  60. %option with_dom no
  61. %option with_bc no
  62. %option with_transsid no
  63. %option with_curl no
  64. %option with_mhash no
  65. %option with_wddx no
  66. %option with_gdbm no
  67. %option with_versioning no
  68. %option with_pear no
  69. %option with_snmp no
  70. # fixing implicit extension dependencies and correlations
  71. %if "%{with_pear}" == "yes"
  72. %undefine with_xml
  73. %define with_xml yes
  74. %endif
  75. %if "%{with_freetype}" == "yes"
  76. %undefine with_gd
  77. %define with_gd yes
  78. %endif
  79. %if "%{with_mysql}" == "yes" || "%{with_pdflib}" == "yes" || "%{with_gd}" == "yes" || "%{with_dom}" == "yes"
  80. %undefine with_zlib
  81. %define with_zlib yes
  82. %endif
  83. %if "%{with_pgsql}" == "yes"
  84. %undefine with_openssl
  85. %define with_openssl yes
  86. %endif
  87. # list of sources
  88. Source0: http://www.php.net/distributions/php-%{version}.tar.gz
  89. # build information
  90. Prefix: %{l_prefix}
  91. BuildRoot: %{l_buildroot}
  92. BuildPreReq: OpenPKG, openpkg >= 20030708, gcc, flex, bison
  93. PreReq: OpenPKG, openpkg >= 20030708, MTA
  94. %if "%{with_mysql}" == "yes"
  95. BuildPreReq: mysql
  96. PreReq: mysql
  97. %endif
  98. %if "%{with_pgsql}" == "yes"
  99. BuildPreReq: postgresql
  100. PreReq: postgresql
  101. %endif
  102. %if "%{with_gd}" == "yes"
  103. BuildPreReq: gd, jpeg, png
  104. PreReq: gd, jpeg, png
  105. %endif
  106. %if "%{with_db}" == "yes"
  107. BuildPreReq: db
  108. PreReq: db
  109. %endif
  110. %if "%{with_pdflib}" == "yes"
  111. BuildPreReq: pdflib, jpeg, png
  112. PreReq: pdflib, jpeg, png
  113. %endif
  114. %if "%{with_zlib}" == "yes"
  115. BuildPreReq: zlib
  116. PreReq: zlib
  117. %endif
  118. %if "%{with_bzip2}" == "yes"
  119. BuildPreReq: bzip2
  120. PreReq: bzip2
  121. %endif
  122. %if "%{with_openssl}" == "yes"
  123. BuildPreReq: openssl
  124. PreReq: openssl
  125. %endif
  126. %if "%{with_openldap}" == "yes"
  127. BuildPreReq: openldap
  128. PreReq: openldap
  129. %if "%{with_openldapsasl}" == "yes"
  130. BuildPreReq: openldap::with_sasl = yes
  131. PreReq: openldap::with_sasl = yes
  132. %else
  133. BuildPreReq: openldap::with_sasl = no
  134. PreReq: openldap::with_sasl = no
  135. %endif
  136. %endif
  137. %if "%{with_mm}" == "yes"
  138. BuildPreReq: mm
  139. PreReq: mm
  140. %endif
  141. %if "%{with_pcre}" == "yes"
  142. BuildPreReq: pcre
  143. PreReq: pcre
  144. %endif
  145. %if "%{with_java}" == "yes"
  146. BuildPreReq: j2se
  147. PreReq: j2se
  148. %endif
  149. %if "%{with_freetype}" == "yes"
  150. BuildPreReq: freetype
  151. PreReq: freetype
  152. %endif
  153. %if "%{with_gettext}" == "yes"
  154. BuildPreReq: gettext, libiconv
  155. PreReq: gettext, libiconv
  156. %endif
  157. %if "%{with_imap}" == "yes"
  158. BuildPreReq: imap, openssl
  159. PreReq: imap, openssl
  160. %endif
  161. %if "%{with_xml}" == "yes"
  162. BuildPreReq: libxml
  163. PreReq: libxml
  164. %endif
  165. %if "%{with_xslt}" == "yes"
  166. BuildPreReq: libxslt
  167. PreReq: libxslt
  168. %endif
  169. %if "%{with_dom}" == "yes"
  170. BuildPreReq: libxml, libxslt
  171. PreReq: libxml, libxslt
  172. %endif
  173. %if "%{with_curl}" == "yes"
  174. BuildPreReq: curl
  175. PreReq: curl
  176. %endif
  177. %if "%{with_mhash}" == "yes"
  178. BuildPreReq: mhash
  179. PreReq: mhash
  180. %endif
  181. %if "%{with_gdbm}" == "yes"
  182. BuildPreReq: gdbm, gdbm::with_ndbm = yes
  183. PreReq: gdbm, gdbm::with_ndbm = yes
  184. %endif
  185. %if "%{with_oci7}" == "yes" || "%{with_oci8}" == "yes"
  186. BuildPreReq: ORACLE
  187. %endif
  188. %if "%{with_snmp}" == "yes"
  189. BuildPreReq: snmp
  190. PreReq: snmp
  191. %endif
  192. AutoReq: no
  193. AutoReqProv: no
  194. %description
  195. PHP is an HTML-embedded scripting language. Much of its syntax is
  196. borrowed from C, Java and Perl with a couple of unique PHP-specific
  197. features thrown in. The goal of the language is to allow web
  198. developers to write dynamically generated pages quickly.
  199. This is the Command Line Interface (CLI) and Common Gateway
  200. Interface (CGI) version of PHP, intended for use in the "shebang"
  201. line ("#!%{l_prefix}/bin/php") of stand-alone PHP based programs
  202. and for use in the "shebang" line ("#!%{l_prefix}/cgi/php") of
  203. stand-alone webserver-independent CGI scripts.
  204. %prep
  205. %setup -q -n php-%{version}
  206. %build
  207. # configure package
  208. cflags="%{l_cflags -O}"
  209. cppflags="%{l_cppflags}"
  210. ldflags="%{l_ldflags}"
  211. libs=""
  212. %if "%{with_gdbm}" == "yes"
  213. libs="$libs -lndbm -lgdbm"
  214. %endif
  215. %if "%{with_gd}" == "yes"
  216. libs="$libs -lpng -lz"
  217. %endif
  218. %if "%{with_gettext}" == "yes"
  219. libs="$libs -liconv"
  220. %endif
  221. %if "%{with_openldap}" == "yes" && "%{with_openldapsasl}" == "yes"
  222. libs="$libs -lsasl2"
  223. %endif
  224. %if "%{with_imap}" == "yes"
  225. libs="$libs -lssl -lcrypto"
  226. %endif
  227. %if "%{with_db}" == "yes"
  228. libs="$libs -ldb"
  229. %endif
  230. %if "%{with_oci7}" == "yes" || "%{with_oci8}" == "yes"
  231. ORACLE_HOME="`%{l_prefix}/etc/rc --query oracle_home`"
  232. export ORACLE_HOME
  233. %endif
  234. CC="%{l_cc}" \
  235. CFLAGS="$cflags" \
  236. CPPFLAGS="$cppflags" \
  237. LDFLAGS="$ldflags" \
  238. LIBS="$libs" \
  239. PROG_SENDMAIL="%{l_prefix}/sbin/sendmail" \
  240. ./configure \
  241. --prefix=%{l_prefix} \
  242. --sysconfdir=%{l_prefix}/etc/php5 \
  243. --with-config-file-path=%{l_prefix}/etc/php5 \
  244. --libdir=%{l_prefix}/lib/php5 \
  245. --disable-all \
  246. %if "%{with_calendar}" == "yes"
  247. --enable-calendar \
  248. %endif
  249. %if "%{with_mysql}" == "yes"
  250. --with-mysql=%{l_prefix} \
  251. %else
  252. --without-mysql \
  253. %endif
  254. %if "%{with_pgsql}" == "yes"
  255. --with-pgsql=%{l_prefix} \
  256. %else
  257. --without-pgsql \
  258. %endif
  259. %if "%{with_gd}" == "yes"
  260. --with-gd=%{l_prefix} \
  261. --with-jpeg-dir=%{l_prefix} \
  262. --with-png-dir=%{l_prefix} \
  263. %endif
  264. %if "%{with_freetype}" == "yes"
  265. --enable-gd-imgstrttf \
  266. --enable-gd-native-ttf \
  267. --with-freetype-dir=%{l_prefix} \
  268. %endif
  269. %if "%{with_db}" == "yes"
  270. --with-db4=%{l_prefix} \
  271. %endif
  272. %if "%{with_debug}" == "yes"
  273. --with-debug=yes \
  274. %else
  275. --with-debug=no \
  276. %endif
  277. %if "%{with_zlib}" == "yes"
  278. --with-zlib=%{l_prefix} \
  279. --with-zlib-dir=%{l_prefix} \
  280. %endif
  281. %if "%{with_bzip2}" == "yes"
  282. --with-bz2=%{l_prefix} \
  283. %endif
  284. %if "%{with_pdflib}" == "yes"
  285. --with-pdflib=%{l_prefix} \
  286. --with-jpeg-dir=%{l_prefix} \
  287. --with-png-dir=%{l_prefix} \
  288. %endif
  289. %if "%{with_openssl}" == "yes" || "%{with_openldap}" == "yes"
  290. --with-openssl=%{l_prefix} \
  291. %endif
  292. %if "%{with_openldap}" == "yes"
  293. --with-ldap=%{l_prefix} \
  294. %endif
  295. %if "%{with_mm}" == "yes"
  296. --with-mm=%{l_prefix} \
  297. --enable-session \
  298. %endif
  299. %if "%{with_pcre}" == "yes"
  300. --with-pcre=%{l_prefix} \
  301. %endif
  302. %if "%{with_ftp}" == "yes"
  303. --enable-ftp \
  304. %endif
  305. %if "%{with_java}" == "yes"
  306. --with-java=%{l_prefix}/libexec/j2se \
  307. %endif
  308. %if "%{with_oci7}" == "yes"
  309. --with-oracle \
  310. %endif
  311. %if "%{with_oci8}" == "yes"
  312. --with-oci8 \
  313. %endif
  314. %if "%{with_gettext}" == "yes"
  315. --with-gettext=%{l_prefix} \
  316. %endif
  317. %if "%{with_imap}" == "yes"
  318. --with-imap=%{l_prefix} \
  319. --with-imap-ssl=%{l_prefix} \
  320. %endif
  321. %if "%{with_xml}" == "yes"
  322. --enable-xml \
  323. --with-libxml-dir=%{l_prefix} \
  324. %else
  325. --disable-xml \
  326. %endif
  327. %if "%{with_xslt}" == "yes"
  328. --with-xsl=%{l_prefix} \
  329. %else
  330. --without-xsl \
  331. %endif
  332. %if "%{with_dom}" == "yes"
  333. --enable-dom=%{l_prefix} \
  334. --with-libxml-dir=%{l_prefix} \
  335. %else
  336. --disable-dom \
  337. %endif
  338. %if "%{with_wddx}" == "yes"
  339. --enable-wddx \
  340. %endif
  341. %if "%{with_bc}" == "yes"
  342. --enable-bcmath \
  343. %endif
  344. %if "%{with_transsid}" == "yes"
  345. --enable-trans-sid \
  346. %endif
  347. %if "%{with_mhash}" == "yes"
  348. --with-mhash=%{l_prefix} \
  349. %endif
  350. %if "%{with_curl}" == "yes"
  351. --with-curl=%{l_prefix} \
  352. %endif
  353. %if "%{with_gdbm}" == "yes"
  354. --with-gdbm=%{l_prefix} \
  355. %endif
  356. %if "%{with_versioning}" == "yes"
  357. --enable-versioning \
  358. %endif
  359. %if "%{with_pear}" == "yes"
  360. --with-pear \
  361. %else
  362. --without-pear \
  363. %endif
  364. %if "%{with_snmp}" == "yes"
  365. --with-snmp=%{l_prefix} \
  366. %endif
  367. --enable-cli \
  368. --enable-cgi \
  369. --enable-force-cgi-redirect \
  370. --enable-discard-path \
  371. --enable-track-vars \
  372. --enable-memory-limit
  373. # build package
  374. %{l_make} %{l_mflags}
  375. %install
  376. # install package
  377. rm -rf $RPM_BUILD_ROOT
  378. %{l_make} %{l_mflags} install INSTALL_ROOT=$RPM_BUILD_ROOT
  379. # install CLI version
  380. # ("make install" incorrectly installs the CGI version into bin/php!)
  381. %{l_shtool} mkdir -f -p -m 755 \
  382. $RPM_BUILD_ROOT%{l_prefix}/bin \
  383. $RPM_BUILD_ROOT%{l_prefix}/man/man1
  384. %{l_shtool} install -c -s -m 755 \
  385. sapi/cli/php $RPM_BUILD_ROOT%{l_prefix}/bin/php5
  386. %{l_shtool} install -c -m 644 \
  387. sapi/cli/php.1 $RPM_BUILD_ROOT%{l_prefix}/man/man1/php5.1
  388. # (re)install CGI version
  389. %{l_shtool} mkdir -f -p -m 755 \
  390. $RPM_BUILD_ROOT%{l_prefix}/cgi
  391. %{l_shtool} install -c -s -m 755 \
  392. sapi/cgi/php $RPM_BUILD_ROOT%{l_prefix}/cgi/php5
  393. # adjust paths
  394. mv $RPM_BUILD_ROOT%{l_prefix}/include/php \
  395. $RPM_BUILD_ROOT%{l_prefix}/include/php5
  396. %{l_shtool} subst \
  397. -e 's;/include/php;/include/php5;g' \
  398. $RPM_BUILD_ROOT%{l_prefix}/bin/phpize \
  399. $RPM_BUILD_ROOT%{l_prefix}/bin/php-config
  400. for bin in php php-config phpextdist phpize; do
  401. mv $RPM_BUILD_ROOT%{l_prefix}/bin/$bin \
  402. $RPM_BUILD_ROOT%{l_prefix}/bin/`echo $bin | sed -e 's;^php;php5;'`
  403. done
  404. # strip down installation
  405. rm -rf $RPM_BUILD_ROOT%{l_prefix}/lib/php/build
  406. rmdir $RPM_BUILD_ROOT%{l_prefix}/lib/php >/dev/null 2>&1 || true
  407. strip $RPM_BUILD_ROOT%{l_prefix}/bin/* >/dev/null 2>&1 || true
  408. # install default configuration file
  409. %{l_shtool} mkdir -f -p -m 755 \
  410. $RPM_BUILD_ROOT%{l_prefix}/etc/php5
  411. %{l_shtool} install -c -m 644 /dev/null \
  412. $RPM_BUILD_ROOT%{l_prefix}/etc/php5/php.ini
  413. # determine installation files
  414. %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT %{l_files_std} \
  415. '%config %{l_prefix}/etc/php5/*'
  416. %files -f files
  417. %clean
  418. rm -rf $RPM_BUILD_ROOT