wok-current view postfix/receipt @ rev 7710

merge
author fireflyoo <lufeng369@gmail.com>
date Sun Dec 19 23:29:00 2010 +0800 (2010-12-19)
parents f3327707164a
children e5372f17be2d
line source
1 # SliTaz package receipt.
3 PACKAGE="postfix"
4 VERSION="2.7.2"
5 CATEGORY="network"
6 SHORT_DESC="fast, easy to administer, and secure mailer."
7 MAINTAINER="pascal.bellard@slitaz.org"
8 TARBALL="$PACKAGE-$VERSION.tar.gz"
9 WEB_SITE="http://www.postfix.org/"
10 WGET_URL="ftp://ftp.cs.tu-berlin.de/pub/net/mail/postfix/official/$TARBALL"
11 BUILD_DEPENDS="db-dev openldap-dev pcre-dev openssl-dev perl"
12 DEPENDS="libdb libldap pcre openssl slitaz-base-files cyrus-sasl \
13 libkrb5 libcomerr3"
14 CONFIG_FILES="/etc/postfix"
16 # Rules to configure and make the package.
17 compile_rules()
18 {
19 cd $src
20 make makefiles \
21 CCARGS='-DHAS_DB -DHAS_LDAP \
22 -DDEF_DAEMON_DIR=\"/usr/lib/postfix\" \
23 -DDEF_MANPAGE_DIR=\"/usr/share/man\"' \
24 AUXLIBS="-ldb -lldap -llber" &&
25 make
26 install_root=$PWD/_pkg \
27 sh postfix-install -non-interactive
28 }
30 # Rules to gen a SliTaz package suitable for Tazpkg.
31 genpkg_rules()
32 {
33 mkdir -p $fs/usr/share/licenses/
34 cp -a $_pkg/usr/lib $fs/usr
35 cp -a $_pkg/usr/bin $fs/usr
36 cp -a $_pkg/usr/sbin $fs/usr
37 cp -a $_pkg/etc $fs
39 awk 'BEGIN {n=0} /MUST/ {n++} /ALIASES/ {n++} { if (n==1) print }' \
40 < $_pkg/etc/postfix/aliases > $fs/etc/postfix/aliases
41 while read keyword data; do
42 grep -q ^$keyword $fs/etc/postfix/main.cf && continue
43 mv $fs/etc/postfix/main.cf $fs/etc/postfix/main.cf.$$
44 awk "BEGIN { scan=1 } /^#$keyword / { if (scan) { print \"$keyword $data\" ; scan=0 } } { print }" \
45 < $fs/etc/postfix/main.cf.$$ > $fs/etc/postfix/main.cf
46 rm -f $fs/etc/postfix/main.cf.$$
47 done << EOF
48 mydomain = localdomain
49 myorigin = localhost
50 mydestination = localhost, localhost.\$mydomain
51 mynetworks = 127.0.0.0/8
52 alias_maps = hash:/etc/postfix/aliases
53 EOF
54 cp -a stuff/etc $fs
55 cp -a $_pkg/var $fs
56 mv $fs/etc/postfix/TLS_LICENSE $fs/usr/share/licenses/POSTFIX_TLS_LICENSE
57 mv $fs/etc/postfix/LICENSE $fs/usr/share/licenses/POSTFIX_LICENSE
58 cp -a stuff/etc/init.d $fs/etc
59 rm -f $fs/usr/lib/postfix/post* $fs/usr/lib/postfix/*.cf
60 strip -s $fs/usr/lib/postfix/*
61 }
63 # Pre and post install commands for Tazpkg.
64 post_install()
65 {
66 # adduser postfix if needed
67 if ! grep -q postfix $1/etc/passwd; then
68 echo -n "Adding user Postfix..."
69 chroot $1/ adduser -s /bin/false -h /dev/null \
70 -g "Postfix Daemon user" -H -D -S postfix
71 status
72 fi
73 # addgroup postdrop if needed
74 if ! grep -q postdrop $1/etc/group; then
75 echo -n "Adding group postdrop..."
76 chroot $1/ addgroup postdrop
77 status
78 fi
79 chroot $1/ sh -c 'chown postfix /var/spool/postfix/* /var/lib/postfix'
80 chroot $1/ chgrp postdrop /var/spool/postfix/maildrop \
81 /var/spool/postfix/public /usr/sbin/postdrop /usr/sbin/postqueue
82 chmod 2755 $1/usr/sbin/postdrop $1/usr/sbin/postqueue
83 chmod 2710 $1/var/spool/postfix/public
84 chmod 1730 $1/var/spool/postfix/maildrop
85 chroot $1/ postalias /etc/postfix/aliases
86 cat <<EOF
87 ----
88 Warning: you still need to edit myorigin/mydestination/mynetworks
89 parameter settings in /etc/postfix/main.cf.
90 See also http://www.postfix.org/STANDARD_CONFIGURATION_README.html
92 To start $PACKAGE server you can run :
94 /etc/init.d/$PACKAGE start
96 Or add $PACKAGE to RUN_DAEMONS in /etc/rcS.conf
97 ----
98 EOF
99 }
101 post_remove()
102 {
103 deluser postfix
104 delgroup postdrop
105 }