wok view postfix/receipt @ rev 15711

postfix: update AUXLIBS
author Pascal Bellard <pascal.bellard@slitaz.org>
date Mon Dec 23 16:58:02 2013 +0000 (2013-12-23)
parents 34db88a12c7a
children ad05e742684d
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"
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 -DUSE_TLS \
30 -DDEF_MANPAGE_DIR=\"/usr/share/man\"' \
31 AUXLIBS="-ldb -lldap -llber -lsasl2 -lssl -lcrypto \
32 -L/usr/lib/mysql -lmysqlclient -lz -lm " &&
33 make
34 install_root=$WOK/$PACKAGE/install \
35 sh postfix-install -non-interactive
36 }
38 # Rules to gen a SliTaz package suitable for Tazpkg.
39 genpkg_rules()
40 {
41 mkdir -p $fs/usr/share/licenses/
42 cp -a $install/usr/lib $fs/usr
43 cp -a $install/usr/bin $fs/usr
44 cp -a $install/usr/sbin $fs/usr
45 cp -a $install/etc $fs
47 awk 'BEGIN {n=0} /MUST/ {n++} /ALIASES/ {n++} { if (n==1) print }' \
48 < $install/etc/postfix/aliases > $fs/etc/postfix/aliases
49 while read keyword data; do
50 grep -q ^$keyword $fs/etc/postfix/main.cf && continue
51 mv $fs/etc/postfix/main.cf $fs/etc/postfix/main.cf.$$
52 awk "BEGIN { scan=1 } /^#$keyword / { if (scan) { print \"$keyword $data\" ; scan=0 } } { print }" \
53 < $fs/etc/postfix/main.cf.$$ > $fs/etc/postfix/main.cf
54 rm -f $fs/etc/postfix/main.cf.$$
55 done << EOF
56 mydomain = localdomain
57 myorigin = localhost
58 mydestination = localhost, localhost.\$mydomain
59 mynetworks = 127.0.0.0/8
60 alias_maps = hash:/etc/postfix/aliases
61 EOF
62 cp -a $stuff/etc $fs
63 cp -a $install/var $fs
64 mv $fs/etc/postfix/TLS_LICENSE $fs/usr/share/licenses/POSTFIX_TLS_LICENSE
65 mv $fs/etc/postfix/LICENSE $fs/usr/share/licenses/POSTFIX_LICENSE
66 cp -a $stuff/etc/init.d $fs/etc
67 rm -f $fs/usr/lib/postfix/post* $fs/usr/lib/postfix/*.cf
68 strip -s $fs/usr/lib/postfix/*
69 }
71 # Pre and post install commands for Tazpkg.
72 post_install()
73 {
75 local user
76 local group
78 user=postfix
79 group=postdrop
81 if ! grep -q $user $1/etc/passwd; then
82 echo -n "Adding user/group $user..."
83 chroot $1/ addgroup -S $user
84 chroot $1/ adduser -S -D -H -G $user $user
85 chroot $1/ addgroup -S $group
86 status
87 fi
89 # addgroup postdrop if needed
90 if ! grep -q postdrop $1/etc/group; then
91 echo -n "Adding group ${group}..."
92 chroot $1/ addgroup -S $group
93 status
94 fi
96 chroot $1/ chown ${user} /var/spool/postfix/* /var/lib/postfix
97 chroot $1/ chgrp ${group} /var/spool/postfix/maildrop \
98 /var/spool/postfix/public /usr/sbin/postdrop /usr/sbin/postqueue
99 chmod 2755 $1/usr/sbin/postdrop $1/usr/sbin/postqueue
100 chmod 2710 $1/var/spool/postfix/public
101 chmod 1730 $1/var/spool/postfix/maildrop
102 chroot $1/ postalias /etc/postfix/aliases
103 cat <<EOF
105 ----
106 Warning: you still need to edit myorigin/mydestination/mynetworks
107 parameter settings in /etc/postfix/main.cf.
108 See also http://www.postfix.org/STANDARD_CONFIGURATION_README.html
110 To start $PACKAGE server you can run :
112 /etc/init.d/$PACKAGE start
114 Or add $PACKAGE to RUN_DAEMONS in /etc/rcS.conf
115 ----
116 EOF
117 }
119 # Overlap busybox
120 pre_install()
121 {
122 rm -f $1/usr/sbin/sendmail
123 }
125 post_remove()
126 {
127 deluser postfix
128 delgroup postdrop
129 ln -s /bin/busybox /usr/sbin/sendmail
130 }