summaryrefslogtreecommitdiff
path: root/www/mod_auth_mysql_another
diff options
context:
space:
mode:
authorMartin Blapp <mbr@FreeBSD.org>2003-06-30 09:35:28 +0000
committerMartin Blapp <mbr@FreeBSD.org>2003-06-30 09:35:28 +0000
commitaf0819b4341f146e2f9f750456e231ed029de4b1 (patch)
treeb3b667a07f188368d3d98c721e857a7c18448dc8 /www/mod_auth_mysql_another
parentFix latest update (diff)
Update to 2.0. Include Apache 2 support.
PR: 52436 Submitted by: Alex Dupre <sysadmin@alexdupre.com>
Notes
Notes: svn path=/head/; revision=83888
Diffstat (limited to 'www/mod_auth_mysql_another')
-rw-r--r--www/mod_auth_mysql_another/Makefile81
-rw-r--r--www/mod_auth_mysql_another/distinfo2
-rw-r--r--www/mod_auth_mysql_another/files/USAGE126
-rw-r--r--www/mod_auth_mysql_another/files/patch-Makefile24
-rw-r--r--www/mod_auth_mysql_another/pkg-descr16
-rw-r--r--www/mod_auth_mysql_another/pkg-plist12
6 files changed, 57 insertions, 204 deletions
diff --git a/www/mod_auth_mysql_another/Makefile b/www/mod_auth_mysql_another/Makefile
index 2826e7baedf6..d63fcbcf4ae1 100644
--- a/www/mod_auth_mysql_another/Makefile
+++ b/www/mod_auth_mysql_another/Makefile
@@ -5,72 +5,57 @@
# $FreeBSD$
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 --git a/www/mod_auth_mysql_another/distinfo b/www/mod_auth_mysql_another/distinfo
index 8da2f9dfc650..7e098ea33590 100644
--- a/www/mod_auth_mysql_another/distinfo
+++ b/www/mod_auth_mysql_another/distinfo
@@ -1 +1 @@
-MD5 (mod_auth_mysql.c.gz) = 2b70fbfe0fb8d263c1c3711c435c4df6
+MD5 (mod_auth_mysql.tgz) = b6646a117703b3704091e8f19f02e43e
diff --git a/www/mod_auth_mysql_another/files/USAGE b/www/mod_auth_mysql_another/files/USAGE
deleted file mode 100644
index f94c0cf2eeb7..000000000000
--- a/www/mod_auth_mysql_another/files/USAGE
+++ /dev/null
@@ -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 --git a/www/mod_auth_mysql_another/files/patch-Makefile b/www/mod_auth_mysql_another/files/patch-Makefile
index 62665ace52a6..39ea5d440d2c 100644
--- a/www/mod_auth_mysql_another/files/patch-Makefile
+++ b/www/mod_auth_mysql_another/files/patch-Makefile
@@ -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 --git a/www/mod_auth_mysql_another/pkg-descr b/www/mod_auth_mysql_another/pkg-descr
index 251973dbbdf4..c42a7e60f09c 100644
--- a/www/mod_auth_mysql_another/pkg-descr
+++ b/www/mod_auth_mysql_another/pkg-descr
@@ -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 --git a/www/mod_auth_mysql_another/pkg-plist b/www/mod_auth_mysql_another/pkg-plist
index 00111ad7507c..78398f4fbe94 100644
--- a/www/mod_auth_mysql_another/pkg-plist
+++ b/www/mod_auth_mysql_another/pkg-plist
@@ -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