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