php3.spec 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206
  1. ##
  2. ## php3.spec -- OpenPKG RPM Specification
  3. ## Copyright (c) 2000-2004 The OpenPKG Project <http://www.openpkg.org/>
  4. ## Copyright (c) 2000-2004 Ralf S. Engelschall <rse@engelschall.com>
  5. ## Copyright (c) 2000-2004 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: php3
  27. Summary: Personal HomePage (PHP)
  28. URL: http://www.php.net/
  29. Vendor: The PHP Project
  30. Packager: The OpenPKG Project
  31. Distribution: OpenPKG
  32. Class: EVAL
  33. Group: Language
  34. License: PHP
  35. Version: 3.0.18
  36. Release: 20040203
  37. # package options
  38. %option with_mysql no
  39. %option with_pgsql no
  40. %option with_gd no
  41. %option with_bdb no
  42. %option with_zlib no
  43. %option with_ssl no
  44. %option with_ftp no
  45. # fixing implicit inter-module dependencies and correlations
  46. %if "%{with_mysql}" == "yes" || "%{with_gd}" == "yes"
  47. %undefine with_zlib
  48. %define with_zlib yes
  49. %endif
  50. %if "%{with_pgsql}" == "yes"
  51. %undefine with_ssl
  52. %define with_ssl yes
  53. %endif
  54. # list of sources
  55. Source0: http://www.php.net/distributions/php-%{version}.tar.gz
  56. Patch0: http://static.php.net/www.php.net/distributions/mime.c.diff-3.0.gz
  57. # build information
  58. Prefix: %{l_prefix}
  59. BuildRoot: %{l_buildroot}
  60. BuildPreReq: OpenPKG, openpkg >= 20040130, gcc, flex, bison
  61. PreReq: OpenPKG, openpkg >= 20040130, MTA
  62. BuildPreReq: gdbm
  63. PreReq: gdbm
  64. %if "%{with_mysql}" == "yes"
  65. BuildPreReq: mysql
  66. PreReq: mysql
  67. %endif
  68. %if "%{with_pgsql}" == "yes"
  69. BuildPreReq: postgresql
  70. PreReq: postgresql
  71. %endif
  72. %if "%{with_gd}" == "yes"
  73. BuildPreReq: gd, jpeg, png
  74. PreReq: gd, jpeg, png
  75. %endif
  76. %if "%{with_bdb}" == "yes"
  77. BuildPreReq: db
  78. PreReq: db
  79. %endif
  80. %if "%{with_zlib}" == "yes"
  81. BuildPreReq: zlib
  82. PreReq: zlib
  83. %endif
  84. %if "%{with_ssl}" == "yes"
  85. BuildPreReq: openssl
  86. PreReq: openssl
  87. %endif
  88. AutoReq: no
  89. AutoReqProv: no
  90. %description
  91. PHP is an HTML-embedded scripting language. Much of its syntax is
  92. borrowed from C, Java and Perl with a couple of unique PHP-specific
  93. features thrown in. The goal of the language is to allow web
  94. developers to write dynamically generated pages quickly.
  95. This is the Common Gateway Interface (CGI) version of PHP, intended
  96. for use in the "shebang" line ("#!%{l_prefix}/cgi/php") of
  97. stand-alone webserver-independent CGI scripts.
  98. THIS IS THE ALREADY DEPRECATED VERSION 3.x OF PHP.
  99. USE IT IN A PRODUCTION ENVIRONMENT ON YOUR OWN RISK ONLY.
  100. %track
  101. prog php3 = {
  102. version = 3.0.18
  103. url = http://www.php.net/releases.php
  104. regex = php-(3.\d+\.\d+)\.tar\.gz
  105. }
  106. %prep
  107. %setup -q -n php-%{version}
  108. cd functions
  109. %patch -p0
  110. %build
  111. # configure package
  112. cflags="%{l_cflags -O}"
  113. cppflags="%{l_cppflags}"
  114. ldflags="%{l_ldflags}"
  115. libs="-lgdbm"
  116. %if "%{with_gd}" == "yes"
  117. libs="$libs -lpng -lz"
  118. %endif
  119. %if "%{with_bdb}" == "yes"
  120. libs="$libs -ldb"
  121. %endif
  122. CC="%{l_cc}" \
  123. CFLAGS="$cflags" \
  124. CPPFLAGS="$cppflags" \
  125. LDFLAGS="$ldflags" \
  126. LIBS="$libs" \
  127. PROG_SENDMAIL="%{l_prefix}/sbin/sendmail" \
  128. ./configure \
  129. --prefix=%{l_prefix} \
  130. --sysconfdir=%{l_prefix}/etc/php3 \
  131. --with-config-file-path=%{l_prefix}/etc/php3 \
  132. %if "%{with_mysql}" == "yes"
  133. --with-mysql=%{l_prefix} \
  134. %else
  135. --without-mysql \
  136. %endif
  137. %if "%{with_pgsql}" == "yes"
  138. --with-pgsql=%{l_prefix} \
  139. %else
  140. --without-pgsql \
  141. %endif
  142. %if "%{with_gd}" == "yes"
  143. --with-gd=%{l_prefix} \
  144. --with-jpeg-dir=%{l_prefix} \
  145. --with-png-dir=%{l_prefix} \
  146. %endif
  147. %if "%{with_bdb}" == "yes"
  148. --with-db4=%{l_prefix} \
  149. %endif
  150. %if "%{with_zlib}" == "yes"
  151. --with-zlib=%{l_prefix} \
  152. --with-zlib-dir=%{l_prefix} \
  153. %endif
  154. %if "%{with_ssl}" == "yes"
  155. --with-openssl=%{l_prefix} \
  156. %endif
  157. %if "%{with_ftp}" == "yes"
  158. --enable-ftp \
  159. %else
  160. --disable-ftp \
  161. %endif
  162. --without-apache \
  163. --enable-force-cgi-redirect \
  164. --enable-discard-path \
  165. --enable-track-vars \
  166. --enable-memory-limit
  167. # build package
  168. %{l_make} %{l_mflags -O}
  169. %install
  170. # install package
  171. rm -rf $RPM_BUILD_ROOT
  172. %{l_shtool} mkdir -f -p -m 755 \
  173. $RPM_BUILD_ROOT%{l_prefix}/cgi \
  174. $RPM_BUILD_ROOT%{l_prefix}/etc/php3
  175. %{l_shtool} install -c -s -m 755 \
  176. php $RPM_BUILD_ROOT%{l_prefix}/cgi/php3
  177. # install default configuration file
  178. %{l_shtool} mkdir -f -p -m 755 \
  179. $RPM_BUILD_ROOT%{l_prefix}/etc/php3
  180. %{l_shtool} install -c -m 644 /dev/null \
  181. $RPM_BUILD_ROOT%{l_prefix}/etc/php3/php.ini
  182. # determine installation files
  183. %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT %{l_files_std} \
  184. '%config %{l_prefix}/etc/php3/*'
  185. %files -f files
  186. %clean
  187. rm -rf $RPM_BUILD_ROOT