wok-current view dovecot/receipt @ rev 25560

Update some web_site
author Pascal Bellard <pascal.bellard@slitaz.org>
date Tue Apr 25 18:09:10 2023 +0000 (20 months ago)
parents bfabe25c21ff
children
line source
1 # SliTaz package receipt.
3 PACKAGE="dovecot"
4 VERSION="2.3.18"
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 libpostgresqlclient
16 mysql-dev openldap-dev openssl-dev pam-dev
17 postgresql-dev sqlite-dev"
19 # What is the latest version available today?
20 current_version()
21 {
22 wget -O - https://www.dovecot.org/download/ 2>/dev/null | \
23 sed "/latest/d;/$PACKAGE-[0-9]/!d;/tar/!d;s|.*$PACKAGE-||;s|.tar.*||" | sort -Vr | sed q
24 }
26 # Rules to configure and make the package.
27 compile_rules()
28 {
29 ./configure \
30 --prefix=/usr \
31 --sysconfdir=/etc \
32 --localstatedir=/var \
33 --libexecdir=/usr/lib/$PACKAGE \
34 --with-ldap=plugin \
35 --with-mysql \
36 --with-pgsql \
37 --with-sql=plugin \
38 --with-sqlite \
39 --with-ssl=openssl \
40 $CONFIGURE_ARGS &&
41 make &&
42 make install DESTDIR=$DESTDIR
43 }
45 # Rules to gen a SliTaz package suitable for Tazpkg.
46 genpkg_rules()
47 {
48 mkdir -p $fs/etc/ssl/misc
49 mkdir -p $fs/usr/lib
50 mkdir -p $fs/var/log/dovecot
52 cp -a $install/etc $fs
53 cp -a $install/usr/bin $fs/usr
54 cp -a $install/usr/lib $fs/usr
55 cp -a $install/usr/sbin $fs/usr
57 cp -pa $stuff/init.d $fs/etc
58 cp -pa $install/usr/share/doc/dovecot/example-config/* \
59 $fs/etc/dovecot
60 cp -pa $src/doc/*.cnf $fs/etc/ssl
61 cp -pa $src/doc/mkcert.sh $fs/etc/ssl/misc/dovmkcert.sh
63 # Remove archive files *.*a
64 find $fs -name "*.*a" -exec rm -f {} \;
66 # Fix permissions
67 chmod 755 $fs/etc/ssl/misc/*
69 # Customising configuration.
70 sed -i -e "s|^#default_vsz_limit.*|default_vsz_limit = 50M|" \
71 $fs/etc/dovecot/conf.d/10-master.conf
73 sed -i -e "s|^#log_path =.*|log_path = /var/log/dovecot/dovecot.log|" \
74 $fs/etc/dovecot/conf.d/10-logging.conf
76 sed -i -e "s|^#listen.*|listen = *|" \
77 $fs/etc/dovecot/dovecot.conf
79 # Unsafe, see CVE-2014-3566 POODLE
80 sed -i -e "s|^#ssl_protocols =.*|ssl_protocols = !SSLv2 !SSLv3|" \
81 $fs/etc/dovecot/conf.d/10-ssl.conf
82 }
84 # Post install commands for Tazpkg.
85 post_install()
86 {
87 local user
88 local group
90 user=dovecot
91 group=dovecot
93 if ! grep -q $user "$1/etc/passwd"
94 then
95 echo
96 echo -n "Adding user and group $user..."
97 chroot "$1/" addgroup -g 76 -S $group
98 chroot "$1/" adduser -u 76 -S -D -H -G $group $user
99 chroot "$1/" adduser -u 74 -S -D -H -G nogroup dovenull
100 status
101 fi
103 # Set permissions for files and directories
104 chroot "$1/" chown -R ${user}.${group} /var/log/${user} \
106 # Create certificate, if neccessary
107 [ -f "$1/etc/ssl/certs/dovecot.pem" ] ||
108 chroot "$1/" sh -c 'cd etc/ssl; ./misc/dovmkcert.sh'
110 cat <<EOF
111 ----
112 To start $PACKAGE server you can run :
114 /etc/init.d/$PACKAGE start
116 Or add $PACKAGE to RUN_DAEMONS in /etc/rcS.conf
117 ----
118 EOF
119 }
121 # Post remove commands for Tazpkg.
122 post_remove()
123 {
124 echo "Removing obsolete files..."
125 test -d "$1/var/log/dovecot" && rm -rf "$1/var/log/dovecot"
126 test -d "$1/var/run/dovecot" && rm -rf "$1/var/run/dovecot"
128 echo "Removing user and group dovecot"
129 chroot "$1/" deluser dovecot
130 chroot "$1/" deluser dovenull
131 }