[Midnightbsd-cvs] mports: mports/net: add phpldapadmin
laffer1 at midnightbsd.org
laffer1 at midnightbsd.org
Sun Oct 7 12:18:56 EDT 2007
Log Message:
-----------
add phpldapadmin
Modified Files:
--------------
mports/net:
Makefile (r1.42 -> r1.43)
Added Files:
-----------
mports/net/phpldapadmin:
Makefile (r1.1)
distinfo (r1.1)
pkg-descr (r1.1)
pkg-plist-chunk (r1.1)
mports/net/phpldapadmin/files:
pkg-deinstall.in (r1.1)
pkg-install.in (r1.1)
pkg-message.in (r1.1)
-------------- next part --------------
--- /dev/null
+++ net/phpldapadmin/pkg-plist-chunk
@@ -0,0 +1,7 @@
+ at mode 640
+ at group %%PLAGRP%%
+ at unexec if cmp -s %D/%%PLADIR%%/config/config.php.example %D/%%PLADIR%%/config/config.php ; then rm -f %D/%%PLADIR%%/config/config.php ; fi
+%%PLADIR%%/config/config.php.example
+ at exec [ ! -f %B/config.php ] && cp -p %B/%f %B/config.php || true
+ at mode
+ at group
--- /dev/null
+++ net/phpldapadmin/pkg-descr
@@ -0,0 +1,11 @@
+phpLDAPadmin is a web-based LDAP client. It provides easy,
+anywhere-accessible, multi-language administration for your LDAP
+server. Its hierarchical tree-viewer and advanced search functionality
+make it intuitive to browse and administer your LDAP directory. Since
+it is a web application, this LDAP browser works on many platforms,
+making your LDAP server easily manageable from any
+location. phpLDAPadmin is the perfect LDAP browser for the LDAP
+professional and novice alike. Its user base consists mostly of LDAP
+administration professionals.
+
+WWW: http://phpldapadmin.sourceforge.net/
--- /dev/null
+++ net/phpldapadmin/Makefile
@@ -0,0 +1,106 @@
+# New ports collection makefile for: phpLDAPadmin
+# Date created: 07 Oct 2007
+# Whom: Lucas Holt <luke at midnightbsd.org>
+#
+# $MidnightBSD: mports/net/phpldapadmin/Makefile,v 1.1 2007/10/07 16:18:54 laffer1 Exp $
+# $FreeBSD: ports/net/phpldapadmin/Makefile,v 1.20 2007/03/22 16:42:26 pav Exp $
+#
+
+PORTNAME= phpldapadmin
+PORTVERSION= 1.0.2
+PORTEPOCH= 1
+CATEGORIES= net www
+MASTER_SITES= ${MASTER_SITE_SOURCEFORGE}
+MASTER_SITE_SUBDIR= phpldapadmin
+DISTNAME= ${PORTNAME}-${PORTVERSION}
+
+MAINTAINER= ports at MidnightBSD.org
+COMMENT= A set of PHP-scripts to administer LDAP over the web
+LICENSE= gpl2
+
+NO_BUILD= yes
+USE_PHP= gettext ldap openssl pcre session xml
+
+.if defined(WITH_SUPHP)
+
+PKGNAMESUFFIX+= -suphp
+RUN_DEPENDS+= ${LOCALBASE}/sbin/suphp:${PORTSDIR}/www/suphp
+WANT_PHP_CGI= yes
+
+PLAUSR?= pldapadm
+
+SUB_LIST+= PLAUSR=${PLAUSR} \
+ PLAGRP=${PLAGRP}
+SUB_FILES+= pkg-install pkg-deinstall
+
+.else
+
+WANT_PHP_WEB= yes
+
+.endif
+
+# PLAUSR is only used WITH_SUPHP
+PLADIR?= www/${PORTNAME}
+PLAGRP?= ${WWWGRP}
+CFGDIR= config
+CFGFILE= config.php
+
+SUB_LIST+= PKGNAME=${PKGNAME} \
+ PLADIR=${PLADIR}
+SUB_FILES+= pkg-message
+
+PLIST= ${WRKDIR}/plist
+PLIST_SUB+= PLADIR=${PLADIR} PLAGRP=${PLAGRP}
+
+.SILENT:
+
+pre-everything::
+ ${ECHO_MSG} ""
+ ${ECHO_MSG} "You may use the following build options:"
+ ${ECHO_MSG} ""
+ ${ECHO_MSG} " WITH_SUPHP=yes Install appropriately for use with"
+ ${ECHO_MSG} " the www/suphp port [default: no]"
+ ${ECHO_MSG} ""
+
+post-patch:
+ cd ${WRKSRC} ; \
+ ${FIND} . ! -type d ! -name ${CFGFILE}.example ! -name .cvsignore | \
+ ${SORT} | ${SED} -e "s!^\.!%%PLADIR%%!" >${PLIST} ; \
+ ${CAT} ${PKGDIR}/pkg-plist-chunk >>${PLIST} ; \
+ ${FIND} . -type d | ${SORT} -r | ${SED} \
+ -e 's!^\./${CFGDIR}$$!@dirrmtry %%PLADIR%%/${CFGDIR}!' \
+ -e 's!^\.$$!@dirrmtry %%PLADIR%%!' \
+ -e 's!^\.!@dirrm %%PLADIR%%!' >>${PLIST}
+
+pre-install:
+.if defined(WITH_SUPHP)
+ ${SETENV} ${SCRIPTS_ENV} ${SH} ${PKGINSTALL} ${PKGNAME} PRE-INSTALL
+.endif
+
+do-install: install-app install-conf
+
+install-app:
+ cd ${WRKSRC} ; \
+ for src in $$( ${FIND} . ! -name .cvsignore ) ; do \
+ dst=${PREFIX}/${PLADIR}$${src#.} ; \
+ if ${TEST} -d $$src ; then \
+ ${MKDIR} $$dst ; \
+ else \
+ ${INSTALL_DATA} $$src $$dst ; \
+ fi \
+ done
+
+install-conf:
+ cd ${PREFIX}/${PLADIR}/${CFGDIR} ; \
+ ${CHMOD} 0640 ${CFGFILE}.example ; \
+ ${CHGRP} ${PLAGRP} ${CFGFILE}.example ; \
+ if ${TEST} ! -f ${CFGFILE} ; then \
+ ${CP} -p ${CFGFILE}.example ${CFGFILE} ; \
+ fi
+
+post-install:
+.if defined(WITH_SUPHP)
+ ${SETENV} ${SCRIPTS_ENV} ${SH} ${PKGINSTALL} ${PKGNAME} POST-INSTALL
+.endif
+
+.include <bsd.port.mk>
--- /dev/null
+++ net/phpldapadmin/distinfo
@@ -0,0 +1,3 @@
+MD5 (phpldapadmin-1.0.2.tar.gz) = 316b917d8abe1b37603c49b61b068bd0
+SHA256 (phpldapadmin-1.0.2.tar.gz) = ece5e531a7794ec870b748919b2370f9d544ffa07d7957940b3459e005dc5cde
+SIZE (phpldapadmin-1.0.2.tar.gz) = 788484
Index: Makefile
===================================================================
RCS file: /home/cvs/mports/net/Makefile,v
retrieving revision 1.42
retrieving revision 1.43
diff -Lnet/Makefile -Lnet/Makefile -u -r1.42 -r1.43
--- net/Makefile
+++ net/Makefile
@@ -42,6 +42,7 @@
SUBDIR += php5-soap
SUBDIR += php5-sockets
SUBDIR += php5-xmlrpc
+ SUBDIR += phpldapadmin
SUBDIR += rdesktop
SUBDIR += rrdtool
SUBDIR += rsync
--- /dev/null
+++ net/phpldapadmin/files/pkg-install.in
@@ -0,0 +1,98 @@
+#!/bin/sh
+#
+# $MidnightBSD: mports/net/phpldapadmin/files/pkg-install.in,v 1.1 2007/10/07 16:18:54 laffer1 Exp $
+#
+
+PATH=/usr/sbin:/usr/bin:/bin ; export PATH
+
+pladir=%%PREFIX%%/%%PLADIR%%
+plausr=%%PLAUSR%%
+plagrp=%%PLAGRP%%
+
+plagcos="phpLDAPadmin Owner"
+plahome=/nonexistent
+plashell=/sbin/nologin
+
+create_group() {
+ local user group gcos home shell
+
+ user=$1
+ group=$2
+ gcos=$3
+ home=$4
+ shell=$5
+
+ if pw groupadd -n $group ; then
+ echo "===> Group $group created"
+ else
+ cat <<-EOERRORMSG
+ *** Failed to create the $group group.
+
+ Please add the $user user and $group group
+ manually with the commands:
+
+ pw groupadd -n $group
+ pw useradd -n $user -g $group -c "$gcos" \\
+ -d $home -s $shell -h -
+
+ and retry installing this package.
+ EOERRORMSG
+ exit 1
+ fi
+}
+
+
+create_user() {
+ local user group gcos home shell
+
+ user=$1
+ group=$2
+ gcos=$3
+ home=$4
+ shell=$5
+
+ if pw useradd -n $user -g $group -c "$gcos" -d $home -s $shell -h - ; then
+ echo "===> Created $user user"
+ else
+ cat <<-EOERRORMSG
+ *** Failed to create the $user user.
+
+ Please add the $user user manually with the command:
+
+ pw useradd -n $user -g $group -c "$gcos" \\
+ -d $home -s $shell -h -
+
+ and retry installing this package.
+ EOERRORMSG
+ exit 1
+ fi
+}
+
+
+case $2 in
+ PRE-INSTALL)
+
+ # Create the pla user and group if they do not already exist
+
+ if pw user show -n $plausr >/dev/null 2>&1 ; then
+ echo "===> Using pre-existing user $plausr"
+ else
+ if ! pw group show -n $plagrp >/dev/null 2>&1 ; then
+ create_group $plausr $plagrp "$plagcos" $plahome \
+ $plashell
+ fi
+ create_user $plausr $plagrp "$plagcos" $plahome $plashell
+ fi
+ ;;
+ POST-INSTALL)
+
+ # Change ownership of the phpLDAPadmin directory
+
+ echo "===> Adjusting file ownership in $pladir"
+ chown -R $plausr:$plagrp $pladir || exit 1
+ ;;
+esac
+
+#
+# That's All Folks!
+#
--- /dev/null
+++ net/phpldapadmin/files/pkg-message.in
@@ -0,0 +1,22 @@
+
+%%PKGNAME%% has been installed into:
+
+ %%PREFIX%%/%%PLADIR%%
+
+Please edit config.php to suit your needs.
+
+To make phpLDAPadmin available through your web site, I suggest that
+you add something like following to httpd.conf:
+
+ Alias /phpldapadmin/ "%%PREFIX%%/%%PLADIR%%/htdocs"
+
+ <Directory "%%PREFIX%%/%%PLADIR%%/htdocs">
+ Options none
+ AllowOverride none
+
+ Order Deny,Allow
+ Deny from all
+ Allow from 127.0.0.1 .example.com
+ </Directory>
+
+
--- /dev/null
+++ net/phpldapadmin/files/pkg-deinstall.in
@@ -0,0 +1,25 @@
+#!/bin/sh
+#
+# $MidnightBSD: mports/net/phpldapadmin/files/pkg-deinstall.in,v 1.1 2007/10/07 16:18:54 laffer1 Exp $
+
+case $2 in
+ POST-DEINSTALL)
+ cat <<EOMSG
+The phpldapadmin-suphp port has been deleted.
+If you are not upgrading and don't intend to use
+phpLDAPadmin any more then you may wish to delete
+the %%PLAUSR%% account, which can be done with
+the following command:
+
+ # pw userdel %%PLAUSR%%
+EOMSG
+ if [ -d %%PREFIX%%/%%PLADIR%% ] ; then
+ echo " # rm -rf %%PREFIX%%/%%PLADIR%%/"
+ fi
+ echo
+ ;;
+esac
+
+#
+# That's All Folks!
+#
More information about the Midnightbsd-cvs
mailing list