updated on Wed Jan 25 20:08:56 UTC 2012
[aur-mirror.git] / mailman-pgp-smime / PKGBUILD
blobc69aa56b61d0be4326985e1e516d267655f19584
1 _pkgname=mailman
2 pkgname=${_pkgname}-pgp-smime
3 _pkgver=2.1.13
4 patchver=2010-09-08
5 pkgver=${_pkgver}+20100908
6 pkgrel=1
7 pkgdesc="Mailing list manager with built in web access and experimental support for signed and encrypted lists"
8 conflicts=(${_pkgname})
9 provides=(${_pkgname}=${_pkgver})
10 arch=('i686' 'x86_64')
11 license=('GPL')
12 url="http://non-gnu.uvt.nl/mailman-pgp-smime/"
13 depends=('python2' 'python-gnupginterface' 'smtp-server')
14 makedepends=('autoconf')
15 # 'Defaults.py' should not be changed by users; 'mm_cfg.py' should instead.
16 backup=('usr/lib/mailman/Mailman/mm_cfg.py')
17 install=${_pkgname}.install
18 source=(http://ftp.gnu.org/gnu/${_pkgname}/${_pkgname}-${_pkgver}.tgz
19         http://non-gnu.uvt.nl/pub/mailman/${_pkgname}-${_pkgver}-pgp-smime_$patchver.patch.gz
20         mailman-userfix.patch
21         mailman-2.1-build.patch
22         rc.mailman)
23 md5sums=('3235323ccb3e0135c10b7c66a440390b'
24          'b0070812b16fd808d508a36ba6ccf27e'
25          '345e2a6351c0da9f22adec39c428d402'
26          'ed04d062379eb21e39ce1e70e6b1ade2'
27          '3d83d06d0ec3319bf3c7d9df5d18e89f')
29 build() {
30   cd $srcdir
31   rm -rf $pkgname-${_pkgver}
32   cp -r ${_pkgname}-${_pkgver} $pkgname-${_pkgver}
34   cd $pkgname-${_pkgver}
36   # fix calls to /usr/bin/python
37   find . -name '*.py' | xargs sed -i 's@^#!.*python$@#!/usr/bin/python2@'
39   # this fixes the build without the mailman user and group
40   patch -Np1 -i ${srcdir}/mailman-userfix.patch
42   # fix directory permissions to satisfy check_perms
43   patch -Np1 -i ${srcdir}/mailman-2.1-build.patch
45   # apply pgp/smime patch
46   patch -Np1 -i $srcdir/${_pkgname}-${_pkgver}-pgp-smime_$patchver.patch
49   autoreconf
51   ./configure --without-permcheck \
52               --prefix=/usr/lib/mailman \
53               --with-var-prefix=/var/lib/mailman \
54               --with-mail-gid=mailman \
55               --with-cgi-gid=http --with-python=/usr/bin/python2
57   make
60 package() {
61   cd $srcdir/$pkgname-${_pkgver}
62   make DESTDIR=$pkgdir install
64   # let's follow Fedora FHS way; Gentoo does it the other way round
66   # Create a link so that the config file mm_cfg.py appears in config
67   # directory /etc/mailman. We don't put mm_cfg.py in the config directory
68   # because its executable code (python file) and the security policy wants
69   # to keep executable code out of /etc and inside of a lib directory instead,
70   # and because traditionally mm_cfg.py was in the Mailman subdirectory and
71   # experienced mailman admins will expect to find it there. But having it
72   # "appear" in the config directory is good practice and heading in the
73   # right direction for FHS compliance.
74   install -d -m755 ${pkgdir}/etc/${_pkgname}
75   ln -sv /usr/lib/mailman/Mailman/mm_cfg.py ${pkgdir}/etc/${_pkgname}/mm_cfg.py
77   # fix some permissions to satisfy check_perms
78   chown -R 80:80 $pkgdir/{usr/lib/mailman,var/lib/mailman,etc/mailman/*}
79   chown http:80 ${pkgdir}/var/lib/mailman/archives/private
80   chmod 2770 ${pkgdir}/var/lib/mailman/archives/private
81   chmod 2755 ${pkgdir}/usr/lib/mailman/cgi-bin/* 
82   chmod 2755 ${pkgdir}/usr/lib/mailman/mail/mailman
83   
84   # install the launch script
85   install -D -m755 $srcdir/rc.mailman $pkgdir/etc/rc.d/mailman || return 1