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