wok-current annotate postfix/receipt @ rev 11850
Up libcrypto (1.0.0g)
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Mon Feb 27 09:12:19 2012 +0100 (2012-02-27) |
parents | 112f8b86d59d |
children | bd2839cfbcdd |
rev | line source |
---|---|
pascal@1159 | 1 # SliTaz package receipt. |
pascal@1159 | 2 |
pascal@1159 | 3 PACKAGE="postfix" |
slaxemulator@9830 | 4 VERSION="2.8.3" |
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@1159 | 8 TARBALL="$PACKAGE-$VERSION.tar.gz" |
pascal@1159 | 9 WEB_SITE="http://www.postfix.org/" |
pankso@3845 | 10 WGET_URL="ftp://ftp.cs.tu-berlin.de/pub/net/mail/postfix/official/$TARBALL" |
pascal@10484 | 11 BUILD_DEPENDS="db-dev openldap-dev pcre-dev openssl-dev perl mysql-dev libsasl" |
erjo@9679 | 12 DEPENDS="libdb libldap pcre libssl slitaz-base-files libsasl \ |
pascal@5005 | 13 libkrb5 libcomerr3" |
pascal@1195 | 14 CONFIG_FILES="/etc/postfix" |
pascal@1159 | 15 |
pascal@1159 | 16 # Rules to configure and make the package. |
pascal@1159 | 17 compile_rules() |
pascal@1159 | 18 { |
pascal@1159 | 19 cd $src |
pankso@3845 | 20 make makefiles \ |
pankso@3845 | 21 CCARGS='-DHAS_DB -DHAS_LDAP \ |
erjo@9679 | 22 -DHAS_MYSQL -I/usr/include/mysql \ |
pankso@3845 | 23 -DDEF_DAEMON_DIR=\"/usr/lib/postfix\" \ |
pankso@3845 | 24 -DDEF_MANPAGE_DIR=\"/usr/share/man\"' \ |
erjo@9679 | 25 AUXLIBS="-ldb -lldap -llber \ |
erjo@9679 | 26 -L/usr/lib/mysql -lmysqlclient -lz -lm " && |
pascal@1159 | 27 make |
pankso@3845 | 28 install_root=$PWD/_pkg \ |
pascal@1159 | 29 sh postfix-install -non-interactive |
erjo@9679 | 30 # install_root=$install \ |
erjo@9679 | 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@1159 | 37 mkdir -p $fs/usr/share/licenses/ |
pankso@3845 | 38 cp -a $_pkg/usr/lib $fs/usr |
pascal@1159 | 39 cp -a $_pkg/usr/bin $fs/usr |
pascal@1159 | 40 cp -a $_pkg/usr/sbin $fs/usr |
pascal@1159 | 41 cp -a $_pkg/etc $fs |
pankso@3845 | 42 |
pascal@1195 | 43 awk 'BEGIN {n=0} /MUST/ {n++} /ALIASES/ {n++} { if (n==1) print }' \ |
pascal@1195 | 44 < $_pkg/etc/postfix/aliases > $fs/etc/postfix/aliases |
pascal@1203 | 45 while read keyword data; do |
pascal@1203 | 46 grep -q ^$keyword $fs/etc/postfix/main.cf && continue |
pascal@1203 | 47 mv $fs/etc/postfix/main.cf $fs/etc/postfix/main.cf.$$ |
pascal@1203 | 48 awk "BEGIN { scan=1 } /^#$keyword / { if (scan) { print \"$keyword $data\" ; scan=0 } } { print }" \ |
pascal@1203 | 49 < $fs/etc/postfix/main.cf.$$ > $fs/etc/postfix/main.cf |
pascal@1203 | 50 rm -f $fs/etc/postfix/main.cf.$$ |
pascal@1203 | 51 done << EOF |
pascal@1203 | 52 mydomain = localdomain |
pascal@1203 | 53 myorigin = localhost |
pascal@1203 | 54 mydestination = localhost, localhost.\$mydomain |
pascal@1203 | 55 mynetworks = 127.0.0.0/8 |
pascal@1203 | 56 alias_maps = hash:/etc/postfix/aliases |
pascal@1203 | 57 EOF |
erjo@9672 | 58 cp -a $stuff/etc $fs |
pascal@1159 | 59 cp -a $_pkg/var $fs |
pascal@1159 | 60 mv $fs/etc/postfix/TLS_LICENSE $fs/usr/share/licenses/POSTFIX_TLS_LICENSE |
pascal@1159 | 61 mv $fs/etc/postfix/LICENSE $fs/usr/share/licenses/POSTFIX_LICENSE |
erjo@9672 | 62 cp -a $stuff/etc/init.d $fs/etc |
pankso@3845 | 63 rm -f $fs/usr/lib/postfix/post* $fs/usr/lib/postfix/*.cf |
pankso@3845 | 64 strip -s $fs/usr/lib/postfix/* |
pascal@1159 | 65 } |
pascal@1159 | 66 |
pascal@1159 | 67 # Pre and post install commands for Tazpkg. |
pascal@1159 | 68 post_install() |
pascal@1159 | 69 { |
pankso@3845 | 70 # adduser postfix if needed |
pascal@1159 | 71 if ! grep -q postfix $1/etc/passwd; then |
pankso@3845 | 72 echo -n "Adding user Postfix..." |
pankso@3845 | 73 chroot $1/ adduser -s /bin/false -h /dev/null \ |
slaxemulator@10721 | 74 -g "Postfix Daemon user" -u 75 -H -D postfix |
pascal@1159 | 75 status |
pascal@1159 | 76 fi |
pascal@1159 | 77 # addgroup postdrop if needed |
pascal@1159 | 78 if ! grep -q postdrop $1/etc/group; then |
pascal@1159 | 79 echo -n "Adding group postdrop..." |
slaxemulator@10721 | 80 chroot $1/ addgroup -u 73 postdrop |
pascal@1159 | 81 status |
pascal@1159 | 82 fi |
pascal@2391 | 83 chroot $1/ sh -c 'chown postfix /var/spool/postfix/* /var/lib/postfix' |
pascal@2391 | 84 chroot $1/ chgrp postdrop /var/spool/postfix/maildrop \ |
pascal@2391 | 85 /var/spool/postfix/public /usr/sbin/postdrop /usr/sbin/postqueue |
pascal@1206 | 86 chmod 2755 $1/usr/sbin/postdrop $1/usr/sbin/postqueue |
pascal@1206 | 87 chmod 2710 $1/var/spool/postfix/public |
pascal@1206 | 88 chmod 1730 $1/var/spool/postfix/maildrop |
pascal@2391 | 89 chroot $1/ postalias /etc/postfix/aliases |
pascal@1159 | 90 cat <<EOF |
pascal@1159 | 91 ---- |
pascal@1159 | 92 Warning: you still need to edit myorigin/mydestination/mynetworks |
pascal@1159 | 93 parameter settings in /etc/postfix/main.cf. |
pascal@1159 | 94 See also http://www.postfix.org/STANDARD_CONFIGURATION_README.html |
pascal@1159 | 95 |
pascal@1159 | 96 To start $PACKAGE server you can run : |
pascal@1159 | 97 |
pascal@1159 | 98 /etc/init.d/$PACKAGE start |
pascal@1159 | 99 |
pascal@1159 | 100 Or add $PACKAGE to RUN_DAEMONS in /etc/rcS.conf |
pascal@1159 | 101 ---- |
pascal@1159 | 102 EOF |
pascal@1159 | 103 } |
pascal@1159 | 104 |
pascal@8878 | 105 # Overlap busybox |
pascal@8878 | 106 pre_install() |
pascal@8878 | 107 { |
pascal@8878 | 108 rm -f $1/usr/sbin/sendmail |
pascal@8878 | 109 } |
pascal@8878 | 110 |
pascal@1159 | 111 post_remove() |
pascal@1159 | 112 { |
pascal@1159 | 113 deluser postfix |
pascal@1159 | 114 delgroup postdrop |
pascal@8878 | 115 ln -s /bin/busybox /usr/sbin/sendmail |
pascal@1159 | 116 } |