wok-next view cyrus-imapd/receipt @ rev 20755
brasero: update bdeps
author | Aleksej Bobylev <al.bobylev@gmail.com> |
---|---|
date | Fri Jun 01 17:37:26 2018 +0300 (2018-06-01) |
parents | 2985612f2b3f |
children | d958fec46c9f |
line source
1 # SliTaz package receipt v2.
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 WEB_SITE="http://cyrusimap.web.cmu.edu/"
11 TARBALL="$PACKAGE-$VERSION.tar.gz"
12 WGET_URL="ftp://ftp.cyrusimap.org/$PACKAGE/$TARBALL"
14 BUILD_DEPENDS="libcomerr libcomerr-dev cyrus-sasl cyrus-sasl-dev openssl-dev \
15 db-dev perl-dev zlib-dev"
16 SPLIT="cyrus-imapd-dev"
18 compile_rules() {
19 export LDFLAGS="$LDFLAGS -lpthread"
20 ./configure \
21 --prefix=/usr \
22 --infodir=/usr/share/info \
23 --with-service-path=/usr/lib/cyrus \
24 --with-cyrus-prefix=/usr/lib/cyrus \
25 --with-com_err=yes \
26 --enable-murder \
27 --enable-replication \
28 --mandir=/usr/share/man \
29 $CONFIGURE_ARGS &&
30 make &&
31 make DESTDIR=$DESTDIR install
32 }
34 genpkg_rules() {
35 case $PACKAGE in
36 cyrus-imapd)
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 CONFIG_FILES="/etc/imapd.conf /etc/cyrus.conf"
49 DEPENDS="libcomerr cyrus-sasl openssl db perl libwrap \
50 slitaz-base-files net-snmp"
51 ;;
52 *-dev)
53 mkdir -p $fs/usr/lib
54 cp -a $install/usr/lib/lib* $fs/usr/lib
55 cp -a $install/usr/include $fs/usr
56 ;;
57 esac
58 }
60 post_install_cyrus_imapd() {
61 # adduser cyrus if needed
62 if ! grep -q cyrus "$1/etc/passwd"; then
63 echo -n "Adding user cyrus..."
64 chroot "$1/" adduser cyrus -D -H -S -h /tmp
65 chroot "$1/" sh -c 'echo "cyrus:cyrus" | chpasswd -m > /dev/null'
66 status
67 fi
68 # addgroup mail if needed
69 if ! grep -q mail "$1/etc/group"; then
70 echo -n "Adding group mail..."
71 chroot "$1/" sh -c 'addgroup mail && addgroup cyrus mail'
72 status
73 fi
74 chroot "$1/" chown -R cyrus.mail /var/spool/imap /var/imap
75 while read name port end; do
76 grep -q $port "$1/etc/services" || \
77 echo "$name $port $end" >> "$1/etc/services"
78 done <<EOF
79 pop3 110/tcp pop-3
80 nntp 119/tcp readnews untp
81 imap 143/tcp imap2 imap4
82 imsp 406/tcp
83 nntps 563/tcp snntp
84 acap 674/tcp
85 imaps 993/tcp
86 pop3s 995/tcp
87 kpop 1109/tcp
88 sieve 2000/tcp
89 lmtp 2003/tcp
90 fud 4201/udp
91 EOF
92 [ "$1" ] || /etc/init.d/$PACKAGE start
93 if [ -f "$1/etc/init.d/postfix" ]; then
94 if ! grep -v ^# "$1/etc/postfix/main.cf" | grep -q lmtp:unix; then
95 echo "Append to /etc/postfix/main.cf:"
96 echo -n " "
97 echo "mailbox_transport = lmtp:unix:/var/imap/socket/lmtp" | \
98 tee -a "$1/etc/postfix/main.cf"
99 if [ -z "$1" ]; then
100 /etc/init.d/postfix start || /etc/init.d/postfix reload
101 fi
102 fi
103 fi
104 msg="Creating mailbox for"
105 for i in root $(awk -F: '{ if ($3 >= 1000) print $1 }' < "$1/etc/passwd"); do
106 echo -n "$msg $i"
107 msg=","
108 done
109 echo ""
110 for i in root $(awk -F: '{ if ($3 >= 1000) print $1 }' < "$1/etc/passwd"); do
111 echo "createmailbox user.$i"
112 done | chroot "$1/" cyradm -u cyrus -w cyrus 127.0.0.1 >/dev/null 2>&1
113 chroot "$1/" su -c "/usr/lib/cyrus/bin/reconstruct" cyrus >/dev/null 2>&1
114 cat <<EOF
116 .---------------------------------------------------.
117 | Users must have a password to access the mailbox. |
118 |---------------------------------------------------|
119 | To start $PACKAGE server you can run: |
120 | |
121 | /etc/init.d/$PACKAGE start |
122 | |
123 | Or add $PACKAGE to RUN_DAEMONS in /etc/rcS.conf |
124 '---------------------------------------------------'
125 EOF
127 # A security hole with ssh...
128 [ -f "$1/etc/ssh/sshd_config" ] &&
129 ! grep -q cyrus "$1/etc/ssh/sshd_config" &&
130 echo "DenyUsers cyrus" >> "$1/etc/ssh/sshd_config"
131 }
133 post_remove_cyrus_imapd() {
134 deluser cyrus
135 delgroup mail
136 }