wok view cyrus-imapd/receipt @ rev 24451

updated cyrus-imapd and cyrus-imapd-dev (3.0.13 -> 3.4.3)
author Hans-G?nter Theisgen
date Tue Feb 15 14:10:08 2022 +0100 (2022-02-15)
parents 2a0479881723
children 92d14c9730a8
line source
1 # SliTaz package receipt.
3 PACKAGE="cyrus-imapd"
4 VERSION="3.4.3"
5 CATEGORY="network"
6 SHORT_DESC="IMAP server."
7 MAINTAINER="pascal.bellard@slitaz.org"
8 LICENSE="BSD"
9 WEB_SITE="https://cyrusimap.org/"
11 TARBALL="$PACKAGE-$VERSION.tar.gz"
12 WGET_URL="https://github.com/cyrusimap/$PACKAGE/releases/download/$PACKAGE-$VERSION/$TARBALL"
14 DEPENDS="cyrus-sasl db gcc83-lib-base jansson libcomerr libwrap net-snmp openssl
15 perl slitaz-base-files"
16 BUILD_DEPENDS="cyrus-sasl-dev db-dev gcc83 icu-dev jansson-dev libcomerr-dev
17 openssl-dev perl util-linux-uuid-dev"
19 CONFIG_FILES="/etc/imapd.conf /etc/cyrus.conf"
21 # What is the latest version available today?
22 current_version()
23 {
24 wget -O - https://github.com/cyrusimap/cyrus-imapd/releases 2>/dev/null | \
25 sed '/archive.*tar/!d;s|.*/[a-z-]*\(.*\).tar.*|\1|;q'
26 }
28 # Rules to configure and make the package.
29 compile_rules()
30 {
31 export LDFLAGS="$LDFLAGS -lpthread"
33 # 3.4.3 unrecognised
34 # --with-service-path=/usr/lib/cyrus
35 # --with-cyrus-prefix=/usr/lib/cyrus
37 ./configure \
38 CC=gcc-83 \
39 CXX=g++-83 \
40 --prefix=/usr \
41 --infodir=/usr/share/info \
42 --with-com_err=yes \
43 --enable-murder \
44 --enable-replication \
45 --mandir=/usr/share/man \
46 $CONFIGURE_ARGS &&
47 make &&
48 make install DESTDIR=$DESTDIR
49 }
51 # Rules to gen a SliTaz package suitable for Tazpkg.
52 genpkg_rules()
53 {
54 mkdir -p $fs/usr/lib/cyrus
55 mkdir -p $fs/var/imap
56 mkdir -p $fs/var/spool/imap/stage.
58 cp -a $install/usr/bin $fs/usr
59 cp -a $install/usr/lib/libcyrus*.so* $fs/usr/lib
60 cp -a $install/usr/lib/perl5 $fs/usr/lib
61 strip -s $fs/usr/lib/lib*
62 cp $src/tools/mkimap $fs/usr/lib/cyrus
63 cp -a $stuff/etc $fs
64 cp $src/doc/examples/cyrus_conf/small.conf \
65 $fs/etc/cyrus.conf
66 for i in proc db socket log msg ptclient
67 do
68 mkdir -m 755 $fs/var/imap/$i
69 done
70 }
72 # Pre and post install commands for Tazpkg.
73 post_install()
74 {
75 # adduser cyrus if needed
76 if ! grep -q cyrus "$1/etc/passwd"
77 then
78 echo
79 echo -n "Adding user cyrus..."
80 chroot "$1/" adduser cyrus -D -H -S -h /tmp
81 chroot "$1/" sh -c 'echo "cyrus:cyrus" | chpasswd -m > /dev/null'
82 status
83 fi
85 # addgroup mail if needed
86 if ! grep -q mail "$1/etc/group"
87 then
88 echo
89 echo -n "Adding group mail..."
90 chroot "$1/" sh -c 'addgroup mail && addgroup cyrus mail'
91 status
92 fi
94 chroot "$1/" chown -R cyrus.mail /var/spool/imap /var/imap
95 while read name port end
96 do
97 grep -q $port "$1/etc/services" || \
98 echo "$name $port $end" >> "$1/etc/services"
99 done <<EOF
100 pop3 110/tcp pop-3
101 nntp 119/tcp readnews untp
102 imap 143/tcp imap2 imap4
103 imsp 406/tcp
104 nntps 563/tcp snntp
105 acap 674/tcp
106 imaps 993/tcp
107 pop3s 995/tcp
108 kpop 1109/tcp
109 sieve 2000/tcp
110 lmtp 2003/tcp
111 fud 4201/udp
112 EOF
114 [ "$1" ] || /etc/init.d/$PACKAGE start
115 if [ -f "$1/etc/init.d/postfix" ]
116 then
117 if ! grep -v ^# "$1/etc/postfix/main.cf" | grep -q lmtp:unix
118 then
119 echo
120 echo "Append to /etc/postfix/main.cf:"
121 echo -n " "
122 echo "mailbox_transport = lmtp:unix:/var/imap/socket/lmtp" | \
123 tee -a "$1/etc/postfix/main.cf"
124 if [ -z "$1" ]
125 then
126 /etc/init.d/postfix start || /etc/init.d/postfix reload
127 fi
128 fi
129 fi
131 msg="\\nCreating mailbox for"
132 for i in root $(awk -F: '{ if ($3 >= 1000) print $1 }' < "$1/etc/passwd")
133 do
134 echo -en "$msg $i"
135 msg=","
136 done
137 echo ""
139 for i in root $(awk -F: '{ if ($3 >= 1000) print $1 }' < "$1/etc/passwd")
140 do
141 echo "createmailbox user.$i"
142 done | chroot "$1/" cyradm -u cyrus -w cyrus 127.0.0.1 >/dev/null 2>&1
143 chroot "$1/" su -c "/usr/lib/cyrus/bin/reconstruct" cyrus >/dev/null 2>&1
145 cat <<EOF
146 ----
147 Users must have a password to access the mailbox.
148 To start $PACKAGE server you can run :
150 /etc/init.d/$PACKAGE start
152 Or add $PACKAGE to RUN_DAEMONS in /etc/rcS.conf
153 ----
154 EOF
156 # A security hole with ssh...
157 [ -f "$1/etc/ssh/sshd_config" ] &&
158 ! grep -q cyrus "$1/etc/ssh/sshd_config" &&
159 echo "DenyUsers cyrus" >> "$1/etc/ssh/sshd_config"
160 }
162 post_remove()
163 {
164 deluser cyrus
165 delgroup mail
166 }