wok-next view cyrus-imapd/receipt @ rev 5019

[a-z]*-update DEPENDS: nvidia is hardware-specific and should be removed or optional
author Rohit Joshi <jozee@slitaz.org>
date Mon Mar 01 09:06:07 2010 +0000 (2010-03-01)
parents 8d23268c7571
children ee71defcb545
line source
1 # SliTaz package receipt.
3 PACKAGE="cyrus-imapd"
4 VERSION="2.2.12"
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-dev cyrus-sasl cyrus-sasl-dev openssl-dev db-dev"
12 DEPENDS="libcomerr cyrus-sasl openssl db perl libwrap slitaz-base-files \
13 net-snmp"
14 CONFIG_FILES="/etc/imapd.conf /etc/cyrus.conf"
16 # Rules to configure and make the package.
17 compile_rules()
18 {
19 cd $src
20 while read arg file; do
21 [ -f done.$file ] && continue
22 echo "Apply $file..."
23 patch $arg < ../stuff/$file
24 touch done.$file
25 done << EOT
26 -p1 50-FTBFS-gcc-4.0-fix.dpatch
27 -p0 p1.patch
28 -p0 p2.patch
29 EOT
30 ./configure --prefix=/usr --infodir=/usr/share/info \
31 --with-service-path=/usr/lib/cyrus \
32 --mandir=/usr/share/man $CONFIGURE_ARGS &&
33 make &&
34 make DESTDIR=$PWD/_pkg install
35 }
37 # Rules to gen a SliTaz package suitable for Tazpkg.
38 genpkg_rules()
39 {
40 mkdir -p $fs/usr/lib $fs/var/imap $fs/var/spool/imap/stage.
41 cp -a $_pkg/usr/bin $fs/usr
42 cp -a $_pkg/usr/lib/cyrus $fs/usr/lib
43 cp -a $_pkg/usr/lib/perl5 $fs/usr/lib
44 strip -s $fs/usr/lib/cyrus/bin/*
45 cp $src/tools/mkimap $fs/usr/lib/cyrus/bin
46 cp -a stuff/etc $fs
47 cp $src/master/conf/small.conf $fs/etc/cyrus.conf
48 for i in proc db socket log msg ptclient; do
49 mkdir -m 755 $fs/var/imap/$i
50 done
51 }
53 # Pre and post install commands for Tazpkg.
54 post_install()
55 {
56 # adduser cyrus if needed
57 if ! grep -q cyrus $1/etc/passwd; then
58 echo -n "Adding user cyrus..."
59 chroot $1/ adduser cyrus -D -H -S -h /tmp
60 chroot $1/ sh -c 'echo "cyrus:cyrus" | chpasswd > /dev/null'
61 status
62 fi
63 # addgroup mail if needed
64 if ! grep -q mail $1/etc/group; then
65 echo -n "Adding group mail..."
66 chroot $1/ sh -c 'addgroup mail && addgroup cyrus mail'
67 status
68 fi
69 chroot $1/ chown -R cyrus.mail /var/spool/imap /var/imap
70 while read name port end; do
71 grep -q $port $1/etc/services || \
72 echo "$name $port $end" >> $1/etc/services
73 done <<EOF
74 pop3 110/tcp pop-3
75 nntp 119/tcp readnews untp
76 imap 143/tcp imap2 imap4
77 imsp 406/tcp
78 nntps 563/tcp snntp
79 acap 674/tcp
80 imaps 993/tcp
81 pop3s 995/tcp
82 kpop 1109/tcp
83 sieve 2000/tcp
84 lmtp 2003/tcp
85 fud 4201/udp
86 EOF
87 [ -z "$1" ] && /etc/init.d/$PACKAGE start
88 if [ -f $1/etc/init.d/postfix ]; then
89 if ! grep -v ^# $1/etc/postfix/main.cf | grep -q lmtp:unix; then
90 echo "Append to /etc/postfix/main.cf:"
91 echo -n " "
92 echo "mailbox_transport = lmtp:unix:/var/imap/socket/lmtp" | \
93 tee -a $1/etc/postfix/main.cf
94 if [ -z "$1" ]; then
95 /etc/init.d/postfix start || /etc/init.d/postfix reload
96 fi
97 fi
98 fi
99 msg="Creating mailbox for"
100 for i in root $(awk -F: '{ if ($3 >= 1000) print $1 }' < $1/etc/passwd); do
101 echo -n "$msg $i"
102 msg=","
103 done
104 echo ""
105 for i in root $(awk -F: '{ if ($3 >= 1000) print $1 }' < $1/etc/passwd); do
106 echo "createmailbox user.$i"
107 done | chroot $1/ cyradm -u cyrus -w cyrus 127.0.0.1 >/dev/null 2>&1
108 chroot $1/ su -c "/usr/lib/cyrus/bin/reconstruct" cyrus >/dev/null 2>&1
109 cat <<EOF
110 ----
111 Users must have a password to access the mailbox.
112 To start $PACKAGE server you can run :
114 /etc/init.d/$PACKAGE start
116 Or add $PACKAGE to RUN_DAEMONS in /etc/rcS.conf
117 ----
118 EOF
119 }
121 post_remove()
122 {
123 deluser cyrus
124 delgroup mail
125 }