wok-next view postfix/receipt @ rev 20634
oxine: update bdeps
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Fri Apr 27 12:51:30 2018 +0200 (2018-04-27) |
parents | 731f74708293 |
children | d5aab818505e |
line source
1 # SliTaz package receipt v2.
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"
13 BUILD_DEPENDS="db-dev openldap-dev pcre-dev openssl-dev perl mysql-dev \
14 cyrus-sasl-dev libsasl"
15 SPLIT="postfix postfix-mysql"
17 # Rules to configure and make the package.
18 compile_rules()
19 {
20 make makefiles \
21 CCARGS='-DHAS_DB -DHAS_LDAP \
22 -DUSE_SASL_AUTH -DUSE_CYRUS_SASL -I /usr/include/sasl \
23 -DHAS_MYSQL -I/usr/include/mysql \
24 -DDEF_DAEMON_DIR=\"/usr/lib/postfix\" \
25 -DUSE_TLS \
26 -DDEF_MANPAGE_DIR=\"/usr/share/man\"' \
27 AUXLIBS="-ldb -lldap -llber -lsasl2 -lssl -lcrypto -lpthread \
28 -L/usr/lib/mysql -lmysqlclient -lz -lm " &&
29 make
30 install_root=$WOK/$PACKAGE/install \
31 sh postfix-install -non-interactive
32 }
34 # Rules to gen a SliTaz package suitable for Tazpkg.
35 genpkg_rules()
36 {
37 case $PACKAGE in
38 postfix)
39 TAZPANEL_DAEMON="man|edit::/etc/postfix/main.cf|options|web::$WEB_SITE"
40 CONFIG_FILES="/etc/postfix"
41 PROVIDE="sendmail"
42 DEPENDS="libdb libldap pcre openssl slitaz-base-files libsasl \
43 libkrb5 libcomerr3 libmysqlclient"
44 mkdir -p $fs/usr/share/licenses/
45 cp -a $install/usr/lib $fs/usr
46 cp -a $install/usr/bin $fs/usr
47 cp -a $install/usr/sbin $fs/usr
48 cp -a $install/etc $fs
50 awk 'BEGIN {n=0} /MUST/ {n++} /ALIASES/ {n++} { if (n==1) print }' \
51 < $install/etc/postfix/aliases > $fs/etc/postfix/aliases
52 while read keyword data; do
53 grep -q ^$keyword $fs/etc/postfix/main.cf && continue
54 mv $fs/etc/postfix/main.cf $fs/etc/postfix/main.cf.$$
55 awk "BEGIN { scan=1 } /^#$keyword / { if (scan) { print \"$keyword $data\" ; scan=0 } } { print }" \
56 < $fs/etc/postfix/main.cf.$$ > $fs/etc/postfix/main.cf
57 rm -f $fs/etc/postfix/main.cf.$$
58 done << EOF
59 mydomain = localdomain
60 myorigin = localhost
61 mydestination = localhost, localhost.\$mydomain
62 mynetworks = 127.0.0.0/8
63 alias_maps = hash:/etc/postfix/aliases
64 EOF
65 cat >> $fs/etc/postfix/main.cf <<EOF
67 # Unsafe, see CVE-2014-3566 POODLE
68 smtpd_tls_mandatory_protocols = !SSLv2, !SSLv3
69 EOF
70 cp -a $stuff/etc $fs
71 cp -a $install/var $fs
72 mv $fs/etc/postfix/TLS_LICENSE $fs/usr/share/licenses/POSTFIX_TLS_LICENSE
73 mv $fs/etc/postfix/LICENSE $fs/usr/share/licenses/POSTFIX_LICENSE
74 cp -a $stuff/etc/init.d $fs/etc
75 rm -f $fs/usr/lib/postfix/post* $fs/usr/lib/postfix/*.cf
76 strip -s $fs/usr/lib/postfix/*
77 ;;
78 postfix-mysql)
79 CAT="network|MySQL support for postfix"
80 DEPENDS="postfix libmysqlclient"
81 mkdir -p $fs/usr/lib/postfix/
82 cp -a $src/src/global/dict_mysql.o $fs/usr/lib/postfix
83 ;;
84 esac
85 }
87 # Pre and post install commands for Tazpkg.
88 post_install_postfix()
89 {
91 local user
92 local group
94 user=postfix
95 group=postdrop
97 if ! grep -q $user "$1/etc/passwd"; then
98 echo -n "Adding user/group $user..."
99 chroot "$1/" addgroup -S $user
100 chroot "$1/" adduser -S -D -H -G $user $user
101 chroot "$1/" addgroup -S $group
102 status
103 fi
105 # addgroup postdrop if needed
106 if ! grep -q postdrop "$1/etc/group"; then
107 echo -n "Adding group ${group}..."
108 chroot "$1/" addgroup -S $group
109 status
110 fi
112 chroot "$1/" chown ${user} /var/spool/postfix/* /var/lib/postfix
113 chroot "$1/" chgrp ${group} /var/spool/postfix/maildrop \
114 /var/spool/postfix/public /usr/sbin/postdrop /usr/sbin/postqueue
115 chmod 2755 "$1/usr/sbin/postdrop" "$1/usr/sbin/postqueue"
116 chmod 2710 "$1/var/spool/postfix/public"
117 chmod 1730 "$1/var/spool/postfix/maildrop"
118 chroot "$1/" postalias /etc/postfix/aliases
119 cat <<EOF
121 ----
122 Warning: you still need to edit myorigin/mydestination/mynetworks
123 parameter settings in /etc/postfix/main.cf.
124 See also http://www.postfix.org/STANDARD_CONFIGURATION_README.html
126 To start $PACKAGE server you can run :
128 /etc/init.d/$PACKAGE start
130 Or add $PACKAGE to RUN_DAEMONS in /etc/rcS.conf
131 ----
132 EOF
133 }
135 # Overlap busybox
136 pre_install_postfix()
137 {
138 rm -f "$1/usr/sbin/sendmail"
139 }
141 post_remove_postfix()
142 {
143 deluser postfix
144 delgroup postdrop
145 ln -s /bin/busybox /usr/sbin/sendmail
146 }