Subject: pkg/12722: new php4-mcrypt package
To: None <gnats-bugs@gnats.netbsd.org>
From: None <sborrill@precedence.co.uk>
List: netbsd-bugs
Date: 04/23/2001 13:03:19
>Number:         12722
>Category:       pkg
>Synopsis:       mcrypt support for php4
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    pkg-manager
>State:          open
>Class:          change-request
>Submitter-Id:   net
>Arrival-Date:   Mon Apr 23 05:16:01 PDT 2001
>Closed-Date:
>Last-Modified:
>Originator:     Stephen Borrill
>Release:        NetBSD 1.5 (pkgsrc 9th April 2001)
>Organization:
	Precedence Technologies Ltd
>Environment:
System: NetBSD cats 1.5 NetBSD 1.5 (CATS) #1: Sun Nov 19 14:18:30 PST 2000     matt@tiger.local:/u1/kobj/CATS arm32


>Description:
This adds mcrypt library support to php4
>How-To-Repeat:
mcrypt is not a compiled in module in the php4 package
>Fix:
This consists of 4 files (3 new and one replacement). 2 are patches for the
php4 package and two are for the new php4-mcrypt packages
--- 8< ---
New /usr/pkgsrc/www/php4-mcrypt/Makefile
# $NetBSD: Makefile,v 1.0 2001/04/18 18:18:15 jlam Exp $

.include "../../www/php4/Makefile.module"

MODNAME=		mcrypt
CATEGORIES+=		security
PHP_PKG_VERS=		nb1

COMMENT=		PHP4 extension for mcrypt security library

DEPENDS+=		libmcrypt-*:../../security/libmcrypt

EVAL_PREFIX+=		MCRYPTDIR=libmcrypt
CONFIGURE_ARGS+=	--with-${MODNAME}=shared,${LOCALBASE}

.include "../../mk/bsd.pkg.mk"

--- 8< ---
New /usr/pkgsrc/www/php4-mcrypt/pkg/DESCR
PHP is a programming language designed to be embedded into web pages.
This module provides mcrypt library support for PHP4.

--- 8< ---
Replacement /usr/pkgsrc/www/php4/patches/patch-ab
This stops linking with init_mcrypt() being taken as proof of existence of
libmcrypt 2.2. Current pkgsrc libmcrypt is 2.4.x. The logic of the test in the
php4 configure script is wrong. This patch swaps it round.
--- configure.orig	Thu Jan 11 18:39:29 2001
+++ configure	Mon Apr 23 12:17:10 2001
@@ -6336,6 +6336,7 @@
   cat > conftest.$ac_ext <<EOF
 #line 6338 "configure"
 #include "confdefs.h"
+#include <sys/types.h>
 #include <sys/socket.h>
 #include <netinet/in.h>
 int main() {
@@ -23088,12 +23089,7 @@
 
   LIBS=$old_LIBS
   LDFLAGS="$old_LDFLAGS"
-  if test "$ac_cv_lib_mcrypt_init_mcrypt" = "yes"; then
-	cat >> confdefs.h <<\EOF
-#define HAVE_LIBMCRYPT22 1
-EOF
-
-  elif test "$ac_cv_lib_mcrypt_mcrypt_module_open" = "yes"; then
+  if test "$ac_cv_lib_mcrypt_mcrypt_module_open" = "yes"; then
     
  case "ltdl" in
  c|c_r|pthread*) ;;
@@ -23110,6 +23106,11 @@
 #define HAVE_LIBMCRYPT24 1
 EOF
 
+  elif test "$ac_cv_lib_mcrypt_init_mcrypt" = "yes"; then
+	cat >> confdefs.h <<\EOF
+#define HAVE_LIBMCRYPT22 1
+EOF
+
   else
     { echo "configure: error: Sorry" 1>&2; exit 1; }
   fi
@@ -40176,6 +40177,7 @@
 fi
 
 
+if false; then
 echo $ac_n "checking for pam_start in -lpam""... $ac_c" 1>&6
 echo "configure:40181: checking for pam_start in -lpam" >&5
 ac_lib_var=`echo pam'_'pam_start | sed 'y%./+-%__p_%'`
@@ -40220,6 +40222,8 @@
 else
   echo "$ac_t""no" 1>&6
 fi
+
+fi # if false
  
 
 for ac_func in getcwd getwd
@@ -47325,9 +47329,6 @@
 
     $SHELL $srcdir/ltconfig --output=shlibtool --disable-static --srcdir=$srcdir --cache-file=./config.cache $srcdir/ltmain.sh
     SHARED_LIBTOOL='$(SHELL) $(top_builddir)/shlibtool'
-  else
-    PHP_COMPILE='$(COMPILE) -c $< && touch $@'
-    CXX_PHP_COMPILE='$(CXX_COMPILE) -c $< && touch $@'
   fi
 fi
 
--- 8< ---
New /usr/pkgsrc/www/php4/patches/patch-ah
This stops linking with init_mcrypt() being taken as proof of existence of
libmcrypt 2.2. Current pkgsrc libmcrypt is 2.4.x. The logic of the test in the
php4 configure script is wrong. This patch swaps it round.
--- ext/mcrypt/config.m4.orig	Mon Apr 23 12:20:39 2001
+++ ext/mcrypt/config.m4	Mon Apr 23 12:21:50 2001
@@ -27,11 +27,11 @@
   AC_CHECK_LIB(mcrypt, mcrypt_module_open, [LIBS="$LIBS -lltdl"],[ ],)
   LIBS=$old_LIBS
   LDFLAGS="$old_LDFLAGS"
-  if test "$ac_cv_lib_mcrypt_init_mcrypt" = "yes"; then
-	AC_DEFINE(HAVE_LIBMCRYPT22,1,[ ])
-  elif test "$ac_cv_lib_mcrypt_mcrypt_module_open" = "yes"; then
+  if test "$ac_cv_lib_mcrypt_mcrypt_module_open" = "yes"; then
     AC_ADD_LIBRARY(ltdl)
 	AC_DEFINE(HAVE_LIBMCRYPT24,1,[ ])
+  elif test "$ac_cv_lib_mcrypt_init_mcrypt" = "yes"; then
+	AC_DEFINE(HAVE_LIBMCRYPT22,1,[ ])
   else
     AC_MSG_ERROR(Sorry, I was not able to diagnose which libmcrypt version you have installed.)
   fi
>Release-Note:
>Audit-Trail:
>Unformatted: