wok-6.x view postfix/receipt @ rev 3785

Add: xalan-xerces-j (2.7.1)
author Matthew Sheets <rcx@zoominternet.net>
date Thu Jul 30 15:27:14 2009 +0000 (2009-07-30)
parents 30a2f8a2ce99
children b7ffe250e629
line source
1 # SliTaz package receipt.
3 PACKAGE="postfix"
4 VERSION="2.5.5"
5 CATEGORY="network"
6 SHORT_DESC="fast, easy to administer, and secure mailer."
7 MAINTAINER="pascal.bellard@slitaz.org"
8 TARBALL="$PACKAGE-$VERSION.tar.gz"
9 WEB_SITE="http://www.postfix.org/"
10 WGET_URL="ftp://mir1.ovh.net/ftp.postfix.org/postfix-release/official/$TARBALL"
11 BUILD_DEPENDS="db-dev openldap-dev pcre-dev openssl-dev"
12 DEPENDS="libdb libldap pcre openssl slitaz-base-files cyrus-sasl"
13 CONFIG_FILES="/etc/postfix"
15 # Rules to configure and make the package.
16 compile_rules()
17 {
19 cd $src
20 make makefiles CCARGS="-DHAS_DB -DHAS_LDAP" AUXLIBS="-ldb -lldap -llber"
21 make
22 install_root=/home/slitaz/wok/postfix/postfix-$VERSION/_pkg \
23 sh postfix-install -non-interactive
24 }
26 # Rules to gen a SliTaz package suitable for Tazpkg.
27 genpkg_rules()
28 {
29 mkdir -p $fs/usr/share/licenses/
30 cp -a $_pkg/usr/libexec $fs/usr
31 cp -a $_pkg/usr/bin $fs/usr
32 cp -a $_pkg/usr/sbin $fs/usr
33 cp -a $_pkg/etc $fs
34 awk 'BEGIN {n=0} /MUST/ {n++} /ALIASES/ {n++} { if (n==1) print }' \
35 < $_pkg/etc/postfix/aliases > $fs/etc/postfix/aliases
36 while read keyword data; do
37 grep -q ^$keyword $fs/etc/postfix/main.cf && continue
38 mv $fs/etc/postfix/main.cf $fs/etc/postfix/main.cf.$$
39 awk "BEGIN { scan=1 } /^#$keyword / { if (scan) { print \"$keyword $data\" ; scan=0 } } { print }" \
40 < $fs/etc/postfix/main.cf.$$ > $fs/etc/postfix/main.cf
41 rm -f $fs/etc/postfix/main.cf.$$
42 done << EOF
43 mydomain = localdomain
44 myorigin = localhost
45 mydestination = localhost, localhost.\$mydomain
46 mynetworks = 127.0.0.0/8
47 alias_maps = hash:/etc/postfix/aliases
48 EOF
49 cp -a stuff/etc $fs
50 cp -a $_pkg/var $fs
51 mv $fs/etc/postfix/TLS_LICENSE $fs/usr/share/licenses/POSTFIX_TLS_LICENSE
52 mv $fs/etc/postfix/LICENSE $fs/usr/share/licenses/POSTFIX_LICENSE
53 cp -a stuff/etc/init.d $fs/etc
54 rm -f $fs/etc/postfix/post*
55 }
57 # Pre and post install commands for Tazpkg.
58 post_install()
59 {
60 # adduser postfix if needed
61 if ! grep -q postfix $1/etc/passwd; then
62 echo -n "Adding user postfix..."
63 chroot $1/ adduser postfix -D -H -S -h /dev/null
64 status
65 fi
66 # addgroup postfix if needed
67 if ! grep -q postfix $1/etc/group; then
68 echo -n "Adding group postfix..."
69 chroot $1/ sh -c 'addgroup postfix && addgroup postfix postfix'
70 status
71 fi
72 # addgroup postdrop if needed
73 if ! grep -q postdrop $1/etc/group; then
74 echo -n "Adding group postdrop..."
75 chroot $1/ addgroup postdrop
76 status
77 fi
78 chroot $1/ sh -c 'chown postfix /var/spool/postfix/* /var/lib/postfix'
79 chroot $1/ chgrp postdrop /var/spool/postfix/maildrop \
80 /var/spool/postfix/public /usr/sbin/postdrop /usr/sbin/postqueue
81 chmod 2755 $1/usr/sbin/postdrop $1/usr/sbin/postqueue
82 chmod 2710 $1/var/spool/postfix/public
83 chmod 1730 $1/var/spool/postfix/maildrop
84 chroot $1/ postalias /etc/postfix/aliases
85 cat <<EOF
86 ----
87 Warning: you still need to edit myorigin/mydestination/mynetworks
88 parameter settings in /etc/postfix/main.cf.
89 See also http://www.postfix.org/STANDARD_CONFIGURATION_README.html
91 To start $PACKAGE server you can run :
93 /etc/init.d/$PACKAGE start
95 Or add $PACKAGE to RUN_DAEMONS in /etc/rcS.conf
96 ----
97 EOF
98 }
100 post_remove()
101 {
102 deluser postfix
103 delgroup postfix
104 delgroup postdrop
105 }