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

updated cppunit (1.14.0 -> 1.15.1)
author Hans-G?nter Theisgen
date Mon Jun 22 16:07:43 2020 +0100 (2020-06-22)
parents 8f84e001fe1d
children
line source
1 # SliTaz package receipt v2.
3 PACKAGE="cyrus-imapd"
4 VERSION="3.0.13"
5 CATEGORY="network"
6 SHORT_DESC="IMAP server"
7 MAINTAINER="pascal.bellard@slitaz.org"
8 LICENSE="BSD"
9 WEB_SITE="https://www.cyrusimap.org/"
10 REPOLOGY="cyrus-imapd2"
12 TARBALL="$PACKAGE-$VERSION.tar.gz"
13 WGET_URL="${WEB_SITE}releases/$TARBALL"
15 BUILD_DEPENDS="cyrus-sasl cyrus-sasl-dev db-dev jansson-dev
16 libcomerr libcomerr-dev openssl-dev perl-dev zlib-dev"
17 SPLIT="$PACKAGE-dev"
19 compile_rules()
20 {
21 export LDFLAGS="$LDFLAGS -lpthread"
23 ./configure \
24 --prefix=/usr \
25 --infodir=/usr/share/info \
26 --with-service-path=/usr/lib/cyrus \
27 --with-cyrus-prefix=/usr/lib/cyrus \
28 --with-com_err=yes \
29 --enable-murder \
30 --enable-replication \
31 --mandir=/usr/share/man \
32 $CONFIGURE_ARGS &&
33 make &&
34 make DESTDIR=$install install
35 }
37 genpkg_rules()
38 {
39 case $PACKAGE in
40 cyrus-imapd)
41 mkdir -p $fs/usr/lib
42 mkdir -p $fs/var/imap
43 mkdir -p $fs/var/spool/imap/stage.
45 cp -a $install/usr/bin $fs/usr
46 cp -a $install/usr/lib/cyrus $fs/usr/lib
47 cp -a $install/usr/lib/perl5 $fs/usr/lib
48 strip -s $fs/usr/lib/cyrus/*
49 cp $src/tools/mkimap $fs/usr/lib/cyrus
50 cp -a $stuff/etc $fs
51 cp $src/master/conf/small.conf $fs/etc/cyrus.conf
53 for i in proc db socket log msg ptclient
54 do
55 mkdir -m 755 $fs/var/imap/$i
56 done
58 CONFIG_FILES="/etc/imapd.conf /etc/cyrus.conf"
59 DEPENDS="cyrus-sasl db libcomerr libwrap net-snmp
60 openssl perl slitaz-base-files"
61 ;;
62 *-dev)
63 mkdir -p $fs/usr/lib
65 cp -a $install/usr/lib/lib* $fs/usr/lib
66 cp -a $install/usr/include $fs/usr
67 ;;
68 esac
69 }
71 post_install_cyrus_imapd()
72 {
73 # adduser cyrus if needed
74 if ! grep -q cyrus "$1/etc/passwd"
75 then
76 echo -n "Adding user cyrus..."
77 chroot "$1/" adduser cyrus -D -H -S -h /tmp
78 chroot "$1/" sh -c 'echo "cyrus:cyrus" | chpasswd -m > /dev/null'
79 status
80 fi
82 # addgroup mail if needed
83 if ! grep -q mail "$1/etc/group"
84 then
85 echo -n "Adding group mail..."
86 chroot "$1/" sh -c 'addgroup mail && addgroup cyrus mail'
87 status
88 fi
90 chroot "$1/" chown -R cyrus.mail /var/spool/imap /var/imap
92 while read name port end
93 do
94 grep -q $port "$1/etc/services" || \
95 echo "$name $port $end" >> "$1/etc/services"
96 done <<EOF
97 pop3 110/tcp pop-3
98 nntp 119/tcp readnews untp
99 imap 143/tcp imap2 imap4
100 imsp 406/tcp
101 nntps 563/tcp snntp
102 acap 674/tcp
103 imaps 993/tcp
104 pop3s 995/tcp
105 kpop 1109/tcp
106 sieve 2000/tcp
107 lmtp 2003/tcp
108 fud 4201/udp
109 EOF
110 [ "$1" ] || /etc/init.d/$PACKAGE start
111 if [ -f "$1/etc/init.d/postfix" ]
112 then
113 if ! grep -v ^# "$1/etc/postfix/main.cf" | grep -q lmtp:unix
114 then
115 echo "Append to /etc/postfix/main.cf:"
116 echo -n " "
117 echo "mailbox_transport = lmtp:unix:/var/imap/socket/lmtp" | \
118 tee -a "$1/etc/postfix/main.cf"
119 if [ -z "$1" ]
120 then
121 /etc/init.d/postfix start || /etc/init.d/postfix reload
122 fi
123 fi
124 fi
126 msg="Creating mailbox for"
127 for i in root $(awk -F: '{ if ($3 >= 1000) print $1 }' < "$1/etc/passwd")
128 do
129 echo -n "$msg $i"
130 msg=","
131 done
132 echo ""
133 for i in root $(awk -F: '{ if ($3 >= 1000) print $1 }' < "$1/etc/passwd")
134 do
135 echo "createmailbox user.$i"
136 done | chroot "$1/" cyradm -u cyrus -w cyrus 127.0.0.1 >/dev/null 2>&1
137 chroot "$1/" su -c "/usr/lib/cyrus/bin/reconstruct" cyrus >/dev/null 2>&1
138 [ -n "$quiet" ] || cat <<EOF
140 .---------------------------------------------------.
141 | Users must have a password to access the mailbox. |
142 |---------------------------------------------------|
143 | To start $PACKAGE server you can run: |
144 | |
145 | /etc/init.d/$PACKAGE start |
146 | |
147 | Or add $PACKAGE to RUN_DAEMONS in /etc/rcS.conf |
148 '---------------------------------------------------'
149 EOF
151 # A security hole with ssh...
152 [ -f "$1/etc/ssh/sshd_config" ] &&
153 ! grep -q cyrus "$1/etc/ssh/sshd_config" &&
154 echo "DenyUsers cyrus" >> "$1/etc/ssh/sshd_config"
155 }
157 post_remove_cyrus_imapd()
158 {
159 deluser cyrus
160 delgroup mail
161 }