php.spec 11 KB

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