php.spec 11 KB

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