wok-4.x annotate postfix/receipt @ rev 1159
Add postfix
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Sun Jul 27 14:51:29 2008 +0000 (2008-07-27) |
parents | |
children | 327fe5ea9abb |
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@1159 | 11 BUILD_DEPENDS="db-dev openldap-dev pcre-dev" |
pascal@1159 | 12 DEPENDS="libdb libldap pcre" |
pascal@1159 | 13 |
pascal@1159 | 14 # Rules to configure and make the package. |
pascal@1159 | 15 compile_rules() |
pascal@1159 | 16 { |
pascal@1159 | 17 |
pascal@1159 | 18 cd $src |
pascal@1159 | 19 make makefiles CCARGS="-DHAS_DB -DHAS_LDAP" AUXLIBS="-ldb -lldap -llber" |
pascal@1159 | 20 make |
pascal@1159 | 21 install_root=/home/slitaz/wok/postfix/postfix-2.5.2/_pkg \ |
pascal@1159 | 22 sh postfix-install -non-interactive |
pascal@1159 | 23 } |
pascal@1159 | 24 |
pascal@1159 | 25 # Rules to gen a SliTaz package suitable for Tazpkg. |
pascal@1159 | 26 genpkg_rules() |
pascal@1159 | 27 { |
pascal@1159 | 28 mkdir -p $fs/usr/share/licenses/ |
pascal@1159 | 29 cp -a $_pkg/usr/libexec $fs/usr |
pascal@1159 | 30 cp -a $_pkg/usr/bin $fs/usr |
pascal@1159 | 31 cp -a $_pkg/usr/sbin $fs/usr |
pascal@1159 | 32 cp -a $_pkg/etc $fs |
pascal@1159 | 33 cp -a $_pkg/var $fs |
pascal@1159 | 34 mv $fs/etc/postfix/TLS_LICENSE $fs/usr/share/licenses/POSTFIX_TLS_LICENSE |
pascal@1159 | 35 mv $fs/etc/postfix/LICENSE $fs/usr/share/licenses/POSTFIX_LICENSE |
pascal@1159 | 36 cp -a stuff/etc/init.d $fs/etc |
pascal@1159 | 37 chmod 2755 $fs/usr/sbin/postdrop $fs/usr/sbin/postqueue |
pascal@1159 | 38 rm -f $fs/etc/postfix/post-install $fs/etc/postfix/postfix-files \ |
pascal@1159 | 39 $fs/etc/postfix/postfix-script |
pascal@1159 | 40 } |
pascal@1159 | 41 |
pascal@1159 | 42 # Pre and post install commands for Tazpkg. |
pascal@1159 | 43 post_install() |
pascal@1159 | 44 { |
pascal@1159 | 45 ( cd $1/ ; cpio -o -H newc | gzip -9 ) > \ |
pascal@1159 | 46 $1/$INSTALLED/$PACKAGE/volatile.cpio.gz <<EOT |
pascal@1159 | 47 etc/postfix/access |
pascal@1159 | 48 etc/postfix/aliases |
pascal@1159 | 49 etc/postfix/canonical |
pascal@1159 | 50 etc/postfix/generic |
pascal@1159 | 51 etc/postfix/header_checks |
pascal@1159 | 52 etc/postfix/main.cf |
pascal@1159 | 53 etc/postfix/master.cf |
pascal@1159 | 54 etc/postfix/relocated |
pascal@1159 | 55 etc/postfix/transport |
pascal@1159 | 56 etc/postfix/virtual |
pascal@1159 | 57 EOT |
pascal@1159 | 58 # adduser postfix if needed |
pascal@1159 | 59 if ! grep -q postfix $1/etc/passwd; then |
pascal@1159 | 60 echo -n "Adding user postfix..." |
pascal@1159 | 61 chroot $1/ adduser postfix -D -H -S |
pascal@1159 | 62 status |
pascal@1159 | 63 fi |
pascal@1159 | 64 # addgroup postfix if needed |
pascal@1159 | 65 if ! grep -q postfix $1/etc/group; then |
pascal@1159 | 66 echo -n "Adding group postfix..." |
pascal@1159 | 67 chroot $1/ addgroup postfix && addgroup postfix postfix |
pascal@1159 | 68 status |
pascal@1159 | 69 fi |
pascal@1159 | 70 # addgroup postdrop if needed |
pascal@1159 | 71 if ! grep -q postdrop $1/etc/group; then |
pascal@1159 | 72 echo -n "Adding group postdrop..." |
pascal@1159 | 73 chroot $1/ addgroup postdrop |
pascal@1159 | 74 status |
pascal@1159 | 75 fi |
pascal@1159 | 76 chown postfix /var/spool/postfix/* /var/lib/postfix |
pascal@1159 | 77 chown root /var/spool/postfix/pid |
pascal@1159 | 78 chgrp postdrop /var/spool/postfix/maildrop /var/spool/postfix/public \ |
pascal@1159 | 79 /usr/sbin/postdrop /usr/sbin/postqueue |
pascal@1159 | 80 cat <<EOF |
pascal@1159 | 81 ---- |
pascal@1159 | 82 Warning: you still need to edit myorigin/mydestination/mynetworks |
pascal@1159 | 83 parameter settings in /etc/postfix/main.cf. |
pascal@1159 | 84 See also http://www.postfix.org/STANDARD_CONFIGURATION_README.html |
pascal@1159 | 85 |
pascal@1159 | 86 To start $PACKAGE server you can run : |
pascal@1159 | 87 |
pascal@1159 | 88 /etc/init.d/$PACKAGE start |
pascal@1159 | 89 |
pascal@1159 | 90 Or add $PACKAGE to RUN_DAEMONS in /etc/rcS.conf |
pascal@1159 | 91 ---- |
pascal@1159 | 92 EOF |
pascal@1159 | 93 } |
pascal@1159 | 94 |
pascal@1159 | 95 post_remove() |
pascal@1159 | 96 { |
pascal@1159 | 97 deluser postfix |
pascal@1159 | 98 delgroup postfix |
pascal@1159 | 99 delgroup postdrop |
pascal@1159 | 100 } |
pascal@1159 | 101 |
pascal@1159 | 102 repack_cleanup() |
pascal@1159 | 103 { |
pascal@1159 | 104 zcat $INSTALLED/$PACKAGE/volatile.cpio.gz | ( cd $1 ; cpio -id ) |
pascal@1159 | 105 } |