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