wok-next annotate postfix/receipt @ rev 20919
dbus-python -> python-dbus
author | Aleksej Bobylev <al.bobylev@gmail.com> |
---|---|
date | Wed Aug 22 09:09:15 2018 +0300 (2018-08-22) |
parents | 731f74708293 |
children | d5aab818505e |
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" |
pascal@20324 | 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" |
pascal@20324 | 15 SPLIT="postfix postfix-mysql" |
pascal@12163 | 16 |
pascal@1159 | 17 # Rules to configure and make the package. |
pascal@1159 | 18 compile_rules() |
pascal@1159 | 19 { |
pankso@3845 | 20 make makefiles \ |
pankso@3845 | 21 CCARGS='-DHAS_DB -DHAS_LDAP \ |
pascal@12163 | 22 -DUSE_SASL_AUTH -DUSE_CYRUS_SASL -I /usr/include/sasl \ |
erjo@9679 | 23 -DHAS_MYSQL -I/usr/include/mysql \ |
pankso@3845 | 24 -DDEF_DAEMON_DIR=\"/usr/lib/postfix\" \ |
erjo@15709 | 25 -DUSE_TLS \ |
pankso@3845 | 26 -DDEF_MANPAGE_DIR=\"/usr/share/man\"' \ |
pascal@18736 | 27 AUXLIBS="-ldb -lldap -llber -lsasl2 -lssl -lcrypto -lpthread \ |
erjo@9679 | 28 -L/usr/lib/mysql -lmysqlclient -lz -lm " && |
pascal@1159 | 29 make |
erjo@12040 | 30 install_root=$WOK/$PACKAGE/install \ |
pascal@1159 | 31 sh postfix-install -non-interactive |
pascal@1159 | 32 } |
pascal@1159 | 33 |
pascal@1159 | 34 # Rules to gen a SliTaz package suitable for Tazpkg. |
pascal@1159 | 35 genpkg_rules() |
pascal@1159 | 36 { |
pascal@20324 | 37 case $PACKAGE in |
pascal@20324 | 38 postfix) |
pascal@20324 | 39 TAZPANEL_DAEMON="man|edit::/etc/postfix/main.cf|options|web::$WEB_SITE" |
pascal@20324 | 40 CONFIG_FILES="/etc/postfix" |
pascal@20324 | 41 PROVIDE="sendmail" |
al@20453 | 42 DEPENDS="libdb libldap pcre openssl slitaz-base-files libsasl \ |
pascal@20324 | 43 libkrb5 libcomerr3 libmysqlclient" |
pascal@20324 | 44 mkdir -p $fs/usr/share/licenses/ |
pascal@20324 | 45 cp -a $install/usr/lib $fs/usr |
pascal@20324 | 46 cp -a $install/usr/bin $fs/usr |
pascal@20324 | 47 cp -a $install/usr/sbin $fs/usr |
pascal@20324 | 48 cp -a $install/etc $fs |
pankso@3845 | 49 |
pascal@20324 | 50 awk 'BEGIN {n=0} /MUST/ {n++} /ALIASES/ {n++} { if (n==1) print }' \ |
pascal@20324 | 51 < $install/etc/postfix/aliases > $fs/etc/postfix/aliases |
pascal@20324 | 52 while read keyword data; do |
pascal@20324 | 53 grep -q ^$keyword $fs/etc/postfix/main.cf && continue |
pascal@20324 | 54 mv $fs/etc/postfix/main.cf $fs/etc/postfix/main.cf.$$ |
pascal@20324 | 55 awk "BEGIN { scan=1 } /^#$keyword / { if (scan) { print \"$keyword $data\" ; scan=0 } } { print }" \ |
pascal@20324 | 56 < $fs/etc/postfix/main.cf.$$ > $fs/etc/postfix/main.cf |
pascal@20324 | 57 rm -f $fs/etc/postfix/main.cf.$$ |
pascal@20324 | 58 done << EOF |
pascal@1203 | 59 mydomain = localdomain |
pascal@1203 | 60 myorigin = localhost |
pascal@1203 | 61 mydestination = localhost, localhost.\$mydomain |
pascal@1203 | 62 mynetworks = 127.0.0.0/8 |
pascal@1203 | 63 alias_maps = hash:/etc/postfix/aliases |
pascal@1203 | 64 EOF |
pascal@20324 | 65 cat >> $fs/etc/postfix/main.cf <<EOF |
pascal@17237 | 66 |
pascal@17237 | 67 # Unsafe, see CVE-2014-3566 POODLE |
pascal@17237 | 68 smtpd_tls_mandatory_protocols = !SSLv2, !SSLv3 |
pascal@17237 | 69 EOF |
pascal@20324 | 70 cp -a $stuff/etc $fs |
pascal@20324 | 71 cp -a $install/var $fs |
pascal@20324 | 72 mv $fs/etc/postfix/TLS_LICENSE $fs/usr/share/licenses/POSTFIX_TLS_LICENSE |
pascal@20324 | 73 mv $fs/etc/postfix/LICENSE $fs/usr/share/licenses/POSTFIX_LICENSE |
pascal@20324 | 74 cp -a $stuff/etc/init.d $fs/etc |
pascal@20324 | 75 rm -f $fs/usr/lib/postfix/post* $fs/usr/lib/postfix/*.cf |
pascal@20324 | 76 strip -s $fs/usr/lib/postfix/* |
pascal@20324 | 77 ;; |
pascal@20324 | 78 postfix-mysql) |
pascal@20324 | 79 CAT="network|MySQL support for postfix" |
pascal@20324 | 80 DEPENDS="postfix libmysqlclient" |
pascal@20324 | 81 mkdir -p $fs/usr/lib/postfix/ |
pascal@20324 | 82 cp -a $src/src/global/dict_mysql.o $fs/usr/lib/postfix |
pascal@20324 | 83 ;; |
pascal@20324 | 84 esac |
pascal@1159 | 85 } |
pascal@1159 | 86 |
pascal@1159 | 87 # Pre and post install commands for Tazpkg. |
pascal@20324 | 88 post_install_postfix() |
pascal@1159 | 89 { |
erjo@12040 | 90 |
erjo@12040 | 91 local user |
erjo@12040 | 92 local group |
erjo@12040 | 93 |
erjo@12040 | 94 user=postfix |
erjo@12040 | 95 group=postdrop |
erjo@12040 | 96 |
pascal@18730 | 97 if ! grep -q $user "$1/etc/passwd"; then |
erjo@12040 | 98 echo -n "Adding user/group $user..." |
pascal@18730 | 99 chroot "$1/" addgroup -S $user |
pascal@18730 | 100 chroot "$1/" adduser -S -D -H -G $user $user |
pascal@18730 | 101 chroot "$1/" addgroup -S $group |
pascal@1159 | 102 status |
pascal@1159 | 103 fi |
erjo@12040 | 104 |
pascal@1159 | 105 # addgroup postdrop if needed |
pascal@18730 | 106 if ! grep -q postdrop "$1/etc/group"; then |
erjo@12040 | 107 echo -n "Adding group ${group}..." |
pascal@18730 | 108 chroot "$1/" addgroup -S $group |
pascal@1159 | 109 status |
pascal@1159 | 110 fi |
erjo@12040 | 111 |
pascal@18730 | 112 chroot "$1/" chown ${user} /var/spool/postfix/* /var/lib/postfix |
pascal@18730 | 113 chroot "$1/" chgrp ${group} /var/spool/postfix/maildrop \ |
pascal@2391 | 114 /var/spool/postfix/public /usr/sbin/postdrop /usr/sbin/postqueue |
pascal@18730 | 115 chmod 2755 "$1/usr/sbin/postdrop" "$1/usr/sbin/postqueue" |
pascal@18730 | 116 chmod 2710 "$1/var/spool/postfix/public" |
pascal@18730 | 117 chmod 1730 "$1/var/spool/postfix/maildrop" |
pascal@18730 | 118 chroot "$1/" postalias /etc/postfix/aliases |
pascal@1159 | 119 cat <<EOF |
erjo@12040 | 120 |
pascal@1159 | 121 ---- |
pascal@1159 | 122 Warning: you still need to edit myorigin/mydestination/mynetworks |
pascal@1159 | 123 parameter settings in /etc/postfix/main.cf. |
pascal@1159 | 124 See also http://www.postfix.org/STANDARD_CONFIGURATION_README.html |
pascal@1159 | 125 |
pascal@1159 | 126 To start $PACKAGE server you can run : |
pascal@1159 | 127 |
pascal@1159 | 128 /etc/init.d/$PACKAGE start |
pascal@1159 | 129 |
pascal@1159 | 130 Or add $PACKAGE to RUN_DAEMONS in /etc/rcS.conf |
pascal@1159 | 131 ---- |
pascal@1159 | 132 EOF |
pascal@1159 | 133 } |
pascal@1159 | 134 |
pascal@8878 | 135 # Overlap busybox |
pascal@20324 | 136 pre_install_postfix() |
pascal@8878 | 137 { |
pascal@18730 | 138 rm -f "$1/usr/sbin/sendmail" |
pascal@8878 | 139 } |
pascal@8878 | 140 |
pascal@20324 | 141 post_remove_postfix() |
pascal@1159 | 142 { |
pascal@1159 | 143 deluser postfix |
pascal@1159 | 144 delgroup postdrop |
pascal@8878 | 145 ln -s /bin/busybox /usr/sbin/sendmail |
pascal@1159 | 146 } |