aboutsummaryrefslogtreecommitdiff
path: root/net/phpldapadmin
diff options
context:
space:
mode:
authorSam Lawrance <lawrance@FreeBSD.org>2005-12-11 23:51:12 +0000
committerSam Lawrance <lawrance@FreeBSD.org>2005-12-11 23:51:12 +0000
commit4992047d947fd9bb8fd29da2fb45a6a0b258c990 (patch)
tree2df3c4e2d4512a4a4cd3a98b6983ff5adf978aab /net/phpldapadmin
parent2cb8b80f5371f1a45a4bd9020b19e2b35cd7cd68 (diff)
downloadports-4992047d947fd9bb8fd29da2fb45a6a0b258c990.tar.gz
ports-4992047d947fd9bb8fd29da2fb45a6a0b258c990.zip
Notes
Diffstat (limited to 'net/phpldapadmin')
-rw-r--r--net/phpldapadmin/Makefile47
-rw-r--r--net/phpldapadmin/distinfo5
-rw-r--r--net/phpldapadmin/files/pkg-deinstall.in26
-rw-r--r--net/phpldapadmin/files/pkg-install.in98
-rw-r--r--net/phpldapadmin/files/pkg-message.in24
-rw-r--r--net/phpldapadmin/pkg-plist-chunk4
6 files changed, 173 insertions, 31 deletions
diff --git a/net/phpldapadmin/Makefile b/net/phpldapadmin/Makefile
index 678fa86e47d3..894d947ecf09 100644
--- a/net/phpldapadmin/Makefile
+++ b/net/phpldapadmin/Makefile
@@ -6,7 +6,7 @@
#
PORTNAME= phpldapadmin
-PORTVERSION= 0.9.7
+PORTVERSION= 0.9.7.2
PORTEPOCH= 1
CATEGORIES= net www
MASTER_SITES= ${MASTER_SITE_SOURCEFORGE}
@@ -24,17 +24,12 @@ USE_PHP= ldap openssl pcre session
PKGNAMESUFFIX= -suphp
RUN_DEPENDS+= ${LOCALBASE}/sbin/suphp:${PORTSDIR}/www/suphp
WANT_PHP_CGI= yes
-PKGINST_SKEL= ${PKGDIR}/pkg-install${PKGNAMESUFFIX}
-PKGINSTALL= ${WRKDIR}/pkg-install${PKGNAMESUFFIX}
-PKGDEINST_SKEL= ${PKGDIR}/pkg-deinstall${PKGNAMESUFFIX}
-PKGDEINSTALL= ${WRKDIR}/pkg-deinstall${PKGNAMESUFFIX}
PLAUSR?= pldapadm
-SED_SCRIPT= -e 's!%%PREFIX%%!${PREFIX}!g' \
- -e 's!%%PLADIR%%!${PLADIR}!g' \
- -e 's!%%PLAUSR%%!${PLAUSR}!g' \
- -e 's!%%PLAGRP%%!${PLAGRP}!g'
+SUB_LIST+= PLAUSR=${PLAUSR} \
+ PLAGRP=${PLAGRP}
+SUB_FILES+= pkg-install pkg-deinstall
.else
@@ -42,17 +37,22 @@ WANT_PHP_WEB= yes
.endif
-MSG_SKEL= ${PKGDIR}/pkg-message
-PKGMESSAGE= ${WRKDIR}/pkg-message
-
# 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}
+sedSTART= @unexec rmdir %D/%%PLADIR%%
+sedEND= 2>/dev/null || true
+
.SILENT:
pre-everything::
@@ -64,21 +64,14 @@ pre-everything::
${ECHO_MSG} ""
post-patch:
- ${RM} -f ${PLIST}
- cd ${WRKSRC} ; \
+ cd ${WRKSRC} ; \
${FIND} . ! -type d ! -name ${CFGFILE}.example ! -name .cvsignore | \
- ${SORT} | ${SED} "s!^\.!%%PLADIR%%!" >${PLIST} ; \
- ${CAT} ${PKGDIR}/pkg-plist-chunk >>${PLIST} ; \
- ${FIND} . -type d | ${SORT} -r | ${SED} \
- -e 's!^\.$$!@unexec rmdir %D/%%PLADIR%% 2>/dev/null || true!' \
- -e 's!^\.!@dirrm %%PLADIR%%!' >>${PLIST}
- ${SED} -e 's!%%PKGNAME%%!${PKGNAME}!g' \
- -e 's!%%PREFIX%%!${PREFIX}!g' \
- -e 's!%%PLADIR%%!${PLADIR}!g' ${MSG_SKEL} > ${PKGMESSAGE}
-.if defined(WITH_SUPHP)
- ${SED} ${SED_SCRIPT} ${PKGINST_SKEL} > ${PKGINSTALL}
- ${SED} ${SED_SCRIPT} ${PKGDEINST_SKEL} > ${PKGDEINSTALL}
-.endif
+ ${SORT} | ${SED} -e "s!^\.!%%PLADIR%%!" >${PLIST} ; \
+ ${CAT} ${PKGDIR}/pkg-plist-chunk >>${PLIST} ; \
+ ${FIND} . -type d | ${SORT} -r | ${SED} \
+ -e 's!^\./${CFGDIR}$$!${sedSTART}/${CFGDIR} ${sedEND}!' \
+ -e 's!^\.$$!${sedSTART} ${sedEND}!' \
+ -e 's!^\.!@dirrm %%PLADIR%%!' >>${PLIST}
pre-install:
.if defined(WITH_SUPHP)
@@ -99,7 +92,7 @@ install-app:
done
install-conf:
- cd ${PREFIX}/${PLADIR} ; \
+ cd ${PREFIX}/${PLADIR}/${CFGDIR} ; \
${CHMOD} 0640 ${CFGFILE}.example ; \
${CHGRP} ${PLAGRP} ${CFGFILE}.example ; \
if ${TEST} ! -f ${CFGFILE} ; then \
diff --git a/net/phpldapadmin/distinfo b/net/phpldapadmin/distinfo
index 8a92c56bb2cd..bea9c8c006b5 100644
--- a/net/phpldapadmin/distinfo
+++ b/net/phpldapadmin/distinfo
@@ -1,2 +1,3 @@
-MD5 (phpldapadmin-0.9.7.tar.gz) = a9a6f8dd289210a3d732552d38eb2d25
-SIZE (phpldapadmin-0.9.7.tar.gz) = 745974
+MD5 (phpldapadmin-0.9.7.2.tar.gz) = ac9923e37bbc232b9ca537cfd9282691
+SHA256 (phpldapadmin-0.9.7.2.tar.gz) = bcc3b608336e93f821759e2cdc2120c7abf855a962a3e1972d5a7b9df50059cd
+SIZE (phpldapadmin-0.9.7.2.tar.gz) = 819703
diff --git a/net/phpldapadmin/files/pkg-deinstall.in b/net/phpldapadmin/files/pkg-deinstall.in
new file mode 100644
index 000000000000..cca9c556093d
--- /dev/null
+++ b/net/phpldapadmin/files/pkg-deinstall.in
@@ -0,0 +1,26 @@
+#!/bin/sh
+#
+# $FreeBSD: /tmp/pcvs/ports/net/phpldapadmin/files/pkg-deinstall.in,v 1.1 2005-12-11 23:51:12 lawrance 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!
+#
diff --git a/net/phpldapadmin/files/pkg-install.in b/net/phpldapadmin/files/pkg-install.in
new file mode 100644
index 000000000000..b56e32ad6767
--- /dev/null
+++ b/net/phpldapadmin/files/pkg-install.in
@@ -0,0 +1,98 @@
+#!/bin/sh
+#
+# $FreeBSD: /tmp/pcvs/ports/net/phpldapadmin/files/pkg-install.in,v 1.1 2005-12-11 23:51:12 lawrance 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!
+#
diff --git a/net/phpldapadmin/files/pkg-message.in b/net/phpldapadmin/files/pkg-message.in
new file mode 100644
index 000000000000..365faf3c5f9f
--- /dev/null
+++ b/net/phpldapadmin/files/pkg-message.in
@@ -0,0 +1,24 @@
+
+%%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 the following to httpd.conf:
+
+ Alias /phpldapadmin/ "%%PREFIX%%/%%PLADIR%%/htdocs"
+
+Please note: if you are upgrading from version 0.9.7 or earlier, the
+layout of the %%PKGNAME%% files has been completely reworked. You
+will need to modify your apache configuration and merge the settings
+from your original configuration file:
+
+ %%PREFIX%%/%%PLADIR%%/config.php
+
+ to
+
+ %%PREFIX%%/%%PLADIR%%/config/config.php
+
+
diff --git a/net/phpldapadmin/pkg-plist-chunk b/net/phpldapadmin/pkg-plist-chunk
index 29ae43a7b280..8a9de645dd50 100644
--- a/net/phpldapadmin/pkg-plist-chunk
+++ b/net/phpldapadmin/pkg-plist-chunk
@@ -1,7 +1,7 @@
@mode 640
@group %%PLAGRP%%
-@unexec if cmp -s %D/%%PLADIR%%/config.php.example %D/%%PLADIR%%/config.php ; then rm -f %D/%%PLADIR%%/config.php ; fi
-%%PLADIR%%/config.php.example
+@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
@exec [ ! -f %B/config.php ] && cp -p %B/%f %B/config.php || true
@mode
@group