wok-6.x rev 1159
Add postfix
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Sun Jul 27 14:51:29 2008 +0000 (2008-07-27) |
parents | 4561ef060373 |
children | d78262312181 |
files | postfix/receipt postfix/stuff/etc/init.d/postfix |
line diff
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/postfix/receipt Sun Jul 27 14:51:29 2008 +0000 1.3 @@ -0,0 +1,105 @@ 1.4 +# SliTaz package receipt. 1.5 + 1.6 +PACKAGE="postfix" 1.7 +VERSION="2.5.2" 1.8 +CATEGORY="network" 1.9 +SHORT_DESC="fast, easy to administer, and secure mailer." 1.10 +MAINTAINER="pascal.bellard@slitaz.org" 1.11 +TARBALL="$PACKAGE-$VERSION.tar.gz" 1.12 +WEB_SITE="http://www.postfix.org/" 1.13 +WGET_URL="ftp://mir1.ovh.net/ftp.postfix.org/postfix-release/official/$TARBALL" 1.14 +BUILD_DEPENDS="db-dev openldap-dev pcre-dev" 1.15 +DEPENDS="libdb libldap pcre" 1.16 + 1.17 +# Rules to configure and make the package. 1.18 +compile_rules() 1.19 +{ 1.20 + 1.21 + cd $src 1.22 + make makefiles CCARGS="-DHAS_DB -DHAS_LDAP" AUXLIBS="-ldb -lldap -llber" 1.23 + make 1.24 + install_root=/home/slitaz/wok/postfix/postfix-2.5.2/_pkg \ 1.25 + sh postfix-install -non-interactive 1.26 +} 1.27 + 1.28 +# Rules to gen a SliTaz package suitable for Tazpkg. 1.29 +genpkg_rules() 1.30 +{ 1.31 + mkdir -p $fs/usr/share/licenses/ 1.32 + cp -a $_pkg/usr/libexec $fs/usr 1.33 + cp -a $_pkg/usr/bin $fs/usr 1.34 + cp -a $_pkg/usr/sbin $fs/usr 1.35 + cp -a $_pkg/etc $fs 1.36 + cp -a $_pkg/var $fs 1.37 + mv $fs/etc/postfix/TLS_LICENSE $fs/usr/share/licenses/POSTFIX_TLS_LICENSE 1.38 + mv $fs/etc/postfix/LICENSE $fs/usr/share/licenses/POSTFIX_LICENSE 1.39 + cp -a stuff/etc/init.d $fs/etc 1.40 + chmod 2755 $fs/usr/sbin/postdrop $fs/usr/sbin/postqueue 1.41 + rm -f $fs/etc/postfix/post-install $fs/etc/postfix/postfix-files \ 1.42 + $fs/etc/postfix/postfix-script 1.43 +} 1.44 + 1.45 +# Pre and post install commands for Tazpkg. 1.46 +post_install() 1.47 +{ 1.48 + ( cd $1/ ; cpio -o -H newc | gzip -9 ) > \ 1.49 + $1/$INSTALLED/$PACKAGE/volatile.cpio.gz <<EOT 1.50 +etc/postfix/access 1.51 +etc/postfix/aliases 1.52 +etc/postfix/canonical 1.53 +etc/postfix/generic 1.54 +etc/postfix/header_checks 1.55 +etc/postfix/main.cf 1.56 +etc/postfix/master.cf 1.57 +etc/postfix/relocated 1.58 +etc/postfix/transport 1.59 +etc/postfix/virtual 1.60 +EOT 1.61 + # adduser postfix if needed 1.62 + if ! grep -q postfix $1/etc/passwd; then 1.63 + echo -n "Adding user postfix..." 1.64 + chroot $1/ adduser postfix -D -H -S 1.65 + status 1.66 + fi 1.67 + # addgroup postfix if needed 1.68 + if ! grep -q postfix $1/etc/group; then 1.69 + echo -n "Adding group postfix..." 1.70 + chroot $1/ addgroup postfix && addgroup postfix postfix 1.71 + status 1.72 + fi 1.73 + # addgroup postdrop if needed 1.74 + if ! grep -q postdrop $1/etc/group; then 1.75 + echo -n "Adding group postdrop..." 1.76 + chroot $1/ addgroup postdrop 1.77 + status 1.78 + fi 1.79 + chown postfix /var/spool/postfix/* /var/lib/postfix 1.80 + chown root /var/spool/postfix/pid 1.81 + chgrp postdrop /var/spool/postfix/maildrop /var/spool/postfix/public \ 1.82 + /usr/sbin/postdrop /usr/sbin/postqueue 1.83 + cat <<EOF 1.84 +---- 1.85 +Warning: you still need to edit myorigin/mydestination/mynetworks 1.86 +parameter settings in /etc/postfix/main.cf. 1.87 +See also http://www.postfix.org/STANDARD_CONFIGURATION_README.html 1.88 + 1.89 +To start $PACKAGE server you can run : 1.90 + 1.91 + /etc/init.d/$PACKAGE start 1.92 + 1.93 +Or add $PACKAGE to RUN_DAEMONS in /etc/rcS.conf 1.94 +---- 1.95 +EOF 1.96 +} 1.97 + 1.98 +post_remove() 1.99 +{ 1.100 + deluser postfix 1.101 + delgroup postfix 1.102 + delgroup postdrop 1.103 +} 1.104 + 1.105 +repack_cleanup() 1.106 +{ 1.107 + zcat $INSTALLED/$PACKAGE/volatile.cpio.gz | ( cd $1 ; cpio -id ) 1.108 +}
2.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 2.2 +++ b/postfix/stuff/etc/init.d/postfix Sun Jul 27 14:51:29 2008 +0000 2.3 @@ -0,0 +1,65 @@ 2.4 +#!/bin/sh 2.5 +# /etc/init.d/postfix : Start, stop and restart SMTP server on SliTaz, at 2.6 +# boot time or with the command line. 2.7 +# 2.8 +# To start SMTP server at boot time, just put postfix in the $RUN_DAEMONS 2.9 +# variable of /etc/rcS.conf and configure options with /etc/daemons.conf 2.10 +# 2.11 +. /etc/init.d/rc.functions 2.12 +. /etc/daemons.conf 2.13 + 2.14 +NAME=Postfix 2.15 +DESC="SMTP server" 2.16 +DAEMON=/usr/libexec/master 2.17 +OPTIONS=$POSTFIX_OPTIONS 2.18 +PIDFILE=/var/spool/postfix/pid/master.pid 2.19 + 2.20 +case "$1" in 2.21 + start) 2.22 + if [ -f $PIDFILE ] ; then 2.23 + echo "$NAME already running." 2.24 + exit 1 2.25 + fi 2.26 + echo -n "Starting $DESC: $NAME... " 2.27 + $DAEMON $OPTIONS & 2.28 + status 2.29 + ;; 2.30 + stop) 2.31 + if [ ! -f $PIDFILE ] ; then 2.32 + echo "$NAME is not running." 2.33 + exit 1 2.34 + fi 2.35 + echo -n "Stopping $DESC: $NAME... " 2.36 + kill `cat $PIDFILE` 2.37 + status 2.38 + ;; 2.39 + restart) 2.40 + if [ ! -f $PIDFILE ] ; then 2.41 + echo "$NAME is not running." 2.42 + exit 1 2.43 + fi 2.44 + echo -n "Restarting $DESC: $NAME... " 2.45 + kill `cat $PIDFILE` 2.46 + sleep 2 2.47 + $DAEMON $OPTIONS & 2.48 + status 2.49 + ;; 2.50 + reload) 2.51 + if [ ! -f $PIDFILE ] ; then 2.52 + echo "$NAME is not running." 2.53 + exit 1 2.54 + fi 2.55 + postsuper active || exit 1 2.56 + kill -HUP `cat $PIDFILE` 2.57 + postsuper & 2.58 + status 2.59 + ;; 2.60 + *) 2.61 + echo "" 2.62 + echo -e "\033[1mUsage:\033[0m /etc/init.d/`basename $0` [start|stop|restart|reload]" 2.63 + echo "" 2.64 + exit 1 2.65 + ;; 2.66 +esac 2.67 + 2.68 +exit 0