--- admin/PlamoBuild-template-20170415 2017-04-15 12:25:32.000000000 +0900 +++ plamo/00_base/logrotate/PlamoBuild.logrotate-3.8.1 2017-04-24 11:52:59.000000000 +0900 @@ -1,18 +1,18 @@ #!/bin/sh ###################################################################### -url="" +url="http://ftp.nara.wide.ad.jp/pub/sunfreeware/SOURCES/logrotate-3.8.1.tar.gz" verify= digest= commitid= -pkgbase= -vers= +pkgbase=logrotate +vers=3.8.1 arch=`uname -m` -build=P1 +build=P5 src=$pkgbase-$vers patchfiles="" OPT_CONFIG="" -DOCS="README" +DOCS="README.HPUX README.Solaris CHANGES COPYING" template=20170415 tmplurl=ftp://plamo.linet.gr.jp/pub/Plamo-src/admin ###################################################################### @@ -61,19 +61,78 @@ 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 \ -exec touch -t `date '+%m%d0900'` {} \; compress setup_docdir + cp -a $S/examples $docdir/$src + chown -R root.root $docdir/$src/examples + mv $docdir/$src/{examples,{COPYING,$func,$myname,$spec}.gz} $C + mv $C/{examples,{COPYING,$func,$myname,$spec}.gz} $docdir/$src + touch -r $S $docdir/$src convert_links - 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 cleanup