aboutsummaryrefslogtreecommitdiff
path: root/www/horde-passwd
diff options
context:
space:
mode:
authorThierry Thomas <thierry@FreeBSD.org>2006-01-06 00:38:13 +0000
committerThierry Thomas <thierry@FreeBSD.org>2006-01-06 00:38:13 +0000
commite23ee358fa1ac94e411715abac088791dc154c19 (patch)
tree2f2d07d89e8f9b0b1bbbaa61fc0a3c53d8b1308c /www/horde-passwd
parent8931540e0ace91aa22d2f957ccaefa11eb78adca (diff)
downloadports-e23ee358fa1ac94e411715abac088791dc154c19.tar.gz
ports-e23ee358fa1ac94e411715abac088791dc154c19.zip
Notes
Diffstat (limited to 'www/horde-passwd')
-rw-r--r--www/horde-passwd/Makefile19
-rw-r--r--www/horde-passwd/files/pkg-deinstall.in27
-rw-r--r--www/horde-passwd/pkg-plist2
3 files changed, 42 insertions, 6 deletions
diff --git a/www/horde-passwd/Makefile b/www/horde-passwd/Makefile
index 874f9c154bc7..610720ca8fef 100644
--- a/www/horde-passwd/Makefile
+++ b/www/horde-passwd/Makefile
@@ -26,10 +26,13 @@ COMMENT= A password changing module for Horde
RUN_DEPENDS= ${LOCALBASE}/${LHORDEDIR}/rpc.php:${PORTSDIR}/www/horde
NO_BUILD= yes
+USE_APACHE= 1.3+ # needed to test APACHE_VERSION
-PLIST_SUB= LPWDDIR=${LPWDDIR} PWDDIR=${PWDDIR}
+PLIST_SUB= LPWDDIR=${LPWDDIR} PWDDIR=${PWDDIR} \
+ HORDE_INC=${HORDE_INC:S|^${LOCALBASE}/||}
PKGMESSAGE= ${WRKDIR}/pkg-message
-SUB_FILES= pkg-message
+PKGDEINSTALL= ${WRKDIR}/pkg-deinstall
+SUB_FILES= pkg-message pkg-deinstall
SUB_LIST= PWDDIR=${PWDDIR} CONFDIR=${CONFDIR} HORDEDIR=${HORDEDIR}
DOCS= LICENSE README docs/CHANGES docs/CREDITS docs/INSTALL \
@@ -44,11 +47,17 @@ HORDEDIR= ${PREFIX}/${LHORDEDIR}
PWDDIR= ${PREFIX}/${LPWDDIR}
CONFDIR= ${PWDDIR}/config
+.include <bsd.port.pre.mk>
+
+.if ${APACHE_VERSION} >= 20
+HORDE_INC= ${LOCALBASE}/etc/apache${APACHE_VERSION:S/20/2/}/Includes
+.else
HORDE_INC= ${LOCALBASE}/etc/horde
+.endif
pre-configure:
@${SED} -e "s:/home/httpd/html/horde/passwd:${PWDDIR}:g" \
- ${FILESDIR}/httpd.conf.pwd > ${WRKDIR}/httpd.conf.pwd
+ ${FILESDIR}/httpd.conf.pwd > ${WRKDIR}/httpd-pwd.conf
do-install:
@${MKDIR} ${PWDDIR}
@@ -63,7 +72,7 @@ do-install:
.endfor
@${CHOWN} -R www:www ${PWDDIR}
@${CHMOD} -R o-rwx ${CONFDIR}
- @${CP} -p ${FILESDIR}/httpd.conf.pwd ${HORDE_INC}/httpd.conf.pwd
+ @${INSTALL_DATA} ${WRKDIR}/httpd-pwd.conf ${HORDE_INC}
.if !defined(NOPORTDOCS)
@${MKDIR} ${DOCSDIR}
.for FILE in ${DOCS}
@@ -77,4 +86,4 @@ post-install:
@${CAT} ${PKGMESSAGE}
@${ECHO_MSG}
-.include <bsd.port.mk>
+.include <bsd.port.post.mk>
diff --git a/www/horde-passwd/files/pkg-deinstall.in b/www/horde-passwd/files/pkg-deinstall.in
new file mode 100644
index 000000000000..7f79726e85c1
--- /dev/null
+++ b/www/horde-passwd/files/pkg-deinstall.in
@@ -0,0 +1,27 @@
+#!/bin/sh
+#
+# $FreeBSD$
+#
+# Backup horde-passwd config files, if needed.
+
+if [ x$2 != xDEINSTALL ]; then
+ exit
+fi
+
+if [ -z "${PACKAGE_BUILDING}" ]; then
+ for cf in `ls %%PWDDIR%%/config/*php`; do
+ diff -bBqw $cf $cf.dist >/dev/null 2>&1
+ case $? in
+ 0) # original config file, will be deleted by pkg-plist
+ ;;
+ 1) # config file has been updated, must be backuped
+ cp -p $cf $cf.previous
+ echo "===> Backing-up..."
+ echo "---> $cf has been saved ***"
+ echo "---> as $cf.previous ***"
+ ;;
+ *) # not found?
+ ;;
+ esac
+ done
+fi
diff --git a/www/horde-passwd/pkg-plist b/www/horde-passwd/pkg-plist
index cfc3e65733b2..f774ee530482 100644
--- a/www/horde-passwd/pkg-plist
+++ b/www/horde-passwd/pkg-plist
@@ -102,7 +102,7 @@
%%LPWDDIR%%/test.php
%%LPWDDIR%%/themes/graphics/favicon.ico
%%LPWDDIR%%/themes/graphics/passwd.png
-etc/horde/httpd.conf.pwd
+%%HORDE_INC%%/httpd-pwd.conf
%%PORTDOCS%%@dirrm %%DOCSDIR%%
@dirrm %%LPWDDIR%%/themes/graphics
@dirrm %%LPWDDIR%%/themes