wok annotate postfix/receipt @ rev 1503

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