wok-next view postfix/receipt @ rev 17652

Up: tcl 8.6.3
author Alexander Medvedev <devl547@gmail.com>
date Sat Feb 14 22:32:45 2015 +0000 (2015-02-14)
parents f2bdc266fba2
children 9e01bc6321ea
line source
1 # SliTaz package receipt.
3 PACKAGE="postfix"
4 VERSION="2.10.2"
5 CATEGORY="network"
6 SHORT_DESC="fast, easy to administer, and secure mailer."
7 MAINTAINER="pascal.bellard@slitaz.org"
8 LICENSE="other"
9 TARBALL="$PACKAGE-$VERSION.tar.gz"
10 WEB_SITE="http://www.postfix.org/"
11 WGET_URL="ftp://ftp.cs.tu-berlin.de/pub/net/mail/postfix/official/$TARBALL"
12 TAZPANEL_DAEMON="man|edit::/etc/postfix/main.cf|options|web::$WEB_SITE"
13 CONFIG_FILES="/etc/postfix"
14 PROVIDE="sendmail"
16 DEPENDS="libdb libldap pcre libssl slitaz-base-files libsasl libkrb5 \
17 libcomerr3 libmysqlclient"
18 BUILD_DEPENDS="db-dev openldap-dev pcre-dev openssl-dev perl mysql-dev \
19 cyrus-sasl-dev libsasl"
21 # Rules to configure and make the package.
22 compile_rules()
23 {
24 cd $src
25 make makefiles \
26 CCARGS='-DHAS_DB -DHAS_LDAP \
27 -DUSE_SASL_AUTH -DUSE_CYRUS_SASL -I /usr/include/sasl \
28 -DHAS_MYSQL -I/usr/include/mysql \
29 -DDEF_DAEMON_DIR=\"/usr/lib/postfix\" \
30 -DUSE_TLS \
31 -DDEF_MANPAGE_DIR=\"/usr/share/man\"' \
32 AUXLIBS="-ldb -lldap -llber -lsasl2 -lssl -lcrypto \
33 -L/usr/lib/mysql -lmysqlclient -lz -lm " &&
34 make
35 install_root=$WOK/$PACKAGE/install \
36 sh postfix-install -non-interactive
37 }
39 # Rules to gen a SliTaz package suitable for Tazpkg.
40 genpkg_rules()
41 {
42 mkdir -p $fs/usr/share/licenses/
43 cp -a $install/usr/lib $fs/usr
44 cp -a $install/usr/bin $fs/usr
45 cp -a $install/usr/sbin $fs/usr
46 cp -a $install/etc $fs
48 awk 'BEGIN {n=0} /MUST/ {n++} /ALIASES/ {n++} { if (n==1) print }' \
49 < $install/etc/postfix/aliases > $fs/etc/postfix/aliases
50 while read keyword data; do
51 grep -q ^$keyword $fs/etc/postfix/main.cf && continue
52 mv $fs/etc/postfix/main.cf $fs/etc/postfix/main.cf.$$
53 awk "BEGIN { scan=1 } /^#$keyword / { if (scan) { print \"$keyword $data\" ; scan=0 } } { print }" \
54 < $fs/etc/postfix/main.cf.$$ > $fs/etc/postfix/main.cf
55 rm -f $fs/etc/postfix/main.cf.$$
56 done << EOF
57 mydomain = localdomain
58 myorigin = localhost
59 mydestination = localhost, localhost.\$mydomain
60 mynetworks = 127.0.0.0/8
61 alias_maps = hash:/etc/postfix/aliases
62 EOF
63 cat >> $fs/etc/postfix/main.cf <<EOF
65 # Unsafe, see CVE-2014-3566 POODLE
66 smtpd_tls_mandatory_protocols = !SSLv2, !SSLv3
67 EOF
68 cp -a $stuff/etc $fs
69 cp -a $install/var $fs
70 mv $fs/etc/postfix/TLS_LICENSE $fs/usr/share/licenses/POSTFIX_TLS_LICENSE
71 mv $fs/etc/postfix/LICENSE $fs/usr/share/licenses/POSTFIX_LICENSE
72 cp -a $stuff/etc/init.d $fs/etc
73 rm -f $fs/usr/lib/postfix/post* $fs/usr/lib/postfix/*.cf
74 strip -s $fs/usr/lib/postfix/*
75 }
77 # Pre and post install commands for Tazpkg.
78 post_install()
79 {
81 local user
82 local group
84 user=postfix
85 group=postdrop
87 if ! grep -q $user $1/etc/passwd; then
88 echo -n "Adding user/group $user..."
89 chroot $1/ addgroup -S $user
90 chroot $1/ adduser -S -D -H -G $user $user
91 chroot $1/ addgroup -S $group
92 status
93 fi
95 # addgroup postdrop if needed
96 if ! grep -q postdrop $1/etc/group; then
97 echo -n "Adding group ${group}..."
98 chroot $1/ addgroup -S $group
99 status
100 fi
102 chroot $1/ chown ${user} /var/spool/postfix/* /var/lib/postfix
103 chroot $1/ chgrp ${group} /var/spool/postfix/maildrop \
104 /var/spool/postfix/public /usr/sbin/postdrop /usr/sbin/postqueue
105 chmod 2755 $1/usr/sbin/postdrop $1/usr/sbin/postqueue
106 chmod 2710 $1/var/spool/postfix/public
107 chmod 1730 $1/var/spool/postfix/maildrop
108 chroot $1/ postalias /etc/postfix/aliases
109 cat <<EOF
111 ----
112 Warning: you still need to edit myorigin/mydestination/mynetworks
113 parameter settings in /etc/postfix/main.cf.
114 See also http://www.postfix.org/STANDARD_CONFIGURATION_README.html
116 To start $PACKAGE server you can run :
118 /etc/init.d/$PACKAGE start
120 Or add $PACKAGE to RUN_DAEMONS in /etc/rcS.conf
121 ----
122 EOF
123 }
125 # Overlap busybox
126 pre_install()
127 {
128 rm -f $1/usr/sbin/sendmail
129 }
131 post_remove()
132 {
133 deluser postfix
134 delgroup postdrop
135 ln -s /bin/busybox /usr/sbin/sendmail
136 }