summaryrefslogtreecommitdiff
path: root/security/clamav/files/pkg-install.in
diff options
context:
space:
mode:
authorJean-Yves Lefort <jylefort@FreeBSD.org>2005-05-13 08:16:40 +0000
committerJean-Yves Lefort <jylefort@FreeBSD.org>2005-05-13 08:16:40 +0000
commit8e9ddc579f1587d5ca7499cad72d489eb60f53f4 (patch)
tree1e9b6d59f0c5791b622545e0c25dce59fa75008b /security/clamav/files/pkg-install.in
parentAdd p5-Devel-Arena 0.04, (diff)
- Update to 0.85 [1]
- Fix syntax of "extern C" wrappers in .h files [2] - Use SUB_FILES facility - Polish the Makefile PR: ports/80947 Submitted by: maintainer [1], Milan Obuch <ports-bugs@dino.sk> [2]
Notes
Notes: svn path=/head/; revision=135177
Diffstat (limited to 'security/clamav/files/pkg-install.in')
-rw-r--r--security/clamav/files/pkg-install.in71
1 files changed, 71 insertions, 0 deletions
diff --git a/security/clamav/files/pkg-install.in b/security/clamav/files/pkg-install.in
new file mode 100644
index 000000000000..3a5a36371c91
--- /dev/null
+++ b/security/clamav/files/pkg-install.in
@@ -0,0 +1,71 @@
+#!/bin/sh
+# $FreeBSD: /tmp/pcvs/ports/security/clamav/files/pkg-install.in,v 1.1 2005-05-13 08:16:40 jylefort Exp $
+
+PREFIX=${PKG_PREFIX:-%%PREFIX%%}
+DESTDIR=${PKG_DESTDIR:-}
+
+CLAMAVUSER=%%CLAMAVUSER%%
+CLAMAVGROUP=%%CLAMAVGROUP%%
+UID=106
+GID=$UID
+
+DBDIR=$DESTDIR%%DBDIR%%
+LOGDIR=$DESTDIR%%LOGDIR%%
+RUNDIR=$DESTDIR%%RUNDIR%%
+
+if [ "$2" = "PRE-INSTALL" ]; then
+
+ if ! pw groupshow "$CLAMAVGROUP" 2>/dev/null 1>&2; then
+ if pw groupadd $CLAMAVGROUP -g $GID; then
+ echo "=> Added group \"$CLAMAVGROUP\"."
+ else
+ echo "=> Adding group \"$CLAMAVGROUP\" failed..."
+ exit 1
+ fi
+ fi
+
+ if ! pw usershow "$CLAMAVUSER" 2>/dev/null 1>&2; then
+ if pw useradd $CLAMAVUSER -u $UID -g $CLAMAVGROUP -h - \
+ -s "/sbin/nologin" -d "/nonexistent" \
+ -c "Clam Antivirus"; \
+ then
+ pw groupmod mail -m $CLAMAVUSER
+ echo "=> Added user \"$CLAMAVUSER\"."
+ else
+ echo "=> Adding user \"$CLAMAVUSER\" failed..."
+ exit 1
+ fi
+ fi
+
+elif [ "$2" = "POST-INSTALL" ]; then
+
+ if [ ! -d "$DBDIR" ]; then
+ mkdir -p "$DBDIR" || exit 1
+ chown "$CLAMAVUSER:$CLAMAVGROUP" "$DBDIR" || exit 1
+ fi
+
+ if [ ! -d "$LOGDIR" ]; then
+ mkdir -p "$LOGDIR" || exit 1
+ chown "$CLAMAVUSER:$CLAMAVGROUP" "$LOGDIR" || exit 1
+ fi
+
+ if [ ! -d "$RUNDIR" ]; then
+ mkdir -p "$RUNDIR" || exit 1
+ chown "$CLAMAVUSER:$CLAMAVGROUP" "$RUNDIR" || exit 1
+ fi
+
+ if [ -f "$DESTDIR$PREFIX/etc/clamav.conf" ]; then
+ echo
+ echo "**************** WARNING ****************"
+ echo "* *"
+ echo "* The configuration file has changed: *"
+ echo "* Please edit $PREFIX/etc/clamd.conf *"
+ echo "* and remove $PREFIX/etc/clamav.conf *"
+ echo "* *"
+ echo "**************** WARNING ****************"
+ echo
+ fi
+
+fi
+
+exit 0