wok annotate postfix/receipt @ rev 4391

util-linux-ng-blkid: update depends.
author Eric Joseph-Alexandre <erjo@slitaz.org>
date Thu Oct 15 20:56:02 2009 +0000 (2009-10-15)
parents 051a78c03e10
children f3327707164a
rev   line source
pascal@1159 1 # SliTaz package receipt.
pascal@1159 2
pascal@1159 3 PACKAGE="postfix"
pankso@3845 4 VERSION="2.6.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@1166 11 BUILD_DEPENDS="db-dev openldap-dev pcre-dev openssl-dev"
paul@2120 12 DEPENDS="libdb libldap pcre openssl slitaz-base-files cyrus-sasl"
pascal@1195 13 CONFIG_FILES="/etc/postfix"
pascal@1159 14
pascal@1159 15 # Rules to configure and make the package.
pascal@1159 16 compile_rules()
pascal@1159 17 {
pascal@1159 18 cd $src
pankso@3845 19 make makefiles \
pankso@3845 20 CCARGS='-DHAS_DB -DHAS_LDAP \
pankso@3845 21 -DDEF_DAEMON_DIR=\"/usr/lib/postfix\" \
pankso@3845 22 -DDEF_MANPAGE_DIR=\"/usr/share/man\"' \
pankso@3845 23 AUXLIBS="-ldb -lldap -llber" &&
pascal@1159 24 make
pankso@3845 25 install_root=$PWD/_pkg \
pascal@1159 26 sh postfix-install -non-interactive
pascal@1159 27 }
pascal@1159 28
pascal@1159 29 # Rules to gen a SliTaz package suitable for Tazpkg.
pascal@1159 30 genpkg_rules()
pascal@1159 31 {
pascal@1159 32 mkdir -p $fs/usr/share/licenses/
pankso@3845 33 cp -a $_pkg/usr/lib $fs/usr
pascal@1159 34 cp -a $_pkg/usr/bin $fs/usr
pascal@1159 35 cp -a $_pkg/usr/sbin $fs/usr
pascal@1159 36 cp -a $_pkg/etc $fs
pankso@3845 37
pascal@1195 38 awk 'BEGIN {n=0} /MUST/ {n++} /ALIASES/ {n++} { if (n==1) print }' \
pascal@1195 39 < $_pkg/etc/postfix/aliases > $fs/etc/postfix/aliases
pascal@1203 40 while read keyword data; do
pascal@1203 41 grep -q ^$keyword $fs/etc/postfix/main.cf && continue
pascal@1203 42 mv $fs/etc/postfix/main.cf $fs/etc/postfix/main.cf.$$
pascal@1203 43 awk "BEGIN { scan=1 } /^#$keyword / { if (scan) { print \"$keyword $data\" ; scan=0 } } { print }" \
pascal@1203 44 < $fs/etc/postfix/main.cf.$$ > $fs/etc/postfix/main.cf
pascal@1203 45 rm -f $fs/etc/postfix/main.cf.$$
pascal@1203 46 done << EOF
pascal@1203 47 mydomain = localdomain
pascal@1203 48 myorigin = localhost
pascal@1203 49 mydestination = localhost, localhost.\$mydomain
pascal@1203 50 mynetworks = 127.0.0.0/8
pascal@1203 51 alias_maps = hash:/etc/postfix/aliases
pascal@1203 52 EOF
pascal@1195 53 cp -a stuff/etc $fs
pascal@1159 54 cp -a $_pkg/var $fs
pascal@1159 55 mv $fs/etc/postfix/TLS_LICENSE $fs/usr/share/licenses/POSTFIX_TLS_LICENSE
pascal@1159 56 mv $fs/etc/postfix/LICENSE $fs/usr/share/licenses/POSTFIX_LICENSE
pascal@1159 57 cp -a stuff/etc/init.d $fs/etc
pankso@3845 58 rm -f $fs/usr/lib/postfix/post* $fs/usr/lib/postfix/*.cf
pankso@3845 59 strip -s $fs/usr/lib/postfix/*
pascal@1159 60 }
pascal@1159 61
pascal@1159 62 # Pre and post install commands for Tazpkg.
pascal@1159 63 post_install()
pascal@1159 64 {
pankso@3845 65 # adduser postfix if needed
pascal@1159 66 if ! grep -q postfix $1/etc/passwd; then
pankso@3845 67 echo -n "Adding user Postfix..."
pankso@3845 68 chroot $1/ adduser -s /bin/false -h /dev/null \
pankso@3845 69 -g "Postfix Daemon user" -H -D -S postfix
pascal@1159 70 status
pascal@1159 71 fi
pascal@1159 72 # addgroup postdrop if needed
pascal@1159 73 if ! grep -q postdrop $1/etc/group; then
pascal@1159 74 echo -n "Adding group postdrop..."
pascal@1159 75 chroot $1/ addgroup postdrop
pascal@1159 76 status
pascal@1159 77 fi
pascal@2391 78 chroot $1/ sh -c 'chown postfix /var/spool/postfix/* /var/lib/postfix'
pascal@2391 79 chroot $1/ chgrp postdrop /var/spool/postfix/maildrop \
pascal@2391 80 /var/spool/postfix/public /usr/sbin/postdrop /usr/sbin/postqueue
pascal@1206 81 chmod 2755 $1/usr/sbin/postdrop $1/usr/sbin/postqueue
pascal@1206 82 chmod 2710 $1/var/spool/postfix/public
pascal@1206 83 chmod 1730 $1/var/spool/postfix/maildrop
pascal@2391 84 chroot $1/ postalias /etc/postfix/aliases
pascal@1159 85 cat <<EOF
pascal@1159 86 ----
pascal@1159 87 Warning: you still need to edit myorigin/mydestination/mynetworks
pascal@1159 88 parameter settings in /etc/postfix/main.cf.
pascal@1159 89 See also http://www.postfix.org/STANDARD_CONFIGURATION_README.html
pascal@1159 90
pascal@1159 91 To start $PACKAGE server you can run :
pascal@1159 92
pascal@1159 93 /etc/init.d/$PACKAGE start
pascal@1159 94
pascal@1159 95 Or add $PACKAGE to RUN_DAEMONS in /etc/rcS.conf
pascal@1159 96 ----
pascal@1159 97 EOF
pascal@1159 98 }
pascal@1159 99
pascal@1159 100 post_remove()
pascal@1159 101 {
pascal@1159 102 deluser postfix
pascal@1159 103 delgroup postdrop
pascal@1159 104 }