--- admin/PlamoBuild.template.common.without_comment 2016-06-15 20:51:13.000000000 +0900 +++ plamo/00_base/old/logrotate-20160606/PlamoBuild.logrotate-3.8.1 2016-06-06 08:26:47.000000000 +0900 @@ -1,15 +1,14 @@ #!/bin/sh ###################################################################### -url="" -pkgbase= -vers= +url="https://fedorahosted.org/releases/l/o/logrotate/logrotate-3.8.1.tar.gz" +pkgbase=logrotate +vers=3.8.1 arch=`uname -m` -build=P1 +build=P4 src=$pkgbase-$vers -patchfiles="" OPT_CONFIG="" -DOCS="README" +DOCS="README.HPUX README.Solaris CHANGES COPYING" ###################################################################### fscheck() { @@ -224,17 +223,6 @@ done for i in `seq 0 $((${#B[@]} - 1))` ; do cd ${B[$i]} - for j in ${patchfiles[$i]} ; do - case ${j##*.} in - gz) gunzip -c $W/$j | patch -Np1 -i - ;; - bz2) bunzip2 -c $W/j | patch -Np1 -i - ;; - xz) unxz -c $W/$j | patch -Np1 -i - ;; - *) patch -Np1 -i $W/$j ;; - esac - done - done - for i in `seq 0 $((${#B[@]} - 1))` ; do - cd ${B[$i]} if [ -f Makefile ] ; then make clean fi @@ -269,9 +257,50 @@ for i in `seq 0 $((${#B[@]} - 1))` ; do cd ${B[$i]} if [ -f Makefile ] ; then - make install DESTDIR=$P + make install PREFIX=$P MANDIR=/usr/share/man fi done + install -d $P/etc/logrotate.d + cat <<- "EOF" > $P/etc/logrotate.conf.new + # /etc/logrotate.conf + # + # logrotate is designed to ease administration of systems that generate large + # numbers of log files. It allows automatic rotation, compression, removal, and + # mailing of log files. Each log file may be handled daily, weekly, monthly, or + # when it grows too large. + # + # logrotate is normally run daily from root's crontab. + # + # For more details, see "man logrotate". + + # rotate log files weekly: + weekly + + # keep 4 weeks worth of backlogs: + rotate 4 + + # create new (empty) log files after rotating old ones: + create + + # uncomment this if you want your log files compressed: + compress + + # some packages install log rotation information in this directory: + include /etc/logrotate.d + + # Rotate /var/log/wtmp: + /var/log/wtmp { + monthly + create 0664 root utmp + rotate 1 + } + + # Note that /var/log/lastlog is not rotated. This is intentional, and it should + # not be. The lastlog file is a database, and is also a sparse file that takes + # up much less space on the drive than it appears. + + # system-specific logs may be also be configured below: + EOF touch $W/i.et cd $W find $P ! -type l -newer i.st ! -newer i.et \ @@ -294,10 +323,28 @@ fi ( cd $docdir ; find ${src[$i]} -type d -exec touch -r $W/{} {} \; ) done + cp -a $S/examples $docdir/$src + chown -R root.root $docdir/$src/examples + mv $docdir/$src/{examples,{COPYING,$myname}.gz} $C + mv $C/{examples,{COPYING,$myname}.gz} $docdir/$src + touch -r $S $docdir/$src convert - tar cvpf $pkg.tar -C $P `cd $P ; find usr/bin | tail -n+2` - tar rvpf $pkg.tar -C $P `cd $P ; find usr/share/man/man1 | tail -n+2` + install -d $P/install + cat <<- "EOF" > $P/install/doinst.sh + mv etc/logrotate.conf.new /tmp + if [ -f etc/logrotate.conf ] ; then + mv /tmp/logrotate.conf.new etc/logrotate.conf.dist + else + mv /tmp/logrotate.conf.new etc/logrotate.conf + fi + 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 etc/logrotate.{d,conf.new} + 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