wok view dovecot/receipt @ rev 24439

Add some current_version
author Pascal Bellard <pascal.bellard@slitaz.org>
date Sun Feb 13 18:01:32 2022 +0000 (2022-02-13)
parents ce368efd05fe
children 1c049ccf6c26
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 # What is the latest version available today?
19 current_version()
20 {
21 wget -O - https://www.dovecot.org/download/ 2>/dev/null | \
22 sed "/latest/d;/$PACKAGE-[0-9]/!d;/tar/!d;s|.*$PACKAGE-||;s|.tar.*||" | sort -Vr | sed q
23 }
25 # Rules to configure and make the package.
26 compile_rules()
27 {
28 ./configure \
29 --prefix=/usr \
30 --sysconfdir=/etc/dovecot \
31 --localstatedir=/var \
32 --libexecdir=/usr/lib/$PACKAGE \
33 --with-ldap=plugin \
34 --with-mysql \
35 --with-pgsql \
36 --with-sql=plugin \
37 --with-sqlite \
38 --with-ssl=openssl \
39 $CONFIGURE_ARGS &&
40 make &&
41 make DESTDIR=$DESTDIR install
43 }
45 # Rules to gen a SliTaz package suitable for Tazpkg.
46 genpkg_rules()
47 {
48 mkdir -p $fs/usr/lib
49 mkdir -p $fs/var/log/dovecot
50 mkdir -p $fs/etc/ssl/misc
52 cp -a $install/usr/sbin $fs/usr
53 cp -a $install/usr/bin $fs/usr
54 cp -a $install/usr/lib $fs/usr
55 cp -a $install/etc $fs
57 cp -pa $stuff/init.d $fs/etc
59 #cp -pa $fs/etc/dovecot/dovecot-example.conf $fs/etc/dovecot/dovecot.conf
60 cp -pa $install/usr/share/doc/dovecot/example-config/* \
61 $fs/etc/dovecot/
62 #cp -pa $src/doc/example-config/conf.d/*.conf $fs/etc/dovecot/conf.d
63 #cp -pa $src/doc/example-config/conf.d/*.ext $fs/etc/dovecot/conf.d
64 cp -pa $src/doc/*.cnf $fs/etc/ssl
65 cp -pa $src/doc/mkcert.sh \
66 $fs/etc/ssl/misc/dovmkcert.sh
68 # Remove archive files *.*a
69 find $fs -name "*.*a" -exec rm -f {} \;
71 # Fix permissions
72 chmod 755 $fs/etc/ssl/misc/*
74 # Customising configuration.
75 sed -i -e "s/^#default_vsz_limit.*/default_vsz_limit = 50M/" \
76 $fs/etc/dovecot/conf.d/10-master.conf
78 sed -i -e "s!^#log_path =.*!log_path = /var/log/dovecot/dovecot.log!" \
79 $fs/etc/dovecot/conf.d/10-logging.conf
81 sed -i -e "s/^#listen.*/listen = */" \
82 $fs/etc/dovecot/dovecot.conf
84 # Unsafe, see CVE-2014-3566 POODLE
85 sed -i -e "s/^#ssl_protocols =.*/ssl_protocols = !SSLv2 !SSLv3/" \
86 $fs/etc/dovecot/conf.d/10-ssl.conf
87 }
89 #nd post install commands for Tazpkg.
90 post_install()
91 {
92 local user
93 local group
95 user=dovecot
96 group=dovecot
98 if ! grep -q $user "$1/etc/passwd"
99 then
100 echo
101 echo -n "Adding user/group $user..."
102 chroot "$1/" addgroup -g 76 -S $group
103 chroot "$1/" adduser -u 76 -S -D -H -G $group $user
104 chroot "$1/" adduser -u 74 -S -D -H -G nogroup dovenull
105 status
106 fi
108 # Set permissions for files and directories
109 chroot "$1/" chown -R ${user}.${group} /var/log/${user} \
111 cat <<EOF
112 ----
113 To start $PACKAGE server you can run :
115 /etc/init.d/$PACKAGE start
117 Or add $PACKAGE to RUN_DAEMONS in /etc/rcS.conf
118 ----
119 EOF
120 }
123 post_remove()
124 {
125 echo "Removing stalled files..."
126 test -d "$1/var/log/dovecot" && rm -rf "$1/var/log/dovecot"
127 test -d "$1/var/run/dovecot" && rm -rf "$1/var/run/dovecot"
129 echo "Removing user/group daemon"
130 chroot "$1/" deluser dovecot
131 chroot "$1/" deluser dovenull
132 }