php.spec 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352
  1. ##
  2. ## php.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. # package information
  26. Name: php
  27. Summary: Personal HomePage (PHP)
  28. URL: http://www.php.net/
  29. Vendor: The PHP Project
  30. Packager: The OpenPKG Project
  31. Distribution: OpenPKG [BASE]
  32. Group: Language
  33. License: PHP
  34. Version: 4.3.2
  35. Release: 20030702
  36. # package options (analog to apache.spec)
  37. %option with_calendar no
  38. %option with_mysql no
  39. %option with_gd no
  40. %option with_db no
  41. %option with_debug no
  42. %option with_pdflib no
  43. %option with_zlib no
  44. %option with_bzip2 no
  45. %option with_openssl no
  46. %option with_openldap no
  47. %option with_openldapsasl no
  48. %option with_mm no
  49. %option with_pcre no
  50. %option with_ftp no
  51. %option with_java no
  52. %option with_oci7 no
  53. %option with_oci8 no
  54. %option with_freetype no
  55. %option with_gettext no
  56. %option with_imap no
  57. %option with_xml no
  58. %option with_dom no
  59. %option with_bc no
  60. %option with_transsid no
  61. %option with_curl no
  62. %option with_mhash no
  63. %option with_wddx no
  64. %option with_gdbm no
  65. %option with_versioning no
  66. %option with_pear no
  67. # fixing implicit inter-module dependencies and correlations
  68. %if "%{with_freetype}" == "yes"
  69. %undefine with_gd
  70. %define with_gd yes
  71. %endif
  72. %if "%{with_mysql}" == "yes" || "%{with_pdflib}" == "yes" || "%{with_gd}" == "yes" || "%{with_dom}" == "yes"
  73. %undefine with_zlib
  74. %define with_zlib yes
  75. %endif
  76. # list of sources
  77. Source0: http://www.php.net/distributions/php-%{version}.tar.gz
  78. Patch0: php.patch
  79. # build information
  80. Prefix: %{l_prefix}
  81. BuildRoot: %{l_buildroot}
  82. BuildPreReq: OpenPKG, openpkg >= 20020206, gcc, sed, flex, bison
  83. PreReq: OpenPKG, openpkg >= 20020206
  84. %if "%{with_mysql}" == "yes"
  85. BuildPreReq: MYSQL
  86. %endif
  87. %if "%{with_gd}" == "yes"
  88. BuildPreReq: gd, jpeg, png
  89. %endif
  90. %if "%{with_db}" == "yes"
  91. BuildPreReq: db
  92. %endif
  93. %if "%{with_pdflib}" == "yes"
  94. BuildPreReq: pdflib, jpeg, png
  95. %endif
  96. %if "%{with_zlib}" == "yes"
  97. BuildPreReq: zlib
  98. %endif
  99. %if "%{with_bzip2}" == "yes"
  100. BuildPreReq: bzip2
  101. %endif
  102. %if "%{with_openssl}" == "yes"
  103. BuildPreReq: openssl
  104. %endif
  105. %if "%{with_openldap}" == "yes"
  106. BuildPreReq: openldap
  107. %if "%{with_openldapsasl}" == "yes"
  108. BuildPreReq: openldap::with_sasl = yes
  109. %else
  110. BuildPreReq: openldap::with_sasl = no
  111. %endif
  112. %endif
  113. %if "%{with_mm}" == "yes"
  114. BuildPreReq: mm
  115. %endif
  116. %if "%{with_pcre}" == "yes"
  117. BuildPreReq: pcre
  118. %endif
  119. %if "%{with_java}" == "yes"
  120. BuildPreReq: j2se
  121. %endif
  122. %if "%{with_freetype}" == "yes"
  123. BuildPreReq: freetype
  124. %endif
  125. %if "%{with_gettext}" == "yes"
  126. BuildPreReq: gettext, libiconv
  127. %endif
  128. %if "%{with_imap}" == "yes"
  129. BuildPreReq: imap, openssl
  130. %endif
  131. %if "%{with_xml}" == "yes"
  132. BuildPreReq: expat
  133. %endif
  134. %if "%{with_dom}" == "yes"
  135. BuildPreReq: libxml, libxslt
  136. %endif
  137. %if "%{with_curl}" == "yes"
  138. BuildPreReq: curl
  139. %endif
  140. %if "%{with_mhash}" == "yes"
  141. BuildPreReq: mhash
  142. %endif
  143. %if "%{with_gdbm}" == "yes"
  144. BuildPreReq: gdbm, gdbm::with_ndbm = yes
  145. %endif
  146. %if "%{with_oci7}" == "yes" || "%{with_oci8}" == "yes"
  147. BuildPreReq: ORACLE
  148. %endif
  149. AutoReq: no
  150. AutoReqProv: no
  151. %description
  152. PHP is an HTML-embedded scripting language. Much of its syntax is
  153. borrowed from C, Java and Perl with a couple of unique PHP-specific
  154. features thrown in. The goal of the language is to allow web
  155. developers to write dynamically generated pages quickly.
  156. This is the Command Line Interface (CLI) version, intended for
  157. use in the "shebang" line ("#!%{l_prefix}/bin/php") of stand-alone
  158. webserver-independent CGI scripts.
  159. %prep
  160. %setup -q
  161. %patch -p1
  162. %build
  163. cflags="%{l_cflags -O}"
  164. ldflags=""
  165. libs=""
  166. %if "%{with_gdbm}" == "yes"
  167. cflags="$cflags -I%{l_prefix}/include"
  168. ldflags="$ldflags -L%{l_prefix}/lib"
  169. libs="$libs -lndbm -lgdbm"
  170. %endif
  171. %if "%{with_oci7}" == "yes" || "%{with_oci8}" == "yes"
  172. ORACLE_HOME="`%{l_prefix}/etc/rc --query oracle_home`"
  173. export ORACLE_HOME
  174. %endif
  175. %if "%{with_openldap}" == "yes" && "%{with_openldapsasl}" == "yes"
  176. libs="$libs -lsasl2"
  177. %endif
  178. CC="%{l_cc}" \
  179. CFLAGS="$cflags" \
  180. LDFLAGS="$ldflags" \
  181. LIBS="$libs" \
  182. ./configure \
  183. --prefix=%{l_prefix} \
  184. --with-config-file-path=%{l_prefix}/etc/php \
  185. %if "%{with_calendar}" == "yes"
  186. --enable-calendar \
  187. %endif
  188. %if "%{with_mysql}" == "yes"
  189. --with-mysql=%{l_prefix} \
  190. %else
  191. --without-mysql \
  192. %endif
  193. %if "%{with_gd}" == "yes"
  194. --with-gd=%{l_prefix} \
  195. --with-jpeg-dir=%{l_prefix} \
  196. --with-png-dir=%{l_prefix} \
  197. %endif
  198. %if "%{with_freetype}" == "yes"
  199. --enable-gd-imgstrttf \
  200. --enable-gd-native-ttf \
  201. --with-freetype-dir=%{l_prefix} \
  202. %endif
  203. %if "%{with_db}" == "yes"
  204. --with-db3=%{l_prefix} \
  205. %endif
  206. %if "%{with_debug}" == "yes"
  207. --with-debug=yes \
  208. %else
  209. --with-debug=no \
  210. %endif
  211. %if "%{with_zlib}" == "yes"
  212. --with-zlib=%{l_prefix} \
  213. --with-zlib-dir=%{l_prefix} \
  214. %endif
  215. %if "%{with_bzip2}" == "yes"
  216. --with-bz2=%{l_prefix} \
  217. %endif
  218. %if "%{with_pdflib}" == "yes"
  219. --with-pdflib=%{l_prefix} \
  220. --with-jpeg-dir=%{l_prefix} \
  221. --with-png-dir=%{l_prefix} \
  222. %endif
  223. %if "%{with_openssl}" == "yes" || "%{with_openldap}" == "yes"
  224. --with-openssl=%{l_prefix} \
  225. %endif
  226. %if "%{with_openldap}" == "yes"
  227. --with-ldap=%{l_prefix} \
  228. %endif
  229. %if "%{with_mm}" == "yes"
  230. --with-mm=%{l_prefix} \
  231. --enable-session \
  232. %endif
  233. %if "%{with_pcre}" == "yes"
  234. --with-pcre=%{l_prefix} \
  235. %endif
  236. %if "%{with_ftp}" == "yes"
  237. --enable-ftp \
  238. %endif
  239. %if "%{with_java}" == "yes"
  240. --with-java=%{l_prefix}/libexec/j2se \
  241. %endif
  242. %if "%{with_oci7}" == "yes"
  243. --with-oracle \
  244. %endif
  245. %if "%{with_oci8}" == "yes"
  246. --with-oci8 \
  247. %endif
  248. %if "%{with_gettext}" == "yes"
  249. --with-gettext=%{l_prefix} \
  250. %endif
  251. %if "%{with_imap}" == "yes"
  252. --with-imap=%{l_prefix} \
  253. --with-imap-ssl=%{l_prefix} \
  254. %endif
  255. %if "%{with_xml}" == "yes"
  256. --with-xml=%{l_prefix} \
  257. %endif
  258. %if "%{with_dom}" == "yes"
  259. --with-dom=%{l_prefix} \
  260. --with-dom-xslt=%{l_prefix} \
  261. --with-dom-exslt=%{l_prefix} \
  262. %endif
  263. %if "%{with_wddx}" == "yes"
  264. --enable-wddx \
  265. %endif
  266. %if "%{with_bc}" == "yes"
  267. --enable-bcmath \
  268. %endif
  269. %if "%{with_transsid}" == "yes"
  270. --enable-trans-sid \
  271. %endif
  272. %if "%{with_mhash}" == "yes"
  273. --with-mhash=%{l_prefix} \
  274. %endif
  275. %if "%{with_curl}" == "yes"
  276. --with-curl=%{l_prefix} \
  277. %endif
  278. %if "%{with_gdbm}" == "yes"
  279. --with-gdbm=%{l_prefix} \
  280. %endif
  281. %if "%{with_versioning}" == "yes"
  282. --enable-versioning \
  283. %endif
  284. --enable-cli \
  285. %if "%{with_pear}" == "yes"
  286. --with-pear \
  287. %else
  288. --without-pear \
  289. %endif
  290. --enable-force-cgi-redirect \
  291. --enable-discard-path \
  292. --enable-track-vars
  293. %{l_make} %{l_mflags}
  294. %install
  295. rm -rf $RPM_BUILD_ROOT
  296. %{l_shtool} mkdir -f -p -m 755 \
  297. $RPM_BUILD_ROOT%{l_prefix}/bin \
  298. $RPM_BUILD_ROOT%{l_prefix}/cgi \
  299. $RPM_BUILD_ROOT%{l_prefix}/etc/php \
  300. $RPM_BUILD_ROOT%{l_prefix}/include/php/main \
  301. $RPM_BUILD_ROOT%{l_prefix}/include/php/Zend \
  302. $RPM_BUILD_ROOT%{l_prefix}/include/php/TSRM \
  303. $RPM_BUILD_ROOT%{l_prefix}/include/php/regex \
  304. $RPM_BUILD_ROOT%{l_prefix}/lib/php
  305. %{l_shtool} install -c -s -m 755 \
  306. sapi/cli/php \
  307. $RPM_BUILD_ROOT%{l_prefix}/cgi/
  308. ln $RPM_BUILD_ROOT%{l_prefix}/cgi/php \
  309. $RPM_BUILD_ROOT%{l_prefix}/bin/php
  310. %{l_shtool} install -c -m 644 /dev/null \
  311. $RPM_BUILD_ROOT%{l_prefix}/etc/php/php.ini
  312. %{l_shtool} install -c -m 644 /dev/null \
  313. $RPM_BUILD_ROOT%{l_prefix}/etc/php/php.ini
  314. %{l_shtool} install -c -m 644 \
  315. *.h include/*.h $RPM_BUILD_ROOT%{l_prefix}/include/php/
  316. %{l_shtool} install -c -m 644 \
  317. main/*.h $RPM_BUILD_ROOT%{l_prefix}/include/php/main/
  318. %{l_shtool} install -c -m 644 \
  319. Zend/*.h $RPM_BUILD_ROOT%{l_prefix}/include/php/Zend/
  320. %{l_shtool} install -c -m 644 \
  321. TSRM/*.h $RPM_BUILD_ROOT%{l_prefix}/include/php/TSRM/
  322. %{l_shtool} install -c -m 644 \
  323. regex/*.h $RPM_BUILD_ROOT%{l_prefix}/include/php/regex/
  324. %if "%{with_pear}" == "yes"
  325. ( cd $RPM_BUILD_DIR/%{name}-%{version}/pear
  326. export INSTALL_ROOT=$RPM_BUILD_ROOT
  327. $RPM_BUILD_ROOT%{l_prefix}/bin/php -n -dsafe_mode=0 \
  328. install-pear.php package-*.xml
  329. $RPM_BUILD_ROOT%{l_prefix}/bin/php -n -dsafe_mode=0 \
  330. install-pear.php packages/*.tar
  331. ) || exit 1
  332. %endif
  333. %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT %{l_files_std} \
  334. '%config %{l_prefix}/etc/php/php.ini' \
  335. '%dir %attr(0755,%{l_musr},%{l_mgrp}) %{l_prefix}/lib/php' \
  336. '%not %dir %attr(0644,%{l_musr},%{l_mgrp}) %{l_prefix}/lib/php'
  337. %files -f files
  338. %clean
  339. rm -rf $RPM_BUILD_ROOT