wok-next view dovecot/receipt @ rev 21727

created recipe for vbindiff
author Hans-G?nter Theisgen
date Sat Nov 21 14:32:44 2020 +0100 (2020-11-21)
parents 7d220edb0d73
children
line source
1 # SliTaz package receipt v2.
3 PACKAGE="dovecot"
4 VERSION="2.3.10"
5 CATEGORY="network"
6 SHORT_DESC="Dovecot IMAP and POP3 Server"
7 MAINTAINER="maintainer@slitaz.org"
8 LICENSE="LGPL2.1"
9 WEB_SITE="https://dovecot.org/"
11 TARBALL="$PACKAGE-$VERSION.tar.gz"
12 WGET_URL="http://www.dovecot.org/releases/${VERSION%.*}/$TARBALL"
14 BUILD_DEPENDS="libcap-dev libmysqlclient mysql-dev openldap-dev
15 openssl-dev pam-dev postgresql-dev sqlite3-dev"
17 compile_rules()
18 {
19 ./configure \
20 --sysconfdir=/etc/dovecot \
21 --libexecdir=/usr/lib/$PACKAGE \
22 --with-ssl=openssl \
23 --with-ldap=plugin \
24 --with-sql=plugin \
25 --with-mysql \
26 --with-pgsql \
27 --with-sqlite \
28 $CONFIGURE_ARGS &&
29 fix libtool &&
30 make &&
31 make DESTDIR=$install install || return 1
33 install -Dm755 $stuff/init.d/dovecot $install/etc/init.d/dovecot
34 }
36 genpkg_rules()
37 {
38 mkdir -p $fs/usr/lib \
39 $fs/var/log/dovecot \
40 $fs/etc/ssl/misc
42 cp -a $install/usr/sbin $fs/usr
43 cp -a $install/usr/bin $fs/usr
44 cp -a $install/usr/lib $fs/usr
45 cp -a $install/etc $fs/
47 #cp -pa $fs/etc/dovecot/dovecot-example.conf $fs/etc/dovecot/dovecot.conf
48 cp -pa $install/usr/share/doc/dovecot/example-config/* $fs/etc/dovecot/
49 #cp -pa $src/doc/example-config/conf.d/*.conf $fs/etc/dovecot/conf.d
50 #cp -pa $src/doc/example-config/conf.d/*.ext $fs/etc/dovecot/conf.d
51 cp -pa $src/doc/*.cnf $fs/etc/ssl
52 cp -pa $src/doc/mkcert.sh $fs/etc/ssl/misc/dovmkcert.sh
54 # Remove archive file *.*a
55 find $fs -name "*.*a" -exec rm -f {} \;
57 # Fix permissions
58 chmod 755 $fs/etc/ssl/misc/*
60 # Customising configuration
61 sed -i -e "s/^#default_vsz_limit.*/default_vsz_limit = 50M/" \
62 $fs/etc/dovecot/conf.d/10-master.conf
64 sed -i -e "s!^#log_path =.*!log_path = /var/log/dovecot/dovecot.log!" \
65 $fs/etc/dovecot/conf.d/10-logging.conf
67 sed -i -e "s/^#listen.*/listen = */" \
68 $fs/etc/dovecot/dovecot.conf
70 # Unsafe, see CVE-2014-3566 POODLE
71 sed -i -e "s/^#ssl_protocols =.*/ssl_protocols = !SSLv2 !SSLv3/" \
72 $fs/etc/dovecot/conf.d/10-ssl.conf
73 DEPENDS="openssl libcap openldap pam postgresql libmysqlclient"
74 }
76 post_install()
77 {
78 local user=dovecot group=dovecot
80 if ! grep -q $user "$1/etc/passwd"
81 then
82 chroot "$1/" addgroup -g 76 -S $group
83 chroot "$1/" adduser -u 76 -S -D -H -G $group $user
84 chroot "$1/" adduser -u 74 -S -D -H -G nogroup dovenull
85 fi
87 # Set permissions for files and directories
88 chroot "$1/" chown -R $user:$group /var/log/dovecot
90 [ -n "$quiet" } || cat <<EOF
92 .------------------------------------------------.
93 | To start dovecot server you can run: |
94 | /etc/init.d/dovecot start |
95 | |
96 | Or add dovecot to RUN_DAEMONS in /etc/rcS.conf |
97 '------------------------------------------------'
98 EOF
99 }
102 post_remove()
103 {
104 [ -d "$1/var/log/dovecot" ] && rm -rf "$1/var/log/dovecot"
105 [ -d "$1/var/run/dovecot" ] && rm -rf "$1/var/run/dovecot"
107 chroot "$1/" deluser dovecot
108 chroot "$1/" deluser dovenull
109 }