wok-next view postfix/receipt @ rev 11218
Add from wok-undigest: buildroot cairo-compmgr catfish cdrtools collectd collectd-apache collectd-bind collectd-dev
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Thu Nov 03 22:14:55 2011 +0100 (2011-11-03) |
parents | 112f8b86d59d |
children | bd2839cfbcdd |
line source
1 # SliTaz package receipt.
3 PACKAGE="postfix"
4 VERSION="2.8.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 perl mysql-dev libsasl"
12 DEPENDS="libdb libldap pcre libssl slitaz-base-files libsasl \
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 -DHAS_MYSQL -I/usr/include/mysql \
23 -DDEF_DAEMON_DIR=\"/usr/lib/postfix\" \
24 -DDEF_MANPAGE_DIR=\"/usr/share/man\"' \
25 AUXLIBS="-ldb -lldap -llber \
26 -L/usr/lib/mysql -lmysqlclient -lz -lm " &&
27 make
28 install_root=$PWD/_pkg \
29 sh postfix-install -non-interactive
30 # install_root=$install \
31 # sh postfix-install -non-interactive
32 }
34 # Rules to gen a SliTaz package suitable for Tazpkg.
35 genpkg_rules()
36 {
37 mkdir -p $fs/usr/share/licenses/
38 cp -a $_pkg/usr/lib $fs/usr
39 cp -a $_pkg/usr/bin $fs/usr
40 cp -a $_pkg/usr/sbin $fs/usr
41 cp -a $_pkg/etc $fs
43 awk 'BEGIN {n=0} /MUST/ {n++} /ALIASES/ {n++} { if (n==1) print }' \
44 < $_pkg/etc/postfix/aliases > $fs/etc/postfix/aliases
45 while read keyword data; do
46 grep -q ^$keyword $fs/etc/postfix/main.cf && continue
47 mv $fs/etc/postfix/main.cf $fs/etc/postfix/main.cf.$$
48 awk "BEGIN { scan=1 } /^#$keyword / { if (scan) { print \"$keyword $data\" ; scan=0 } } { print }" \
49 < $fs/etc/postfix/main.cf.$$ > $fs/etc/postfix/main.cf
50 rm -f $fs/etc/postfix/main.cf.$$
51 done << EOF
52 mydomain = localdomain
53 myorigin = localhost
54 mydestination = localhost, localhost.\$mydomain
55 mynetworks = 127.0.0.0/8
56 alias_maps = hash:/etc/postfix/aliases
57 EOF
58 cp -a $stuff/etc $fs
59 cp -a $_pkg/var $fs
60 mv $fs/etc/postfix/TLS_LICENSE $fs/usr/share/licenses/POSTFIX_TLS_LICENSE
61 mv $fs/etc/postfix/LICENSE $fs/usr/share/licenses/POSTFIX_LICENSE
62 cp -a $stuff/etc/init.d $fs/etc
63 rm -f $fs/usr/lib/postfix/post* $fs/usr/lib/postfix/*.cf
64 strip -s $fs/usr/lib/postfix/*
65 }
67 # Pre and post install commands for Tazpkg.
68 post_install()
69 {
70 # adduser postfix if needed
71 if ! grep -q postfix $1/etc/passwd; then
72 echo -n "Adding user Postfix..."
73 chroot $1/ adduser -s /bin/false -h /dev/null \
74 -g "Postfix Daemon user" -u 75 -H -D postfix
75 status
76 fi
77 # addgroup postdrop if needed
78 if ! grep -q postdrop $1/etc/group; then
79 echo -n "Adding group postdrop..."
80 chroot $1/ addgroup -u 73 postdrop
81 status
82 fi
83 chroot $1/ sh -c 'chown postfix /var/spool/postfix/* /var/lib/postfix'
84 chroot $1/ chgrp postdrop /var/spool/postfix/maildrop \
85 /var/spool/postfix/public /usr/sbin/postdrop /usr/sbin/postqueue
86 chmod 2755 $1/usr/sbin/postdrop $1/usr/sbin/postqueue
87 chmod 2710 $1/var/spool/postfix/public
88 chmod 1730 $1/var/spool/postfix/maildrop
89 chroot $1/ postalias /etc/postfix/aliases
90 cat <<EOF
91 ----
92 Warning: you still need to edit myorigin/mydestination/mynetworks
93 parameter settings in /etc/postfix/main.cf.
94 See also http://www.postfix.org/STANDARD_CONFIGURATION_README.html
96 To start $PACKAGE server you can run :
98 /etc/init.d/$PACKAGE start
100 Or add $PACKAGE to RUN_DAEMONS in /etc/rcS.conf
101 ----
102 EOF
103 }
105 # Overlap busybox
106 pre_install()
107 {
108 rm -f $1/usr/sbin/sendmail
109 }
111 post_remove()
112 {
113 deluser postfix
114 delgroup postdrop
115 ln -s /bin/busybox /usr/sbin/sendmail
116 }