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.

156 lines
3.8 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: PHP 4 - A powerful scripting language
  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. Copyright: GPL
  36. BuildRoot: /tmp/php4-root
  37. Requires: webserver
  38. %description
  39. PHP4 is a powerful apache module that adds scripting and database connection
  40. capabilities to the apache server. This version includes the "php" binary
  41. for suExec and stand alone php scripts too.
  42. %prep
  43. %setup -q -n TARDIR
  44. #mkdir manual; cd manual && tar xzf $RPM_SOURCE_DIR/php3-manual.tar.gz
  45. chown -R root.root .
  46. ./buildconf
  47. %build
  48. # first the standalone (why can't you build both at once?)
  49. # need to run this under sh or it breaks
  50. sh ./configure --prefix=/usr \
  51. --with-config-file-path=/usr/lib \
  52. --enable-force-cgi-redirect \
  53. --enable-safe-mode \
  54. --with-exec-dir=/usr/bin \
  55. --with-mysql=/usr \
  56. --with-pdflib=/usr \
  57. --with-zlib=/usr \
  58. --enable-xml \
  59. --enable-wddx
  60. make
  61. mv php php.keepme
  62. # then the apache module
  63. rm config.cache
  64. sh ./configure --prefix=/usr \
  65. --with-apxs=/usr/sbin/apxs \
  66. --enable-versioning \
  67. --with-config-file-path=/usr/lib \
  68. --enable-safe-mode \
  69. --with-exec-dir=/usr/bin \
  70. --with-mysql=/usr \
  71. --with-pdflib=/usr \
  72. --with-zlib=/usr \
  73. --enable-xml \
  74. --enable-wddx
  75. make clean
  76. make
  77. # restore cgi version
  78. mv php.keepme php
  79. %install
  80. rm -rf $RPM_BUILD_ROOT
  81. mkdir -p $RPM_BUILD_ROOT/usr/lib/apache
  82. install -m 755 .libs/libphp4.so $RPM_BUILD_ROOT/usr/lib/apache
  83. mkdir -p $RPM_BUILD_ROOT/usr/bin
  84. install -m 755 php $RPM_BUILD_ROOT/usr/bin
  85. %clean
  86. rm -rf $RPM_BUILD_ROOT
  87. %changelog
  88. * Mon Mar 04 2002 Arjen Lentz <agl@bitbike.com>
  89. - Fix path and remove --with-imap due to conflicts with kerberos.
  90. * Fri Jun 29 2001 Jani Taskinen <sniper@iki.fi>
  91. - Removed some useless configure options. Made the tar names correct.
  92. * Sun Apr 30 2000 Joey Smith <joey@samaritan.com>
  93. - Small fix: Description still referred to package as PHP3.
  94. * Wed Jul 21 1999 Sam Liddicott <sam@campbellsci.co.uk>
  95. - added php4b1 and modified cgi building rules so it doesn't break module
  96. * Wed Mar 17 1999 Sam Liddicott <sam@campbellsci.co.uk>
  97. - Stuffed in 3.0.7 source tar and added "php" as a build destination
  98. * Mon Oct 12 1998 Cristian Gafton <gafton@redhat.com>
  99. - rebuild for apache 1.3.3
  100. * Thu Oct 08 1998 Preston Brown <pbrown@redhat.com>
  101. - updated to 3.0.5, fixes nasty bugs in 3.0.4.
  102. * Sun Sep 27 1998 Cristian Gafton <gafton@redhat.com>
  103. - updated to 3.0.4 and recompiled for apache 1.3.2
  104. * Thu Sep 03 1998 Preston Brown <pbrown@redhat.com>
  105. - improvements; builds with apache-devel package installed.
  106. * Tue Sep 01 1998 Preston Brown <pbrown@redhat.com>
  107. - Made initial cut for PHP3.
  108. %files
  109. /usr/lib/apache/libphp4.so
  110. /usr/bin/php
  111. %doc TODO CODING_STANDARDS CREDITS ChangeLog LICENSE BUGS examples
  112. %doc manual/*
  113. EOF
  114. RPMDIR=/usr/src/redhat/RPMS
  115. SPECDIR=/usr/src/redhat/SPECS
  116. SRCDIR=/usr/src/redhat/SOURCES
  117. (
  118. make clean
  119. find . -name config.cache -exec rm -f '{}'
  120. cd ..
  121. tar czvf ${SRCDIR}/${TAR} $TARDIR )
  122. cp -a $SPEC $SPECDIR/${SPEC}
  123. #cp -a *.patch $SRCDIR
  124. cd $SRCDIR
  125. chown -R root.root ${TAR}
  126. cd $SPECDIR
  127. rpm -ba -v ${SPEC}