u-boot-bug: Drop do_stage (not needed), add package_stagefile_shell to deploy
[openembedded.git] / recipes / bogofilter / bogofilter_0.96.6.bb
blobeb930eb249802a1710319e42cc6bad09cd855e18
1 SECTION = "console/network"
2 DEPENDS = "virtual/db"
3 RDEPENDS_${PN} = "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 = "r9"
9 PRIORITY = "optional"
11 SRC_URI = "http://launchpad.net/bogofilter/main/0.96.6/+download/bogofilter-0.96.6.tar.gz;name=src \
12 file://configure.ac.patch \
13 file://volatiles \
14 file://postfix-filter.sh \
15 file://bogohelper.sh "
16 SRC_URI[src.md5sum] = "7e8e9593662f6394a56f99f12f525d6e"
17 SRC_URI[src.sha256sum] = "0b12fdd5b0bc50b582327764ee5cd415809db6d7adc233f1801bc0d0bf435a6d"
20 inherit autotools
22 EXTRA_OECONF = "--with-libdb-prefix=${libdir}"
24 do_install_append () {
25 mkdir -p ${D}${sysconfdir}/default/volatiles
26 install -m 644 ${WORKDIR}/volatiles ${D}${sysconfdir}/default/volatiles/01_bogofilter
27 install -m 755 ${WORKDIR}/postfix-filter.sh ${D}${bindir}/postfix-filter.sh
28 install -m 755 ${WORKDIR}/bogohelper.sh ${D}${bindir}/bogohelper.sh
31 pkg_postinst () {
32 grep filter /etc/group || addgroup filter
33 grep spam /etc/passwd || adduser --disabled-password --home=/var/spool/filter --ingroup filter -g "Bogofilter" spam
34 grep bogo /etc/passwd || adduser --disabled-password --home=/home/bogo --ingroup filter -g "Bogofilter" bogo
35 [ -f "/etc/postfix/master.cf" ] && grep "/usr/bin/postfix-filter.sh" /etc/postfix/master.cf || {
36 echo "bogofilter unix - n n - - pipe" >> /etc/postfix/master.cf
37 echo " flags=R user=bogo argv=/usr/bin/postfix-filter.sh -f ${sender} -- ${recipient}" >> /etc/postfix/master.cf
39 /etc/init.d/populate-volatile.sh update