wok annotate dovecot/receipt @ rev 18862

Up tzdata(2016a)
author Aleksej Bobylev <al.bobylev@gmail.com>
date Thu Jan 28 17:55:47 2016 +0200 (2016-01-28)
parents 70fb5fbb6fde
children 970c5ec9a60a
rev   line source
pascal@11220 1 # SliTaz package receipt.
pascal@11220 2
pascal@11220 3 PACKAGE="dovecot"
slaxemulator@12767 4 VERSION="2.1.6"
pascal@11220 5 CATEGORY="network"
pascal@11220 6 SHORT_DESC="Dovecot IMAP and POP3 Server."
pascal@11220 7 MAINTAINER="l.lemarinel@gmail.com"
pascal@15021 8 LICENSE="LGPL2.1"
pascal@11220 9 TARBALL="$PACKAGE-$VERSION.tar.gz"
slaxemulator@12767 10 WEB_SITE="http://dovecot.org"
slaxemulator@12767 11 WGET_URL="http://www.dovecot.org/releases/${VERSION:0:3}/$TARBALL"
slaxemulator@12767 12
slaxemulator@12767 13 DEPENDS="libssl libcap openldap pam postgresql libmysqlclient"
pascal@11220 14 BUILD_DEPENDS="openssl-dev libcap-dev openldap-dev \
gokhlayeh@11431 15 libmysqlclient mysql-dev sqlite-dev pam-dev postgresql-dev"
pascal@11220 16
pascal@11220 17 # Rules to configure and make the package.
pascal@11220 18 compile_rules()
pascal@11220 19 {
pascal@11220 20 cd $src
pascal@11220 21 ./configure --prefix=/usr \
slaxemulator@12767 22 --sysconfdir=/etc/dovecot \
erjo@12060 23 --localstatedir=/var \
pascal@11220 24 --libexecdir=/usr/lib/$PACKAGE \
pascal@11220 25 --with-ssl=openssl \
pascal@11220 26 --with-ldap=plugin \
pascal@11220 27 --with-sql=plugin \
pascal@11220 28 --with-mysql \
pascal@11220 29 --with-pgsql \
gokhlayeh@11573 30 --with-sqlite \
gokhlayeh@11573 31 $CONFIGURE_ARGS &&
slaxemulator@12767 32 make &&
slaxemulator@12767 33 make DESTDIR=$DESTDIR install
pascal@11220 34
pascal@11220 35 }
pascal@11220 36
pascal@11220 37 # Rules to gen a SliTaz package suitable for Tazpkg.
pascal@11220 38 genpkg_rules()
pascal@11220 39 {
erjo@12043 40 mkdir -p $fs/usr/lib \
erjo@12043 41 $fs/var/log/dovecot \
erjo@12060 42 $fs/etc/ssl/misc
erjo@12060 43
pascal@11220 44
pascal@11220 45 cp -a $install/usr/sbin $fs/usr
erjo@12060 46 cp -a $install/usr/bin $fs/usr
pascal@11220 47 cp -a $install/usr/lib $fs/usr
pascal@11220 48 cp -a $install/etc $fs/
pascal@11220 49
erjo@12043 50 cp -pa $stuff/init.d $fs/etc
erjo@12043 51
erjo@12060 52 #cp -pa $fs/etc/dovecot/dovecot-example.conf $fs/etc/dovecot/dovecot.conf
erjo@12060 53 cp -pa $install/usr/share/doc/dovecot/example-config/* $fs/etc/dovecot/
erjo@12060 54 #cp -pa $src/doc/example-config/conf.d/*.conf $fs/etc/dovecot/conf.d
erjo@12060 55 #cp -pa $src/doc/example-config/conf.d/*.ext $fs/etc/dovecot/conf.d
erjo@12060 56 cp -pa $src/doc/*.cnf $fs/etc/ssl
erjo@12060 57 cp -pa $src/doc/mkcert.sh $fs/etc/ssl/misc/dovmkcert.sh
erjo@12043 58
pascal@11220 59 # Remove archive file *.*a
pascal@11220 60 find $fs -name "*.*a" -exec rm -f {} \;
pascal@11220 61
erjo@12060 62 # Fix perms
erjo@12060 63 chmod 755 $fs/etc/ssl/misc/*
erjo@12060 64
erjo@12060 65 # Customising config.
pascal@17238 66 sed -i -e "s/^#default_vsz_limit.*/default_vsz_limit = 50M/" \
erjo@12060 67 $fs/etc/dovecot/conf.d/10-master.conf
erjo@12149 68
pascal@17238 69 sed -i -e "s!^#log_path =.*!log_path = /var/log/dovecot/dovecot.log!" \
erjo@12060 70 $fs/etc/dovecot/conf.d/10-logging.conf
erjo@12060 71
pascal@17238 72 sed -i -e "s/^#listen.*/listen = */" \
erjo@12060 73 $fs/etc/dovecot/dovecot.conf
pascal@17238 74
pascal@17238 75 # Unsafe, see CVE-2014-3566 POODLE
pascal@17238 76 sed -i -e "s/^#ssl_protocols =.*/ssl_protocols = !SSLv2 !SSLv3/" \
pascal@17238 77 $fs/etc/dovecot/conf.d/10-ssl.conf
pascal@11220 78 }
erjo@12043 79
erjo@12043 80 #nd post install commands for Tazpkg.
erjo@12043 81 post_install()
erjo@12043 82 {
erjo@12043 83 local user
erjo@12043 84 local group
erjo@12043 85
erjo@12043 86 user=dovecot
erjo@12043 87 group=dovecot
erjo@12043 88
pascal@18730 89 if ! grep -q $user "$1/etc/passwd"; then
erjo@12043 90 echo -n "Adding user/group $user..."
pascal@18730 91 chroot "$1/" addgroup -g 76 -S $group
pascal@18730 92 chroot "$1/" adduser -u 76 -S -D -H -G $group $user
pascal@18730 93 chroot "$1/" adduser -u 74 -S -D -H -G nogroup dovenull
erjo@12043 94 status
erjo@12043 95 fi
erjo@12043 96
erjo@12043 97
erjo@12043 98 # Set perms for files and directories
pascal@18730 99 chroot "$1/" chown -R ${user}.${group} /var/log/${user} \
erjo@12043 100
erjo@12043 101 cat <<EOF
erjo@12043 102 ----
erjo@12043 103 To start $PACKAGE server you can run :
erjo@12043 104
erjo@12043 105 /etc/init.d/$PACKAGE start
erjo@12043 106
erjo@12043 107 Or add $PACKAGE to RUN_DAEMONS in /etc/rcS.conf
erjo@12043 108 ----
erjo@12043 109 EOF
erjo@12043 110 }
erjo@12043 111
erjo@12043 112
erjo@12043 113 post_remove()
erjo@12043 114 {
erjo@12043 115 echo "Removing stalled files..."
pascal@18730 116 test -d "$1/var/log/dovecot" && rm -rf "$1/var/log/dovecot"
pascal@18730 117 test -d "$1/var/run/dovecot" && rm -rf "$1/var/run/dovecot"
erjo@12043 118
erjo@12043 119 echo "Removing user/group daemon"
slaxemulator@12767 120 chroot "$1/" deluser dovecot
slaxemulator@12767 121 chroot "$1/" deluser dovenull
erjo@12043 122 }