--- admin/PlamoBuild.template.common.without_comment 2016-06-15 20:51:13.000000000 +0900 +++ plamo/00_base/old/logrotate-20160116/PlamoBuild.logrotate-3.8.1 2016-01-16 07:32:10.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=P3 src=$pkgbase-$vers -patchfiles="" OPT_CONFIG="" -DOCS="README" +DOCS="README.HPUX README.Solaris CHANGES COPYING" ###################################################################### fscheck() { @@ -186,35 +185,13 @@ fi if [ $opt_download -eq 1 ] ; then for i in $url ; do - if [ ! -f ${i##*/} ] ; then - wget $i ; j=${i%.*} - for sig in asc sig{,n} {sha{256,1},md5}{,sum} ; do - if wget --spider $i.$sig ; then wget $i.$sig ; break ; fi - if wget --spider $j.$sig ; then - case ${i##*.} in - gz) gunzip -c ${i##*/} > ${j##*/} ;; - bz2) bunzip2 -c ${i##*/} > ${j##*/} ;; - xz) unxz -c ${i##*/} > ${j##*/} ;; - esac - touch -r ${i##*/} ${j##*/} ; i=$j ; wget $i.$sig ; break - fi - done - if [ -f ${i##*/}.$sig ] ; then - case $sig in - asc|sig|sign) gpg2 --verify ${i##*/}.$sig ;; - sha256|sha1|md5) ${sig}sum -c ${i##*/}.$sig ;; - *) $sig -c ${i##*/}.$sig ;; - esac - if [ $? -ne 0 ] ; then echo "archive verify failed" ; exit ; fi - fi - fi + if [ ! -f ${i##*/} ] ; then wget $i ; fi done for i in $url ; do case ${i##*.} in tar) tar xvpf ${i##*/} ;; - gz|tgz) tar xvpzf ${i##*/} ;; - bz2|tbz) tar xvpjf ${i##*/} ;; - xz|txz) tar xvpJf ${i##*/} ;; + gz) tar xvpzf ${i##*/} ;; + bz2) tar xvpjf ${i##*/} ;; esac done fi @@ -224,17 +201,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 @@ -242,8 +208,8 @@ rm -rf config.cache config.log fi if [ -x configure ] ; then - ./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var \ - --libdir='${exec_prefix}'/$libdir --infodir='${prefix}'/share/info \ + ./configure --prefix=/usr --libdir='${exec_prefix}'/$libdir \ + --infodir='${prefix}'/share/info \ --mandir='${prefix}'/share/man ${OPT_CONFIG[$i]} fi done @@ -269,9 +235,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 +301,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 + if [ -f etc/logrotate.conf ] ; then + rm etc/logrotate.conf.new + else + mv etc/logrotate.conf.new /tmp + 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