Patching php port

2008-10-01 Thread Tamar Lea
Hello all

I am trying to install the php 5.2.6 port with thttpd. I have a patch file
to make it compile with version 2.25b, because the standard version only
works with 2.21. The patch works but the files always get overwritten when I
run the build again. How do I do this?

These are the commands I used

cd /usr/ports/lang/php5
make extract
make patch
cd work
patch -p0  ~/ports/thttpd.diff
vi php-5.2.6/configure # and other checks to see if the patch worked
cd ..
make install

This results in an error in the configure file, which has reverted to the
original. What am I doing wrong?

Thanks for help

Tamar
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: Patching php port

2008-10-01 Thread Jeremy Chadwick
On Wed, Oct 01, 2008 at 11:37:29AM +0100, Tamar Lea wrote:
 Hello all
 
 I am trying to install the php 5.2.6 port with thttpd. I have a patch file
 to make it compile with version 2.25b, because the standard version only
 works with 2.21. The patch works but the files always get overwritten when I
 run the build again. How do I do this?
 
 These are the commands I used
 
 cd /usr/ports/lang/php5
 make extract
 make patch
 cd work
 patch -p0  ~/ports/thttpd.diff
 vi php-5.2.6/configure # and other checks to see if the patch worked
 cd ..
 make install
 
 This results in an error in the configure file, which has reverted to the
 original. What am I doing wrong?

Never modify configure scripts.  You need to modify the autoconf
template the configure script is built off of.

In the case of lang/php5, autoconf is run to build the configure script
during the make configure stage (which is being executed during part
of make install).  Note the USE_AUTOTOOLS line in the Makefile.

Make your changes to configure.in.

-- 
| Jeremy Chadwickjdc at parodius.com |
| Parodius Networking   http://www.parodius.com/ |
| UNIX Systems Administrator  Mountain View, CA, USA |
| Making life hard for others since 1977.  PGP: 4BD6C0CB |

___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: Patching php port

2008-10-01 Thread Tamar Lea
Thanks for your reply, Jeremy. I now understand why it didn't work, but I
have absolutely no idea how to edit configure.in. I have only just figured
out what my patch is doing today. I think it would be easier to tell the
makefile to modify configure after the autoconf, but I don't know how to do
that either. This is the patch I wish to apply:
diff -pruN php-5.2.6/configure php-5.2.6-thttpd225b/configure
--- php-5.2.6/configure 2007-11-08 23:36:28.0 +0800
+++ php-5.2.6-thttpd225b/configure 2007-12-06 13:10:13.0 +0800
@@ -11525,10 +11525,14 @@ if test $PHP_THTTPD != no; then
  patch=test -f $THTTPD/php_patched || \
  (cd $THTTPD  patch -p1  $abs_srcdir/sapi/thttpd/thttpd_patch  touch
php_patched)

+ elif grep thttpd.2.25b $PHP_THTTPD/version.h /dev/null; then
+ patch=test -f $THTTPD/php_patched || \
+ (cd $THTTPD  patch -p1  $abs_srcdir/sapi/thttpd/thttpd-2.25b_patch 
touch php_patched)
+
  elif grep Premium $PHP_THTTPD/version.h /dev/null; then
  patch=
  else
- { echo configure: error: This version only supports thttpd-2.21b and
Premium thttpd 12; exit 1; }
+ { echo configure: error: This version only supports thttpd-2.21b,
thttpd-2.25b and Premium thttpd 12; exit 1; }
  fi

Ideally I would like to do this myself but I think the learning curve is too
steep right now. Any suggestions appreciated.
Tamar
On Wed, Oct 1, 2008 at 12:06 PM, Jeremy Chadwick [EMAIL PROTECTED] wrote:

 On Wed, Oct 01, 2008 at 11:37:29AM +0100, Tamar Lea wrote:
  Hello all
 
  I am trying to install the php 5.2.6 port with thttpd. I have a patch
 file
  to make it compile with version 2.25b, because the standard version only
  works with 2.21. The patch works but the files always get overwritten
 when I
  run the build again. How do I do this?
 
  These are the commands I used
 
  cd /usr/ports/lang/php5
  make extract
  make patch
  cd work
  patch -p0  ~/ports/thttpd.diff
  vi php-5.2.6/configure # and other checks to see if the patch worked
  cd ..
  make install
 
  This results in an error in the configure file, which has reverted to the
  original. What am I doing wrong?

 Never modify configure scripts.  You need to modify the autoconf
 template the configure script is built off of.

 In the case of lang/php5, autoconf is run to build the configure script
 during the make configure stage (which is being executed during part
 of make install).  Note the USE_AUTOTOOLS line in the Makefile.

 Make your changes to configure.in.

 --
 | Jeremy Chadwickjdc at parodius.com |
 | Parodius Networking   http://www.parodius.com/ |
 | UNIX Systems Administrator  Mountain View, CA, USA |
 | Making life hard for others since 1977.  PGP: 4BD6C0CB |


___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: Patching php port

2008-10-01 Thread Jeremy Chadwick
On Wed, Oct 01, 2008 at 01:14:03PM +0100, Tamar Lea wrote:
 Thanks for your reply, Jeremy. I now understand why it didn't work, but I
 have absolutely no idea how to edit configure.in. I have only just figured
 out what my patch is doing today. I think it would be easier to tell the
 makefile to modify configure after the autoconf, but I don't know how to do
 that either. This is the patch I wish to apply:

Welcome to the pains of the GNU autotools!  Here's what you'll need:

http://www.gnu.org/software/autoconf/manual/html_node/index.html

You should be able to examine the configure.in file and reverse
engineer how to accomplish what you need.  Remember: it's just a mix of
sh, m4, and macros.  Don't let it diminish your morale.  :-)

-- 
| Jeremy Chadwickjdc at parodius.com |
| Parodius Networking   http://www.parodius.com/ |
| UNIX Systems Administrator  Mountain View, CA, USA |
| Making life hard for others since 1977.  PGP: 4BD6C0CB |

___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]