wok view dovecot/receipt @ rev 24011

mosh: create /usr/share/terminfo/x/xterm-256color link
author Pascal Bellard <pascal.bellard@slitaz.org>
date Fri Feb 05 17:16:12 2021 +0000 (2021-02-05)
parents 3c832ef040e6
children bfabe25c21ff
line source
1 # SliTaz package receipt.
3 PACKAGE="dovecot"
4 VERSION="2.3.9.2"
5 CATEGORY="network"
6 SHORT_DESC="Dovecot IMAP and POP3 Server."
7 MAINTAINER="l.lemarinel@gmail.com"
8 LICENSE="LGPL2.1"
9 WEB_SITE="https://dovecot.org/"
11 TARBALL="$PACKAGE-$VERSION.tar.gz"
12 WGET_URL="https://www.dovecot.org/releases/${VERSION:0:3}/$TARBALL"
14 DEPENDS="libcap libmysqlclient libssl openldap pam postgresql"
15 BUILD_DEPENDS="libcap-dev libmysqlclient mysql-dev openldap-dev
16 openssl-dev pam-dev postgresql-dev sqlite-dev"
18 # Rules to configure and make the package.
19 compile_rules()
20 {
21 ./configure \
22 --prefix=/usr \
23 --sysconfdir=/etc/dovecot \
24 --localstatedir=/var \
25 --libexecdir=/usr/lib/$PACKAGE \
26 --with-ldap=plugin \
27 --with-mysql \
28 --with-pgsql \
29 --with-sql=plugin \
30 --with-sqlite \
31 --with-ssl=openssl \
32 $CONFIGURE_ARGS &&
33 make &&
34 make DESTDIR=$DESTDIR install
36 }
38 # Rules to gen a SliTaz package suitable for Tazpkg.
39 genpkg_rules()
40 {
41 mkdir -p $fs/usr/lib
42 mkdir -p $fs/var/log/dovecot
43 mkdir -p $fs/etc/ssl/misc
45 cp -a $install/usr/sbin $fs/usr
46 cp -a $install/usr/bin $fs/usr
47 cp -a $install/usr/lib $fs/usr
48 cp -a $install/etc $fs
50 cp -pa $stuff/init.d $fs/etc
52 #cp -pa $fs/etc/dovecot/dovecot-example.conf $fs/etc/dovecot/dovecot.conf
53 cp -pa $install/usr/share/doc/dovecot/example-config/* \
54 $fs/etc/dovecot/
55 #cp -pa $src/doc/example-config/conf.d/*.conf $fs/etc/dovecot/conf.d
56 #cp -pa $src/doc/example-config/conf.d/*.ext $fs/etc/dovecot/conf.d
57 cp -pa $src/doc/*.cnf $fs/etc/ssl
58 cp -pa $src/doc/mkcert.sh \
59 $fs/etc/ssl/misc/dovmkcert.sh
61 # Remove archive files *.*a
62 find $fs -name "*.*a" -exec rm -f {} \;
64 # Fix permissions
65 chmod 755 $fs/etc/ssl/misc/*
67 # Customising configuration.
68 sed -i -e "s/^#default_vsz_limit.*/default_vsz_limit = 50M/" \
69 $fs/etc/dovecot/conf.d/10-master.conf
71 sed -i -e "s!^#log_path =.*!log_path = /var/log/dovecot/dovecot.log!" \
72 $fs/etc/dovecot/conf.d/10-logging.conf
74 sed -i -e "s/^#listen.*/listen = */" \
75 $fs/etc/dovecot/dovecot.conf
77 # Unsafe, see CVE-2014-3566 POODLE
78 sed -i -e "s/^#ssl_protocols =.*/ssl_protocols = !SSLv2 !SSLv3/" \
79 $fs/etc/dovecot/conf.d/10-ssl.conf
80 }
82 #nd post install commands for Tazpkg.
83 post_install()
84 {
85 local user
86 local group
88 user=dovecot
89 group=dovecot
91 if ! grep -q $user "$1/etc/passwd"
92 then
93 echo
94 echo -n "Adding user/group $user..."
95 chroot "$1/" addgroup -g 76 -S $group
96 chroot "$1/" adduser -u 76 -S -D -H -G $group $user
97 chroot "$1/" adduser -u 74 -S -D -H -G nogroup dovenull
98 status
99 fi
101 # Set permissions for files and directories
102 chroot "$1/" chown -R ${user}.${group} /var/log/${user} \
104 cat <<EOF
105 ----
106 To start $PACKAGE server you can run :
108 /etc/init.d/$PACKAGE start
110 Or add $PACKAGE to RUN_DAEMONS in /etc/rcS.conf
111 ----
112 EOF
113 }
116 post_remove()
117 {
118 echo "Removing stalled files..."
119 test -d "$1/var/log/dovecot" && rm -rf "$1/var/log/dovecot"
120 test -d "$1/var/run/dovecot" && rm -rf "$1/var/run/dovecot"
122 echo "Removing user/group daemon"
123 chroot "$1/" deluser dovecot
124 chroot "$1/" deluser dovenull
125 }