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