wok-next annotate cyrus-imapd/receipt @ rev 21247

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