--- admin/PlamoBuild-template-20161020 2016-10-20 00:36:22.000000000 +0900 +++ plamo/01_minimum/devel.txz/old/libc-20161209/PlamoBuild.libc-2.20 2016-12-09 19:36:44.000000000 +0900 @@ -1,15 +1,28 @@ #!/bin/sh ###################################################################### -url="" -pkgbase= -vers= +url="http://ftp.gnu.org/gnu/glibc/glibc-2.20.tar.xz + http://www.linuxfromscratch.org/patches/downloads/glibc/glibc-2.19-fhs-1.patch + http://ftp.su.se/pub/mirrors/lunar-linux.org/lunar/patches/glibc-2.20-do_ftell_wide-memleak.patch + http://ftp.su.se/pub/mirrors/lunar-linux.org/lunar/patches/glibc-2.20-getifaddrs_internal-segfault.patch + http://ftp.su.se/pub/mirrors/lunar-linux.org/lunar/patches/glibc-2.20-linux-3.16-additions.patch + http://slackware.cs.utah.edu/pub/slackware/slackware-current/source/l/glibc/glibc-c-utf8-locale.patch.gz + ftp://plamo.linet.gr.jp/pub/Plamo-src/plamo/00_base/glibc/CVE-2015-7547.patch + ftp://plamo.linet.gr.jp/pub/Plamo-src/plamo/00_base/glibc/CVE-2015-8776.patch + ftp://plamo.linet.gr.jp/pub/Plamo-src/plamo/00_base/glibc/CVE-2015-8778.patch + ftp://plamo.linet.gr.jp/pub/Plamo-src/plamo/00_base/glibc/CVE-2015-8779.patch" +pkgbase=libc +vers=2.20 arch=`uname -m` -build=P1 -src=$pkgbase-$vers -patchfiles="" -OPT_CONFIG="" -DOCS="README" +build=P5 +src=glibc-$vers +patchfiles="glibc-2.19-fhs-1.patch glibc-2.20-do_ftell_wide-memleak.patch + glibc-2.20-getifaddrs_internal-segfault.patch + glibc-2.20-linux-3.16-additions.patch glibc-c-utf8-locale.patch.gz + `echo CVE-2015-{7547,877{6,8,9}}.patch`" +OPT_CONFIG="--enable-kernel=2.6.32 --enable-obsolete-rpc" +DOCS="BUGS CONFORMANCE COPYING* ChangeLog* INSTALL LICENSES NEWS + PROJECTS README" template=20161020 tmplurl=ftp://plamo.linet.gr.jp/pub/Plamo-src/admin ###################################################################### @@ -165,6 +178,7 @@ W=`pwd` for i in `seq 0 $((${#src[@]} - 1))` ; do S[$i]=$W/${src[$i]} ; B[$i]=$W/build`test ${#src[@]} -eq 1 || echo $i` + S2[$i]=$W/source`test ${#src[@]} -eq 1 || echo $i` done P=$W/work ; C=$W/pivot infodir=$P/usr/share/info @@ -222,10 +236,11 @@ fi if [ $opt_config -eq 1 ] ; then for i in `seq 0 $((${#B[@]} - 1))` ; do - if [ -d ${B[$i]} ] ; then rm -rf ${B[$i]} ; fi ; cp -a ${S[$i]} ${B[$i]} + if [ -d ${S2[$i]} ] ; then rm -rf ${S2[$i]} ; fi ; cp -a ${S[$i]} ${S2[$i]} + if [ -d ${B[$i]} ] ; then rm -rf ${B[$i]} ; fi ; mkdir ${B[$i]} done for i in `seq 0 $((${#B[@]} - 1))` ; do - cd ${B[$i]} + cd ${S2[$i]} for j in ${patchfiles[$i]} ; do case ${j##*.} in gz) gunzip -c $W/$j | patch -Np1 -i - ;; @@ -235,18 +250,41 @@ esac done done + cp -p localedata/Makefile{,.orig} + cat <<- "EOF" | patch localedata/Makefile + 235a236 + > --no-archive \ + EOF for i in `seq 0 $((${#B[@]} - 1))` ; do - cd ${B[$i]} + cd ${S2[$i]} if [ -f Makefile ] ; then make clean fi if [ -f config.log ] ; then rm -rf config.cache config.log fi - if [ -x configure ] ; then - ./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var \ + cd ${B[$i]} + case $arch in + i686) + cat <<- "EOF" > configparms ;; + CFLAGS += -march=i486 -mtune=native -O3 -pipe + EOF + x86_64) + cat <<- "EOF" > configparms ;; + slibdir=/lib64 + CFLAGS += -march=x86-64 -mtune=generic -O3 -pipe + EOF + armv7l) + cat <<- "EOF" > configparms ;; + CFLAGS += -march=armv7-a -mtune=native -O3 -pipe + EOF + esac + if [ -x ${S2[$i]}/configure ] ; then + ${S2[$i]}/configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var \ --libdir='${exec_prefix}'/$libdir --infodir='${prefix}'/share/info \ - --mandir='${prefix}'/share/man ${OPT_CONFIG[$i]} + --mandir='${prefix}'/share/man ${OPT_CONFIG[$i]} \ + --libexecdir=/usr/$libdir/glibc \ + --build=$arch-pc-linux --target=$arch-pc-linux fi done fi @@ -311,9 +349,11 @@ ( cd $docdir ; find ${src[$i]} -type d -exec touch -r $W/{} {} \; ) done 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` + tar cvpf $pkg.tar -C $P `cd $P ; find usr/$libdir -maxdepth 1 ! -type d` + 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/info | 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