wok-next view postfix/receipt @ rev 16377
Add flrec - Audio recorder
author | Christophe Lincoln <pankso@slitaz.org> |
---|---|
date | Tue Apr 15 00:52:16 2014 +0200 (2014-04-15) |
parents | 7d6af743d21a |
children | f2bdc266fba2 |
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 cp -a $stuff/etc $fs
64 cp -a $install/var $fs
65 mv $fs/etc/postfix/TLS_LICENSE $fs/usr/share/licenses/POSTFIX_TLS_LICENSE
66 mv $fs/etc/postfix/LICENSE $fs/usr/share/licenses/POSTFIX_LICENSE
67 cp -a $stuff/etc/init.d $fs/etc
68 rm -f $fs/usr/lib/postfix/post* $fs/usr/lib/postfix/*.cf
69 strip -s $fs/usr/lib/postfix/*
70 }
72 # Pre and post install commands for Tazpkg.
73 post_install()
74 {
76 local user
77 local group
79 user=postfix
80 group=postdrop
82 if ! grep -q $user $1/etc/passwd; then
83 echo -n "Adding user/group $user..."
84 chroot $1/ addgroup -S $user
85 chroot $1/ adduser -S -D -H -G $user $user
86 chroot $1/ addgroup -S $group
87 status
88 fi
90 # addgroup postdrop if needed
91 if ! grep -q postdrop $1/etc/group; then
92 echo -n "Adding group ${group}..."
93 chroot $1/ addgroup -S $group
94 status
95 fi
97 chroot $1/ chown ${user} /var/spool/postfix/* /var/lib/postfix
98 chroot $1/ chgrp ${group} /var/spool/postfix/maildrop \
99 /var/spool/postfix/public /usr/sbin/postdrop /usr/sbin/postqueue
100 chmod 2755 $1/usr/sbin/postdrop $1/usr/sbin/postqueue
101 chmod 2710 $1/var/spool/postfix/public
102 chmod 1730 $1/var/spool/postfix/maildrop
103 chroot $1/ postalias /etc/postfix/aliases
104 cat <<EOF
106 ----
107 Warning: you still need to edit myorigin/mydestination/mynetworks
108 parameter settings in /etc/postfix/main.cf.
109 See also http://www.postfix.org/STANDARD_CONFIGURATION_README.html
111 To start $PACKAGE server you can run :
113 /etc/init.d/$PACKAGE start
115 Or add $PACKAGE to RUN_DAEMONS in /etc/rcS.conf
116 ----
117 EOF
118 }
120 # Overlap busybox
121 pre_install()
122 {
123 rm -f $1/usr/sbin/sendmail
124 }
126 post_remove()
127 {
128 deluser postfix
129 delgroup postdrop
130 ln -s /bin/busybox /usr/sbin/sendmail
131 }