wok-current view postfix/receipt @ rev 15467

asterisk: update deps
author Pascal Bellard <pascal.bellard@slitaz.org>
date Fri Nov 08 10:09:54 2013 +0000 (2013-11-08)
parents a0647742dc85
children 34db88a12c7a
line source
1 # SliTaz package receipt.
3 PACKAGE="postfix"
4 VERSION="2.10.1"
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"
15 DEPENDS="libdb libldap pcre libssl slitaz-base-files libsasl libkrb5 \
16 libcomerr3 libmysqlclient"
17 BUILD_DEPENDS="db-dev openldap-dev pcre-dev openssl-dev perl mysql-dev \
18 cyrus-sasl-dev libsasl"
20 # Rules to configure and make the package.
21 compile_rules()
22 {
23 cd $src
24 make makefiles \
25 CCARGS='-DHAS_DB -DHAS_LDAP \
26 -DUSE_SASL_AUTH -DUSE_CYRUS_SASL -I /usr/include/sasl \
27 -DHAS_MYSQL -I/usr/include/mysql \
28 -DDEF_DAEMON_DIR=\"/usr/lib/postfix\" \
29 -DDEF_MANPAGE_DIR=\"/usr/share/man\"' \
30 AUXLIBS="-ldb -lldap -llber -lsasl2 \
31 -L/usr/lib/mysql -lmysqlclient -lz -lm " &&
32 make
33 install_root=$WOK/$PACKAGE/install \
34 sh postfix-install -non-interactive
35 }
37 # Rules to gen a SliTaz package suitable for Tazpkg.
38 genpkg_rules()
39 {
40 mkdir -p $fs/usr/share/licenses/
41 cp -a $install/usr/lib $fs/usr
42 cp -a $install/usr/bin $fs/usr
43 cp -a $install/usr/sbin $fs/usr
44 cp -a $install/etc $fs
46 awk 'BEGIN {n=0} /MUST/ {n++} /ALIASES/ {n++} { if (n==1) print }' \
47 < $install/etc/postfix/aliases > $fs/etc/postfix/aliases
48 while read keyword data; do
49 grep -q ^$keyword $fs/etc/postfix/main.cf && continue
50 mv $fs/etc/postfix/main.cf $fs/etc/postfix/main.cf.$$
51 awk "BEGIN { scan=1 } /^#$keyword / { if (scan) { print \"$keyword $data\" ; scan=0 } } { print }" \
52 < $fs/etc/postfix/main.cf.$$ > $fs/etc/postfix/main.cf
53 rm -f $fs/etc/postfix/main.cf.$$
54 done << EOF
55 mydomain = localdomain
56 myorigin = localhost
57 mydestination = localhost, localhost.\$mydomain
58 mynetworks = 127.0.0.0/8
59 alias_maps = hash:/etc/postfix/aliases
60 EOF
61 cp -a $stuff/etc $fs
62 cp -a $install/var $fs
63 mv $fs/etc/postfix/TLS_LICENSE $fs/usr/share/licenses/POSTFIX_TLS_LICENSE
64 mv $fs/etc/postfix/LICENSE $fs/usr/share/licenses/POSTFIX_LICENSE
65 cp -a $stuff/etc/init.d $fs/etc
66 rm -f $fs/usr/lib/postfix/post* $fs/usr/lib/postfix/*.cf
67 strip -s $fs/usr/lib/postfix/*
68 }
70 # Pre and post install commands for Tazpkg.
71 post_install()
72 {
74 local user
75 local group
77 user=postfix
78 group=postdrop
80 if ! grep -q $user $1/etc/passwd; then
81 echo -n "Adding user/group $user..."
82 chroot $1/ addgroup -S $user
83 chroot $1/ adduser -S -D -H -G $user $user
84 chroot $1/ addgroup -S $group
85 status
86 fi
88 # addgroup postdrop if needed
89 if ! grep -q postdrop $1/etc/group; then
90 echo -n "Adding group ${group}..."
91 chroot $1/ addgroup -S $group
92 status
93 fi
95 chroot $1/ chown ${user} /var/spool/postfix/* /var/lib/postfix
96 chroot $1/ chgrp ${group} /var/spool/postfix/maildrop \
97 /var/spool/postfix/public /usr/sbin/postdrop /usr/sbin/postqueue
98 chmod 2755 $1/usr/sbin/postdrop $1/usr/sbin/postqueue
99 chmod 2710 $1/var/spool/postfix/public
100 chmod 1730 $1/var/spool/postfix/maildrop
101 chroot $1/ postalias /etc/postfix/aliases
102 cat <<EOF
104 ----
105 Warning: you still need to edit myorigin/mydestination/mynetworks
106 parameter settings in /etc/postfix/main.cf.
107 See also http://www.postfix.org/STANDARD_CONFIGURATION_README.html
109 To start $PACKAGE server you can run :
111 /etc/init.d/$PACKAGE start
113 Or add $PACKAGE to RUN_DAEMONS in /etc/rcS.conf
114 ----
115 EOF
116 }
118 # Overlap busybox
119 pre_install()
120 {
121 rm -f $1/usr/sbin/sendmail
122 }
124 post_remove()
125 {
126 deluser postfix
127 delgroup postdrop
128 ln -s /bin/busybox /usr/sbin/sendmail
129 }