--- admin/PlamoBuild.template.common.without_comment 2016-06-15 20:51:13.000000000 +0900 +++ plamo/01_minimum/network.txz/old/postfix-20161001/PlamoBuild.postfix-2.11.8 2016-10-01 22:29:30.000000000 +0900 @@ -1,15 +1,16 @@ #!/bin/sh ###################################################################### -url="" -pkgbase= -vers= +url="http://mirror.postfix.jp/postfix-release/official/postfix-2.11.8.tar.gz" +pkgbase=postfix +vers=2.11.8 arch=`uname -m` -build=P1 +build=P2 src=$pkgbase-$vers patchfiles="" OPT_CONFIG="" -DOCS="README" +DOCS="AAAREADME COMPATIBILITY COPYRIGHT HISTORY INSTALL IPv6-ChangeLog + LICENSE PORTING RELEASE_NOTES* TLS_* US_PATENT_6321267" ###################################################################### fscheck() { @@ -247,6 +248,15 @@ --mandir='${prefix}'/share/man ${OPT_CONFIG[$i]} fi done + cp -p conf/postfix-files{,.orig} + cat <<- "EOF" >> conf/postfix-files + $command_directory/smtp-source:f:root:root:-:755 + $command_directory/smtp-sink:f:root:root:-:755 + $command_directory/qmqp-source:f:root:root:-:755 + $command_directory/qmqp-sink:f:root:root:-:755 + EOF + make makefiles CCARGS="-DNO_NIS -DUSE_SASL_AUTH -DUSE_CYRUS_SASL \ + -DUSE_TLS -I/usr/include/sasl" AUXLIBS="-lsasl2 -lssl -lcrypto" fi if [ $opt_build -eq 1 ] ; then for i in `seq 0 $((${#B[@]} - 1))` ; do @@ -268,15 +278,67 @@ touch $W/i.st ; sleep 1 for i in `seq 0 $((${#B[@]} - 1))` ; do cd ${B[$i]} - if [ -f Makefile ] ; then + false && if [ -f Makefile ] ; then make install DESTDIR=$P fi done + sh postfix-install -non-interactive -package install_root=$P \ + html_directory=/usr/share/doc/postfix/html \ + manpage_directory=/usr/share/man \ + readme_directory=/usr/share/doc/postfix/README_FILES + install -d $P/usr/lib + ln -s /usr/sbin/sendmail $P/usr/lib + for i in access aliases canonical generic \ + header_checks main.cf master.cf relocated transport virtual ; do + mv $P/etc/postfix/$i{,.new} + done + mv $P/etc/postfix/{{access,aliases}.new,bounce.cf.default,canonical.new} $C + mv $P/etc/postfix/{{generic,header_checks}.new,main.cf.default} $C + mv $P/etc/postfix/{main.cf.new,makedefs.out,{master.cf,relocated}.new} $C + mv $P/etc/postfix/{transport,virtual}.new $C + mv $C/{{access,aliases}.new,bounce.cf.default,canonical.new} $P/etc/postfix + mv $C/{{generic,header_checks}.new,main.cf.default} $P/etc/postfix + mv $C/{main.cf.new,makedefs.out,{master.cf,relocated}.new} $P/etc/postfix + mv $C/{transport,virtual}.new $P/etc/postfix + sed -i "/^\(html\|readme\)_directory/s@postfix@$src@" \ + $P/etc/postfix/main.cf.new + cat <<- "EOF" >> $P/etc/postfix/main.cf.new + + # Plamo local configurations (for fml and SMTP auth with SASL2) + alias_maps = hash:/etc/aliases + allow_mail_to_commands = alias,forward,include + smtpd_recipient_limit = 5000 + + #smtpd_sasl_auth_enable = yes + #smtpd_sasl_local_domain = + #smtpd_sasl_authenticated_header = yes + #smtpd_recipient_restrictions = + # permit_mynetworks + # permit_sasl_authenticated + # reject_unauth_destination + ## for Cyrus SASL + #smtpd_sasl_path = smtpd + #smtp_sasl_password_maps = hash:/etc/postfix/sasl_password + ## for Dovecot SASL + #smtpd_sasl_type = dovecot + #data_directory = /var/lib/postfix + EOF + sed -i 's@^#\(submission\)@\1@' $P/etc/postfix/master.cf.new + install -m 644 proto/aliases0 $P/etc/aliases.new + install -d $P/etc/rc.d/init.d + ln -s /usr/sbin/postfix $P/etc/rc.d/init.d + for i in active bounce corrupt defer deferred flush \ + hold incoming private maildrop public saved trace ; do + chown postfix $P/var/spool/postfix/$i + done + chgrp postdrop $P/var/spool/postfix/{maildrop,public} touch $W/i.et cd $W find $P ! -type l -newer i.st ! -newer i.et \ -exec touch -t `date '+%m%d0900'` {} \; compress + strip_bindir $P/usr/libexec/postfix + touch -t `date '+%m%d0900'` $P/usr/libexec/postfix for i in `seq 0 $((${#DOCS[@]} - 1))` ; do for j in ${DOCS[$i]} ; do for k in ${S[$i]}/$j ; do @@ -294,10 +356,68 @@ fi ( cd $docdir ; find ${src[$i]} -type d -exec touch -r $W/{} {} \; ) done + mv $docdir/postfix/html $docdir/$src + mv $docdir/postfix/README_FILES $docdir/$src + mv $docdir/$src/{README_FILES,{RELEASE_NOTES*,TLS_*}.gz} $C + mv $docdir/$src/{US_PATENT_6321267.gz,html,$myname.gz} $C + mv $C/{README_FILES,{RELEASE_NOTES*,TLS_*}.gz} $docdir/$src + mv $C/{US_PATENT_6321267.gz,html,$myname.gz} $docdir/$src + touch -r $S $docdir/$src convert - tar cvpf $pkg.tar -C $P `cd $P ; find usr/bin | tail -n+2` + prune_symlink $P/usr/lib + prune_symlink $P/etc/rc.d/init.d + cat <<- "EOF" >> $P/install/doinst.sh + + postfix_config() { + mv etc/postfix/$1.new /tmp + if [ -f etc/postfix/$1 ] ; then + mv /tmp/$1.new etc/postfix/$1.dist + else + mv /tmp/$1.new etc/postfix/$1 + fi + } + + for i in access aliases canonical generic \ + header_checks main.cf master.cf relocated transport virtual ; do + postfix_config $i + done + mv etc/aliases.new /tmp + if [ -f etc/aliases ] ; then + mv /tmp/aliases.new etc/aliases.dist + else + mv /tmp/aliases.new etc/aliases + fi + EOF + cat <<- EOF | sed 's/^|//' >> $P/install/doinst.sh + |#%% begin initialize $pkg + |if ! grep -q submission /etc/services ; then + | cat <<- "EOF" >> /etc/services + | submission 587/tcp + | submission 587/udp + | EOF + |fi + |if ps ax | grep inetd | grep -vq grep ; then + | killall -HUP inetd + |fi + |postfix upgrade-configuration + |postfix set-permissions + |[ -f /etc/aliases.db ] || newaliases + |#%% end + EOF + touch -t `date '+%m%d0900'` $P/install/doinst.sh + tar cvpf $pkg.tar -C $P `cd $P ; find usr/sbin | tail -n+2` + tar rvpf $pkg.tar -C $P usr/lib/sendmail + tar rvpf $pkg.tar -C $P `cd $P ; find usr/bin | tail -n+2` + tar rvpf $pkg.tar -C $P usr/libexec/postfix + tar rvpf $pkg.tar -C $P etc/postfix + tar rvpf $pkg.tar -C $P etc/aliases.new + tar rvpf $pkg.tar -C $P etc/rc.d/init.d/postfix + tar rvpf $pkg.tar -C $P var/{lib,spool}/postfix tar rvpf $pkg.tar -C $P `cd $P ; find usr/share/man/man1 | tail -n+2` + tar rvpf $pkg.tar -C $P `cd $P ; find usr/share/man/man5 | tail -n+2` + tar rvpf $pkg.tar -C $P `cd $P ; find usr/share/man/man8 | tail -n+2` tar rvpf $pkg.tar -C $P usr/share/doc/$src + tar rvpf $pkg.tar -C $P install/doinst.sh touch -t `date '+%m%d0900'` $pkg.tar ; xz $pkg.tar ; touch $pkg.tar.xz mv $pkg.tar.xz $pkg.txz read -p "Do you want to keep work files? [y/N] " ans