wok-next diff postfix/receipt @ rev 21020

Cleaning is almost finished... I should proceed to upgrades.
author Aleksej Bobylev <al.bobylev@gmail.com>
date Fri Nov 02 14:15:08 2018 +0200 (2018-11-02)
parents e6615350078d
children
line diff
     1.1 --- a/postfix/receipt	Wed Feb 28 16:28:07 2018 +0200
     1.2 +++ b/postfix/receipt	Fri Nov 02 14:15:08 2018 +0200
     1.3 @@ -3,7 +3,7 @@
     1.4  PACKAGE="postfix"
     1.5  VERSION="2.10.2"
     1.6  CATEGORY="network"
     1.7 -SHORT_DESC="fast, easy to administer, and secure mailer"
     1.8 +SHORT_DESC="Fast, easy to administer, and secure mailer"
     1.9  MAINTAINER="pascal.bellard@slitaz.org"
    1.10  LICENSE="other"
    1.11  TARBALL="$PACKAGE-$VERSION.tar.gz"
    1.12 @@ -12,11 +12,9 @@
    1.13  
    1.14  BUILD_DEPENDS="db-dev openldap-dev pcre-dev openssl-dev perl mysql-dev \
    1.15  cyrus-sasl-dev libsasl"
    1.16 -SPLIT="postfix postfix-mysql"
    1.17 +SPLIT="$PACKAGE-mysql"
    1.18  
    1.19 -# Rules to configure and make the package.
    1.20 -compile_rules()
    1.21 -{
    1.22 +compile_rules() {
    1.23  	make makefiles \
    1.24  	CCARGS='-DHAS_DB -DHAS_LDAP \
    1.25  		-DUSE_SASL_AUTH -DUSE_CYRUS_SASL -I /usr/include/sasl \
    1.26 @@ -26,74 +24,69 @@
    1.27  		-DDEF_MANPAGE_DIR=\"/usr/share/man\"' \
    1.28  	AUXLIBS="-ldb -lldap -llber -lsasl2 -lssl -lcrypto -lpthread \
    1.29  		-L/usr/lib/mysql -lmysqlclient -lz -lm " &&
    1.30 -	make
    1.31 +	make &&
    1.32  	install_root=$WOK/$PACKAGE/install \
    1.33  		sh postfix-install -non-interactive
    1.34  }
    1.35  
    1.36 -# Rules to gen a SliTaz package suitable for Tazpkg.
    1.37 -genpkg_rules()
    1.38 -{
    1.39 +genpkg_rules() {
    1.40  	case $PACKAGE in
    1.41 -	postfix)
    1.42 -		TAZPANEL_DAEMON="man|edit::/etc/postfix/main.cf|options|web::$WEB_SITE"
    1.43 -		CONFIG_FILES="/etc/postfix"
    1.44 -		PROVIDE="sendmail"
    1.45 -		DEPENDS="libdb libldap pcre openssl slitaz-base-files libsasl \
    1.46 +		postfix)
    1.47 +			TAZPANEL_DAEMON="man|edit::/etc/postfix/main.cf|options|web::$WEB_SITE"
    1.48 +			CONFIG_FILES="/etc/postfix"
    1.49 +			PROVIDE="sendmail"
    1.50 +			DEPENDS="libdb libldap pcre openssl slitaz-base-files libsasl \
    1.51  			libkrb5 libcomerr3 libmysqlclient"
    1.52 -		mkdir -p $fs/usr/share/licenses/
    1.53 -		cp -a $install/usr/lib $fs/usr
    1.54 -		cp -a $install/usr/bin $fs/usr
    1.55 -		cp -a $install/usr/sbin $fs/usr
    1.56 -		cp -a $install/etc $fs
    1.57 +			mkdir -p $fs/usr/share/licenses/
    1.58 +			cp -a $install/usr/lib $fs/usr
    1.59 +			cp -a $install/usr/bin $fs/usr
    1.60 +			cp -a $install/usr/sbin $fs/usr
    1.61 +			cp -a $install/etc $fs
    1.62  
    1.63 -		awk 'BEGIN {n=0} /MUST/ {n++} /ALIASES/ {n++} { if (n==1) print }' \
    1.64 +			awk 'BEGIN {n=0} /MUST/ {n++} /ALIASES/ {n++} { if (n==1) print }' \
    1.65  			< $install/etc/postfix/aliases > $fs/etc/postfix/aliases
    1.66 -		while read keyword data; do
    1.67 -			grep -q ^$keyword $fs/etc/postfix/main.cf && continue
    1.68 -			mv $fs/etc/postfix/main.cf $fs/etc/postfix/main.cf.$$
    1.69 -			awk "BEGIN { scan=1 } /^#$keyword / { if (scan) { print \"$keyword $data\" ; scan=0 } } { print }" \
    1.70 +			while read keyword data; do
    1.71 +				grep -q ^$keyword $fs/etc/postfix/main.cf && continue
    1.72 +				mv $fs/etc/postfix/main.cf $fs/etc/postfix/main.cf.$$
    1.73 +				awk "BEGIN { scan=1 } /^#$keyword / { if (scan) { print \"$keyword $data\"; scan=0 } } { print }" \
    1.74  				< $fs/etc/postfix/main.cf.$$ > $fs/etc/postfix/main.cf
    1.75 -			rm -f $fs/etc/postfix/main.cf.$$
    1.76 -		done << EOF
    1.77 +				rm -f $fs/etc/postfix/main.cf.$$
    1.78 +			done << EOF
    1.79  mydomain = localdomain
    1.80  myorigin = localhost
    1.81  mydestination = localhost, localhost.\$mydomain
    1.82  mynetworks = 127.0.0.0/8
    1.83  alias_maps = hash:/etc/postfix/aliases
    1.84  EOF
    1.85 -		cat >> $fs/etc/postfix/main.cf <<EOF
    1.86 +			cat >> $fs/etc/postfix/main.cf <<EOF
    1.87  
    1.88  # Unsafe, see CVE-2014-3566 POODLE
    1.89  smtpd_tls_mandatory_protocols = !SSLv2, !SSLv3
    1.90  EOF
    1.91 -		cp -a $stuff/etc $fs
    1.92 -		cp -a $install/var $fs
    1.93 -		mv $fs/etc/postfix/TLS_LICENSE $fs/usr/share/licenses/POSTFIX_TLS_LICENSE
    1.94 -		mv $fs/etc/postfix/LICENSE $fs/usr/share/licenses/POSTFIX_LICENSE
    1.95 -		cp -a $stuff/etc/init.d $fs/etc
    1.96 -		rm -f $fs/usr/lib/postfix/post* $fs/usr/lib/postfix/*.cf
    1.97 -		strip -s $fs/usr/lib/postfix/*
    1.98 -		;;
    1.99 -	postfix-mysql)
   1.100 -		CAT="network|MySQL support for postfix"
   1.101 -		DEPENDS="postfix libmysqlclient"
   1.102 -		mkdir -p $fs/usr/lib/postfix/
   1.103 -		cp -a $src/src/global/dict_mysql.o $fs/usr/lib/postfix
   1.104 -		;;
   1.105 +			cp -a $stuff/etc $fs
   1.106 +			cp -a $install/var $fs
   1.107 +			mv $fs/etc/postfix/TLS_LICENSE $fs/usr/share/licenses/POSTFIX_TLS_LICENSE
   1.108 +			mv $fs/etc/postfix/LICENSE $fs/usr/share/licenses/POSTFIX_LICENSE
   1.109 +			cp -a $stuff/etc/init.d $fs/etc
   1.110 +			rm -f $fs/usr/lib/postfix/post* $fs/usr/lib/postfix/*.cf
   1.111 +			strip -s $fs/usr/lib/postfix/*
   1.112 +			;;
   1.113 +		*-mysql)
   1.114 +			CAT="network|postfix support"
   1.115 +			DEPENDS="postfix libmysqlclient"
   1.116 +			mkdir -p $fs/usr/lib/postfix/
   1.117 +			cp -a $src/src/global/dict_mysql.o $fs/usr/lib/postfix
   1.118 +			;;
   1.119  	esac
   1.120  }
   1.121  
   1.122 -# Pre and post install commands for Tazpkg.
   1.123 -post_install_postfix()
   1.124 -{
   1.125 -
   1.126 +post_install_postfix() {
   1.127  	local user
   1.128  	local group
   1.129 -	
   1.130 +
   1.131  	user=postfix
   1.132  	group=postdrop
   1.133 -	
   1.134 +
   1.135  	if ! grep -q $user "$1/etc/passwd"; then
   1.136  		echo -n "Adding user/group $user..."
   1.137  		chroot "$1/" addgroup -S $user
   1.138 @@ -104,42 +97,42 @@
   1.139  
   1.140  	# addgroup postdrop if needed
   1.141  	if ! grep -q postdrop "$1/etc/group"; then
   1.142 -		echo -n "Adding group ${group}..."
   1.143 +		echo -n "Adding group $group..."
   1.144  		chroot "$1/" addgroup -S $group
   1.145  		status
   1.146  	fi
   1.147  
   1.148 -	chroot "$1/" chown ${user} /var/spool/postfix/* /var/lib/postfix
   1.149 -	chroot "$1/" chgrp ${group} /var/spool/postfix/maildrop \
   1.150 +	chroot "$1/" chown $user /var/spool/postfix/* /var/lib/postfix
   1.151 +	chroot "$1/" chgrp $group /var/spool/postfix/maildrop \
   1.152  		/var/spool/postfix/public /usr/sbin/postdrop /usr/sbin/postqueue
   1.153  	chmod 2755 "$1/usr/sbin/postdrop" "$1/usr/sbin/postqueue"
   1.154  	chmod 2710 "$1/var/spool/postfix/public"
   1.155  	chmod 1730 "$1/var/spool/postfix/maildrop"
   1.156  	chroot "$1/" postalias /etc/postfix/aliases
   1.157  	cat <<EOF
   1.158 -	
   1.159 -----
   1.160 -Warning: you still need to edit myorigin/mydestination/mynetworks
   1.161 -parameter settings in /etc/postfix/main.cf.
   1.162 -See also http://www.postfix.org/STANDARD_CONFIGURATION_README.html
   1.163  
   1.164 -To start $PACKAGE server you can run :
   1.165 -
   1.166 -    /etc/init.d/$PACKAGE start
   1.167 -
   1.168 -Or add $PACKAGE to RUN_DAEMONS in /etc/rcS.conf
   1.169 -----
   1.170 +	.-----------------------------------------------------------.
   1.171 +	| WARNING:                                                  |
   1.172 +	| you still need to edit myorigin/mydestination/mynetworks  |
   1.173 +	| parameter settings in /etc/postfix/main.cf.               |
   1.174 +	| See also:                                                 |
   1.175 +	| http://www.postfix.org/STANDARD_CONFIGURATION_README.html |
   1.176 +	|-----------------------------------------------------------|
   1.177 +	| To start postfix server you can run:                      |
   1.178 +	|                                                           |
   1.179 +	|    /etc/init.d/$PACKAGE start                             |
   1.180 +	|                                                           |
   1.181 +	| or add postfix to RUN_DAEMONS in /etc/rcS.conf            |
   1.182 +	'-----------------------------------------------------------'
   1.183  EOF
   1.184  }
   1.185  
   1.186  # Overlap busybox
   1.187 -pre_install_postfix()
   1.188 -{
   1.189 +pre_install_postfix() {
   1.190  	rm -f "$1/usr/sbin/sendmail"
   1.191  }
   1.192  
   1.193 -post_remove_postfix()
   1.194 -{
   1.195 +post_remove_postfix() {
   1.196  	deluser postfix
   1.197  	delgroup postdrop
   1.198  	ln -s /bin/busybox /usr/sbin/sendmail