diff options
author | Carlo Landmeter <clandmeter@gmail.com> | 2009-02-03 11:00:09 +0000 |
---|---|---|
committer | Natanael Copa <ncopa@alpinelinux.org> | 2009-02-03 13:14:55 +0000 |
commit | 3eb2093259273aa7dfa99703451562d540b69c95 (patch) | |
tree | 07edf6f821cdc8afcb13361cef880c1c3db954df /extra | |
parent | 2c562a5244981133c691c807cf3b9b87857b63a9 (diff) | |
download | aports-3eb2093259273aa7dfa99703451562d540b69c95.tar.bz2 aports-3eb2093259273aa7dfa99703451562d540b69c95.tar.xz |
extra/clamav: new aport
Diffstat (limited to 'extra')
-rw-r--r-- | extra/clamav/APKBUILD | 39 | ||||
-rw-r--r-- | extra/clamav/clamav-0.94.2-nls.patch | 71 | ||||
-rw-r--r-- | extra/clamav/clamav.confd | 9 | ||||
-rw-r--r-- | extra/clamav/clamav.initd | 39 | ||||
-rw-r--r-- | extra/clamav/clamav.install | 10 |
5 files changed, 168 insertions, 0 deletions
diff --git a/extra/clamav/APKBUILD b/extra/clamav/APKBUILD new file mode 100644 index 000000000..28cafd4bb --- /dev/null +++ b/extra/clamav/APKBUILD @@ -0,0 +1,39 @@ +# Contributor: Carlo Landmeter <clandmeter at gmail> +# Maintainer: Carlo Landmeter <clandmeter at gmail> +pkgname=clamav +pkgver=0.94.2 +pkgrel=0 +pkgdesc="An anti-virus toolkit for UNIX" +url="http://www.clamav.net/" +license="GPL" +depends="zlib gmp" +install=clamav.install +makedepends="gmp-dev zlib-dev" +subpackages="$pkgname-doc $pkgname-dev" +source="http://downloads.sourceforge.net/$pkgname/$pkgname-$pkgver.tar.gz + clamav.initd + clamav.confd + clamav-0.94.2-nls.patch + $install" + +build() { + cd "$srcdir/$pkgname-$pkgver" + + patch -p0 -i "$srcdir/clamav-0.94.2-nls.patch" || return 1 + + ./configure --prefix=/usr \ + --sysconfdir=/etc \ + --mandir=/usr/share/man \ + --infodir=/usr/share/info \ + --disable-clamav + make || return 1 + make DESTDIR="$pkgdir" install + + install -m755 -D "$srcdir"/$pkgname.initd "$pkgdir"/etc/init.d/$pkgname + install -m644 -D "$srcdir"/$pkgname.confd "$pkgdir"/etc/conf.d/$pkgname +} + +md5sums="1181e6d62341b84708f126cc353f7ebf clamav-0.94.2.tar.gz +d0c708403940c51e52eb27ea1610a27d clamav.initd +431dfe7403323e247a88b97beade5d78 clamav.confd +328a0c3449a6b516e443d7db5a0d4d01 clamav-0.94.2-nls.patch" diff --git a/extra/clamav/clamav-0.94.2-nls.patch b/extra/clamav/clamav-0.94.2-nls.patch new file mode 100644 index 000000000..7e02a29d6 --- /dev/null +++ b/extra/clamav/clamav-0.94.2-nls.patch @@ -0,0 +1,71 @@ +Patch to disable nls (gettext) support for clamd. Taken from gentoo: +http://sources.gentoo.org/viewcvs.py/gentoo-x86/app-antivirus/clamav/files/clamav-0.94-nls.patch?view=log + +--- clamav-milter/clamav-milter.c Fri Nov 21 22:24:41 2008 ++++ clamav-milter/clamav-milter.c Mon Feb 2 09:30:14 2009 +@@ -113,6 +113,7 @@ + + #ifdef C_LINUX + #include <sys/sendfile.h> /* FIXME: use sendfile on BSD not Linux */ ++#ifdef ENABLE_NLS + #include <libintl.h> + #include <locale.h> + +@@ -125,7 +126,8 @@ + #define _(s) s + #define N_(s) s + +-#endif ++#endif /* ENABLE_NLS */ ++#endif /* C_LINUX */ + + #ifdef USE_SYSLOG + #include <syslog.h> +@@ -774,7 +776,7 @@ + else + progname = "clamav-milter"; + +-#ifdef C_LINUX ++#ifdef ENABLE_NLS + setlocale(LC_ALL, ""); + bindtextdomain(progname, DATADIR"/clamav-milter/locale"); + textdomain(progname); +--- configure.in Wed Nov 26 12:15:08 2008 ++++ configure.in Mon Feb 2 09:30:14 2009 +@@ -609,6 +609,14 @@ + fi + fi + ++AC_ARG_ENABLE([nls], ++ AC_HELP_STRING([--disable-nls], [disable NLS support]), ++ [want_nls=$enableval], [want_nls=yes] ++) ++if test $want_nls = yes; then ++ CPPFLAGS="$CPPFLAGS -DENABLE_NLS" ++fi ++ + AC_ARG_ENABLE([ipv6], + [ --disable-ipv6 disable IPv6 support], + want_ipv6=$enableval, want_ipv6="yes") +--- shared/getopt.c Fri Nov 21 22:24:42 2008 ++++ shared/getopt.c Mon Feb 2 09:30:14 2009 +@@ -82,7 +82,7 @@ + + #ifndef _ + /* This is for other GNU distributions with internationalized messages. */ +-# if defined HAVE_LIBINTL_H || defined _LIBC ++# if (defined(HAVE_LIBINTL_H) || defined(_LIBC)) && defined(ENABLE_NLS) + # include <libintl.h> + # ifndef _ + # define _(msgid) gettext (msgid) +--- shared/output.c Tue Nov 25 20:11:00 2008 ++++ shared/output.c Mon Feb 2 09:30:14 2009 +@@ -61,7 +61,7 @@ + pthread_mutex_t logg_mutex = PTHREAD_MUTEX_INITIALIZER; + #endif + +-#ifdef C_LINUX ++#if defined(C_LINUX) && defined(ENABLE_NLS) + #include <libintl.h> + #include <locale.h> + diff --git a/extra/clamav/clamav.confd b/extra/clamav/clamav.confd new file mode 100644 index 000000000..0abb80c6e --- /dev/null +++ b/extra/clamav/clamav.confd @@ -0,0 +1,9 @@ +# Sample conf.d file for alpine linux + +# +# Specify daemon $OPTS here. +# + +OPTS="" +USER="nobody" +GROUP="nobody" diff --git a/extra/clamav/clamav.initd b/extra/clamav/clamav.initd new file mode 100644 index 000000000..980c53e72 --- /dev/null +++ b/extra/clamav/clamav.initd @@ -0,0 +1,39 @@ +#!/sbin/runscript + +# Sample init.d file for alpine linux. + +NAME= +DAEMON=/usr/sbin/$NAME + +depend() { + need net +} + +start() { + ebegin "Starting ${NAME}" + start-stop-daemon --start --quiet --background \ + --make-pidfile --pidfile /var/run/${NAME}.pid \ + --chuid ${USER}:${GROUP} \ + --exec ${DAEMON} -- ${OPTS} + eend $? +} + +stop() { + ebegin "Stopping ${NAME}" + start-stop-daemon --stop --quiet \ + --exec ${DAEMON} \ + --pidfile /var/run/${NAME}.pid \ + eend $? +} + +reload() { + ebegin "Reloading ${NAME}" + if ! service_started "${NAME}" ; then + eend 1 "${NAME} is not started" + return 1 + fi + start-stop-daemon --stop --oknodo --signal HUP \ + --exec ${DAEMON} --pidfile /var/run/${NAME}.pid + eend $? +} + diff --git a/extra/clamav/clamav.install b/extra/clamav/clamav.install new file mode 100644 index 000000000..8d427d916 --- /dev/null +++ b/extra/clamav/clamav.install @@ -0,0 +1,10 @@ +#!/bin/sh + +case "$1" in + post_install) + echo '*' + echo '* Adding new user clamav' + echo '*' + adduser -H -s /bin/false -D clamav 2>/dev/null + ;; +esac |