wok view postfix/receipt @ rev 1195
postfix: create /etc/aliases.db
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Wed Aug 06 16:22:16 2008 +0000 (2008-08-06) |
parents | 327fe5ea9abb |
children | 0945fbc42957 |
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 cp -a stuff/etc $fs
37 cp -a $_pkg/var $fs
38 mv $fs/etc/postfix/TLS_LICENSE $fs/usr/share/licenses/POSTFIX_TLS_LICENSE
39 mv $fs/etc/postfix/LICENSE $fs/usr/share/licenses/POSTFIX_LICENSE
40 cp -a stuff/etc/init.d $fs/etc
41 chmod 2755 $fs/usr/sbin/postdrop $fs/usr/sbin/postqueue
42 rm -f $fs/etc/postfix/post-install $fs/etc/postfix/postfix-files \
43 $fs/etc/postfix/postfix-script
44 }
46 # Pre and post install commands for Tazpkg.
47 post_install()
48 {
49 ( cd $1/ ; cpio -o -H newc | gzip -9 ) > \
50 $1/$INSTALLED/$PACKAGE/volatile.cpio.gz <<EOT
51 $(cd $1/ ; find etc/postfix -type f)
52 EOT
53 # adduser postfix if needed
54 if ! grep -q postfix $1/etc/passwd; then
55 echo -n "Adding user postfix..."
56 chroot $1/ adduser postfix -D -H -S -h /dev/null
57 status
58 fi
59 # addgroup postfix if needed
60 if ! grep -q postfix $1/etc/group; then
61 echo -n "Adding group postfix..."
62 chroot $1/ addgroup postfix && addgroup postfix postfix
63 status
64 fi
65 # addgroup postdrop if needed
66 if ! grep -q postdrop $1/etc/group; then
67 echo -n "Adding group postdrop..."
68 chroot $1/ addgroup postdrop
69 status
70 fi
71 chown postfix /var/spool/postfix/* /var/lib/postfix
72 chgrp postdrop /var/spool/postfix/maildrop /var/spool/postfix/public \
73 /usr/sbin/postdrop /usr/sbin/postqueue
74 postalias /etc/postfix/aliases
75 cat <<EOF
76 ----
77 Warning: you still need to edit myorigin/mydestination/mynetworks
78 parameter settings in /etc/postfix/main.cf.
79 See also http://www.postfix.org/STANDARD_CONFIGURATION_README.html
81 To start $PACKAGE server you can run :
83 /etc/init.d/$PACKAGE start
85 Or add $PACKAGE to RUN_DAEMONS in /etc/rcS.conf
86 ----
87 EOF
88 }
90 post_remove()
91 {
92 deluser postfix
93 delgroup postfix
94 delgroup postdrop
95 }
97 repack_cleanup()
98 {
99 zcat $INSTALLED/$PACKAGE/volatile.cpio.gz | ( cd $1 ; cpio -id )
100 }