File:  [ELWIX - Embedded LightWeight unIX -] / embedaddon / php / makerpm
Revision 1.1.1.1 (vendor branch): download - view: text, annotated - select for diffs - revision graph
Tue Feb 21 23:47:52 2012 UTC (12 years, 3 months ago) by misho
Branches: php, MAIN
CVS tags: v5_4_3elwix, v5_4_29p0, v5_4_29, v5_4_20p0, v5_4_20, v5_4_17p0, v5_4_17, v5_3_10, HEAD
php

    1: #! /bin/sh
    2: 
    3: # Based slightly on an original by John H Terpstra but not much left of his.
    4: # S Liddicott 1999 sam@campbellsci.co.uk
    5: 
    6: PREFIX="php"
    7: TARDIR="`basename \`pwd\``"
    8: RELEASE=${1:-1}
    9: VERSION=${2:-`echo $TARDIR | sed "s/$PREFIX-//g"`}
   10: 
   11: if	[ "$VERSION" = "" ]
   12: then	cat <<"EOH"
   13: $PREFIX source needs to be installed in a folder that contains the version
   14: number, e.g. ${PREFIX}5 or ${PREFIX}5b2
   15: EOH
   16: fi
   17: 	
   18: echo "Usage:"
   19: echo "$0 <release> <version>"
   20: echo
   21: echo "e.g.:"
   22: echo "$0 2"
   23: echo -n "Building RPM version $VERSION, release: $RELEASE "
   24: sleep 1 ; echo -n . ; sleep 1 ; echo -n . ; sleep 1 ; echo -n .
   25: echo
   26: 
   27: TAR=php-$VERSION.tar.gz
   28: SPEC=php-$VERSION.spec
   29: PREQUIRES=`rpm -q --provides apache|grep "\(webserver\|httpd\)"`
   30: if  [ "$PREQUIRES" = "" ]
   31: then PREQUIRES="webserver"
   32: fi
   33: 
   34: # write out the .spec file
   35: sed -e "s/PVERSION/$VERSION/g" \
   36:     -e "s/PRELEASE/$RELEASE/g" \
   37:     -e "s/TARDIR/$TARDIR/g" \
   38:     -e "s/PREQUIRES/$PREQUIRES/g" \
   39:     > $SPEC <<'EOF'
   40: Summary: PHP 5 - A powerful scripting language
   41: Name: php5
   42: Version: PVERSION
   43: Release: PRELEASE
   44: Group: Networking/Daemons
   45: Source0: http://www.php.net/distributions/php-%{PACKAGE_VERSION}.tar.gz
   46: Copyright: PHP License
   47: BuildRoot: %{_tmppath}/%{name}-%{version}-buildroot
   48: Requires: PREQUIRES
   49: 
   50: %description
   51: PHP 5 is a powerful apache module that adds scripting and database connection
   52: capabilities to the apache server. This version includes the "php_cgi" binary
   53: for suExec and stand alone php scripts too.
   54: 
   55: %prep
   56: %setup -q -n TARDIR
   57: #mkdir manual; cd manual && tar xzf $RPM_SOURCE_DIR/php3-manual.tar.gz
   58: ./buildconf
   59: 
   60: %build
   61: # first the standalone (why can't you build both at once?)
   62: # need to run this under sh or it breaks
   63: 
   64: sh ./configure --prefix=/usr \
   65: 	--with-config-file-path=%{_sysconfdir} \
   66: 	--disable-cli \
   67: 	--without-pear \
   68: 	--enable-force-cgi-redirect \
   69: 	--enable-safe-mode \
   70: 	--with-exec-dir=/usr/bin \
   71: 	--with-mysql \
   72: 	--with-zlib \
   73: 	--enable-xml \
   74: 	--enable-wddx \
   75: 	--with-gd \
   76: 	--enable-shared \
   77: 
   78: make
   79: mv sapi/cgi/php php.keepme
   80: 
   81: # then the apache module 
   82: test -f config.cache && rm -f config.cache
   83: sh ./configure --prefix=/usr \
   84: 	--with-apxs=/usr/sbin/apxs \
   85: 	--enable-cli \
   86: 	--with-config-file-path=%{_sysconfdir} \
   87: 	--enable-safe-mode \
   88: 	--with-exec-dir=/usr/bin \
   89: 	--with-mysql \
   90: 	--with-zlib \
   91: 	--enable-xml \
   92: 	--enable-wddx \
   93: 	--with-gd \
   94: 	--enable-shared \
   95: 
   96: #	--with-pgsql=shared \
   97: 
   98: make clean
   99: make
  100: # restore cgi version
  101: mv php.keepme sapi/cgi/php
  102: 
  103: %install
  104: rm -rf $RPM_BUILD_ROOT
  105: mkdir -p $RPM_BUILD_ROOT%{_libdir}/apache
  106: install -m 0755 .libs/libphp5.so $RPM_BUILD_ROOT%{_libdir}/apache
  107: mkdir -p $RPM_BUILD_ROOT%{_bindir}
  108: install -m 0755 sapi/cli/php $RPM_BUILD_ROOT%{_bindir}
  109: install -m 0755 sapi/cgi/php $RPM_BUILD_ROOT%{_bindir}/php_cgi
  110: mkdir -p $RPM_BUILD_ROOT%{_mandir}/man1
  111: install -m 0755 sapi/cli/php.1 $RPM_BUILD_ROOT%{_mandir}/man1
  112: mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}
  113: install -m 0755 php.ini-recommended $RPM_BUILD_ROOT%{_sysconfdir}/php.ini
  114: mkdir -p $RPM_BUILD_ROOT%{_libdir}/php/extensions
  115: install -m 0755 modules/*.so $RPM_BUILD_ROOT%{_libdir}/php/extensions
  116: 
  117: %clean
  118: rm -rf $RPM_BUILD_ROOT
  119: 
  120: %changelog
  121: * Thu Nov 27 2003 Marcus Boerger <helly@php.net>
  122: - Fix requirements for older systems.
  123: - Fix rpm build directory for the major distributions.
  124: - Fix config dir.
  125: - Rename package to php.
  126: - Add gd extension.
  127: - Support building of shared extensions.
  128: - Build CLI only once.
  129: 
  130: * Thu Oct 31 2003 Marcus Boerger <helly@php.net>
  131: - Update version to 5.
  132: - Remove unsure external requirements.
  133: - Remove non existing directories
  134: - Fix targets.
  135: - Install both CLI and CGI.
  136: - Install manpage.
  137: - Install ini.
  138: 
  139: * Mon Mar 04 2002 Arjen Lentz <agl@bitbike.com>
  140: - Fix path and remove --with-imap due to conflicts with kerberos.
  141: 
  142: * Fri Jun 29 2001 Jani Taskinen <sniper@iki.fi>
  143: - Removed some useless configure options. Made the tar names correct.
  144: 
  145: * Sun Apr 30 2000 Joey Smith <joey@samaritan.com>
  146: - Small fix: Description still referred to package as PHP3.
  147: 
  148: * Wed Jul 21 1999 Sam Liddicott <sam@campbellsci.co.uk>
  149: - added php4b1 and modified cgi building rules so it doesn't break module
  150: 
  151: * Wed Mar 17 1999 Sam Liddicott <sam@campbellsci.co.uk>
  152: - Stuffed in 3.0.7 source tar and added "php" as a build destination
  153: 
  154: * Mon Oct 12 1998 Cristian Gafton <gafton@redhat.com>
  155: - rebuild for apache 1.3.3
  156: 
  157: * Thu Oct 08 1998 Preston Brown <pbrown@redhat.com>
  158: - updated to 3.0.5, fixes nasty bugs in 3.0.4.
  159: 
  160: * Sun Sep 27 1998 Cristian Gafton <gafton@redhat.com>
  161: - updated to 3.0.4 and recompiled for apache 1.3.2
  162: 
  163: * Thu Sep 03 1998 Preston Brown <pbrown@redhat.com>
  164: - improvements; builds with apache-devel package installed.
  165: 
  166: * Tue Sep 01 1998 Preston Brown <pbrown@redhat.com>
  167: - Made initial cut for PHP3.
  168: 
  169: %files
  170: %defattr(-,root,root)
  171: %{_libdir}/apache/libphp5.so
  172: %{_bindir}/php
  173: %{_bindir}/php_cgi
  174: %{_mandir}/man1/php.1*
  175: %{_sysconfdir}/php.ini
  176: %{_libdir}/php/extensions/*.so
  177: 
  178: %doc TODO CODING_STANDARDS CREDITS ChangeLog LICENSE NEWS
  179: EOF
  180: 
  181: RPMBASE=/usr/src/redhat
  182: for i in /usr/src/redhat /usr/src/packages /usr/src/RPM; do
  183:   if test -d $i; then
  184:     RPMBASE=$i
  185:     break
  186:   fi
  187: done
  188: 
  189: RPMDIR=${RPMBASE}/RPMS
  190: SPECDIR=${RPMBASE}/SPECS
  191: SRCDIR=${RPMBASE}/SOURCES
  192: 
  193: (
  194: make clean
  195: find . -name config.cache -exec rm -f '{}' \;
  196: cd .. 
  197: tar czvf ${SRCDIR}/${TAR} $TARDIR )
  198: 
  199: cp -a $SPEC $SPECDIR/${SPEC}
  200: #cp -a *.patch $SRCDIR
  201: cd $SRCDIR
  202: cd $SPECDIR
  203: rpm -ba -v ${SPEC}

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>