php.spec 9.8 KB

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