wok-6.x annotate postfix/receipt @ rev 15709
Up:Postfix (2.10.2) + Add SSL support
author | Eric Joseph-Alexandre <erjo@slitaz.org> |
---|---|
date | Sun Dec 22 22:07:24 2013 +0100 (2013-12-22) |
parents | 51a1ebbda768 |
children | 7d6af743d21a |
rev | line source |
---|---|
pascal@1159 | 1 # SliTaz package receipt. |
pascal@1159 | 2 |
pascal@1159 | 3 PACKAGE="postfix" |
erjo@15709 | 4 VERSION="2.10.2" |
pascal@1159 | 5 CATEGORY="network" |
pascal@1159 | 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@14772 | 12 TAZPANEL_DAEMON="man|edit::/etc/postfix/main.cf|options|web::$WEB_SITE" |
pascal@1195 | 13 CONFIG_FILES="/etc/postfix" |
pascal@1159 | 14 |
pascal@12163 | 15 DEPENDS="libdb libldap pcre libssl slitaz-base-files libsasl libkrb5 \ |
pascal@12163 | 16 libcomerr3 libmysqlclient" |
pascal@12163 | 17 BUILD_DEPENDS="db-dev openldap-dev pcre-dev openssl-dev perl mysql-dev \ |
pascal@12163 | 18 cyrus-sasl-dev libsasl" |
pascal@12163 | 19 |
pascal@1159 | 20 # Rules to configure and make the package. |
pascal@1159 | 21 compile_rules() |
pascal@1159 | 22 { |
pascal@1159 | 23 cd $src |
pankso@3845 | 24 make makefiles \ |
pankso@3845 | 25 CCARGS='-DHAS_DB -DHAS_LDAP \ |
pascal@12163 | 26 -DUSE_SASL_AUTH -DUSE_CYRUS_SASL -I /usr/include/sasl \ |
erjo@9679 | 27 -DHAS_MYSQL -I/usr/include/mysql \ |
pankso@3845 | 28 -DDEF_DAEMON_DIR=\"/usr/lib/postfix\" \ |
erjo@15709 | 29 -DUSE_TLS \ |
pankso@3845 | 30 -DDEF_MANPAGE_DIR=\"/usr/share/man\"' \ |
pascal@12163 | 31 AUXLIBS="-ldb -lldap -llber -lsasl2 \ |
erjo@9679 | 32 -L/usr/lib/mysql -lmysqlclient -lz -lm " && |
pascal@1159 | 33 make |
erjo@12040 | 34 install_root=$WOK/$PACKAGE/install \ |
pascal@1159 | 35 sh postfix-install -non-interactive |
pascal@1159 | 36 } |
pascal@1159 | 37 |
pascal@1159 | 38 # Rules to gen a SliTaz package suitable for Tazpkg. |
pascal@1159 | 39 genpkg_rules() |
pascal@1159 | 40 { |
pascal@1159 | 41 mkdir -p $fs/usr/share/licenses/ |
erjo@12040 | 42 cp -a $install/usr/lib $fs/usr |
erjo@12040 | 43 cp -a $install/usr/bin $fs/usr |
erjo@12040 | 44 cp -a $install/usr/sbin $fs/usr |
erjo@12040 | 45 cp -a $install/etc $fs |
pankso@3845 | 46 |
pascal@1195 | 47 awk 'BEGIN {n=0} /MUST/ {n++} /ALIASES/ {n++} { if (n==1) print }' \ |
erjo@12040 | 48 < $install/etc/postfix/aliases > $fs/etc/postfix/aliases |
pascal@1203 | 49 while read keyword data; do |
pascal@1203 | 50 grep -q ^$keyword $fs/etc/postfix/main.cf && continue |
pascal@1203 | 51 mv $fs/etc/postfix/main.cf $fs/etc/postfix/main.cf.$$ |
pascal@1203 | 52 awk "BEGIN { scan=1 } /^#$keyword / { if (scan) { print \"$keyword $data\" ; scan=0 } } { print }" \ |
pascal@1203 | 53 < $fs/etc/postfix/main.cf.$$ > $fs/etc/postfix/main.cf |
pascal@1203 | 54 rm -f $fs/etc/postfix/main.cf.$$ |
pascal@1203 | 55 done << EOF |
pascal@1203 | 56 mydomain = localdomain |
pascal@1203 | 57 myorigin = localhost |
pascal@1203 | 58 mydestination = localhost, localhost.\$mydomain |
pascal@1203 | 59 mynetworks = 127.0.0.0/8 |
pascal@1203 | 60 alias_maps = hash:/etc/postfix/aliases |
pascal@1203 | 61 EOF |
erjo@9672 | 62 cp -a $stuff/etc $fs |
erjo@12040 | 63 cp -a $install/var $fs |
pascal@1159 | 64 mv $fs/etc/postfix/TLS_LICENSE $fs/usr/share/licenses/POSTFIX_TLS_LICENSE |
pascal@1159 | 65 mv $fs/etc/postfix/LICENSE $fs/usr/share/licenses/POSTFIX_LICENSE |
erjo@9672 | 66 cp -a $stuff/etc/init.d $fs/etc |
pankso@3845 | 67 rm -f $fs/usr/lib/postfix/post* $fs/usr/lib/postfix/*.cf |
pankso@3845 | 68 strip -s $fs/usr/lib/postfix/* |
pascal@1159 | 69 } |
pascal@1159 | 70 |
pascal@1159 | 71 # Pre and post install commands for Tazpkg. |
pascal@1159 | 72 post_install() |
pascal@1159 | 73 { |
erjo@12040 | 74 |
erjo@12040 | 75 local user |
erjo@12040 | 76 local group |
erjo@12040 | 77 |
erjo@12040 | 78 user=postfix |
erjo@12040 | 79 group=postdrop |
erjo@12040 | 80 |
erjo@12040 | 81 if ! grep -q $user $1/etc/passwd; then |
erjo@12040 | 82 echo -n "Adding user/group $user..." |
erjo@12040 | 83 chroot $1/ addgroup -S $user |
erjo@12040 | 84 chroot $1/ adduser -S -D -H -G $user $user |
erjo@12040 | 85 chroot $1/ addgroup -S $group |
pascal@1159 | 86 status |
pascal@1159 | 87 fi |
erjo@12040 | 88 |
pascal@1159 | 89 # addgroup postdrop if needed |
pascal@1159 | 90 if ! grep -q postdrop $1/etc/group; then |
erjo@12040 | 91 echo -n "Adding group ${group}..." |
erjo@12040 | 92 chroot $1/ addgroup -S $group |
pascal@1159 | 93 status |
pascal@1159 | 94 fi |
erjo@12040 | 95 |
erjo@12040 | 96 chroot $1/ chown ${user} /var/spool/postfix/* /var/lib/postfix |
erjo@12040 | 97 chroot $1/ chgrp ${group} /var/spool/postfix/maildrop \ |
pascal@2391 | 98 /var/spool/postfix/public /usr/sbin/postdrop /usr/sbin/postqueue |
pascal@1206 | 99 chmod 2755 $1/usr/sbin/postdrop $1/usr/sbin/postqueue |
pascal@1206 | 100 chmod 2710 $1/var/spool/postfix/public |
pascal@1206 | 101 chmod 1730 $1/var/spool/postfix/maildrop |
pascal@2391 | 102 chroot $1/ postalias /etc/postfix/aliases |
pascal@1159 | 103 cat <<EOF |
erjo@12040 | 104 |
pascal@1159 | 105 ---- |
pascal@1159 | 106 Warning: you still need to edit myorigin/mydestination/mynetworks |
pascal@1159 | 107 parameter settings in /etc/postfix/main.cf. |
pascal@1159 | 108 See also http://www.postfix.org/STANDARD_CONFIGURATION_README.html |
pascal@1159 | 109 |
pascal@1159 | 110 To start $PACKAGE server you can run : |
pascal@1159 | 111 |
pascal@1159 | 112 /etc/init.d/$PACKAGE start |
pascal@1159 | 113 |
pascal@1159 | 114 Or add $PACKAGE to RUN_DAEMONS in /etc/rcS.conf |
pascal@1159 | 115 ---- |
pascal@1159 | 116 EOF |
pascal@1159 | 117 } |
pascal@1159 | 118 |
pascal@8878 | 119 # Overlap busybox |
pascal@8878 | 120 pre_install() |
pascal@8878 | 121 { |
pascal@8878 | 122 rm -f $1/usr/sbin/sendmail |
pascal@8878 | 123 } |
pascal@8878 | 124 |
pascal@1159 | 125 post_remove() |
pascal@1159 | 126 { |
pascal@1159 | 127 deluser postfix |
pascal@1159 | 128 delgroup postdrop |
pascal@8878 | 129 ln -s /bin/busybox /usr/sbin/sendmail |
pascal@1159 | 130 } |