updated on Thu Jan 19 20:01:47 UTC 2012
[aur-mirror.git] / exim-mysql / PKGBUILD
blob3f99771a0c278d0a68c7ffb407f09303747db44c
1 #################################################
2 # Based on exim
3 # Maintainer: Angel Velasquez <angvp@archlinux.org>
4 # Maintainer: judd <jvinet@zeroflux.org>
5 #################################################
6 # exim-mysql
7 # Maintainer: Ian K Armstrong <ian.k.armstrong@openmail.cc>
9 # dependencies added: libmysqlclient, libspf2, sqlite3
11 ################################################# 
12 pkgname=exim-mysql
13 pkgver=4.77
14 pkgrel=1
15 pkgdesc="A Message Transfer Agent with MySQL and sqlite3 support"
16 arch=('i686' 'x86_64')
17 url="http://www.exim.org/"
18 license=('GPL')
19 backup=(etc/mail/aliases etc/mail/exim.conf etc/logrotate.d/exim etc/conf.d/exim)
20 install=exim.install
21 depends=('db' 'pcre' 'pam' 'tcp_wrappers' 'openssl' 'libmysqlclient' 'libspf2' 'sqlite3')
22 makedepends=('sudo')
23 provides=('smtp-server')
24 conflicts=('smtp-server')
25 options=('!makeflags')
26 source=(ftp://mirrors.24-7-solutions.net/pub/exim/ftp/exim/exim4/exim-${pkgver}.tar.bz2
27         aliases 
28         newaliases 
29         exim 
30         exim.logrotate 
31         exim.conf.d)
32 md5sums=('5d746275f2cc85845567f9d5eb84a57a'
33          '4874006f0585253ddab027d441009757'
34          'ea39f58bffc16f5e3bbe59dffcf09449'
35          '9aed772e87223213e8da9ca5e7376869'
36          'e18a535218718c5eb394ed5c9296fe06'
37          'b75fe4c6e960a59a25b5f51e8f61ba3a')
39 build() {
40   # An exim user is required to build this
41   if [ ! `egrep '^exim' /etc/passwd` ]; then
42     echo "==> Adding user exim"
43     sudo useradd -u 79 -g exim -d /var/spool/exim -s /bin/false exim
44   fi
46   # An exim group is required to build this
47   if [ ! `egrep '^exim' /etc/group` ]; then
48     echo "==> Adding group exim"
49     sudo groupadd -g 79 exim
50   fi
51   
52   cd ${srcdir}/exim-${pkgver}
53   echo "
54 BIN_DIRECTORY=/usr/sbin
55 CONFIGURE_FILE=/etc/mail/exim.conf
56 EXIM_USER=exim
57 EXIM_GROUP=exim
58 SPOOL_DIRECTORY=/var/spool/exim
59 INCLUDE=-I/usr/include
60 ROUTER_ACCEPT=yes
61 ROUTER_DNSLOOKUP=yes
62 ROUTER_IPLITERAL=yes
63 ROUTER_MANUALROUTE=yes
64 ROUTER_QUERYPROGRAM=yes
65 ROUTER_REDIRECT=yes
66 TRANSPORT_APPENDFILE=yes
67 TRANSPORT_AUTOREPLY=yes
68 TRANSPORT_PIPE=yes
69 TRANSPORT_SMTP=yes
70 SUPPORT_MAILDIR=yes
71 LOOKUP_DBM=yes
72 LOOKUP_LSEARCH=yes
73 LOOKUP_MYSQL=yes
74 LOOKUP_SQLITE=yes
75 PCRE_LIBS=-lpcre
76 LOOKUP_INCLUDE=-I /usr/include/mysql
77 LOOKUP_LIBS=-L/usr/lib -lmysqlclient -lsqlite3
78 WITH_CONTENT_SCAN=yes
79 EXPERIMENTAL_SPF=yes
80 CFLAGS  += -I/usr/include/spf2
81 LDFLAGS += -lspf2
82 FIXED_NEVER_USERS=root
83 AUTH_CRAM_MD5=yes
84 AUTH_DOVECOT=yes
85 AUTH_PLAINTEXT=yes
86 AUTH_SPA=yes
87 HEADERS_CHARSET=\"UTF-8\"
88 SUPPORT_TLS=yes
89 TLS_LIBS=-L/usr/lib -lssl -lcrypto
90 TLS_INCLUDE=-I/usr/include/openssl
91 LOG_FILE_PATH=/var/log/exim/%slog
92 COMPRESS_COMMAND=/bin/gzip
93 COMPRESS_SUFFIX=gz
94 ZCAT_COMMAND=/bin/zcat
95 SUPPORT_PAM=yes
96 CFLAGS=-O -I/usr/include
97 EXTRALIBS_EXIM=-L/usr/lib -lwrap -lpam
98 SYSTEM_ALIASES_FILE=/etc/mail/aliases
99 CHOWN_COMMAND=/bin/chown
100 CHGRP_COMMAND=/bin/chgrp
101 CHMOD_COMMAND=/bin/chmod
102 MV_COMMAND=/bin/mv
103 RM_COMMAND=/bin/rm
104 TOUCH_COMMAND=/bin/touch
105 PERL_COMMAND=/usr/bin/perl
106 TMPDIR=\"/tmp\"
107 PID_FILE_PATH=/var/run/exim.pid
108 MAX_NAMED_LIST=16
109 SUPPORT_MOVE_FROZEN_MESSAGES=yes">"Local/Makefile"
110 make
113 package() {
114   cd $srcdir/exim-$pkgver
115   install -D -m644 ../exim.logrotate ${pkgdir}/etc/logrotate.d/exim
116   install -D -m644 ../exim.conf.d ${pkgdir}/etc/conf.d/exim
117   install -D -m644 doc/exim.8 ${pkgdir}/usr/share/man/man8/exim.8
118   install -D -m755 ../exim ${pkgdir}/etc/rc.d/exim
119   mkdir -p ${pkgdir}/var/spool/exim/db ${pkgdir}/etc/mail \
120     ${pkgdir}/var/log/exim ${pkgdir}/usr/{lib,sbin}
121   chown root.exim ${pkgdir}/var/spool/exim ${pkgdir}/var/log/exim
122   chown exim.exim ${pkgdir}/var/spool/exim/db
123   chmod 770 ${pkgdir}/var/spool/exim ${pkgdir}/var/spool/exim/db ${pkgdir}/var/log/exim
124   cd build-Linux-*
125   inst_dest=${pkgdir}/usr/sbin inst_conf=${pkgdir}/etc/mail/exim.conf ../scripts/exim_install
126   cd ${srcdir}/exim-${pkgver}/src
127   sed "s|/etc/aliases|/etc/mail/aliases|g" configure.default | \
128     sed "s|SYSTEM_ALIASES_FILE|/etc/mail/aliases|g" \
129     >${pkgdir}/etc/mail/exim.conf
131   cp ${srcdir}/aliases ${pkgdir}/etc/mail
132   cp ${srcdir}/newaliases ${pkgdir}/usr/sbin
133   cd ${pkgdir}/usr/sbin
134   ln -s exim mailq
135   ln -s exim rmail
136   ln -s exim rsmtp
137   ln -s exim runq
138   ln -s exim sendmail
139   # fhs compliancy
140   ln -s ../sbin/exim ../lib/sendmail
142   mkdir -p ${pkgdir}/etc/rc.d
143   cp ${srcdir}/exim ${pkgdir}/etc/rc.d
145   return 0