diff options
Diffstat (limited to 'community/exim/PKGBUILD')
-rw-r--r-- | community/exim/PKGBUILD | 119 |
1 files changed, 119 insertions, 0 deletions
diff --git a/community/exim/PKGBUILD b/community/exim/PKGBUILD new file mode 100644 index 000000000..db94e4188 --- /dev/null +++ b/community/exim/PKGBUILD @@ -0,0 +1,119 @@ +# $Id: PKGBUILD 38427 2011-01-27 04:52:11Z angvp $ +# Maintainer: Angel Velasquez <angvp@archlinux.org> +# Maintainer: judd <jvinet@zeroflux.org> +pkgname=exim +pkgver=4.74 +pkgrel=1 +pkgdesc="A Message Transfer Agent" +arch=(i686 x86_64) +url="http://www.exim.org/" +license=('GPL') +backup=(etc/mail/aliases etc/mail/exim.conf \ + etc/logrotate.d/exim etc/conf.d/exim) +install=exim.install +depends=('db' 'pcre' 'pam' 'tcp_wrappers' 'openssl' 'libldap') +makedepends=('sudo') +provides=('smtp-server') +conflicts=('smtp-server') +options=('!makeflags') +source=(ftp://mirrors.24-7-solutions.net/pub/exim/ftp/exim/exim4/exim-${pkgver}.tar.bz2 + aliases + newaliases + exim + exim.logrotate + exim.conf.d) +md5sums=('1d9c189940909303d914bbc4247dc861' + '4874006f0585253ddab027d441009757' + 'ea39f58bffc16f5e3bbe59dffcf09449' + '9aed772e87223213e8da9ca5e7376869' + 'd788c26f86a9d72a0aebb3b849fe74f2' + 'b75fe4c6e960a59a25b5f51e8f61ba3a') + +build() { + # An exim user is required to build this + if [ ! `egrep '^exim' /etc/passwd` ]; then + echo "==> Adding user/group exim (temporarily)" + sudo groupadd -g 79 exim + sudo useradd -u 79 -g exim -d /var/spool/exim -s /bin/false exim + cleanup=1 + else + cleanup=0 + fi + + cd ${srcdir}/${pkgname}-${pkgver} + sed -i 's|tail -1|tail -n -1|g' scripts/Configure-config.h + # Make some configuration changes + sed 's|^BIN_DIRECTORY.*$|BIN_DIRECTORY=/usr/sbin|' src/EDITME | \ + sed 's|^CONFIGURE_FILE.*$|CONFIGURE_FILE=/etc/mail/exim.conf|' | \ + sed 's|^EXIM_USER.*$|EXIM_USER=exim|' | \ + sed 's|^COMPRESS_COMMAND.*$|COMPRESS_COMMAND=/bin/gzip|' | \ + sed 's|^ZCAT_COMMAND.*$|ZCAT_COMMAND=/bin/zcat|' | \ + sed 's|^CHOWN_COMMAND.*$|CHOWN_COMMAND=/bin/chown|' | \ + sed 's|^CHGRP_COMMAND.*$|CHGRP_COMMAND=/bin/chgrp|' | \ + sed 's|^EXIM_MONITOR.*$||' | \ + sed 's|^# MAX_NAMED_LIST.*$|MAX_NAMED_LIST=16|' | \ + sed 's|^# SUPPORT_MAILDIR.*$|SUPPORT_MAILDIR=yes|' | \ + sed 's|^# \(PID_FILE_PATH=/var\)/lock/exim.pid.*$|\1/run/exim.pid|' | \ + sed 's|^# TRANSPORT_LMTP=yes|TRANSPORT_LMTP=yes|' | \ + sed 's|^# LOOKUP_LDAP=yes|LOOKUP_LDAP=yes|' | \ + sed 's|^# LDAP_LIB_TYPE=OPENLDAP2|LDAP_LIB_TYPE=OPENLDAP2|' | \ + sed 's|^# LOOKUP_DSEARCH=yes|LOOKUP_DSEARCH=yes|' | \ + sed 's|^# AUTH_CRAM_MD5=yes$|AUTH_CRAM_MD5=yes|' | \ + sed 's|^# AUTH_PLAINTEXT=yes$|AUTH_PLAINTEXT=yes|' | \ + sed 's|^# AUTH_SPA=yes$|AUTH_SPA=yes|' | \ + sed 's|^# AUTH_DOVECOT=yes$|AUTH_DOVECOT=yes|' | \ + sed 's|^# SUPPORT_PAM=yes$|SUPPORT_PAM=yes|' | \ + sed 's|^# USE_TCP_WRAPPERS=yes$|USE_TCP_WRAPPERS=yes|' | \ + sed 's|^EXIM_GROUP.*$|EXIM_GROUP=exim|' | \ + sed 's|^# SUPPORT_TLS.*$|SUPPORT_TLS=yes|' | \ + sed 's|^# TLS_LIBS.*$|TLS_LIBS=-L/usr/lib -lssl -lcrypto|' | \ + sed 's|^# TLS_INCLUDE.*$|TLS_INCLUDE=-I/usr/include/openssl|' | \ + sed 's|^# WITH_CONTENT_SCAN.*$|WITH_CONTENT_SCAN=yes|' | \ + sed 's|^# WITH_OLD_DEMIME.*$|WITH_OLD_DEMIME=yes|' | \ + sed "s|^SYSTEM_ALIASES_FILE=/etc/aliases|SYSTEM_ALIASES_FILE=${pkgdir}/etc/mail/aliases|" | \ + sed 's|^# \(LOG_FILE_PATH=/var/log/exim\)_%slog.*$|\1/%slog|' >Local/Makefile + echo "HAVE_IPV6=YES" >> Local/Makefile + echo "LOOKUP_LIBS=-lldap" >> Local/Makefile + echo "EXTRALIBS_EXIM=-lwrap -lpam" >> Local/Makefile + make +} + +package() { + cd $srcdir/$pkgname-$pkgver + install -D -m644 ../exim.logrotate ${pkgdir}/etc/logrotate.d/exim + install -D -m644 ../exim.conf.d ${pkgdir}/etc/conf.d/exim + install -D -m644 doc/exim.8 ${pkgdir}/usr/share/man/man8/exim.8 + install -D -m755 ../exim ${pkgdir}/etc/rc.d/exim + mkdir -p ${pkgdir}/var/spool/exim/db ${pkgdir}/etc/mail \ + ${pkgdir}/var/log/exim ${pkgdir}/usr/{lib,sbin} + chown root.exim ${pkgdir}/var/spool/exim ${pkgdir}/var/log/exim + chown exim.exim ${pkgdir}/var/spool/exim/db + chmod 770 ${pkgdir}/var/spool/exim ${pkgdir}/var/spool/exim/db ${pkgdir}/var/log/exim + cd build-Linux-* + inst_dest=${pkgdir}/usr/sbin inst_conf=${pkgdir}/etc/mail/exim.conf ../scripts/exim_install + cd ${srcdir}/exim-${pkgver}/src + sed "s|/etc/aliases|/etc/mail/aliases|g" configure.default | \ + sed "s|SYSTEM_ALIASES_FILE|/etc/mail/aliases|g" \ + >${pkgdir}/etc/mail/exim.conf + + cp ${srcdir}/aliases ${pkgdir}/etc/mail + cp ${srcdir}/newaliases ${pkgdir}/usr/sbin + cd ${pkgdir}/usr/sbin + ln -s exim mailq + ln -s exim rmail + ln -s exim rsmtp + ln -s exim runq + ln -s exim sendmail + # fhs compliancy + ln -s ../sbin/exim ../lib/sendmail + + mkdir -p ${pkgdir}/etc/rc.d + cp ${srcdir}/exim ${pkgdir}/etc/rc.d + + + if [ $cleanup -eq 1 ]; then + echo "==> Removing user/group exim" + sudo userdel exim + fi + return 0 +} |