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

Up udev (135)
author Pascal Bellard <pascal.bellard@slitaz.org>
date Wed Dec 17 07:05:23 2008 +0000 (2008-12-17)
parents 0945fbc42957
children bd6010223726
line source
1 # SliTaz package receipt.
3 PACKAGE="postfix"
4 VERSION="2.5.2"
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"
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-2.5.2/_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 ( cd $1/ ; cpio -o -H newc | gzip -9 ) > \
61 $1/$INSTALLED/$PACKAGE/volatile.cpio.gz <<EOT
62 $(cd $1/ ; find etc/postfix -type f)
63 EOT
64 # adduser postfix if needed
65 if ! grep -q postfix $1/etc/passwd; then
66 echo -n "Adding user postfix..."
67 chroot $1/ adduser postfix -D -H -S -h /dev/null
68 status
69 fi
70 # addgroup postfix if needed
71 if ! grep -q postfix $1/etc/group; then
72 echo -n "Adding group postfix..."
73 chroot $1/ addgroup postfix && addgroup postfix postfix
74 status
75 fi
76 # addgroup postdrop if needed
77 if ! grep -q postdrop $1/etc/group; then
78 echo -n "Adding group postdrop..."
79 chroot $1/ addgroup postdrop
80 status
81 fi
82 chown postfix $1/var/spool/postfix/* $1/var/lib/postfix
83 chgrp postdrop $1/var/spool/postfix/maildrop $1/var/spool/postfix/public \
84 $1/usr/sbin/postdrop $1/usr/sbin/postqueue
85 chmod 2755 $1/usr/sbin/postdrop $1/usr/sbin/postqueue
86 chmod 2710 $1/var/spool/postfix/public
87 chmod 1730 $1/var/spool/postfix/maildrop
88 postalias $1/etc/postfix/aliases
89 cat <<EOF
90 ----
91 Warning: you still need to edit myorigin/mydestination/mynetworks
92 parameter settings in /etc/postfix/main.cf.
93 See also http://www.postfix.org/STANDARD_CONFIGURATION_README.html
95 To start $PACKAGE server you can run :
97 /etc/init.d/$PACKAGE start
99 Or add $PACKAGE to RUN_DAEMONS in /etc/rcS.conf
100 ----
101 EOF
102 }
104 post_remove()
105 {
106 deluser postfix
107 delgroup postfix
108 delgroup postdrop
109 }
111 repack_cleanup()
112 {
113 zcat $INSTALLED/$PACKAGE/volatile.cpio.gz | ( cd $1 ; cpio -id )
114 }