# $Id: PKGBUILD 75460 2010-04-01 16:56:22Z giovanni $ # Maintainer: Sven-Hendrik Haase # Contributor: tobias # Contributor: Tobias Kieslich # ----------- NOTE TO ALL USERS ------------ # Go read http://www.courier-mta.org/install.html b4 running or building courier pkgname=courier-mta pkgver=0.66.1 pkgrel=3 pkgdesc="IMAP(s)/POP3(s) and SMTP Server with ML-manager, webmail and webconfig" arch=(i686 x86_64 'mips64el') license=('GPL2') backup=('etc/courier/imapd.cnf' 'etc/courier/pop3d.cnf' \ 'etc/courier/imapd' 'etc/courier/imapd-ssl' \ 'etc/courier/pop3d' 'etc/courier/pop3d-ssl' \ 'etc/courier/courierd' 'etc/courier/sqwebmaild' \ 'etc/courier/esmtpd' 'etc/courier/esmtpd-ssl' \ 'etc/courier/esmtpd.cnf' 'etc/courier/esmtpd-msa' \ 'etc/courier/webadmin/password' 'etc/courier/esmtpauthclient' \ 'etc/conf.d/courier-mta') url="http://courier-mta.org" depends=('courier-authlib>=0.63.0' 'fam' 'gcc-libs' 'gdbm' 'pcre' 'mime-types' 'ca-certificates') optdepends=('libldap') makedepends=('apache>=2.2.9-3' 'pam>=1.0.1-2' 'expect' 'gnupg' 'libldap' 'fam') provides=('smtp-server' 'smtp-forwarder' 'imap-server' 'pop3-server' 'courier-imap' 'courier-maildrop') conflicts=('courier-imap' 'smtp-forwarder' 'smtp-server' 'imap-server' 'courier-maildrop' 'ucspi-tcp') options=('!libtool') install=courier-mta.install source=(http://downloads.sourceforge.net/project/courier/courier/${pkgver}/courier-${pkgver}.tar.bz2 courier-mta.rc.d courier-mta.conf.d esmtpd.rc.d esmtpd-ssl.rc.d imapd.rc.d imapd-ssl.rc.d pop3d.rc.d pop3d-ssl.rc.d webmaild.rc.d) md5sums=('79250d71d88ba2bcb630b7356f0250cd' 'e140f320968e57cfe459cd7a3b4017e0' 'f3ff70b40c7a1f7a017e8c4cc4d92f4f' '799ddd56ff6c9cff132e8c771dde23d9' 'c3b634ea6a671b660bf6a660cef57138' 'd7c951a7e55674778077d5123ec41006' 'dabac9fa0e46872049c02ef6bf83b1f0' '6e9e176eb966759a1f2e3838fccf4e3c' '5c0ddedca1cf2298182dbbb461c189bf' 'ec5c0383d617c1f4877ebba9a9727ef4') # MIGRATION NOTE: # In 2012, support for courier-mta.conf.d and courier-mta.rc.d will be removed. # Remove those files and this note and also courier-mta.install build() { cd ${srcdir}/courier-${pkgver} # fix a tiny bug sed -i -e \ 's|--with-authchangepwdir=/var/tmp/dev/null|--with-authchangepwdir=$libexecdir/authlib|' \ configure && chmod 755 configure # courier is more about configuring than compiling :-), lets start the mess ./configure --prefix=/usr \ --sysconfdir=/etc/courier \ --libdir=/usr/lib \ --libexecdir=/usr/lib \ --localstatedir=/var/spool/courier \ --disable-root-check \ --enable-unicode \ --enable-workarounds-for-imap-client-bugs \ --enable-mimetypes=/etc/mime.types \ --with-piddir=/var/run/courier \ --with-locking-method=lockf \ --with-trashquota \ --with-db=gdbm \ --with-trashquota \ --with-random=/dev/urandom --without-ispell \ --with-mailuser=courier --with-mailgroup=courier \ --with-certdb=/etc/ssl/certs/ make } package() { cd ${srcdir}/courier-${pkgver} #chown mail.mail ${pkgdir}/var/spool/courier make DESTDIR=${pkgdir} install # docs say we can get rid of those after make find ${pkgdir} -name '*\.a' -exec -rm -f {} \; # install the perftest-script for testings install -Dm755 courier/perftest1 ${pkgdir}/usr/lib/courier/perftest1 ############################################################################### # this is what usually "make install-configure" does # *.dist files get rid of "dist" for distfile in ${pkgdir}/etc/courier/*.dist; do mv ${distfile} ${pkgdir}/etc/courier/$(basename ${distfile} .dist) done # install pam files according to the layout used in Archlinux for pamfile in ${pkgdir}/etc/courier/*.authpam; do sed -i 's|/lib/security/pam_pwdb\.so|pam_unix.so|' ${pamfile} #echo "password required pam_unix.so" >> $pamfile install -Dm 644 ${pamfile} \ ${pkgdir}/etc/pam.d/$(basename ${pamfile} .authpam | sed "s/d$//") rm -f ${pamfile} done ############################################################################### # Arch Linux specific tweaks to make things easier for the user # create passwordfile for webadmin -> standard archwebadmin sed -i 's|/etc/courier/webadmin/password|$(DESTDIR)/etc/courier/webadmin/password|g' Makefile yes "archwebadmin" | make DESTDIR=${pkgdir} install-webadmin-password # arch specific scripts install -Dm 644 ${srcdir}/${pkgname}.conf.d ${pkgdir}/etc/conf.d/courier-mta install -Dm 755 ${srcdir}/${pkgname}.rc.d ${pkgdir}/etc/rc.d/courier-mta install -D -m 755 ${srcdir}/imapd.rc.d ${pkgdir}/etc/rc.d/imapd install -D -m 755 ${srcdir}/imapd-ssl.rc.d ${pkgdir}/etc/rc.d/imapd-ssl install -D -m 755 ${srcdir}/pop3d.rc.d ${pkgdir}/etc/rc.d/pop3d install -D -m 755 ${srcdir}/pop3d-ssl.rc.d ${pkgdir}/etc/rc.d/pop3d-ssl install -D -m 755 ${srcdir}/esmtpd.rc.d ${pkgdir}/etc/rc.d/imapd-ssl install -D -m 755 ${srcdir}/esmtpd-ssl.rc.d ${pkgdir}/etc/rc.d/pop3d install -D -m 755 ${srcdir}/webmaild.rc.d ${pkgdir}/etc/rc.d/pop3d-ssl #install -Dm 655 ${srcdir}/courier-webmail-cleancache.cron.hourly \ # ${pkgdir}/etc/cron.hourly/courier-webmail-cleancache # bug http://bugs.archlinux.org/task/5154 find ${pkgdir}/usr/lib -name '*\.a' -exec rm -f {} \; # fixing some permissions chown -R courier:courier ${pkgdir}/usr/lib/courier/modules rm -r ${pkgdir}/var/run #chown -R courier:courier ${pkgdir}/var/run/courier chown root:root ${pkgdir}/usr/{.,bin,lib,sbin,share} # make a link to /usr/sbin/sendmail install -dm 755 ${pkgdir}/usr/sbin cd ${pkgdir}/usr/sbin ln -s ../bin/sendmail ./sendmail }