Merge branch 'org.openembedded.dev' of git://git.openembedded.net/openembedded into...
[vuplus_openembedded] / packages / bogofilter / bogofilter_0.96.0.bb
1 SECTION = "console/network"
2 DEPENDS = "virtual/db"
3 RDEPENDS = "glibc-gconv glibc-gconv-iso8859-1"
4 DESCRIPTION = "Bogofilter is a mail filter that classifies mail as spam or ham (non-spam) \
5 by a statistical analysis of the message's header and content (body). \
6 The program is able to learn from the user's classifications and corrections."
7 LICENSE = "GPL"
8 PR = "r7"
9 PRIORITY = "optional"
10
11 SRC_URI = "http://download.sourceforge.net/bogofilter/bogofilter-${PV}.tar.bz2 \
12            file://${FILESDIR}/configure.ac.patch;patch=1 \
13            file://volatiles \
14            file://postfix-filter.sh \
15            file://bogohelper.sh \
16            "
17
18 inherit autotools
19
20 EXTRA_OECONF = "--with-libdb-prefix=${libdir}"
21
22 do_install_append () {
23         mkdir -p ${D}${sysconfdir}/default/volatiles
24         install -m 644 ${WORKDIR}/volatiles ${D}${sysconfdir}/default/volatiles/01_bogofilter
25         install -m 755 ${WORKDIR}/postfix-filter.sh ${D}${bindir}/postfix-filter.sh
26         install -m 755 ${WORKDIR}/bogohelper.sh ${D}${bindir}/bogohelper.sh
27 }
28
29 pkg_postinst () {
30         grep filter /etc/group || addgroup filter
31         grep spam /etc/passwd || adduser --disabled-password --home=/var/spool/filter --ingroup filter -g "Bogofilter" spam
32         grep bogo /etc/passwd || adduser --disabled-password --home=/home/bogo --ingroup filter -g "Bogofilter" bogo
33         [ -f "/etc/postfix/master.cf" ] && grep "/usr/bin/postfix-filter.sh" /etc/postfix/master.cf || {
34           echo "bogofilter unix -       n       n       -       -       pipe" >> /etc/postfix/master.cf
35           echo "  flags=R user=bogo argv=/usr/bin/postfix-filter.sh -f ${sender} -- ${recipient}" >> /etc/postfix/master.cf
36           }
37         /etc/init.d/populate-volatile.sh update
38 }