head	1.12;
access;
symbols
	RELEASE_5_4_0:1.11
	RELEASE_4_11_0:1.9
	RELEASE_5_3_0:1.7
	RELEASE_4_10_0:1.6
	RELEASE_5_2_1:1.4
	RELEASE_5_2_0:1.4
	RELEASE_4_9_0:1.3
	RELEASE_5_1_0:1.1
	RELEASE_4_8_0:1.1;
locks; strict;
comment	@# @;


1.12
date	2005.05.13.08.16.39;	author jylefort;	state dead;
branches;
next	1.11;

1.11
date	2005.01.27.12.28.08;	author yar;	state Exp;
branches;
next	1.10;

1.10
date	2005.01.12.18.13.08;	author yar;	state Exp;
branches;
next	1.9;

1.9
date	2004.12.22.02.10.11;	author edwin;	state Exp;
branches;
next	1.8;

1.8
date	2004.10.14.09.30.47;	author eik;	state Exp;
branches;
next	1.7;

1.7
date	2004.05.30.08.01.22;	author pav;	state Exp;
branches;
next	1.6;

1.6
date	2004.04.01.16.36.28;	author eik;	state Exp;
branches;
next	1.5;

1.5
date	2004.02.03.06.42.31;	author glewis;	state Exp;
branches;
next	1.4;

1.4
date	2003.09.28.13.29.28;	author dinoex;	state Exp;
branches;
next	1.3;

1.3
date	2003.06.18.09.43.05;	author nork;	state Exp;
branches;
next	1.2;

1.2
date	2003.06.08.16.16.49;	author leeym;	state Exp;
branches;
next	1.1;

1.1
date	2003.01.20.03.41.52;	author edwin;	state Exp;
branches;
next	;


desc
@@


1.12
log
@- 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]
@
text
@#!/bin/sh
# $FreeBSD: ports/security/clamav/pkg-install,v 1.11 2005/01/27 12:28:08 yar 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
@


1.11
log
@Introduce a variable LOGDIR instead of using a literal log directory
pathname everywhere.

Approved by:	Rob Evers (maintainer)
@
text
@d2 1
a2 1
# $FreeBSD: ports/security/clamav/pkg-install,v 1.10 2005/01/12 18:13:08 yar Exp $
@


1.10
log
@Do the things I forgot about in my previous commit:

- Change the last instance of literal `/var/run/clamav' to %%RUNDIR%%.
- Bump PORTREVISION since the changes should improve the functionality
  of the installed package.

PR:		ports/75607
Approved by:	maintainer
@
text
@d2 1
a2 1
# $FreeBSD: ports/security/clamav/pkg-install,v 1.9 2004/12/22 02:10:11 edwin Exp $
a11 1
CLAMLOG=$DESTDIR/var/log/clamav
d13 1
a41 5
	if [ ! -d "$CLAMLOG" ]; then
		mkdir -p "$CLAMLOG" || exit 1
		chown "$CLAMAVUSER:$CLAMAVGROUP" "$CLAMLOG" || exit 1
	fi

d47 5
@


1.9
log
@Fix ports: security/clamav and security/clamav-devel (change db
directory to /var/db/clamav and fix removal of db on deinstall)

	For the sake of coherence, the ClamAV database should be
	installed in /var/db/clamav, not /usr/local/share/clamav.
	Also fixes the database removal on package deinstallation.

PR:		ports/74172
Submitted by:	Jean-Yves Lefort <jylefort@@brutele.be>
Approved by:	Rob Evers <rob@@debank.tv>
@
text
@d2 1
a2 1
# $FreeBSD: ports/security/clamav/pkg-install,v 1.8 2004/10/14 09:30:47 eik Exp $
a11 1
CLAMRUN=$DESTDIR/var/run/clamav
d14 1
a41 5
	if [ ! -d "$CLAMRUN" ]; then
		mkdir -p "$CLAMRUN" || exit 1
		chown "$CLAMAVUSER:$CLAMAVGROUP" "$CLAMRUN" || exit 1
	fi

d52 5
@


1.8
log
@- update to 0.80rc4
  + JPEG comment exploit (MS04-028) detection

  *** IMPORTANT ***
  The configruration file for the clamd daemon has changed from
  /usr/local/etc/clamav.conf to /usr/local/etc/clamd.conf.

PR:		72203
Approved by:	Rob Evers <revers@@infraqon.nl> (maintainer)
@
text
@d2 1
a2 1
# $FreeBSD: ports/security/clamav/pkg-install,v 1.7 2004/05/30 08:01:22 pav Exp $
d14 1
a14 1
DATADIR=$DESTDIR%%DATADIR%%
d52 3
a54 3
	if [ ! -d "$DATADIR" ]; then
		mkdir -p "$DATADIR" || exit 1
		chown "$CLAMAVUSER:$CLAMAVGROUP" "$DATADIR" || exit 1
@


1.7
log
@- Use fixed UID/GID
@
text
@d2 1
a2 1
# $FreeBSD: ports/security/clamav/pkg-install,v 1.6 2004/04/01 16:36:28 eik Exp $
d5 1
d12 3
a14 3
CLAMRUN=/var/run/clamav
CLAMLOG=/var/log/clamav
DATADIR=%%DATADIR%%
d52 1
a52 1
	if [ ! -d "${DATADIR}" ]; then
d55 12
@


1.6
log
@Update to clamav 0.70

- new thread manager (with better SMP support)
- new switch ArchiveDetectEncrypted
- new directive: ArchiveDetectEncrypted
- see /usr/local/share/doc/clamav/NEWS
- install html documentation to /usr/local/share/doc/clamav/html

added CLAMAVUSER/CLAMAVGROUP support

Adopted the port to ensure timely fixes in case I broke something :P
Please reset the maintainer if TERAMOTO Masahiro shows up again.
@
text
@d2 1
a2 1
# $FreeBSD: ports/security/clamav/pkg-install,v 1.5 2004/02/03 06:42:31 glewis Exp $
d8 2
d18 1
a18 1
		if pw groupadd $CLAMAVGROUP; then
d27 1
a27 1
		if pw useradd $CLAMAVUSER -g $CLAMAVGROUP -h - \
@


1.5
log
@. Add $FreeBSD$
. Indent
. Split into pre-install and post-install stages.
  Pre-install: Add the user and group.
  Post-install: Create the log and run directories.
@
text
@d2 1
a2 1
# $FreeBSD$
d6 2
a7 2
USER=clamav
GROUP=clamav
d11 1
d15 3
a17 3
	if ! pw groupshow "$GROUP" 2>/dev/null 1>&2; then
		if pw groupadd $GROUP; then
			echo "=> Added group \"$GROUP\"."
d19 1
a19 1
			echo "=> Adding group \"$GROUP\" failed..."
d24 2
a25 2
	if ! pw usershow "$USER" 2>/dev/null 1>&2; then
		if pw useradd $USER -g $GROUP -h - \
d29 2
a30 2
			pw groupmod mail -m $USER
			echo "=> Added user \"$USER\"."
d32 1
a32 1
			echo "=> Adding user \"$USER\" failed..."
d39 1
a39 1
	if [ ! -d "${CLAMRUN}" ]; then
d41 1
a41 1
		chown "$USER:$GROUP" "$CLAMRUN" || exit 1
d44 1
a44 1
	if [ ! -d "${CLAMLOG}" ]; then
d46 6
a51 1
		chown "$USER:$GROUP" "$CLAMLOG" || exit 1
@


1.4
log
@- don't remove clamav account on deinstall
- use included libtool (seems heavily patched)
- make packageable and include a working configure file
- add a rcNG start/stop script
- added web site
- don't install useless .la files
- use DATADIR
- 510001 is FreeBSD 5.10, 5.1-CURRENT is 501100
- minor cleanup

PR:		57256
Submitted by:	eikemeier@@fillmore-labs.com
@
text
@d2 1
d14 33
a46 8
if ! pw groupshow "$GROUP" 2>/dev/null 1>&2; then
	if pw groupadd $GROUP; then
		echo "=> Added group \"$GROUP\"."
	else
                echo "=> Adding group \"$GROUP\" failed..."
                exit 1
        fi
fi
a47 11
if ! pw usershow "$USER" 2>/dev/null 1>&2; then
        if pw useradd $USER -g $GROUP -h - \
                -s "/sbin/nologin" -d "/nonexistent" \
                -c "Clam Antivirus"; \
        then
		pw groupmod mail -m $USER
                echo "=> Added user \"$USER\"."
        else
                echo "=> Adding user \"$USER\" failed..."
                exit 1
        fi
a48 8

mkdir -p "$CLAMRUN"
chown "$USER:$GROUP" "$CLAMRUN"

mkdir -p "$CLAMLOG"
chown "$USER:$GROUP" "$CLAMLOG"

fi # PRE-INSTALL
@


1.3
log
@o Add mirror site.
o Remove unnecsesary patches for current.
o Add/remove users when installing/removing.
o Set permissions on virus database dir.

PR:		ports/53305
Submitted by:	Rob Evers<rob@@debank.tv>
Approved by:	TERAMOTO Masahiro <markun@@onohara.to> (maintainer)
@
text
@d3 1
a3 1
if [ "$2" = "PRE-INSTALL" ]; then
d8 5
d27 1
a33 1
fi
d35 5
a39 3
if [ "$2" = "POST-INSTALL" ]; then
        chown -R clamav:clamav ${PKG_PREFIX}/share/clamav
fi
d41 1
a41 3
if [ "$2" != "POST-INSTALL" ] && [ "$2" != "PRE-INSTALL" ]; then
	exit 0
fi
@


1.2
log
@Enable pthread support using devel/pth.
Turn on building clamd and clamdscan.

PR:		53056
Pointed out by:	Olivier Tharan <olive@@oban.frmug.org>
Submitted by:	TERAMOTO Masahiro <markun@@onohara.to>
@
text
@d3 1
a3 3
if [ "$2" != "PRE-INSTALL" ]; then
    exit 0
fi
d5 2
a6 2
USER?=clamav
GROUP?=clamav
d28 10
@


1.1
log
@new port: security/clamav

	Clam Antivirus is command line virus scanner using database
	from OpenAntiVirus.

PR:		ports/40602
Submitted by:	TERAMOTO Masahiro <markun@@onohara.to>
@
text
@d7 2
a8 2
USER=clamav
GROUP=clamav
@

