You are not logged in.

#1 2004-10-18 06:33:06

darose
Member
Registered: 2004-04-13
Posts: 158

[new package] Popfile bayesian spam filter (v0.22.0)

New package: Popfile bayesian spam filter daemon.  Awesome app.  I can't live without it.  Accuracy on my system:

Classification Accuracy
Messages classified:     4,880
Classification errors:     28
Accuracy:     99.42%

Not too shabby!

Posted to incoming as:  popfile-0.22.0-1.tar.gz

PKGBUILD:

# popfile email classifier/spam fighter

# Contributor: David Rosenstrauch <darose@darose.net>

pkgname=popfile
pkgver=0.22.0
pkgrel=1
pkgdesc="POPFile is an automatic mail classification tool. Once properly set up and trained, it will scan all email as it arrives and classify it based on your training."
url="http://popfile.sourceforge.net/"
license="GPL"
depends=(perl-timedate perl-html-tagset perl-dbi perl-html-template perl-dbd-sqlite2 sqlite2)
install=popfile.install
source=(http://dl.sourceforge.net/$pkgname/$pkgname-$pkgver.zip $pkgname ${pkgname}d $pkgname.conf)
#md5sums=()

build() {
  # move the source files into $startdir/src/$pkgname-$pkgver (but not the original zip or the daemon script)
  mkdir $startdir/tmp
  mv $startdir/src/* $startdir/tmp/
  mv $startdir/tmp/$pkgname-$pkgver.zip $startdir/src/
  mv $startdir/tmp/${pkgname}d $startdir/src/
  mv $startdir/tmp/$pkgname $startdir/src/
  mv $startdir/tmp/$pkgname.conf $startdir/src/
  install -D -m755 -d $startdir/src/$pkgname-$pkgver
  mv $startdir/tmp/* $startdir/src/$pkgname-$pkgver
  chmod 755 $startdir/src/$pkgname-$pkgver/$pkgname.pl
  rmdir $startdir/tmp

  cd $startdir/src/$pkgname-$pkgver
#  ./configure --prefix=/usr
#  make || return 1
#  make prefix=$startdir/pkg/usr install

  install -D -m755 ../${pkgname}d $startdir/pkg/etc/rc.d/${pkgname}d
  install -D -m755 ../$pkgname $startdir/pkg/usr/sbin/$pkgname
  install -D -m644 ../$pkgname.conf $startdir/pkg/etc/$pkgname.conf
  install -D -m755 -d $startdir/pkg/usr/share/$pkgname/
  install -D -m755 -d $startdir/pkg/var/lib/$pkgname/
  install -D -m755 -d $startdir/pkg/var/log/$pkgname/
  install -D -m755 -d $startdir/pkg/var/run/$pkgname/
  cp -r $startdir/src/$pkgname-$pkgver/* $startdir/pkg/usr/share/$pkgname/
}

Note:  popfile requires 2 new perl library packages, which I built as well:

#1:  Posted to incoming as:  perl-dbd-sqlite2-0.33-1a.tar.gz (should have been perl-dbd-sqlite2-0.33-1.tar.gz, but the upload failed for some reason)

PKGBUILD

# DBD::SQLite2 embeds the SQLite database engine into a DBD driver

# Contributor: David Rosenstrauch <darose@darose.net>

pkgname=perl-dbd-sqlite2
pkgver=0.33
pkgrel=1
pkgdesc="DBD::SQLite2 embeds the SQLite database engine into a DBD driver"
url="http://www.cpan.org/authors/id/M/MS/MSERGEANT/"
depends=(glibc perl-dbi)
source=(http://www.cpan.org/authors/id/M/MS/MSERGEANT/DBD-SQLite2-$pkgver.tar.gz) 
#md5sums=()

build() {
  cd $startdir/src/DBD-SQLite2-$pkgver
  /usr/bin/perl Makefile.PL DESTDIR=$startdir/pkg
  # ugly hack to make install location
  # compatible with newer versions of perl.
  # NOTE: if perl version changes from 5.8.5, change sed line too
  /bin/sed -i "s:5.8.5:current:g" Makefile
  /usr/bin/make || return 1
  /usr/bin/make install
  /bin/rm $startdir/pkg/usr/lib/perl5/current/${CARCH}-linux-thread-multi/perllocal.pod
  /bin/rm $startdir/pkg/usr/lib/perl5/site_perl/current/${CARCH}-linux-thread-multi/auto/DBD/SQLite2/.packlist
}

#2:  Posted to incoming as:  perl-html-template-2.7-1.tar.gz

PKGBUILD

# A Perl module to use HTML Templates

# Contributor: David Rosenstrauch <darose@darose.net>

pkgname=perl-html-template
pkgver=2.7
pkgrel=1
pkgdesc="A Perl module to use HTML Templates"
url="http://www.cpan.org/authors/id/S/SA/SAMTREGAR/"
depends=(perl)
source=(http://www.cpan.org/authors/id/S/SA/SAMTREGAR/HTML-Template-$pkgver.tar.gz) 
#md5sums=()

build() {
  cd $startdir/src/HTML-Template-$pkgver
  /usr/bin/perl Makefile.PL DESTDIR=$startdir/pkg
  # ugly hack to make install location
  # compatible with newer versions of perl.
  # NOTE: if perl version changes from 5.8.5, change sed line too
  /bin/sed -i "s:5.8.5:current:g" Makefile
  /usr/bin/make || return 1
  /usr/bin/make install
  /bin/rm $startdir/pkg/usr/lib/perl5/current/${CARCH}-linux-thread-multi/perllocal.pod
  /bin/rm $startdir/pkg/usr/lib/perl5/site_perl/current/${CARCH}-linux-thread-multi/auto/HTML/Template/.packlist
}

Please let me know any feedback.

DR

Offline

#2 2005-03-27 05:49:42

darose
Member
Registered: 2004-04-13
Posts: 158

Re: [new package] Popfile bayesian spam filter (v0.22.0)

Well, you need to grab the tar.gz files that I mentioned in my initial post.  Those contain the additional files you're looking for.  You can't just use the PKGBUILD by itself.

I had put all those archives up on incoming a while back (ftp://ftp.archlinux.org/incoming/) but the incoming archive seems to have disappeared right now.  (Not sure what that means ... has it been deleted?)

In any case, I'll put the pkgbuild archives you need up on my own web site for now.  You can grab them from here:

http://www.darose.net/perl-dbd-sqlite2.PKGBUILD.tar.gz
http://www.darose.net/perl-html-templat … ILD.tar.gz
http://www.darose.net/popfile.PKGBUILD.tar.gz

HTH.  Feel free to post back on the forum here if you have any problems with this.

DR

Offline

Board footer

Powered by FluxBB