PKGBUILDs/extra/mailman/PKGBUILD

65 lines
2.1 KiB
Bash
Raw Normal View History

2009-10-10 02:23:22 +00:00
# $Id: PKGBUILD 19304 2008-11-20 02:45:32Z allan $
# Maintainer: Paul Mattal <paul@archlinux.org>
pkgname=mailman
pkgver=2.1.11
pkgrel=2
pkgdesc="Mailing list manager with built in web access"
arch=(i686 x86_64)
license=('GPL')
url="http://www.list.org/"
depends=('python24' 'apache' 'smtp-server')
# 'Defaults.py' should not be changed by users; 'mm_cfg.py' should instead.
backup=('home/mailman/Mailman/mm_cfg.py')
install=$pkgname.install
source=(http://ftp.gnu.org/gnu/$pkgname/$pkgname-$pkgver.tgz \
rc.mailman)
md5sums=('d9fd89f54c4743dbcb3b3eec8c6146d6' 'a617b32a2564fce2641a7c7b660ef6cd')
build() {
cd $startdir/src/$pkgname-$pkgver || return 1
# the mailman user and group are required to build
if [ ! `egrep '^mailman' /etc/passwd` ]; then
msg "Adding user/group mailman (temporarily)"
groupadd -g 80 mailman || return 1
sleep 2
useradd -u 80 -g mailman -d /home/mailman -s /bin/false mailman \
|| return 1
mkdir -p /home/mailman || return 1
chown mailman.mailman /home/mailman || return 1
chmod a+rx,g+ws /home/mailman || return 1
cleanup=1
else
cleanup=0
fi
# set permissions and ownership on the target directory
mkdir -p $startdir/pkg/home/mailman || return 1
chown mailman.mailman $startdir/pkg/home/mailman || return 1
chmod a+rx,g+ws $startdir/pkg/home/mailman || return 1
# configure and build
./configure --without-permcheck --prefix=/home/mailman --with-cgi-gid=http \
--with-python=/usr/bin/python2.4 || return 1
make || return 1
make DESTDIR=$startdir/pkg prefix=/home/mailman var_prefix=/home/mailman \
install || return 1
for file in Mailman/Post.py \
Mailman/Archiver/pipermail.py \
bin/msgfmt.py \
tests/fblast.py \
tests/onebounce.py; do
sed -i "s#env python#env python2.4#" $pkgdir/home/mailman/$file
done
# install the launch script
install -D -m755 $startdir/src/rc.mailman $startdir/pkg/etc/rc.d/mailman \
|| return 1
if [ $cleanup -eq 1 ]; then
msg "Removing user/group mailman"
userdel mailman
rmdir /home/mailman
fi
}