wok-6.x view cyrus-imapd/receipt @ rev 11931

clamav: improve package
author Eric Joseph-Alexandre <erjo@slitaz.org>
date Thu Mar 01 02:34:58 2012 +0100 (2012-03-01)
parents 76f0b0ebe349
children ec5cb3f92f0e
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 --with-com_err=yes \
25 --mandir=/usr/share/man $CONFIGURE_ARGS &&
26 make &&
27 make DESTDIR=$PWD/_pkg install
28 }
30 # Rules to gen a SliTaz package suitable for Tazpkg.
31 genpkg_rules()
32 {
33 mkdir -p $fs/usr/lib $fs/var/imap $fs/var/spool/imap/stage.
34 cp -a $_pkg/usr/bin $fs/usr
35 cp -a $_pkg/usr/lib/cyrus $fs/usr/lib
36 cp -a $_pkg/usr/lib/perl5 $fs/usr/lib
37 strip -s $fs/usr/lib/cyrus/*
38 cp $src/tools/mkimap $fs/usr/lib/cyrus
39 cp -a $stuff/etc $fs
40 cp $src/master/conf/small.conf $fs/etc/cyrus.conf
41 for i in proc db socket log msg ptclient; do
42 mkdir -m 755 $fs/var/imap/$i
43 done
44 }
46 # Pre and post install commands for Tazpkg.
47 post_install()
48 {
49 # adduser cyrus if needed
50 if ! grep -q cyrus $1/etc/passwd; then
51 echo -n "Adding user cyrus..."
52 chroot $1/ adduser cyrus -D -H -S -h /tmp
53 chroot $1/ sh -c 'echo "cyrus:cyrus" | chpasswd > /dev/null'
54 status
55 fi
56 # addgroup mail if needed
57 if ! grep -q mail $1/etc/group; then
58 echo -n "Adding group mail..."
59 chroot $1/ sh -c 'addgroup mail && addgroup cyrus mail'
60 status
61 fi
62 chroot $1/ chown -R cyrus.mail /var/spool/imap /var/imap
63 while read name port end; do
64 grep -q $port $1/etc/services || \
65 echo "$name $port $end" >> $1/etc/services
66 done <<EOF
67 pop3 110/tcp pop-3
68 nntp 119/tcp readnews untp
69 imap 143/tcp imap2 imap4
70 imsp 406/tcp
71 nntps 563/tcp snntp
72 acap 674/tcp
73 imaps 993/tcp
74 pop3s 995/tcp
75 kpop 1109/tcp
76 sieve 2000/tcp
77 lmtp 2003/tcp
78 fud 4201/udp
79 EOF
80 [ -z "$1" ] && /etc/init.d/$PACKAGE start
81 if [ -f $1/etc/init.d/postfix ]; then
82 if ! grep -v ^# $1/etc/postfix/main.cf | grep -q lmtp:unix; then
83 echo "Append to /etc/postfix/main.cf:"
84 echo -n " "
85 echo "mailbox_transport = lmtp:unix:/var/imap/socket/lmtp" | \
86 tee -a $1/etc/postfix/main.cf
87 if [ -z "$1" ]; then
88 /etc/init.d/postfix start || /etc/init.d/postfix reload
89 fi
90 fi
91 fi
92 msg="Creating mailbox for"
93 for i in root $(awk -F: '{ if ($3 >= 1000) print $1 }' < $1/etc/passwd); do
94 echo -n "$msg $i"
95 msg=","
96 done
97 echo ""
98 for i in root $(awk -F: '{ if ($3 >= 1000) print $1 }' < $1/etc/passwd); do
99 echo "createmailbox user.$i"
100 done | chroot $1/ cyradm -u cyrus -w cyrus 127.0.0.1 >/dev/null 2>&1
101 chroot $1/ su -c "/usr/lib/cyrus/bin/reconstruct" cyrus >/dev/null 2>&1
102 cat <<EOF
103 ----
104 Users must have a password to access the mailbox.
105 To start $PACKAGE server you can run :
107 /etc/init.d/$PACKAGE start
109 Or add $PACKAGE to RUN_DAEMONS in /etc/rcS.conf
110 ----
111 EOF
112 }
114 post_remove()
115 {
116 deluser cyrus
117 delgroup mail
118 }