php.spec 8.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308
  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: 20030220
  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. # 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. # build information
  77. Prefix: %{l_prefix}
  78. BuildRoot: %{l_buildroot}
  79. BuildPreReq: OpenPKG, openpkg >= 20020206, gcc, sed, flex, bison
  80. PreReq: OpenPKG, openpkg >= 20020206
  81. %if "%{with_mysql}" == "yes"
  82. BuildPreReq: MYSQL
  83. %endif
  84. %if "%{with_gd}" == "yes"
  85. BuildPreReq: GD, jpeg, png
  86. %endif
  87. %if "%{with_db}" == "yes"
  88. BuildPreReq: db
  89. %endif
  90. %if "%{with_pdflib}" == "yes"
  91. BuildPreReq: pdflib, jpeg, png
  92. %endif
  93. %if "%{with_zlib}" == "yes"
  94. BuildPreReq: zlib
  95. %endif
  96. %if "%{with_bzip2}" == "yes"
  97. BuildPreReq: bzip2
  98. %endif
  99. %if "%{with_openssl}" == "yes"
  100. BuildPreReq: openssl
  101. %endif
  102. %if "%{with_openldap}" == "yes"
  103. BuildPreReq: openldap
  104. %endif
  105. %if "%{with_mm}" == "yes"
  106. BuildPreReq: mm
  107. %endif
  108. %if "%{with_pcre}" == "yes"
  109. BuildPreReq: pcre
  110. %endif
  111. %if "%{with_java}" == "yes"
  112. BuildPreReq: j2se
  113. %endif
  114. %if "%{with_freetype}" == "yes"
  115. BuildPreReq: freetype
  116. %endif
  117. %if "%{with_gettext}" == "yes"
  118. BuildPreReq: gettext, libiconv
  119. %endif
  120. %if "%{with_imap}" == "yes"
  121. BuildPreReq: imap
  122. %endif
  123. %if "%{with_xml}" == "yes"
  124. BuildPreReq: expat
  125. %endif
  126. %if "%{with_dom}" == "yes"
  127. BuildPreReq: libxml, libxslt
  128. %endif
  129. %if "%{with_curl}" == "yes"
  130. BuildPreReq: curl
  131. %endif
  132. %if "%{with_mhash}" == "yes"
  133. BuildPreReq: mhash
  134. %endif
  135. %if "%{with_gdbm}" == "yes"
  136. BuildPreReq: gdbm, gdbm::with_ndbm = yes
  137. %endif
  138. %if "%{with_oci7}" == "yes" || "%{with_oci8}" == "yes"
  139. BuildPreReq: ORACLE
  140. %endif
  141. AutoReq: no
  142. AutoReqProv: no
  143. %description
  144. PHP is an HTML-embedded scripting language. Much of its syntax is
  145. borrowed from C, Java and Perl with a couple of unique PHP-specific
  146. features thrown in. The goal of the language is to allow web
  147. developers to write dynamically generated pages quickly.
  148. %prep
  149. %setup -q
  150. %build
  151. cflags="%{l_cflags -O}"
  152. ldflags=""
  153. libs=""
  154. %if "%{with_gdbm}" == "yes"
  155. cflags="$cflags -I%{l_prefix}/include"
  156. ldflags="$ldflags -L%{l_prefix}/lib"
  157. libs="$libs -lndbm -lgdbm"
  158. %endif
  159. CC="%{l_cc}" \
  160. CFLAGS="$cflags" \
  161. LDFLAGS="$ldflags" \
  162. LIBS="$libs" \
  163. ./configure \
  164. --prefix=%{l_prefix} \
  165. --with-config-file-path=%{l_prefix}/etc/php \
  166. %if "%{with_calendar}" == "yes"
  167. --enable-calendar \
  168. %endif
  169. %if "%{with_mysql}" == "yes"
  170. --with-mysql=%{l_prefix} \
  171. %endif
  172. %if "%{with_gd}" == "yes"
  173. --with-gd=%{l_prefix} \
  174. --with-jpeg-dir=%{l_prefix} \
  175. --with-png-dir=%{l_prefix} \
  176. %endif
  177. %if "%{with_freetype}" == "yes"
  178. --enable-gd-imgstrttf \
  179. --enable-gd-native-ttf \
  180. --with-freetype-dir=%{l_prefix} \
  181. %endif
  182. %if "%{with_db}" == "yes"
  183. --with-db3=%{l_prefix} \
  184. %endif
  185. %if "%{with_debug}" == "yes"
  186. --with-debug=yes \
  187. %else
  188. --with-debug=no \
  189. %endif
  190. %if "%{with_zlib}" == "yes"
  191. --with-zlib=%{l_prefix} \
  192. --with-zlib-dir=%{l_prefix} \
  193. %endif
  194. %if "%{with_bzip2}" == "yes"
  195. --with-bz2=%{l_prefix} \
  196. %endif
  197. %if "%{with_pdflib}" == "yes"
  198. --with-pdflib=%{l_prefix} \
  199. --with-jpeg-dir=%{l_prefix} \
  200. --with-png-dir=%{l_prefix} \
  201. %endif
  202. %if "%{with_openssl}" == "yes" || "%{with_openldap}" == "yes"
  203. --with-openssl=%{l_prefix} \
  204. %endif
  205. %if "%{with_openldap}" == "yes"
  206. --with-ldap=%{l_prefix} \
  207. %endif
  208. %if "%{with_mm}" == "yes"
  209. --with-mm=%{l_prefix} \
  210. --enable-session \
  211. %endif
  212. %if "%{with_pcre}" == "yes"
  213. --with-pcre=%{l_prefix} \
  214. %endif
  215. %if "%{with_ftp}" == "yes"
  216. --enable-ftp \
  217. %endif
  218. %if "%{with_java}" == "yes"
  219. --with-java=%{l_prefix}/libexec/j2se \
  220. %endif
  221. %if "%{with_oci7}" == "yes"
  222. --with-oracle \
  223. %endif
  224. %if "%{with_oci8}" == "yes"
  225. --with-oci8 \
  226. %endif
  227. %if "%{with_gettext}" == "yes"
  228. --with-gettext=%{l_prefix} \
  229. %endif
  230. %if "%{with_imap}" == "yes"
  231. --with-imap=%{l_prefix} \
  232. --with-imap-ssl=%{l_prefix} \
  233. %endif
  234. %if "%{with_xml}" == "yes"
  235. --with-xml=%{l_prefix} \
  236. %endif
  237. %if "%{with_dom}" == "yes"
  238. --with-dom=%{l_prefix} \
  239. --with-dom-xslt=%{l_prefix} \
  240. --with-dom-exslt=%{l_prefix} \
  241. %endif
  242. %if "%{with_dom}" == "yes"
  243. --enable-wddx \
  244. %endif
  245. %if "%{with_bc}" == "yes"
  246. --enable-bcmath \
  247. %endif
  248. %if "%{with_transsid}" == "yes"
  249. --enable-trans-sid \
  250. %endif
  251. %if "%{with_mhash}" == "yes"
  252. --with-mhash=%{l_prefix} \
  253. %endif
  254. %if "%{with_curl}" == "yes"
  255. --with-curl=%{l_prefix} \
  256. %endif
  257. %if "%{with_gdbm}" == "yes"
  258. --with-gdbm=%{l_prefix} \
  259. %endif
  260. %if "%{with_versioning}" == "yes"
  261. --enable-versioning \
  262. %endif
  263. --enable-cli \
  264. --enable-force-cgi-redirect \
  265. --enable-discard-path \
  266. --enable-track-vars
  267. %{l_make} %{l_mflags}
  268. %install
  269. rm -rf $RPM_BUILD_ROOT
  270. %{l_shtool} mkdir -f -p -m 755 \
  271. $RPM_BUILD_ROOT%{l_prefix}/bin \
  272. $RPM_BUILD_ROOT%{l_prefix}/cgi \
  273. $RPM_BUILD_ROOT%{l_prefix}/etc/php \
  274. $RPM_BUILD_ROOT%{l_prefix}/include/php/regex
  275. %{l_shtool} install -c -s -m 755 sapi/cli/php $RPM_BUILD_ROOT%{l_prefix}/cgi/
  276. ln $RPM_BUILD_ROOT%{l_prefix}/cgi/php \
  277. $RPM_BUILD_ROOT%{l_prefix}/bin/php
  278. %{l_shtool} install -c -m 644 /dev/null \
  279. $RPM_BUILD_ROOT%{l_prefix}/etc/php/php.ini
  280. %{l_shtool} install -c -m 644 /dev/null \
  281. $RPM_BUILD_ROOT%{l_prefix}/etc/php/php.ini
  282. %{l_shtool} install -c -m 644 \
  283. *.h \
  284. include/*.h \
  285. main/*.h \
  286. Zend/*.h \
  287. TSRM/*.h \
  288. regex/*.h \
  289. $RPM_BUILD_ROOT%{l_prefix}/include/php
  290. %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT %{l_files_std} \
  291. '%config %{l_prefix}/etc/php/php.ini'
  292. %files -f files
  293. %clean
  294. rm -rf $RPM_BUILD_ROOT