--- admin/PlamoBuild.template.common.without_comment 2016-06-15 20:51:13.000000000 +0900 +++ plamo/00_base/old/util_linux-20160427/PlamoBuild.util_linux-2.28 2016-04-27 07:35:14.000000000 +0900 @@ -1,15 +1,17 @@ #!/bin/sh ###################################################################### -url="" -pkgbase= -vers= +url="http://www.kernel.org/pub/linux/utils/util-linux/v2.28/util-linux-2.28.tar.xz" +pkgbase=util_linux +vers=2.28 arch=`uname -m` build=P1 -src=$pkgbase-$vers -patchfiles="" -OPT_CONFIG="" -DOCS="README" +src=util-linux-$vers +OPT_CONFIG="--localstatedir=/var --disable-setpriv --disable-last + --disable-mesg --disable-chfn-chsh --disable-login --disable-nologin + --disable-sulogin --disable-su --enable-write --disable-pylibmount + --without-user --without-python" +DOCS="COPYING ABOUT-NLS ChangeLog README NEWS README.licensing AUTHORS" ###################################################################### fscheck() { @@ -187,22 +189,14 @@ 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 + wget $i + for sig in asc sig{,n} {md5,sha{1,256}}{,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 ;; + md5|sha1|sha256) ${sig}sum -c ${i##*/}.$sig ;; *) $sig -c ${i##*/}.$sig ;; esac if [ $? -ne 0 ] ; then echo "archive verify failed" ; exit ; fi @@ -213,8 +207,8 @@ case ${i##*.} in tar) tar xvpf ${i##*/} ;; gz|tgz) tar xvpzf ${i##*/} ;; - bz2|tbz) tar xvpjf ${i##*/} ;; - xz|txz) tar xvpJf ${i##*/} ;; + bz2) tar xvpjf ${i##*/} ;; + xz) tar xvpJf ${i##*/} ;; esac done fi @@ -224,17 +218,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 +225,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=/$libdir \ + --infodir='${prefix}'/share/info \ --mandir='${prefix}'/share/man ${OPT_CONFIG[$i]} fi done @@ -269,9 +252,15 @@ for i in `seq 0 $((${#B[@]} - 1))` ; do cd ${B[$i]} if [ -f Makefile ] ; then - make install DESTDIR=$P + make -i install DESTDIR=$P fi done + mv $P/usr/bin/logger $P/bin + ln -s /bin/logger $P/usr/bin + mv $P/bin/{,u}mount $P/sbin + ln -s /sbin/mount $P/bin + ln -s /sbin/umount $P/bin + install -d $P/var/lib/hwclock touch $W/i.et cd $W find $P ! -type l -newer i.st ! -newer i.et \ @@ -294,10 +283,34 @@ fi ( cd $docdir ; find ${src[$i]} -type d -exec touch -r $W/{} {} \; ) done + cp -a $S/Documentation $docdir/$src + chmod -R g-w $docdir/$src/Documentation + chown -R root.root $docdir/$src/Documentation + mv $docdir/util-linux/getopt $docdir/$src + mv $docdir/$src/{Documentation,{README,NEWS}.gz,getopt} $C + mv $docdir/$src/{README.licensing,AUTHORS,$myname}.gz $C + mv $C/{Documentation,{README,NEWS}.gz,getopt} $docdir/$src + mv $C/{README.licensing,AUTHORS,$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 cvpf $pkg.tar -C $P `cd $P ; find bin | tail -n+2` + tar rvpf $pkg.tar -C $P `cd $P ; find sbin | tail -n+2` + tar rvpf $pkg.tar -C $P `cd $P ; find usr/bin | tail -n+2` + tar rvpf $pkg.tar -C $P `cd $P ; find usr/sbin | tail -n+2` + tar rvpf $pkg.tar -C $P `cd $P ; find $libdir | tail -n+2` + tar rvpf $pkg.tar -C $P \ + `cd $P ; find usr/$libdir ! -name pkgconfig | tail -n+2` + tar rvpf $pkg.tar -C $P `cd $P ; find usr/include -maxdepth 1 | tail -n+2` + tar rvpf $pkg.tar -C $P `cd $P ; find usr/share/locale -name "*.mo"` + tar rvpf $pkg.tar -C $P \ + `cd $P ; find usr/share/bash-completion/completions | tail -n+2` + tar rvpf $pkg.tar -C $P var/lib/hwclock 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/man3 | 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