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