Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 19 May 2003 18:29:27 +0200 (CEST)
From:      Alex Dupre <sysadmin@alexdupre.com>
To:        FreeBSD-gnats-submit@FreeBSD.org
Subject:   ports/52436: [Update Port] www/mod_auth_mysql_another
Message-ID:  <200305191629.h4JGTQn4035999@vaio.alexdupre.com>
Resent-Message-ID: <200305191630.h4JGUDYb053291@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         52436
>Category:       ports
>Synopsis:       [Update Port] www/mod_auth_mysql_another
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          update
>Submitter-Id:   current-users
>Arrival-Date:   Mon May 19 09:30:13 PDT 2003
>Closed-Date:
>Last-Modified:
>Originator:     Alex Dupre
>Release:        FreeBSD 4.8-ALEXDUPRE i386
>Organization:
>Environment:
System: FreeBSD 4.8-ALEXDUPRE i386
>Description:
Various updates.
The project is now hosted and maintained at sourceforge.
Include Apache 2 support.
>How-To-Repeat:
>Fix:

--- mod_auth_mysql_another.diff begins here ---
diff -ruN mod_auth_mysql_another.orig/Makefile mod_auth_mysql_another/Makefile
--- mod_auth_mysql_another.orig/Makefile	Mon May 19 08:41:42 2003
+++ mod_auth_mysql_another/Makefile	Mon May 19 18:23:30 2003
@@ -5,72 +5,57 @@
 # $FreeBSD: ports/www/mod_auth_mysql_another/Makefile,v 1.4 2003/03/07 06:12:41 ade Exp $
 
 PORTNAME=	mod_auth_mysql_another
-PORTVERSION=	1.0
+PORTVERSION=	2.0
 CATEGORIES=	www
-MASTER_SITES=	ftp://ftp.kcilink.com/pub/
+MASTER_SITES=	${MASTER_SITE_SOURCEFORGE}
+MASTER_SITE_SUBDIR=	modauthmysql
 DISTNAME=       mod_auth_mysql
-EXTRACT_SUFX=	.c.gz
+EXTRACT_SUFX=	.tgz
 
 MAINTAINER=	mbr@FreeBSD.org
 COMMENT=	Allows users to use MySQL databases for user authentication
 
-BUILD_DEPENDS=	${PREFIX}/sbin/apxs:${PORTSDIR}/www/${AP_PORT}
-LIB_DEPENDS=	mysqlclient.10:${PORTSDIR}/databases/mysql323-client
-RUN_DEPENDS=	${PREFIX}/sbin/${AP_TARGET}:${PORTSDIR}/www/${AP_PORT}
-
 .include <bsd.port.pre.mk>
 
-APXS=		${PREFIX}/sbin/apxs
-
-AP_PORT?=	apache13
-.if exists(${APXS})
-APXS_WORKS!=	${APXS} -q TARGET 2>/dev/null || echo no
-.endif
-.if exists(${APXS}) && ${APXS_WORKS} != no
-AP_TARGET!=	${APXS} -q TARGET
-AP_SYSCONF!=	${APXS} -q SYSCONFDIR
-AP_INCLUDE!=	${APXS} -q INCLUDEDIR
-AP_LIBEXEC!=	${APXS} -q LIBEXECDIR
+.if exists(${LOCALBASE}/lib/mysql/libmysqlclient.so.10)
+LIB_DEPENDS=   mysqlclient.10:${PORTSDIR}/databases/mysql323-client
 .else
-AP_TARGET?=	httpd
-AP_SYSCONF?=	${PREFIX}/etc/apache
-AP_INCLUDE?=	${PREFIX}/include/apache
-AP_LIBEXEC?=	${PREFIX}/libexec/apache
+.if exists(${LOCALBASE}/lib/mysql/libmysqlclient.so.14)
+LIB_DEPENDS=   mysqlclient.14:${PORTSDIR}/databases/mysql41-client
+.else
+LIB_DEPENDS=   mysqlclient.12:${PORTSDIR}/databases/mysql40-client
+.endif
 .endif
 
-AUTH_MYSQL_DOCS= apache/manual/mod/mod_auth_mysql_another
-
-PLIST_SUB=	AUTH_MYSQL_DOCS="${AUTH_MYSQL_DOCS}"
+.if exists(${LOCALBASE}/include/apache2/apr.h)
+WITH_APACHE2=	yes
+.endif
 
-PKGMESSAGE=	${WRKSRC}/.install_notes
+APXS=		${LOCALBASE}/sbin/apxs
 
-do-extract:
-	@${RM} -rf ${WRKDIR}
-	@${MKDIR} -p ${WRKDIR}/mod_auth_mysql
-	@for file in ${EXTRACT_ONLY}; do \
-		${CP} ${_DISTDIR}/$$file ${WRKDIR}/mod_auth_mysql; \
-		${EXTRACT_CMD} -d ${WRKDIR}/mod_auth_mysql/$$file; \
-	done
-.if !defined(EXTRACT_PRESERVE_OWNERSHIP)
-	@if [ `id -u` = 0 ]; then \
-		${CHMOD} -R ug-s ${WRKDIR}; \
-		${CHOWN} -R 0:0 ${WRKDIR}; \
-	fi
+.if defined(WITH_APACHE2)
+APACHE_PORT=	${PORTSDIR}/www/apache2
+APACHE_VER=	APACHE2
+PLIST_SUB=	VER="2"
+DSO=		mod_auth_mysql.la
+.else
+APACHE_PORT=	${PORTSDIR}/www/apache13
+APACHE_VER=	APACHE1
+PLIST_SUB=	VER=""
+DSO=		mod_auth_mysql.so
 .endif
 
+BUILD_DEPENDS=	${APXS}:${APACHE_PORT}
+RUN_DEPENDS=	${APXS}:${APACHE_PORT}
+
 post-patch:
-	@${CP} ${WRKDIR}/mod_auth_mysql/Makefile ${WRKDIR}/mod_auth_mysql/Makefile.new
-	@(${SED} -e 's|%%PREFIX%%|${PREFIX}|g' | \
-	    ${SED} -e 's|%%APXS%%|${APXS}|g' | \
-	    ${SED} -e 's|%%APXSFLAGS%%|${APXSFLAGS}|g') \
-	    < ${WRKDIR}/mod_auth_mysql/Makefile.new \
-	    > ${WRKDIR}/mod_auth_mysql/Makefile
+	@${SED} 's|%%LOCALBASE%%|${LOCALBASE}|g;s|%%APXS%%|${APXS}|g;s|%%APACHE_VER%%|${APACHE_VER}|g;s|%%DSO%%|${DSO}|g' \
+		${WRKDIR}/mod_auth_mysql/Makefile.orig > ${WRKDIR}/mod_auth_mysql/Makefile
 
-post-install:
 .if !defined(NOPORTDOCS)
-	@${MKDIR} ${PREFIX}/share/doc/${AUTH_MYSQL_DOCS}
-	@${INSTALL_DATA} ${FILESDIR}/USAGE ${PREFIX}/share/doc/${AUTH_MYSQL_DOCS}
-	@@(cd ${PREFIX}/share/doc && ${LN} -sf ${PREFIX}/share/doc/${AUTH_MYSQL_DOCS} mod_auth_mysql_another)
+post-install:
+	@${MKDIR} ${DOCSDIR}
+	@${INSTALL_DATA} ${WRKSRC}/README ${DOCSDIR}
 .endif
 
 .include <bsd.port.post.mk>
diff -ruN mod_auth_mysql_another.orig/distinfo mod_auth_mysql_another/distinfo
--- mod_auth_mysql_another.orig/distinfo	Mon May 19 08:41:42 2003
+++ mod_auth_mysql_another/distinfo	Mon May 19 09:02:48 2003
@@ -1 +1 @@
-MD5 (mod_auth_mysql.c.gz) = 2b70fbfe0fb8d263c1c3711c435c4df6
+MD5 (mod_auth_mysql.tgz) = b6646a117703b3704091e8f19f02e43e
diff -ruN mod_auth_mysql_another.orig/files/USAGE mod_auth_mysql_another/files/USAGE
--- mod_auth_mysql_another.orig/files/USAGE	Mon May 19 08:41:42 2003
+++ mod_auth_mysql_another/files/USAGE	Thu Jan  1 01:00:00 1970
@@ -1,126 +0,0 @@
-/*
- * http_auth_msql: authentication
- * Rob McCool & Brian Behlendorf.
- * Adapted to Shambhala by rst.
- * converted to use MySQL by Vivek Khera <khera@kciLink.com>
- * FreeBSD port by Martin Blapp, <mb@imp.ch>
- */
-
-
-Module definition information - the part between the -START and -END
-lines below is used by Configure. This could be stored in a separate
-instead.
-
-MODULE-DEFINITION-START
-Name: mysql_auth_module
-ConfigStart
-	MYSQL_LIB="-L/usr/local/lib/mysql -lmysqlclient -lm"
-	if [ "X$MYSQL_LIB" != "X" ]; then
-	LIBS="$LIBS $MYSQL_LIB"
-	echo " + using $MYSQL_LIB for MySQL support"
-	fi
-ConfigEnd
-MODULE-DEFINITION-END
-
-Tracks user/passwords/group in MySQL database.  A suitable table
-might be:
-
-CREATE TABLE user_info (
-	user_name CHAR(30) NOT NULL,
-	user_passwd CHAR(64) NOT NULL,
-	user_group CHAR(10),
-	[ any other fields if needed ]
-	PRIMARY KEY (user)
-)
-
-The password field needs to match to size of the encrypted
-password. It depends if you use MD5, DES or BLOWFISH encyrpted
-passwords. For DES passwords, CHAR(20) is enough.
-
-User_name must be a unique, non-empty field.  Its length is however
-long you want it to be.
-
-Any other fields in the named table will be ignored.  The actual
-field names are configurable using the parameters listed below.
-The defaults are "user_name" and "user_passwd" respectively, for
-the user ID and the password, and "user_group" for the group which
-is optional.  If you like to store passwords in clear text, set
-AuthMySQLCryptedPasswords to Off.  I think this is a bad idea, but
-people have requested it.
-
-Usage in per-directory access conf file:
-
-AuthName MySQL Testing
-AuthType Basic
-AuthGroupFile /dev/null
-AuthMySQLHost localhost
-AuthMySQLDB test
-AuthMySQLUserTable user_info
-require valid-user
-
-The following parameters are optional in the config file.  The defaults
-values are shown here.
-
-AuthMySQLUser <no default -- NULL>
-AuthMySQLPassword <no default -- NULL>
-AuthMySQLNameField user_name
-AuthMySQLPasswordField user_passwd
-AuthMySQLCryptedPasswords On
-AuthMySQLKeepAlive Off
-AuthMySQLAuthoritative On
-AuthMySQLNoPasswd Off
-AuthMySQLGroupField <no default>
-AuthMySQLGroupTable <defaults to value of AuthMySQLUserTable>
-
-The Host of "localhost" means use the MySQL socket instead of a TCP
-connection to the database.  DB is the database name on the server,
-and UserTable is the actual table name within that database.
-
-If AuthMySQLAuthoritative is Off, then iff the user is not found in
-the database, let other auth modules try to find the user.  Default
-is On.
-
-If AuthMySQLKeepAlive is "On", then the server instance will keep
-the MySQL server connection open.  In this case, the first time the
-connection is made, it will use the current set of Host, User, and
-Password settings.  Subsequent changes to these will not affect
-this server, so they should all be the same in every htaccess file.
-If you need to access multiple MySQL servers for this authorization
-scheme from the same web server, then keep this setting "Off" --
-this will open a new connection to the server every time it needs
-one.  The values of the DB and various tables and fields are always
-used from the current htaccess file settings.
-
-If AuthMySQLNoPasswd is "On", then any password the user enters will
-be accepted as long as the user exists in the database.  Setting this
-also overrides the setting for AuthMySQLPasswordField to be the same
-as AuthMySQLNameField (so that the SQL statements still work when there
-is no password at all in the database, and to remain backward-compatible
-with the default values for these fields.)
-
-For groups, we use the same AuthMySQLNameField as above for the
-user ID, and AuthMySQLGroupField to specify the group name.  There
-is no default for this parameter.  Leaving it undefined means
-groups are not implemented using MySQL tables.  AuthMySQLGroupTable
-specifies the table to use to get the group info.  It defaults to
-the value of AuthMySQLUserTable.  If you are not using groups, you
-do not need a "user_group" field in your database, obviously.
-
-A user can be a member of multiple groups, but in this case the
-user id field *cannot* be PRIMARY KEY.  You need to have multiple
-rows with the same user ID, one per group to which that ID belongs.
-In this case, you MUST put the GroupTable on a separate table from
-the user table.  This is to help prevent the user table from having
-inconsistent passwords in it.  If each user is only in one group,
-then the group field can be in the same table as the password
-field.  A group-only table might look like this:
-
-CREATE TABLE user_group (
-	user_name char(50) DEFAULT '' NOT NULL,
-	user_group char(20) DEFAULT '' NOT NULL,
-	create_date int,
-	expire_date int,
-	PRIMARY KEY (user_name,user_group)
-;
-
-note that you still need a user table which has the passwords in it.
diff -ruN mod_auth_mysql_another.orig/files/patch-Makefile mod_auth_mysql_another/files/patch-Makefile
--- mod_auth_mysql_another.orig/files/patch-Makefile	Mon May 19 08:41:42 2003
+++ mod_auth_mysql_another/files/patch-Makefile	Mon May 19 09:04:32 2003
@@ -1,20 +1,14 @@
 --- /dev/null	Sat Apr 20 17:11:40 2002
-+++ Makefile	Sat Apr 20 17:12:22 2002
-@@ -0,0 +1,17 @@
-+APXS      = %%APXS%%
-+APXSFLAGS = %%APXSFLAGS%%
-+DSO   = mod_auth_mysql.so
++++ Makefile.orig	Sat Apr 20 17:12:22 2002
+@@ -0,0 +1,11 @@
++APXS  = %%APXS%%
++DSO   = %%DSO%%
 +SRCS  = mod_auth_mysql.c
-+OPTS  = -I%%PREFIX%%/include -L%%PREFIX%%/lib/mysql -lmysqlclient
++OPTS  = -D %%APACHE_VER%% -I%%LOCALBASE%%/include -L%%LOCALBASE%%/lib/mysql -lmysqlclient
 +
-+all: $(DSO)
++all:
++	$(APXS) -c $(OPTS) $(SRCS)
 +
-+$(DSO): $(SRCS)
-+	$(APXS) $(APXSFLAGS) -o $(DSO) $(OPTS) -c $(SRCS) -rpath %%PREFIX%%/lib/mysql
-+
-+install: $(DSO)
-+	$(APXS) $(APXSFLAGS) $(NAME) -i -A $(DSO)
-+
-+clean:
-+	-rm -f *.o $(DSO)
++install:
++	$(APXS) -i -a $(DSO)
 +
diff -ruN mod_auth_mysql_another.orig/pkg-descr mod_auth_mysql_another/pkg-descr
--- mod_auth_mysql_another.orig/pkg-descr	Mon May 19 08:41:42 2003
+++ mod_auth_mysql_another/pkg-descr	Mon May 19 18:18:31 2003
@@ -1,11 +1,13 @@
-This add-on module allows the apache web server to use a MySQL database for user and/or group authentication.
-For large user lists this can offer a significate speed up over apache's standard flat file format.
+This add-on module allows the apache web server to use a MySQL database
+for user and/or group authentication. For large user lists this can offer
+a significate speed up over apache's standard flat file format.
 
-There is a different version of mod_auth_mysql in the ports tree with different configuration. Unfortunatly
-this version has a bug if used on a system which has more than one authentification databases. You may have
+There is a different version of mod_auth_mysql in the ports tree with
+different configuration. Unfortunatly this version has a bug if used on
+a system which has more than one authentification databases. You may have
 to look which version fits your requirements.
 
-WWW: ftp://ftp.kcilink.com/pub
+WWW: http://modauthmysql.sf.net/
 
-Martin Blapp
-mbr@freebsd.org
+- Alex Dupre
+sysadmin@alexdupre.com
diff -ruN mod_auth_mysql_another.orig/pkg-plist mod_auth_mysql_another/pkg-plist
--- mod_auth_mysql_another.orig/pkg-plist	Mon May 19 08:41:42 2003
+++ mod_auth_mysql_another/pkg-plist	Mon May 19 09:53:17 2003
@@ -1,7 +1,5 @@
-libexec/apache/mod_auth_mysql.so
-@exec %D/sbin/apxs -e -a -n auth_mysql %f
-@unexec %D/sbin/apxs -e -A -n auth_mysql %f
-share/doc/%%AUTH_MYSQL_DOCS%%/USAGE
-@exec (cd %D/share/doc && ln -sf %%AUTH_MYSQL_DOCS%% mod_auth_mysql_another)
-@unexec rm -rf %D/share/doc/mod_auth_mysql_another
-@dirrm share/doc/%%AUTH_MYSQL_DOCS%%
+libexec/apache%%VER%%/mod_auth_mysql.so
+@exec %D/sbin/apxs -e -a -n mysql_auth %f
+@unexec %D/sbin/apxs -e -A -n mysql_auth %f
+%%PORTDOCS%%share/doc/mod_auth_mysql_another/README
+%%PORTDOCS%%@dirrm share/doc/mod_auth_mysql_another
--- mod_auth_mysql_another.diff ends here ---

>Release-Note:
>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200305191629.h4JGTQn4035999>