wok-current annotate postfix/receipt @ rev 25525
created recipe for lua5.1-lpeg 1.0.2
author | Hans-G?nter Theisgen |
---|---|
date | Fri Feb 24 17:54:40 2023 +0100 (18 months ago) |
parents | 8b06244cfb19 |
children |
rev | line source |
---|---|
pascal@1159 | 1 # SliTaz package receipt. |
pascal@1159 | 2 |
pascal@1159 | 3 PACKAGE="postfix" |
Hans-G?nter@21696 | 4 VERSION="3.4.5" |
pascal@1159 | 5 CATEGORY="network" |
Hans-G?nter@21696 | 6 SHORT_DESC="Fast, easy to administer, and secure mailer." |
pascal@1159 | 7 MAINTAINER="pascal.bellard@slitaz.org" |
pascal@15375 | 8 LICENSE="other" |
Hans-G?nter@21696 | 9 WEB_SITE="http://www.postfix.org/" |
Hans-G?nter@21696 | 10 |
pascal@1159 | 11 TARBALL="$PACKAGE-$VERSION.tar.gz" |
Hans-G?nter@21696 | 12 WGET_URL="http://postfix.mirrors.ovh.net/$PACKAGE-release/official/$TARBALL" |
Hans-G?nter@21696 | 13 |
Hans-G?nter@21696 | 14 PROVIDE="sendmail" |
Hans-G?nter@21696 | 15 DEPENDS="libdb libldap pcre libssl slitaz-base-files libsasl libkrb5 \ |
Hans-G?nter@21696 | 16 libcomerr3 libmysqlclient" |
Hans-G?nter@21696 | 17 BUILD_DEPENDS="db-dev openldap-dev pcre-dev openssl-dev perl mysql-dev \ |
Hans-G?nter@21696 | 18 cyrus-sasl-dev libsasl" |
pascal@14772 | 19 TAZPANEL_DAEMON="man|edit::/etc/postfix/main.cf|options|web::$WEB_SITE" |
pascal@1195 | 20 CONFIG_FILES="/etc/postfix" |
pascal@12163 | 21 |
pascal@24453 | 22 # What is the latest version available today? |
pascal@24453 | 23 current_version() |
pascal@24453 | 24 { |
pascal@24453 | 25 wget -O - ${WGET_URL%/*}/ 2>/dev/null | \ |
pascal@24453 | 26 sed "/latest/d;/$PACKAGE-[0-9\.]*tar/!d;/tar/!d;s|.*$PACKAGE-\\(.*\\).tar.*|\\1|" | sort -Vr | sed q |
pascal@24453 | 27 } |
pascal@24453 | 28 |
pascal@1159 | 29 # Rules to configure and make the package. |
pascal@1159 | 30 compile_rules() |
pascal@1159 | 31 { |
pankso@3845 | 32 make makefiles \ |
pankso@3845 | 33 CCARGS='-DHAS_DB -DHAS_LDAP \ |
pascal@12163 | 34 -DUSE_SASL_AUTH -DUSE_CYRUS_SASL -I /usr/include/sasl \ |
erjo@9679 | 35 -DHAS_MYSQL -I/usr/include/mysql \ |
pankso@3845 | 36 -DDEF_DAEMON_DIR=\"/usr/lib/postfix\" \ |
erjo@15709 | 37 -DUSE_TLS \ |
pankso@3845 | 38 -DDEF_MANPAGE_DIR=\"/usr/share/man\"' \ |
pascal@18736 | 39 AUXLIBS="-ldb -lldap -llber -lsasl2 -lssl -lcrypto -lpthread \ |
erjo@9679 | 40 -L/usr/lib/mysql -lmysqlclient -lz -lm " && |
pascal@1159 | 41 make |
pascal@19925 | 42 export install_root=$DESTDIR |
pascal@19927 | 43 sh postfix-install -non-interactive 2>&1 | grep -v warning: |
pascal@1159 | 44 } |
pascal@1159 | 45 |
pascal@1159 | 46 # Rules to gen a SliTaz package suitable for Tazpkg. |
pascal@1159 | 47 genpkg_rules() |
pascal@1159 | 48 { |
pascal@1159 | 49 mkdir -p $fs/usr/share/licenses/ |
Hans-G?nter@21696 | 50 cp -a $install/usr/lib $fs/usr |
Hans-G?nter@21696 | 51 cp -a $install/usr/bin $fs/usr |
Hans-G?nter@21696 | 52 cp -a $install/usr/sbin $fs/usr |
Hans-G?nter@21696 | 53 cp -a $install/etc $fs |
pankso@3845 | 54 |
pascal@1195 | 55 awk 'BEGIN {n=0} /MUST/ {n++} /ALIASES/ {n++} { if (n==1) print }' \ |
erjo@12040 | 56 < $install/etc/postfix/aliases > $fs/etc/postfix/aliases |
pascal@1203 | 57 while read keyword data; do |
pascal@1203 | 58 grep -q ^$keyword $fs/etc/postfix/main.cf && continue |
pascal@1203 | 59 mv $fs/etc/postfix/main.cf $fs/etc/postfix/main.cf.$$ |
pascal@1203 | 60 awk "BEGIN { scan=1 } /^#$keyword / { if (scan) { print \"$keyword $data\" ; scan=0 } } { print }" \ |
pascal@1203 | 61 < $fs/etc/postfix/main.cf.$$ > $fs/etc/postfix/main.cf |
pascal@1203 | 62 rm -f $fs/etc/postfix/main.cf.$$ |
pascal@1203 | 63 done << EOF |
pascal@1203 | 64 mydomain = localdomain |
pascal@1203 | 65 myorigin = localhost |
pascal@1203 | 66 mydestination = localhost, localhost.\$mydomain |
pascal@1203 | 67 mynetworks = 127.0.0.0/8 |
pascal@1203 | 68 alias_maps = hash:/etc/postfix/aliases |
pascal@1203 | 69 EOF |
pascal@17240 | 70 cat >> $fs/etc/postfix/main.cf <<EOF |
pascal@17237 | 71 |
pascal@17237 | 72 # Unsafe, see CVE-2014-3566 POODLE |
pascal@17237 | 73 smtpd_tls_mandatory_protocols = !SSLv2, !SSLv3 |
pascal@17237 | 74 EOF |
erjo@9672 | 75 cp -a $stuff/etc $fs |
erjo@12040 | 76 cp -a $install/var $fs |
pascal@1159 | 77 mv $fs/etc/postfix/TLS_LICENSE $fs/usr/share/licenses/POSTFIX_TLS_LICENSE |
pascal@1159 | 78 mv $fs/etc/postfix/LICENSE $fs/usr/share/licenses/POSTFIX_LICENSE |
erjo@9672 | 79 cp -a $stuff/etc/init.d $fs/etc |
pankso@3845 | 80 rm -f $fs/usr/lib/postfix/post* $fs/usr/lib/postfix/*.cf |
pankso@3845 | 81 strip -s $fs/usr/lib/postfix/* |
pascal@1159 | 82 } |
pascal@1159 | 83 |
pascal@1159 | 84 # Pre and post install commands for Tazpkg. |
pascal@1159 | 85 post_install() |
pascal@1159 | 86 { |
erjo@12040 | 87 |
erjo@12040 | 88 local user |
erjo@12040 | 89 local group |
erjo@12040 | 90 |
erjo@12040 | 91 user=postfix |
erjo@12040 | 92 group=postdrop |
erjo@12040 | 93 |
pascal@18730 | 94 if ! grep -q $user "$1/etc/passwd"; then |
pascal@20319 | 95 echo |
erjo@12040 | 96 echo -n "Adding user/group $user..." |
pascal@18730 | 97 chroot "$1/" addgroup -S $user |
pascal@18730 | 98 chroot "$1/" adduser -S -D -H -G $user $user |
pascal@18730 | 99 chroot "$1/" addgroup -S $group |
pascal@1159 | 100 status |
pascal@1159 | 101 fi |
erjo@12040 | 102 |
pascal@1159 | 103 # addgroup postdrop if needed |
pascal@18730 | 104 if ! grep -q postdrop "$1/etc/group"; then |
pascal@20319 | 105 echo |
erjo@12040 | 106 echo -n "Adding group ${group}..." |
pascal@18730 | 107 chroot "$1/" addgroup -S $group |
pascal@1159 | 108 status |
pascal@1159 | 109 fi |
erjo@12040 | 110 |
pascal@18730 | 111 chroot "$1/" chown ${user} /var/spool/postfix/* /var/lib/postfix |
pascal@18730 | 112 chroot "$1/" chgrp ${group} /var/spool/postfix/maildrop \ |
pascal@2391 | 113 /var/spool/postfix/public /usr/sbin/postdrop /usr/sbin/postqueue |
pascal@18730 | 114 chmod 2755 "$1/usr/sbin/postdrop" "$1/usr/sbin/postqueue" |
pascal@18730 | 115 chmod 2710 "$1/var/spool/postfix/public" |
pascal@18730 | 116 chmod 1730 "$1/var/spool/postfix/maildrop" |
pascal@18730 | 117 chroot "$1/" postalias /etc/postfix/aliases |
pascal@1159 | 118 cat <<EOF |
erjo@12040 | 119 |
pascal@1159 | 120 ---- |
pascal@1159 | 121 Warning: you still need to edit myorigin/mydestination/mynetworks |
pascal@1159 | 122 parameter settings in /etc/postfix/main.cf. |
pascal@1159 | 123 See also http://www.postfix.org/STANDARD_CONFIGURATION_README.html |
pascal@1159 | 124 |
pascal@1159 | 125 To start $PACKAGE server you can run : |
pascal@1159 | 126 |
pascal@1159 | 127 /etc/init.d/$PACKAGE start |
pascal@1159 | 128 |
pascal@1159 | 129 Or add $PACKAGE to RUN_DAEMONS in /etc/rcS.conf |
pascal@1159 | 130 ---- |
pascal@1159 | 131 EOF |
pascal@1159 | 132 } |
pascal@1159 | 133 |
pascal@8878 | 134 # Overlap busybox |
pascal@8878 | 135 pre_install() |
pascal@8878 | 136 { |
pascal@18730 | 137 rm -f "$1/usr/sbin/sendmail" |
pascal@8878 | 138 } |
pascal@8878 | 139 |
pascal@1159 | 140 post_remove() |
pascal@1159 | 141 { |
pascal@1159 | 142 deluser postfix |
pascal@1159 | 143 delgroup postdrop |
pascal@8878 | 144 ln -s /bin/busybox /usr/sbin/sendmail |
pascal@1159 | 145 } |