summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohn Lane2015-06-09 17:34:55 +0100
committerJohn Lane2015-06-09 17:34:55 +0100
commit5a4bbce966a5ab3ddde5cd2bac2470f0a74b3275 (patch)
tree12b92bc1af07c4da281bd5456d295b5642ec67e9
downloadaur-5a4bbce966a5ab3ddde5cd2bac2470f0a74b3275.tar.gz
Initial import
-rw-r--r--.AURINFO28
-rw-r--r--.SRCINFO32
-rw-r--r--PKGBUILD80
-rw-r--r--cyrus-imapd.install63
-rw-r--r--cyrus-master-conf.d1
-rw-r--r--cyrus-master.service11
6 files changed, 215 insertions, 0 deletions
diff --git a/.AURINFO b/.AURINFO
new file mode 100644
index 00000000000..b08f45ce51e
--- /dev/null
+++ b/.AURINFO
@@ -0,0 +1,28 @@
+pkgbase = cyrus-imapd
+ pkgdesc = Cyrus IMAP mail server
+ pkgver = 2.5.3
+ pkgrel = 1
+ url = http://www.cyrusimap.org/
+ install = cyrus-imapd.install
+ arch = i686
+ arch = x86_64
+ arch = armv6h
+ license = custom
+ depends = cyrus-sasl
+ depends = db
+ depends = libsasl
+ depends = perl
+ provides = imap-server
+ provides = pop3-server
+ conflicts = imap-server
+ conflicts = pop3-server
+ source = ftp://ftp.cyrusimap.org/cyrus-imapd/cyrus-imapd-2.5.3.tar.gz
+ source = cyrus-master-conf.d
+ source = cyrus-imapd.install
+ source = cyrus-master.service
+ options = !makeflags
+ backup = etc/cyrus/cyrus.conf
+ backup = etc/cyrus/imapd.conf
+
+pkgname = cyrus-imapd
+
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 00000000000..1699824a401
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,32 @@
+pkgbase = cyrus-imapd
+ pkgdesc = Cyrus IMAP mail server
+ pkgver = 2.5.3
+ pkgrel = 1
+ url = http://www.cyrusimap.org/
+ install = cyrus-imapd.install
+ arch = i686
+ arch = x86_64
+ arch = armv6h
+ license = custom
+ depends = cyrus-sasl
+ depends = db
+ depends = libsasl
+ depends = perl
+ provides = imap-server
+ provides = pop3-server
+ conflicts = imap-server
+ conflicts = pop3-server
+ options = !makeflags
+ backup = etc/cyrus/cyrus.conf
+ backup = etc/cyrus/imapd.conf
+ source = ftp://ftp.cyrusimap.org/cyrus-imapd/cyrus-imapd-2.5.3.tar.gz
+ source = cyrus-master-conf.d
+ source = cyrus-imapd.install
+ source = cyrus-master.service
+ sha256sums = 9ea6fcedf4a2b560cfcdffe90e65c31ba6007dee3c79425e5445988990acb3d8
+ sha256sums = 6b55becbb58ceb66408de19fb6465e4364bf16528d0caa8b756c4316d88419dc
+ sha256sums = 1c6054397b84866831ccc1647d154365cb46158d6d6b162f08bc205edda7119a
+ sha256sums = d5e3f64aff773fb75d5221d567064741a0846849ead6de64d37255e59533c027
+
+pkgname = cyrus-imapd
+
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 00000000000..c70071b7fda
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,80 @@
+# Maintainer: John Lane <archlinux at jelmail dot com>
+# Previously: Fisher Duan <steamedfish@njuopen.com> Ryan Corder <ryanc@greengrey.org>
+
+pkgname=cyrus-imapd
+pkgver=2.5.3
+pkgrel=1
+pkgdesc="Cyrus IMAP mail server"
+arch=('i686' 'x86_64' 'armv6h')
+url="http://www.cyrusimap.org/"
+license=('custom')
+depends=('cyrus-sasl' 'db' 'libsasl' 'perl')
+provides=('imap-server' 'pop3-server')
+conflicts=('imap-server' 'pop3-server')
+options=('!makeflags')
+backup=(etc/cyrus/cyrus.conf etc/cyrus/imapd.conf)
+install="$pkgname.install"
+source=(ftp://ftp.cyrusimap.org/cyrus-imapd/$pkgname-$pkgver.tar.gz
+ 'cyrus-master-conf.d'
+ 'cyrus-imapd.install'
+ 'cyrus-master.service')
+sha256sums=('9ea6fcedf4a2b560cfcdffe90e65c31ba6007dee3c79425e5445988990acb3d8'
+ '6b55becbb58ceb66408de19fb6465e4364bf16528d0caa8b756c4316d88419dc'
+ '1c6054397b84866831ccc1647d154365cb46158d6d6b162f08bc205edda7119a'
+ 'd5e3f64aff773fb75d5221d567064741a0846849ead6de64d37255e59533c027')
+
+build() {
+ cd $srcdir/$pkgname-$pkgver
+
+ CFLAGS=-fPIC ./configure \
+ --prefix=/usr \
+ --includedir=/usr/include/cyrus --mandir=/usr/share/man \
+ --docdir=/usr/share/doc/cyrus \
+ --datadir=/usr/share/cyrus --sysconfdir=/etc/cyrus \
+ --localstatedir=/var/lib/cyrus \
+ --sharedstatedir=/usr/share/cyrus \
+ --enable-murder --enable-nntp --enable-replication \
+ --enable-idled \
+ --with-cyrus-user=cyrus --with-cyrus-group=mail \
+ --with-pidfile=/var/run/cyrmaster.pid \
+ --with-syslogfacility=MAIL \
+ --with-cyrus-prefix=/usr/lib/cyrus \
+ --without-libwrap \
+ --exec-prefix=/usr --libexecdir=/usr/sbin
+
+ make
+}
+
+package() {
+ cd $srcdir/$pkgname-$pkgver
+
+ make DESTDIR="${pkgdir}" install
+
+ # create required directories first
+ mkdir -m 0755 -p $pkgdir/usr/lib/systemd/system
+ mkdir -m 0755 -p $pkgdir/usr/include/cyrus
+ mkdir -m 0755 -p $pkgdir/etc/cyrus
+ mkdir -m 0755 -p $pkgdir/etc/conf.d
+ mkdir -m 0755 -p $pkgdir/etc/rc.d
+
+ # rename master.8 so it doesn't conflict with master.8 from Postfix
+ mv $pkgdir/usr/share/man/man8/master.8 $pkgdir/usr/share/man/man8/cyrus-master.8
+
+ # move cyradm to standard location
+ mv $pkgdir/usr/bin/site_perl/cyradm $pkgdir/usr/bin/cyradm
+ rmdir $pkgdir/usr/bin/site_perl
+
+ # install configs, rc scripts, etc
+ install -m 600 $srcdir/$pkgname-$pkgver/master/conf/normal.conf \
+ $pkgdir/etc/cyrus/cyrus.conf
+ echo "# see imapd.conf(5) man page for correct setup of this file" >> \
+ $pkgdir/etc/cyrus/imapd.conf
+ chmod 600 $pkgdir/etc/cyrus/imapd.conf
+ install -m 644 $srcdir/cyrus-master-conf.d $pkgdir/etc/conf.d/cyrus-master
+ install -m 644 $srcdir/cyrus-master.service \
+ $pkgdir/usr/lib/systemd/system/cyrus-master.service
+ install -Dm 644 $srcdir/$pkgname-$pkgver/COPYING \
+ $pkgdir/usr/share/licenses/$pkgname/COPYING
+ install -Dm 644 $srcdir/$pkgname-$pkgver/README \
+ $pkgdir/usr/share/doc/$pkgname/README
+}
diff --git a/cyrus-imapd.install b/cyrus-imapd.install
new file mode 100644
index 00000000000..5147157b5ca
--- /dev/null
+++ b/cyrus-imapd.install
@@ -0,0 +1,63 @@
+# $Id: $
+#
+# Description: post-install script for cyrus-imapd
+# Contributor: Ryan Corder <ryanc@greengrey.org>
+#
+
+# arg 1: new package version
+post_install() {
+ # create cyrus user
+ if [ -z "`grep '^cyrus:' /etc/passwd`" ]; then
+ useradd -d /var/spool/imap -g mail -s /bin/false cyrus
+ else
+ usermod -s /bin/false cyrus
+ fi
+
+ # all kinds of directories needed for the IMAP spool
+ for subdir in imap/{,db,log,msg,proc,socket,sieve} spool/imap/{,stage.}; do
+ if [ ! -d /var/${subdir} ]; then
+ mkdir -m 0750 -p "/var/${subdir}"
+ fi
+ done
+ for subdir in imap/{user,quota,sieve} spool/imap; do
+ for i in a b c d e f g h i j k l m n o p q r s t v u w x y z \
+ A B C D E F G H I J K L M N O P Q R S T U V W X Y Z \
+ 0 1 2 3 4 5 6 7 8 9; do
+ if [ ! -d /var/${subdir}/${i} ]; then
+ mkdir -m 0750 -p "/var/${subdir}/${i}"
+ fi
+ done
+ done
+ chown -R cyrus:mail "/var/imap"
+ chown -R cyrus:mail "/var/spool/imap"
+
+ # make /var/imap/user/* and /var/imap/quota/* synchronous
+ if df -T /var/imap | grep -q ' ext[234] '; then
+ chattr +S /var/imap/{user,quota}{,/*}
+ fi
+ # make /var/spool/imap/* synchronous
+ if df -T /var/spool/imap | grep -q ' ext[23] '; then
+ chattr +S /var/spool/imap{,/*}
+ fi
+
+ # set more secure permissions on config files
+ chown -R cyrus:mail /etc/cyrus
+ chmod 600 /etc/cyrus/cyrus.conf
+ chmod 600 /etc/cyrus/imapd.conf
+}
+
+# arg 1: new package version
+# arg 2: old package version
+post_upgrade() {
+ post_install $1
+}
+
+# arg 1: old package version
+pre_remove() {
+ userdel cyrus &> /dev/null
+}
+
+op=$1
+shift
+
+$op $*
diff --git a/cyrus-master-conf.d b/cyrus-master-conf.d
new file mode 100644
index 00000000000..8bc799e0b58
--- /dev/null
+++ b/cyrus-master-conf.d
@@ -0,0 +1 @@
+MASTER_OPTIONS="-d"
diff --git a/cyrus-master.service b/cyrus-master.service
new file mode 100644
index 00000000000..4e1f421063a
--- /dev/null
+++ b/cyrus-master.service
@@ -0,0 +1,11 @@
+[Unit]
+Description=Cyrus IMAP mail server
+After=network.target
+
+[Service]
+Type=forking
+ExecStart=/usr/lib/cyrus/bin/master -d
+ExecReload=/bin/kill -HUP $MAINPID
+
+[Install]
+WantedBy=multi-user.target