wok-next diff dovecot/receipt @ rev 20534

Clean default configure options when site script used.
author Aleksej Bobylev <al.bobylev@gmail.com>
date Fri Mar 30 19:31:50 2018 +0300 (2018-03-30)
parents e6615350078d
children 835b3b8ce6ac
line diff
     1.1 --- a/dovecot/receipt	Wed Feb 28 16:28:07 2018 +0200
     1.2 +++ b/dovecot/receipt	Fri Mar 30 19:31:50 2018 +0300
     1.3 @@ -1,26 +1,22 @@
     1.4 -# SliTaz package receipt.
     1.5 +# SliTaz package receipt v2.
     1.6  
     1.7  PACKAGE="dovecot"
     1.8  VERSION="2.1.6"
     1.9  CATEGORY="network"
    1.10 -SHORT_DESC="Dovecot IMAP and POP3 Server."
    1.11 +SHORT_DESC="Dovecot IMAP and POP3 Server"
    1.12  MAINTAINER="l.lemarinel@gmail.com"
    1.13  LICENSE="LGPL2.1"
    1.14 +WEB_SITE="http://dovecot.org"
    1.15 +
    1.16  TARBALL="$PACKAGE-$VERSION.tar.gz"
    1.17 -WEB_SITE="http://dovecot.org"
    1.18  WGET_URL="http://www.dovecot.org/releases/${VERSION:0:3}/$TARBALL"
    1.19  
    1.20 -DEPENDS="openssl libcap openldap pam postgresql libmysqlclient"
    1.21  BUILD_DEPENDS="openssl-dev libcap-dev openldap-dev \
    1.22 - libmysqlclient mysql-dev sqlite3-dev pam-dev postgresql-dev"
    1.23 +libmysqlclient mysql-dev sqlite3-dev pam-dev postgresql-dev"
    1.24  
    1.25 -# Rules to configure and make the package.
    1.26 -compile_rules()
    1.27 -{
    1.28 -	cd $src
    1.29 -	./configure  --prefix=/usr \
    1.30 +compile_rules() {
    1.31 +	./configure \
    1.32  		--sysconfdir=/etc/dovecot \
    1.33 -		--localstatedir=/var \
    1.34  		--libexecdir=/usr/lib/$PACKAGE \
    1.35  		--with-ssl=openssl \
    1.36  		--with-ldap=plugin \
    1.37 @@ -30,24 +26,20 @@
    1.38  		--with-sqlite \
    1.39  		$CONFIGURE_ARGS &&
    1.40  	make &&
    1.41 -	make DESTDIR=$DESTDIR install
    1.42 -	
    1.43 +	make DESTDIR=$DESTDIR install || return 1
    1.44 +
    1.45 +	install -Dm755 $stuff/init.d/dovecot $install/etc/init.d/dovecot
    1.46  }
    1.47  
    1.48 -# Rules to gen a SliTaz package suitable for Tazpkg.
    1.49 -genpkg_rules()
    1.50 -{
    1.51 +genpkg_rules() {
    1.52  	mkdir -p $fs/usr/lib \
    1.53  		$fs/var/log/dovecot \
    1.54  		$fs/etc/ssl/misc
    1.55 -		
    1.56 -	
    1.57 +
    1.58  	cp -a $install/usr/sbin $fs/usr
    1.59  	cp -a $install/usr/bin $fs/usr
    1.60  	cp -a $install/usr/lib $fs/usr
    1.61  	cp -a $install/etc $fs/
    1.62 -	
    1.63 -	cp -pa $stuff/init.d $fs/etc
    1.64  
    1.65  	#cp -pa $fs/etc/dovecot/dovecot-example.conf $fs/etc/dovecot/dovecot.conf
    1.66  	cp -pa $install/usr/share/doc/dovecot/example-config/* $fs/etc/dovecot/
    1.67 @@ -55,68 +47,57 @@
    1.68  	#cp -pa $src/doc/example-config/conf.d/*.ext $fs/etc/dovecot/conf.d
    1.69  	cp -pa $src/doc/*.cnf $fs/etc/ssl
    1.70  	cp -pa $src/doc/mkcert.sh $fs/etc/ssl/misc/dovmkcert.sh
    1.71 -	
    1.72 +
    1.73  	# Remove archive file *.*a
    1.74  	find $fs -name "*.*a" -exec rm -f {} \;
    1.75 -	
    1.76 +
    1.77  	# Fix perms
    1.78  	chmod 755 $fs/etc/ssl/misc/*
    1.79 -	
    1.80 +
    1.81  	# Customising config.
    1.82  	sed -i -e "s/^#default_vsz_limit.*/default_vsz_limit = 50M/" \
    1.83  		$fs/etc/dovecot/conf.d/10-master.conf
    1.84  
    1.85  	sed -i -e "s!^#log_path =.*!log_path = /var/log/dovecot/dovecot.log!" \
    1.86  		$fs/etc/dovecot/conf.d/10-logging.conf
    1.87 -	
    1.88 +
    1.89  	sed -i -e "s/^#listen.*/listen = */" \
    1.90  		$fs/etc/dovecot/dovecot.conf
    1.91  
    1.92  	# Unsafe, see CVE-2014-3566 POODLE
    1.93  	sed -i -e "s/^#ssl_protocols =.*/ssl_protocols = !SSLv2 !SSLv3/" \
    1.94  		$fs/etc/dovecot/conf.d/10-ssl.conf
    1.95 +	DEPENDS="openssl libcap openldap pam postgresql libmysqlclient"
    1.96  }
    1.97  
    1.98 -#nd post install commands for Tazpkg.
    1.99 -post_install()
   1.100 -{
   1.101 -	local user
   1.102 -	local group
   1.103 -	
   1.104 -	user=dovecot
   1.105 -	group=dovecot
   1.106 -	
   1.107 +post_install() {
   1.108 +	local user=dovecot group=dovecot
   1.109 +
   1.110  	if ! grep -q $user "$1/etc/passwd"; then
   1.111 -		echo -n "Adding user/group $user..."
   1.112  		chroot "$1/" addgroup -g 76 -S $group
   1.113 -		chroot "$1/" adduser -u 76 -S -D -H -G $group $user
   1.114 -		chroot "$1/" adduser -u 74 -S -D -H -G nogroup dovenull 
   1.115 -		status
   1.116 +		chroot "$1/" adduser  -u 76 -S -D -H -G $group  $user
   1.117 +		chroot "$1/" adduser  -u 74 -S -D -H -G nogroup dovenull
   1.118  	fi
   1.119 -	
   1.120  
   1.121  	# Set perms for files and directories
   1.122 -	chroot "$1/" chown -R ${user}.${group} /var/log/${user} \
   1.123 +	chroot "$1/" chown -R $user:$group /var/log/dovecot
   1.124  
   1.125 -	cat <<EOF
   1.126 -----
   1.127 -To start $PACKAGE server you can run :
   1.128 +	[ -n "$quiet" } || cat <<EOF
   1.129  
   1.130 -    /etc/init.d/$PACKAGE start
   1.131 -
   1.132 -Or add $PACKAGE to RUN_DAEMONS in /etc/rcS.conf
   1.133 -----
   1.134 +	.------------------------------------------------.
   1.135 +	| To start dovecot server you can run:           |
   1.136 +	|   /etc/init.d/dovecot start                    |
   1.137 +	|                                                |
   1.138 +	| Or add dovecot to RUN_DAEMONS in /etc/rcS.conf |
   1.139 +	'------------------------------------------------'
   1.140  EOF
   1.141  }
   1.142  
   1.143  
   1.144 -post_remove()
   1.145 -{
   1.146 -	echo "Removing stalled files..."
   1.147 -	test -d "$1/var/log/dovecot" && rm -rf "$1/var/log/dovecot"
   1.148 -	test -d "$1/var/run/dovecot" && rm -rf "$1/var/run/dovecot"
   1.149 -	
   1.150 -	echo "Removing user/group daemon"
   1.151 -	chroot "$1/" deluser dovecot 
   1.152 +post_remove() {
   1.153 +	[ -d "$1/var/log/dovecot" ] && rm -rf "$1/var/log/dovecot"
   1.154 +	[ -d "$1/var/run/dovecot" ] && rm -rf "$1/var/run/dovecot"
   1.155 +
   1.156 +	chroot "$1/" deluser dovecot
   1.157  	chroot "$1/" deluser dovenull
   1.158  }