You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

176 lines
4.2 KiB

  1. #! /bin/sh
  2. # Based slightly on an original by John H Terpstra but not much left of his.
  3. # S Liddicott 1999 sam@campbellsci.co.uk
  4. PREFIX="php"
  5. TARDIR="`basename \`pwd\``"
  6. RELEASE=${1:-1}
  7. VERSION=${2:-`echo $TARDIR | sed "s/$PREFIX//g"`}
  8. if [ "$VERSION" = "" ]
  9. then cat <<"EOH"
  10. $PREFIX source needs to be installed in a folder that contains the version
  11. number, e.g. ${PREFIX}4 or ${PREFIX}4b2
  12. EOH
  13. fi
  14. echo "Usage:"
  15. echo "$0 <release>"
  16. echo
  17. echo "e.g.:"
  18. echo "$0 2"
  19. echo -n "Building RPM version $VERSION, release: $RELEASE "
  20. sleep 1 ; echo -n . ; sleep 1 ; echo -n . ; sleep 1 ; echo -n .
  21. echo
  22. TAR=php$VERSION.tar.gz
  23. SPEC=php$VERSION.spec
  24. # write out the .spec file
  25. sed -e "s/PVERSION/$VERSION/g" \
  26. -e "s/PRELEASE/$RELEASE/g" \
  27. -e "s/TARDIR/$TARDIR/g" \
  28. > $SPEC <<'EOF'
  29. Summary: PHP4b1 - a powerful scripting language for HTML
  30. Name: mod_php4
  31. Version: PVERSION
  32. Release: PRELEASE
  33. Group: Networking/Daemons
  34. Source0: http://www.php.net/distributions/php%{PACKAGE_VERSION}.tar.gz
  35. #Source1: php3-manual.tar.gz
  36. Copyright: GPL
  37. BuildRoot: /tmp/php3-root
  38. Requires: webserver
  39. %description
  40. PHP4 is a powerful apache module that adds scripting and database connection
  41. capabilities to the apache server. This version includes the "php" binary
  42. for suExec and stand alone php scripts too.
  43. %prep
  44. %setup -q -n TARDIR
  45. #mkdir manual; cd manual && tar xzf $RPM_SOURCE_DIR/php3-manual.tar.gz
  46. chown -R root.root .
  47. ./buildconf
  48. %build
  49. # first the standalone (why can't you build both at once?)
  50. # need to run this under sh or it breaks
  51. cd ext/wddx
  52. ln -s /usr/src/redhat/BUILD/apache_1.3.9/src/lib/expat-lite ./xml
  53. cd ../..
  54. sh ./configure --prefix=/usr \
  55. --without-gd \
  56. --with-config-file-path=/usr/lib \
  57. --enable-force-cgi-redirect \
  58. --enable-debugger=yes \
  59. --enable-safe-mode \
  60. --with-exec-dir=/usr/bin \
  61. --with-mysql=/usr \
  62. --with-imap=/usr \
  63. --with-pdflib=/usr \
  64. --with-system-regex \
  65. --enable-track-vars \
  66. --with-ttf \
  67. --with-zlib \
  68. --with-xml=/usr/src/redhat/BUILD/apache_1.3.9/src/lib/expat-lite \
  69. --with-wddx \
  70. # ldap don't work
  71. # --with-ldap=/usr \
  72. # system regex conflicts with apache_ssl for some reason
  73. make
  74. mv php php.keepme
  75. # then the apache module
  76. rm config.cache
  77. sh ./configure --prefix=/usr \
  78. --without-gd \
  79. --with-apxs=/usr/sbin/apxs \
  80. --enable-versioning \
  81. --with-config-file-path=/usr/lib \
  82. --enable-debugger=yes \
  83. --enable-safe-mode \
  84. --with-exec-dir=/usr/bin \
  85. --with-mysql=/usr \
  86. --with-imap=/usr \
  87. --with-pdflib=/usr \
  88. --with-system-regex \
  89. --enable-track-vars \
  90. --with-ttf \
  91. --with-zlib \
  92. --with-xml=/usr/src/redhat/BUILD/apache_1.3.9/src/lib/expat-lite \
  93. --with-wddx \
  94. # ldap don't work
  95. # --with-ldap=/usr \
  96. # system regex conflicts with apache_ssl for some reason
  97. make clean
  98. make
  99. # restore cgi version
  100. mv php.keepme php
  101. %install
  102. rm -rf $RPM_BUILD_ROOT
  103. mkdir -p $RPM_BUILD_ROOT/usr/lib/apache
  104. install -m 755 libphp4.so $RPM_BUILD_ROOT/usr/lib/apache
  105. mkdir -p $RPM_BUILD_ROOT/usr/bin
  106. install -m 755 php $RPM_BUILD_ROOT/usr/bin
  107. %clean
  108. rm -rf $RPM_BUILD_ROOT
  109. %changelog
  110. * Sun Apr 30 2000 Joey Smith <joey@samaritan.com>
  111. - Small fix: Description still referred to package as PHP3.
  112. * Wed Jul 21 1999 Sam Liddicott <sam@campbellsci.co.uk>
  113. - added php4b1 and modified cgi building rules so it doesn't break module
  114. * Wed Mar 17 1999 Sam Liddicott <sam@campbellsci.co.uk>
  115. - Stuffed in 3.0.7 source tar and added "php" as a build destination
  116. * Mon Oct 12 1998 Cristian Gafton <gafton@redhat.com>
  117. - rebuild for apache 1.3.3
  118. * Thu Oct 08 1998 Preston Brown <pbrown@redhat.com>
  119. - updated to 3.0.5, fixes nasty bugs in 3.0.4.
  120. * Sun Sep 27 1998 Cristian Gafton <gafton@redhat.com>
  121. - updated to 3.0.4 and recompiled for apache 1.3.2
  122. * Thu Sep 03 1998 Preston Brown <pbrown@redhat.com>
  123. - improvements; builds with apache-devel package installed.
  124. * Tue Sep 01 1998 Preston Brown <pbrown@redhat.com>
  125. - Made initial cut for PHP3.
  126. %files
  127. /usr/lib/apache/libphp4.so
  128. /usr/bin/php
  129. %doc TODO CODING_STANDARDS CREDITS ChangeLog LICENSE BUGS examples
  130. %doc manual/*
  131. EOF
  132. RPMDIR=/usr/src/redhat/RPMS
  133. SPECDIR=/usr/src/redhat/SPECS
  134. SRCDIR=/usr/src/redhat/SOURCES
  135. (
  136. make clean
  137. find . -name config.cache -exec rm -f '{}'
  138. cd ..
  139. tar czvf ${SRCDIR}/${TAR} $TARDIR )
  140. cp -a $SPEC $SPECDIR/${SPEC}
  141. #cp -a *.patch $SRCDIR
  142. cd $SRCDIR
  143. chown -R root.root ${TAR}
  144. cd $SPECDIR
  145. rpm -ba -v ${SPEC}