aboutsummaryrefslogtreecommitdiffstats
path: root/net/sipxpublisher
diff options
context:
space:
mode:
authormiwi <miwi@FreeBSD.org>2007-03-27 16:29:26 +0800
committermiwi <miwi@FreeBSD.org>2007-03-27 16:29:26 +0800
commit959639d2e2bcbffe0794103ee0a2f7d27f867aed (patch)
treed6c70eade4d42dd1670e2e9bf0836122f5733dbf /net/sipxpublisher
parent1b65266ade81caeccc6a6212f4aee213573f74d6 (diff)
downloadfreebsd-ports-graphics-959639d2e2bcbffe0794103ee0a2f7d27f867aed.tar.gz
freebsd-ports-graphics-959639d2e2bcbffe0794103ee0a2f7d27f867aed.tar.zst
freebsd-ports-graphics-959639d2e2bcbffe0794103ee0a2f7d27f867aed.zip
sipxpublisher should change the ownership, if necessary, of files and directories
it installs. Perviously, the toplevel port, sipxpbx, changed ownership for not only its files, but all the dependant ports too. - Bump PORTREVISION Submitted by: Mike Durian <durian@shadetreesoftware.com> (maintainer)
Diffstat (limited to 'net/sipxpublisher')
-rw-r--r--net/sipxpublisher/Makefile14
-rw-r--r--net/sipxpublisher/files/pkg-install.in36
2 files changed, 48 insertions, 2 deletions
diff --git a/net/sipxpublisher/Makefile b/net/sipxpublisher/Makefile
index 5ceed20e331..e1029747332 100644
--- a/net/sipxpublisher/Makefile
+++ b/net/sipxpublisher/Makefile
@@ -7,6 +7,7 @@
PORTNAME= sipxpublisher
PORTVERSION= 3.6.0
+PORTREVISION= 1
CATEGORIES= net
MASTER_SITES= http://www.sipfoundry.org/pub/sipX/3.6/SRC/
@@ -30,10 +31,19 @@ CONFIGURE_ENV+= wwwdir=${PREFIX}/www/sipX \
CONFIGURE_ARGS+= --enable-sip-tls \
--prefix=${PREFIX} \
--localstatedir=${LOCALSTATEDIR}
-SUB_LIST= LOCALSTATEDIR=${LOCALSTATEDIR}
-SUB_FILES= pkg-deinstall
+SUB_LIST= LOCALSTATEDIR=${LOCALSTATEDIR} \
+ PREFIX=${PREFIX}
+SUB_FILES= pkg-install pkg-deinstall
+
+PKGINSTALL= ${WRKDIR}/pkg-install
post-patch:
@${REINPLACE_CMD} -e "s,/bin/bash,${PREFIX}/bin/bash," ${WRKSRC}/bin/sipstatus.sh.in
+pre-install:
+ @${SH} ${PKGINSTALL} ${PORTNAME} PRE-INSTALL
+
+post-install:
+ @${SH} ${PKGINSTALL} ${PORTNAME} POST-INSTALL
+
.include <bsd.port.mk>
diff --git a/net/sipxpublisher/files/pkg-install.in b/net/sipxpublisher/files/pkg-install.in
new file mode 100644
index 00000000000..8ac6d67cf34
--- /dev/null
+++ b/net/sipxpublisher/files/pkg-install.in
@@ -0,0 +1,36 @@
+#!/bin/sh
+
+PATH=/bin:/usr/sbin
+
+USER=sipx
+GROUP=sipx
+
+case $2 in
+PRE-INSTALL)
+ if pw group show "${GROUP}" 2> /dev/null ; then
+ echo "You already have a group \"${GROUP}\", so I will use it."
+ else
+ if pw groupadd ${GROUP} ; then
+ echo "Added group \"${GROUP}\"."
+ else
+ echo "Add of group \"${GROUP}\" failed."
+ exit 1
+ fi
+ fi
+
+ if pw user show "${USER}" 2> /dev/null ; then
+ echo "You already have a user \"${USER}\", so I will use it."
+ else
+ if pw useradd ${USER} -g ${GROUP} -h - \
+ -d %%LOCALSTATEDIR%%/sipxdata/configserver/phone/profile/tftproot -s %%PREFIX%%/bin/bash -c "sipX" ; then
+ echo "Added user \"${USER}\"."
+ else
+ echo "Add of user \"${USER}\" failed."
+ exit 1
+ fi
+ fi
+ ;;
+POST-INSTALL)
+ chown ${USER}:${GROUP} %%PREFIX%%/etc/sipxpbx
+ ;;
+esac