php.spec 11 KB

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