wok-next annotate postfix/receipt @ rev 21573

updated dansguardian (2.10.1.1 -> 2.12.0.3)
author Hans-G?nter Theisgen
date Mon Jun 22 17:38:17 2020 +0100 (2020-06-22)
parents e6615350078d
children
rev   line source
pascal@20324 1 # SliTaz package receipt v2.
pascal@1159 2
pascal@1159 3 PACKAGE="postfix"
erjo@15709 4 VERSION="2.10.2"
pascal@1159 5 CATEGORY="network"
al@21020 6 SHORT_DESC="Fast, easy to administer, and secure mailer"
pascal@1159 7 MAINTAINER="pascal.bellard@slitaz.org"
pascal@15375 8 LICENSE="other"
pascal@1159 9 TARBALL="$PACKAGE-$VERSION.tar.gz"
pascal@1159 10 WEB_SITE="http://www.postfix.org/"
pankso@3845 11 WGET_URL="ftp://ftp.cs.tu-berlin.de/pub/net/mail/postfix/official/$TARBALL"
pascal@1159 12
pascal@12163 13 BUILD_DEPENDS="db-dev openldap-dev pcre-dev openssl-dev perl mysql-dev \
pascal@12163 14 cyrus-sasl-dev libsasl"
al@21020 15 SPLIT="$PACKAGE-mysql"
pascal@12163 16
al@21020 17 compile_rules() {
pankso@3845 18 make makefiles \
pankso@3845 19 CCARGS='-DHAS_DB -DHAS_LDAP \
pascal@12163 20 -DUSE_SASL_AUTH -DUSE_CYRUS_SASL -I /usr/include/sasl \
erjo@9679 21 -DHAS_MYSQL -I/usr/include/mysql \
pankso@3845 22 -DDEF_DAEMON_DIR=\"/usr/lib/postfix\" \
erjo@15709 23 -DUSE_TLS \
pankso@3845 24 -DDEF_MANPAGE_DIR=\"/usr/share/man\"' \
pascal@18736 25 AUXLIBS="-ldb -lldap -llber -lsasl2 -lssl -lcrypto -lpthread \
erjo@9679 26 -L/usr/lib/mysql -lmysqlclient -lz -lm " &&
al@21020 27 make &&
erjo@12040 28 install_root=$WOK/$PACKAGE/install \
pascal@1159 29 sh postfix-install -non-interactive
pascal@1159 30 }
pascal@1159 31
al@21020 32 genpkg_rules() {
pascal@20324 33 case $PACKAGE in
al@21020 34 postfix)
al@21020 35 TAZPANEL_DAEMON="man|edit::/etc/postfix/main.cf|options|web::$WEB_SITE"
al@21020 36 CONFIG_FILES="/etc/postfix"
al@21020 37 PROVIDE="sendmail"
al@21020 38 DEPENDS="libdb libldap pcre openssl slitaz-base-files libsasl \
pascal@20324 39 libkrb5 libcomerr3 libmysqlclient"
al@21020 40 mkdir -p $fs/usr/share/licenses/
al@21020 41 cp -a $install/usr/lib $fs/usr
al@21020 42 cp -a $install/usr/bin $fs/usr
al@21020 43 cp -a $install/usr/sbin $fs/usr
al@21020 44 cp -a $install/etc $fs
pankso@3845 45
al@21020 46 awk 'BEGIN {n=0} /MUST/ {n++} /ALIASES/ {n++} { if (n==1) print }' \
pascal@20324 47 < $install/etc/postfix/aliases > $fs/etc/postfix/aliases
al@21020 48 while read keyword data; do
al@21020 49 grep -q ^$keyword $fs/etc/postfix/main.cf && continue
al@21020 50 mv $fs/etc/postfix/main.cf $fs/etc/postfix/main.cf.$$
al@21020 51 awk "BEGIN { scan=1 } /^#$keyword / { if (scan) { print \"$keyword $data\"; scan=0 } } { print }" \
pascal@20324 52 < $fs/etc/postfix/main.cf.$$ > $fs/etc/postfix/main.cf
al@21020 53 rm -f $fs/etc/postfix/main.cf.$$
al@21020 54 done << EOF
pascal@1203 55 mydomain = localdomain
pascal@1203 56 myorigin = localhost
pascal@1203 57 mydestination = localhost, localhost.\$mydomain
pascal@1203 58 mynetworks = 127.0.0.0/8
pascal@1203 59 alias_maps = hash:/etc/postfix/aliases
pascal@1203 60 EOF
al@21020 61 cat >> $fs/etc/postfix/main.cf <<EOF
pascal@17237 62
pascal@17237 63 # Unsafe, see CVE-2014-3566 POODLE
pascal@17237 64 smtpd_tls_mandatory_protocols = !SSLv2, !SSLv3
pascal@17237 65 EOF
al@21020 66 cp -a $stuff/etc $fs
al@21020 67 cp -a $install/var $fs
al@21020 68 mv $fs/etc/postfix/TLS_LICENSE $fs/usr/share/licenses/POSTFIX_TLS_LICENSE
al@21020 69 mv $fs/etc/postfix/LICENSE $fs/usr/share/licenses/POSTFIX_LICENSE
al@21020 70 cp -a $stuff/etc/init.d $fs/etc
al@21020 71 rm -f $fs/usr/lib/postfix/post* $fs/usr/lib/postfix/*.cf
al@21020 72 strip -s $fs/usr/lib/postfix/*
al@21020 73 ;;
al@21020 74 *-mysql)
al@21020 75 CAT="network|postfix support"
al@21020 76 DEPENDS="postfix libmysqlclient"
al@21020 77 mkdir -p $fs/usr/lib/postfix/
al@21020 78 cp -a $src/src/global/dict_mysql.o $fs/usr/lib/postfix
al@21020 79 ;;
pascal@20324 80 esac
pascal@1159 81 }
pascal@1159 82
al@21020 83 post_install_postfix() {
erjo@12040 84 local user
erjo@12040 85 local group
al@21020 86
erjo@12040 87 user=postfix
erjo@12040 88 group=postdrop
al@21020 89
pascal@18730 90 if ! grep -q $user "$1/etc/passwd"; then
erjo@12040 91 echo -n "Adding user/group $user..."
pascal@18730 92 chroot "$1/" addgroup -S $user
pascal@18730 93 chroot "$1/" adduser -S -D -H -G $user $user
pascal@18730 94 chroot "$1/" addgroup -S $group
pascal@1159 95 status
pascal@1159 96 fi
erjo@12040 97
pascal@1159 98 # addgroup postdrop if needed
pascal@18730 99 if ! grep -q postdrop "$1/etc/group"; then
al@21020 100 echo -n "Adding group $group..."
pascal@18730 101 chroot "$1/" addgroup -S $group
pascal@1159 102 status
pascal@1159 103 fi
erjo@12040 104
al@21020 105 chroot "$1/" chown $user /var/spool/postfix/* /var/lib/postfix
al@21020 106 chroot "$1/" chgrp $group /var/spool/postfix/maildrop \
pascal@2391 107 /var/spool/postfix/public /usr/sbin/postdrop /usr/sbin/postqueue
pascal@18730 108 chmod 2755 "$1/usr/sbin/postdrop" "$1/usr/sbin/postqueue"
pascal@18730 109 chmod 2710 "$1/var/spool/postfix/public"
pascal@18730 110 chmod 1730 "$1/var/spool/postfix/maildrop"
pascal@18730 111 chroot "$1/" postalias /etc/postfix/aliases
pascal@1159 112 cat <<EOF
pascal@1159 113
al@21020 114 .-----------------------------------------------------------.
al@21020 115 | WARNING: |
al@21020 116 | you still need to edit myorigin/mydestination/mynetworks |
al@21020 117 | parameter settings in /etc/postfix/main.cf. |
al@21020 118 | See also: |
al@21020 119 | http://www.postfix.org/STANDARD_CONFIGURATION_README.html |
al@21020 120 |-----------------------------------------------------------|
al@21020 121 | To start postfix server you can run: |
al@21020 122 | |
al@21020 123 | /etc/init.d/$PACKAGE start |
al@21020 124 | |
al@21020 125 | or add postfix to RUN_DAEMONS in /etc/rcS.conf |
al@21020 126 '-----------------------------------------------------------'
pascal@1159 127 EOF
pascal@1159 128 }
pascal@1159 129
pascal@8878 130 # Overlap busybox
al@21020 131 pre_install_postfix() {
pascal@18730 132 rm -f "$1/usr/sbin/sendmail"
pascal@8878 133 }
pascal@8878 134
al@21020 135 post_remove_postfix() {
pascal@1159 136 deluser postfix
pascal@1159 137 delgroup postdrop
pascal@8878 138 ln -s /bin/busybox /usr/sbin/sendmail
pascal@1159 139 }