Introduce a variable LOGDIR instead of using a literal log directory
pathname everywhere. Approved by: Rob Evers (maintainer)
This commit is contained in:
parent
efe22691e4
commit
6a31303cc5
Notes:
svn2git
2021-03-31 03:12:20 +00:00
svn path=/head/; revision=127473
3 changed files with 11 additions and 9 deletions
|
@ -40,8 +40,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} \
|
||||
--disable-clamuko \
|
||||
|
@ -69,6 +70,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' \
|
||||
|
@ -76,7 +78,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}|' \
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue