1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-11-28 01:06:17 +00:00

Introduce a variable LOGDIR instead of using a literal log directory

pathname everywhere.

Approved by:	Rob Evers (maintainer)
This commit is contained in:
Yaroslav Tykhiy 2005-01-27 12:15:27 +00:00
parent 8964faeaed
commit efe22691e4
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=127472
3 changed files with 13 additions and 11 deletions

View File

@ -42,8 +42,9 @@ PKGDEINSTALL= ${WRKDIR}/pkg-deinstall
PORTDOCS= NEWS ChangeLog html
DBDIR= /var/db/clamav
LOGDIR= /var/log/clamav
RUNDIR= /var/run/clamav
PLIST_SUB+= DBDIR=${DBDIR} RUNDIR=${RUNDIR}
PLIST_SUB+= DBDIR=${DBDIR} LOGDIR=${LOGDIR} RUNDIR=${RUNDIR}
CONFIGURE_ARGS= --with-dbdir=${DBDIR} \
--with-zlib=/usr \
@ -72,6 +73,7 @@ CLAMAV_MILTER_SOCKET?= ${RUNDIR}/clmilter.sock
SED_SCRIPT= -e 's|%%PREFIX%%|${PREFIX}|g' \
-e 's|%%DBDIR%%|${DBDIR}|g' \
-e 's|%%LOGDIR%%|${LOGDIR}|g' \
-e 's|%%RUNDIR%%|${RUNDIR}|g' \
-e 's|%%CLAMAVUSER%%|${CLAMAVUSER}|g' \
-e 's|%%CLAMAVGROUP%%|${CLAMAVGROUP}|g' \
@ -79,7 +81,7 @@ SED_SCRIPT= -e 's|%%PREFIX%%|${PREFIX}|g' \
-e 's|%%CLAMAV_MILTER_SOCKET%%|${CLAMAV_MILTER_SOCKET}|g'
SED_CONF= -E -e 's|^\#?(Example)$$|\#\1|' \
-e 's|^\#?((Update)?LogFile) .*/([a-z]+\.log)$$|\1 /var/log/clamav/\3|' \
-e 's|^\#?((Update)?LogFile) .*/([a-z]+\.log)$$|\1 ${LOGDIR}/\3|' \
-e 's|^\#?(PidFile) .*/([a-z]+\.pid)$$|\1 ${RUNDIR}/\2|' \
-e 's|^\#?(LocalSocket) .*$$|\1 ${CLAMAV_CLAMD_SOCKET}|' \
-e 's|^\#?(User) .*$$|\1 ${CLAMAVUSER}|' \
@ -89,7 +91,7 @@ SED_CONF= -E -e 's|^\#?(Example)$$|\#\1|' \
-e 's|^\#?(Checks)$$|\#\1|' \
-e 's|^\#?(DatabaseDirectory) .*$$|\1 ${DBDIR}|' \
-e 's|^\#?(DatabaseOwner) .*$$|\1 ${CLAMAVUSER}|' \
-e 's|^\#?(UpdateLogFile) .*$$|\1 /var/log/clamav/freshclam.log|' \
-e 's|^\#?(UpdateLogFile) .*$$|\1 ${LOGDIR}/freshclam.log|' \
-e 's|^\#?(FixStaleSocket)$$|\1|'
PLIST_SUB+= CLAMAVUSER=${CLAMAVUSER} \

View File

@ -1,5 +1,5 @@
#!/bin/sh
# $FreeBSD: /tmp/pcvs/ports/security/clamav-devel/Attic/pkg-install,v 1.19 2005-01-12 18:22:56 yar Exp $
# $FreeBSD: /tmp/pcvs/ports/security/clamav-devel/Attic/pkg-install,v 1.20 2005-01-27 12:15:27 yar Exp $
PREFIX=${PKG_PREFIX:-%%PREFIX%%}
DESTDIR=${PKG_DESTDIR:-}
@ -9,8 +9,8 @@ CLAMAVGROUP=%%CLAMAVGROUP%%
UID=106
GID=$UID
CLAMLOG=$DESTDIR/var/log/clamav
DBDIR=$DESTDIR%%DBDIR%%
LOGDIR=$DESTDIR%%LOGDIR%%
RUNDIR=$DESTDIR%%RUNDIR%%
if [ "$2" = "PRE-INSTALL" ]; then
@ -39,16 +39,16 @@ if [ "$2" = "PRE-INSTALL" ]; then
elif [ "$2" = "POST-INSTALL" ]; then
if [ ! -d "$CLAMLOG" ]; then
mkdir -p "$CLAMLOG" || exit 1
chown "$CLAMAVUSER:$CLAMAVGROUP" "$CLAMLOG" || exit 1
fi
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

View File

@ -27,5 +27,5 @@ etc/freshclam.conf.default
@unexec [ ! -f %%DBDIR%%/daily.cvd ] || rm -f %%DBDIR%%/daily.cvd || true
@unexec [ ! -f %%DBDIR%%/main.cvd ] || rm -f %%DBDIR%%/main.cvd || true
@unexec rmdir %%DBDIR%%
@unexec rmdir %%LOGDIR%% 2>/dev/null || true
@unexec rmdir %%RUNDIR%% 2>/dev/null || true
@unexec rmdir /var/log/clamav 2>/dev/null || true