2013-05-12 16:18:45 +00:00
|
|
|
# $Id$
|
2013-02-23 03:21:01 +00:00
|
|
|
|
|
|
|
# ALARM: Kevin Mihelich <kevin@archlinuxarm.org>
|
|
|
|
# - v7h needs -fPIC
|
|
|
|
|
|
|
|
pkgname=imap
|
|
|
|
pkgver=2007f
|
2013-10-23 14:04:32 +00:00
|
|
|
pkgrel=4
|
2013-02-23 03:21:01 +00:00
|
|
|
pkgdesc="An IMAP/POP server"
|
|
|
|
arch=('i686' 'x86_64')
|
|
|
|
license=('APACHE')
|
|
|
|
url="http://www.washington.edu/imap"
|
|
|
|
depends=('openssl' 'pam')
|
|
|
|
provides=('imap-server' 'pop3-server')
|
|
|
|
conflicts=('courier-mta' 'courier-imap')
|
|
|
|
source=("ftp://ftp.cac.washington.edu/imap/${pkgname}-${pkgver}.tar.gz"
|
|
|
|
'imap' 'ipop2' 'ipop3')
|
2013-10-23 14:04:32 +00:00
|
|
|
options=('staticlibs')
|
2013-02-23 03:21:01 +00:00
|
|
|
backup=(etc/xinetd.d/{imap,ipop2,ipop3} etc/ssl/certs/{imapd,ipop3d}.pem)
|
|
|
|
md5sums=('2126fd125ea26b73b20f01fcd5940369'
|
2013-05-12 16:18:45 +00:00
|
|
|
'3ae5b3b333bc8ea2da106f6a97d7bd8d'
|
|
|
|
'448f988dc5f9bdb2223dcea3abc4f5f1'
|
|
|
|
'1499b13015075f0aafba04324a6f523a')
|
2013-02-23 03:21:01 +00:00
|
|
|
|
2013-10-23 14:04:32 +00:00
|
|
|
prepare() {
|
2013-02-23 03:21:01 +00:00
|
|
|
sed \
|
|
|
|
-e "s:-g -fno-omit-frame-pointer -O6:\${CFLAGS}:" \
|
|
|
|
-e "s:SSLDIR=/usr/local/ssl:SSLDIR=/usr:" \
|
|
|
|
-e "s:SSLCERTS=\$(SSLDIR)/certs:SSLCERTS=/etc/ssl/certs:" \
|
|
|
|
-i $srcdir/$pkgname-$pkgver/src/osdep/unix/Makefile
|
2013-10-23 14:04:32 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
build() {
|
2013-02-23 03:21:01 +00:00
|
|
|
cd $srcdir/$pkgname-$pkgver
|
|
|
|
# NOTE: if you wish to enforce SSL, use SSLTYPE=unix.nopwd
|
|
|
|
|
|
|
|
if [ "$CARCH" == "armv7h" ]; then
|
|
|
|
yes "y" | make lnp SPECIALAUTHENTICATORS=ssl SSLTYPE=unix EXTRACFLAGS="${CFLAGS} -fPIC"
|
|
|
|
else yes "y" | make lnp SPECIALAUTHENTICATORS=ssl SSLTYPE=unix
|
|
|
|
fi
|
|
|
|
|
|
|
|
# create ssl certs for secure imap
|
|
|
|
for i in imapd ipop3d; do
|
|
|
|
PEM1=$srcdir/pem1
|
|
|
|
PEM2=$srcdir/pem2
|
|
|
|
/usr/bin/openssl req -newkey rsa:1024 -keyout $PEM1 \
|
|
|
|
-nodes -x509 -days 365 -out $PEM2 << EOF
|
|
|
|
--
|
|
|
|
SomeState
|
|
|
|
SomeCity
|
|
|
|
SomeOrganization
|
|
|
|
SomeOrganizationalUnit
|
|
|
|
localhost.localdomain
|
|
|
|
root@localhost.localdomain
|
|
|
|
EOF
|
|
|
|
|
|
|
|
cat $PEM1 > ${i}.pem
|
|
|
|
echo "" >> ${i}.pem
|
|
|
|
cat $PEM2 >> ${i}.pem
|
|
|
|
rm $PEM1 $PEM2
|
|
|
|
umask 022
|
|
|
|
done
|
|
|
|
}
|
|
|
|
|
|
|
|
package() {
|
|
|
|
cd $srcdir/$pkgname-$pkgver
|
2013-05-12 16:18:45 +00:00
|
|
|
install -d $pkgdir/usr/bin
|
|
|
|
install -D -m755 imapd/imapd $pkgdir/usr/bin/imapd
|
|
|
|
install -D -m755 ipopd/ipop2d $pkgdir/usr/bin/ipop2d
|
|
|
|
install -D -m755 ipopd/ipop3d $pkgdir/usr/bin/ipop3d
|
2013-02-23 03:21:01 +00:00
|
|
|
for i in c-client mail imap4r1 rfc822 linkage misc smtp nntp \
|
|
|
|
osdep env_unix env fs ftl nl tcp sslio utf8 utf8aux; do
|
|
|
|
install -D -m644 c-client/${i}.h $pkgdir/usr/include/imap/${i}.h
|
|
|
|
done
|
|
|
|
install -D -m644 c-client/c-client.a $pkgdir/usr/lib/c-client.a
|
|
|
|
ln -sf c-client.a $pkgdir/usr/lib/libc-client.a
|
|
|
|
|
|
|
|
# install certs
|
|
|
|
install -D -m600 imapd.pem $pkgdir/etc/ssl/certs/imapd.pem
|
|
|
|
install -D -m600 ipop3d.pem $pkgdir/etc/ssl/certs/ipop3d.pem
|
|
|
|
|
|
|
|
# install xinetd.d configs
|
|
|
|
install -D -m644 ../imap $pkgdir/etc/xinetd.d/imap
|
|
|
|
install -D -m644 ../ipop2 $pkgdir/etc/xinetd.d/ipop2
|
|
|
|
install -D -m644 ../ipop3 $pkgdir/etc/xinetd.d/ipop3
|
|
|
|
}
|