wok-6.x view cyrus-imapd/receipt @ rev 11893
busybox: add AUFS_NOT_SUPPORTED
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Wed Feb 29 11:50:38 2012 +0100 (2012-02-29) |
parents | a1644dbcf632 |
children | f4fe7aafc085 |
line source
1 # SliTaz package receipt.
3 PACKAGE="cyrus-imapd"
4 VERSION="2.3.16"
5 CATEGORY="network"
6 SHORT_DESC="IMAP server."
7 MAINTAINER="pascal.bellard@slitaz.org"
8 TARBALL="$PACKAGE-$VERSION.tar.gz"
9 WEB_SITE="http://cyrusimap.web.cmu.edu/"
10 WGET_URL="ftp://ftp.andrew.cmu.edu/pub/cyrus/$TARBALL"
11 BUILD_DEPENDS="libcomerr libcomerr-dev cyrus-sasl cyrus-sasl-dev openssl-dev \
12 db-dev perl"
13 DEPENDS="libcomerr cyrus-sasl openssl db perl libwrap slitaz-base-files \
14 net-snmp"
15 CONFIG_FILES="/etc/imapd.conf /etc/cyrus.conf"
17 # Rules to configure and make the package.
18 compile_rules()
19 {
20 cd $src
21 ./configure --prefix=/usr --infodir=/usr/share/info \
22 --with-service-path=/usr/lib/cyrus \
23 --with-cyrus-prefix=/usr/lib/cyrus \
24 --mandir=/usr/share/man $CONFIGURE_ARGS &&
25 make &&
26 make DESTDIR=$PWD/_pkg install
27 }
29 # Rules to gen a SliTaz package suitable for Tazpkg.
30 genpkg_rules()
31 {
32 mkdir -p $fs/usr/lib $fs/var/imap $fs/var/spool/imap/stage.
33 cp -a $_pkg/usr/bin $fs/usr
34 cp -a $_pkg/usr/lib/cyrus $fs/usr/lib
35 cp -a $_pkg/usr/lib/perl5 $fs/usr/lib
36 strip -s $fs/usr/lib/cyrus/*
37 cp $src/tools/mkimap $fs/usr/lib/cyrus
38 cp -a $stuff/etc $fs
39 cp $src/master/conf/small.conf $fs/etc/cyrus.conf
40 for i in proc db socket log msg ptclient; do
41 mkdir -m 755 $fs/var/imap/$i
42 done
43 }
45 # Pre and post install commands for Tazpkg.
46 post_install()
47 {
48 # adduser cyrus if needed
49 if ! grep -q cyrus $1/etc/passwd; then
50 echo -n "Adding user cyrus..."
51 chroot $1/ adduser cyrus -D -H -S -h /tmp
52 chroot $1/ sh -c 'echo "cyrus:cyrus" | chpasswd > /dev/null'
53 status
54 fi
55 # addgroup mail if needed
56 if ! grep -q mail $1/etc/group; then
57 echo -n "Adding group mail..."
58 chroot $1/ sh -c 'addgroup mail && addgroup cyrus mail'
59 status
60 fi
61 chroot $1/ chown -R cyrus.mail /var/spool/imap /var/imap
62 while read name port end; do
63 grep -q $port $1/etc/services || \
64 echo "$name $port $end" >> $1/etc/services
65 done <<EOF
66 pop3 110/tcp pop-3
67 nntp 119/tcp readnews untp
68 imap 143/tcp imap2 imap4
69 imsp 406/tcp
70 nntps 563/tcp snntp
71 acap 674/tcp
72 imaps 993/tcp
73 pop3s 995/tcp
74 kpop 1109/tcp
75 sieve 2000/tcp
76 lmtp 2003/tcp
77 fud 4201/udp
78 EOF
79 [ -z "$1" ] && /etc/init.d/$PACKAGE start
80 if [ -f $1/etc/init.d/postfix ]; then
81 if ! grep -v ^# $1/etc/postfix/main.cf | grep -q lmtp:unix; then
82 echo "Append to /etc/postfix/main.cf:"
83 echo -n " "
84 echo "mailbox_transport = lmtp:unix:/var/imap/socket/lmtp" | \
85 tee -a $1/etc/postfix/main.cf
86 if [ -z "$1" ]; then
87 /etc/init.d/postfix start || /etc/init.d/postfix reload
88 fi
89 fi
90 fi
91 msg="Creating mailbox for"
92 for i in root $(awk -F: '{ if ($3 >= 1000) print $1 }' < $1/etc/passwd); do
93 echo -n "$msg $i"
94 msg=","
95 done
96 echo ""
97 for i in root $(awk -F: '{ if ($3 >= 1000) print $1 }' < $1/etc/passwd); do
98 echo "createmailbox user.$i"
99 done | chroot $1/ cyradm -u cyrus -w cyrus 127.0.0.1 >/dev/null 2>&1
100 chroot $1/ su -c "/usr/lib/cyrus/bin/reconstruct" cyrus >/dev/null 2>&1
101 cat <<EOF
102 ----
103 Users must have a password to access the mailbox.
104 To start $PACKAGE server you can run :
106 /etc/init.d/$PACKAGE start
108 Or add $PACKAGE to RUN_DAEMONS in /etc/rcS.conf
109 ----
110 EOF
111 }
113 post_remove()
114 {
115 deluser cyrus
116 delgroup mail
117 }