diff options
author | William Harrington <kb0iic@berzerkula.org> | 2021-04-06 14:09:59 -0500 |
---|---|---|
committer | William Harrington <kb0iic@berzerkula.org> | 2021-04-06 14:09:59 -0500 |
commit | af28b78b8e659f995b39a5dde2ce2cef0da9fbe0 (patch) | |
tree | a80d4cfef7713f7aa26137c0da553358af4cd7b2 | |
parent | 783a4c48e04e81783848f0cb0f757f6a836d7f6e (diff) |
Add chapter8 script commands.
74 files changed, 835 insertions, 3 deletions
diff --git a/chapter8/acl.sh b/chapter8/acl.sh index 7a693aa..da4caae 100644 --- a/chapter8/acl.sh +++ b/chapter8/acl.sh @@ -1,3 +1,13 @@ #!/bin/bash +./configure --prefix=/usr \ + --bindir=/bin \ + --disable-static \ + --libexecdir=/usr/lib \ + --docdir=/usr/share/doc/acl-"${VERSION}" +make +make -j1 install + +mv -v /usr/lib/libacl.so.* /lib +ln -sfv ../../lib/"$(readlink /usr/lib/libacl.so)" /usr/lib/libacl.so diff --git a/chapter8/attr.sh b/chapter8/attr.sh index 7a693aa..f68d6cb 100644 --- a/chapter8/attr.sh +++ b/chapter8/attr.sh @@ -1,3 +1,13 @@ #!/bin/bash +./configure --prefix=/usr \ + --bindir=/bin \ + --disable-static \ + --sysconfdir=/etc \ + --docdir=/usr/share/doc/attr-"${VERSION}" +make +make -j1 install + +mv -v /usr/lib/libattr.so.* /lib +ln -sfv ../../lib/"$(readlink /usr/lib/libattr.so)" /usr/lib/libattr.so diff --git a/chapter8/autoconf.sh b/chapter8/autoconf.sh index 7a693aa..c3588fd 100644 --- a/chapter8/autoconf.sh +++ b/chapter8/autoconf.sh @@ -1,3 +1,7 @@ #!/bin/bash +./configure --prefix=/usr +make + +make -j1 install diff --git a/chapter8/automake.sh b/chapter8/automake.sh index 7a693aa..e2b76e8 100644 --- a/chapter8/automake.sh +++ b/chapter8/automake.sh @@ -1,3 +1,9 @@ #!/bin/bash +sed -i "s/''/etags/" t/tags-lisp-space.sh +./configure --prefix=/usr --docdir=/usr/share/doc/automake-"${VERSION}" + +make + +make -j1 install diff --git a/chapter8/bash.sh b/chapter8/bash.sh index 7a693aa..65eb2d8 100644 --- a/chapter8/bash.sh +++ b/chapter8/bash.sh @@ -1,3 +1,17 @@ #!/bin/bash +patch -Np1 -i ../bash-"${VERSION}"-fixes-1.patch +sed -i '/^bashline.o:.*shmbchar.h/a bashline.o: ${DEFDIR}/builtext.h' Makefile.in + +./configure --prefix=/usr \ + --docdir=/usr/share/doc/bash-"${VERSION}" \ + --without-bash-malloc \ + --with-installed-readline + +make + +make -j1 install +mv -vf /usr/bin/bash /bin + +#exec /bin/bash --login +h diff --git a/chapter8/bc.sh b/chapter8/bc.sh index 7a693aa..c1d3014 100644 --- a/chapter8/bc.sh +++ b/chapter8/bc.sh @@ -1,3 +1,6 @@ #!/bin/bash +PREFIX=/usr CC=gcc ./configure.sh -G -O3 +make +make -j1 install diff --git a/chapter8/binutils.sh b/chapter8/binutils.sh index 7a693aa..41a99b1 100644 --- a/chapter8/binutils.sh +++ b/chapter8/binutils.sh @@ -1,3 +1,23 @@ #!/bin/bash +expect -c "spawn ls" +sed -i '/@\tincremental_copy/d' gold/testsuite/Makefile.in + +mkdir -v build +cd build || exit 1 + +../configure --prefix=/usr \ + --enable-gold \ + --enable-ld=default \ + --enable-plugins \ + --enable-shared \ + --disable-werror \ + --enable-64-bit-bfd \ + --with-system-zlib + +make tooldir=/usr + +make tooldir=/usr -j1 install + +rm -fv /usr/lib/lib{bfd,ctf,ctf-nobfd,opcodes}.a diff --git a/chapter8/bison.sh b/chapter8/bison.sh index 7a693aa..eb97728 100644 --- a/chapter8/bison.sh +++ b/chapter8/bison.sh @@ -1,3 +1,7 @@ #!/bin/bash +./configure --prefix=/usr --docdir=/usr/share/doc/bison-"${VERSION}" +make + +make -j1 install diff --git a/chapter8/bzip2.sh b/chapter8/bzip2.sh index 7a693aa..b1b4459 100644 --- a/chapter8/bzip2.sh +++ b/chapter8/bzip2.sh @@ -1,3 +1,21 @@ #!/bin/bash +patch -Np1 -i ../bzip2-"${VERSION}"-install_docs-1.patch +sed -i 's@\(ln -s -f \)$(PREFIX)/bin/@\1@' Makefile +sed -i "s@(PREFIX)/man@(PREFIX)/share/man@g" Makefile + +make -f Makefile-libbz2_so +make clean +make + +make PREFIX=/usr -j1 install + +cp -v bzip2-shared /bin/bzip2 +cp -av libbz2.so* /lib +ln -sv ../../lib/libbz2.so.1.0 /usr/lib/libbz2.so +rm -v /usr/bin/{bunzip2,bzcat,bzip2} +ln -sv bzip2 /bin/bunzip2 +ln -sv bzip2 /bin/bzcat + +rm -fv /usr/lib/libbz2.a diff --git a/chapter8/check.sh b/chapter8/check.sh index 7a693aa..9a4f704 100644 --- a/chapter8/check.sh +++ b/chapter8/check.sh @@ -1,3 +1,7 @@ #!/bin/bash +./configure --prefix=/usr --disable-static +make + +make docdir=/usr/share/doc/check-"${VERSION}" -j1 install diff --git a/chapter8/coreutils.sh b/chapter8/coreutils.sh index 7a693aa..62ceb69 100644 --- a/chapter8/coreutils.sh +++ b/chapter8/coreutils.sh @@ -1,3 +1,25 @@ #!/bin/bash +echo $NINJAJOBS +patch -Np1 -i ../coreutils-"${VERSION}"-i18n-1.patch + +sed -i '/test.lock/s/^/#/' gnulib-tests/gnulib.mk + +autoreconf -fiv +FORCE_UNSAFE_CONFIGURE=1 ./configure \ + --prefix=/usr \ + --enable-no-install-program=kill,uptime + +make + +make -j1 install + +mv -v /usr/bin/{cat,chgrp,chmod,chown,cp,date,dd,df,echo} /bin +mv -v /usr/bin/{false,ln,ls,mkdir,mknod,mv,pwd,rm} /bin +mv -v /usr/bin/{rmdir,stty,sync,true,uname} /bin +mv -v /usr/bin/chroot /usr/sbin +mv -v /usr/share/man/man1/chroot.1 /usr/share/man/man8/chroot.8 +sed -i 's/"1"/"8"/' /usr/share/man/man8/chroot.8 + +mv -v /usr/bin/{head,nice,sleep,touch} /bin diff --git a/chapter8/dejagnu.sh b/chapter8/dejagnu.sh index 7a693aa..fc94545 100644 --- a/chapter8/dejagnu.sh +++ b/chapter8/dejagnu.sh @@ -1,3 +1,9 @@ #!/bin/bash +./configure --prefix=/usr +makeinfo --html --no-split -o doc/dejagnu.html doc/dejagnu.texi +makeinfo --plaintext -o doc/dejagnu.txt doc/dejagnu.texi +make -j1 install +install -v -dm755 /usr/share/doc/dejagnu-"${VERSION}" +install -v -m644 doc/dejagnu.{html,txt} /usr/share/doc/dejagnu-"${VERSION}" diff --git a/chapter8/diffutils.sh b/chapter8/diffutils.sh index 7a693aa..c3588fd 100644 --- a/chapter8/diffutils.sh +++ b/chapter8/diffutils.sh @@ -1,3 +1,7 @@ #!/bin/bash +./configure --prefix=/usr +make + +make -j1 install diff --git a/chapter8/e2fsprogs.sh b/chapter8/e2fsprogs.sh index 7a693aa..b872707 100644 --- a/chapter8/e2fsprogs.sh +++ b/chapter8/e2fsprogs.sh @@ -1,3 +1,25 @@ #!/bin/bash +mkdir -v build +cd build || exit 1 +../configure --prefix=/usr \ + --bindir=/bin \ + --with-root-prefix="" \ + --enable-elf-shlibs \ + --disable-libblkid \ + --disable-libuuid \ + --disable-uuidd \ + --disable-fsck + +make + +make -j1 install + +rm -fv /usr/lib/{libcom_err,libe2p,libext2fs,libss}.a +gunzip -v /usr/share/info/libext2fs.info.gz +install-info --dir-file=/usr/share/info/dir /usr/share/info/libext2fs.info + +makeinfo -o doc/com_err.info ../lib/et/com_err.texinfo +install -v -m644 doc/com_err.info /usr/share/info +install-info --dir-file=/usr/share/info/dir /usr/share/info/com_err.info diff --git a/chapter8/eudev.sh b/chapter8/eudev.sh index 7a693aa..a15e189 100644 --- a/chapter8/eudev.sh +++ b/chapter8/eudev.sh @@ -1,3 +1,24 @@ #!/bin/bash +./configure --prefix=/usr \ + --bindir=/sbin \ + --sbindir=/sbin \ + --libdir=/usr/lib \ + --sysconfdir=/etc \ + --libexecdir=/lib \ + --with-rootprefix= \ + --with-rootlibdir=/lib \ + --enable-manpages \ + --disable-static +make + +mkdir -pv /lib/udev/rules.d +mkdir -pv /etc/udev/rules.d + +make -j1 install + +tar -xvf ../udev-lfs-20171102.tar.xz +make -f udev-lfs-20171102/Makefile.lfs install + +udevadm hwdb --update diff --git a/chapter8/expat.sh b/chapter8/expat.sh index 7a693aa..1e21feb 100644 --- a/chapter8/expat.sh +++ b/chapter8/expat.sh @@ -1,3 +1,11 @@ #!/bin/bash +./configure --prefix=/usr \ + --disable-static \ + --docdir=/usr/share/doc/expat-"${VERSION}" +make + +make -j1 install + +install -v -m644 doc/*.{html,png,css} /usr/share/doc/expat-"${VERSION}" diff --git a/chapter8/expect.sh b/chapter8/expect.sh index 7a693aa..1b7ccdc 100644 --- a/chapter8/expect.sh +++ b/chapter8/expect.sh @@ -1,3 +1,11 @@ #!/bin/bash +./configure --prefix=/usr \ + --with-tcl=/usr/lib \ + --enable-shared \ + --mandir=/usr/share/man \ + --with-tclinclude=/usr/include +make +make -j1 install +ln -svf expect"${VERSION}"/libexpect"${VERSION}".so /usr/lib diff --git a/chapter8/file.sh b/chapter8/file.sh index 7a693aa..5adb7d7 100644 --- a/chapter8/file.sh +++ b/chapter8/file.sh @@ -1,3 +1,5 @@ #!/bin/bash - +./configure --prefix=/usr +make +make -j1 install diff --git a/chapter8/findutils.sh b/chapter8/findutils.sh index 7a693aa..b058eea 100644 --- a/chapter8/findutils.sh +++ b/chapter8/findutils.sh @@ -1,3 +1,10 @@ #!/bin/bash +./configure --prefix=/usr --localstatedir=/var/lib/locate +make + +make -j1 install + +mv -v /usr/bin/find /bin +sed -i 's|find:=${BINDIR}|find:=/bin|' /usr/bin/updatedb diff --git a/chapter8/flex.sh b/chapter8/flex.sh index 7a693aa..58d7b29 100644 --- a/chapter8/flex.sh +++ b/chapter8/flex.sh @@ -1,3 +1,10 @@ #!/bin/bash +./configure --prefix=/usr \ + --docdir=/usr/share/doc/flex-"${VERSION}" \ + --disable-static +make + +make -j1 install +ln -sv flex /usr/bin/lex diff --git a/chapter8/gawk.sh b/chapter8/gawk.sh index 7a693aa..eb7c111 100644 --- a/chapter8/gawk.sh +++ b/chapter8/gawk.sh @@ -1,3 +1,12 @@ #!/bin/bash +sed -i 's/extras//' Makefile.in +./configure --prefix=/usr + +make + +make -j1 install + +mkdir -v /usr/share/doc/gawk-"${VERSION}" +cp -v doc/{awkforai.txt,*.{eps,pdf,jpg}} /usr/share/doc/gawk-"${VERSION}" diff --git a/chapter8/gcc.sh b/chapter8/gcc.sh index 7a693aa..7b4df3b 100644 --- a/chapter8/gcc.sh +++ b/chapter8/gcc.sh @@ -1,3 +1,46 @@ #!/bin/bash +case $(uname -m) in + x86_64) + sed -e '/m64=/s/lib64/lib/' \ + -i.orig gcc/config/i386/t-linux64 + ;; +esac +mkdir -v build +cd build || exit 1 + +../configure --prefix=/usr \ + LD=ld \ + --enable-languages=c,c++ \ + --disable-multilib \ + --disable-bootstrap \ + --with-system-zlib + +make + +make -j1 install +rm -rf /usr/lib/gcc/"$(gcc -dumpmachine)"/"${VERSION}"/include-fixed/bits/ + +chown -v -R root:root \ + /usr/lib/gcc/*linux-gnu/"${VERSION}"/include{,-fixed} + +ln -sv ../usr/bin/cpp /lib + +ln -sfv ../../libexec/gcc/"$(gcc -dumpmachine)"/"${VERSION}"/liblto_plugin.so \ + /usr/lib/bfd-plugins/ + +echo 'int main(){}' > dummy.c +cc dummy.c -v -Wl,--verbose &> dummy.log +readelf -l a.out | grep ': /lib' + +grep -o '/usr/lib.*/crt[1in].*succeeded' dummy.log +grep -B4 '^ /usr/include' dummy.log +grep 'SEARCH.*/usr/lib' dummy.log |sed 's|; |\n|g' +grep "/lib.*/libc.so.6 " dummy.log +grep found dummy.log + +rm -v dummy.c a.out dummy.log + +mkdir -pv /usr/share/gdb/auto-load/usr/lib +mv -v /usr/lib/*gdb.py /usr/share/gdb/auto-load/usr/lib diff --git a/chapter8/gdbm.sh b/chapter8/gdbm.sh index 7a693aa..adf3947 100644 --- a/chapter8/gdbm.sh +++ b/chapter8/gdbm.sh @@ -1,3 +1,9 @@ #!/bin/bash +./configure --prefix=/usr \ + --disable-static \ + --enable-libgdbm-compat +make + +make -j1 install diff --git a/chapter8/gettext.sh b/chapter8/gettext.sh index 7a693aa..1ff6c97 100644 --- a/chapter8/gettext.sh +++ b/chapter8/gettext.sh @@ -1,3 +1,10 @@ #!/bin/bash +./configure --prefix=/usr \ + --disable-static \ + --docdir=/usr/share/doc/gettext-"${VERSION}" +make + +make -j1 install +chmod -v 0755 /usr/lib/preloadable_libintl.so diff --git a/chapter8/glibc.sh b/chapter8/glibc.sh index 7a693aa..21289b1 100644 --- a/chapter8/glibc.sh +++ b/chapter8/glibc.sh @@ -1,3 +1,78 @@ #!/bin/bash +patch -Np1 -i ../glibc-"${VERSION}"-fhs-1.patch +sed -e '402a\ *result = local->data.services[database_index];' \ + -i nss/nss_database.c + +mkdir -v build +cd build || exit 1 + +../configure --prefix=/usr \ + --disable-werror \ + --enable-kernel=5.10.0 \ + --enable-stack-protector=strong \ + --with-headers=/usr/include \ + libc_cv_slibdir=/lib + +make PARALLELMFLAGS="${MAKEFLAGS}" + +touch /etc/ld.so.conf + +sed '/test-installation/s@$(PERL)@echo not running@' -i ../Makefile + +make -j1 install + +cp -v ../nscd/nscd.conf /etc/nscd.conf +mkdir -pv /var/cache/nscd + +make localedata/install-locales + +cat > /etc/nsswitch.conf << "EOF" +# Begin /etc/nsswitch.conf + +passwd: files +group: files +shadow: files + +hosts: files dns +networks: files + +protocols: files +services: files +ethers: files +rpc: files + +# End /etc/nsswitch.conf +EOF + +tar -xf ../../tzdata2021a.tar.gz + +ZONEINFO=/usr/share/zoneinfo +mkdir -pv "${ZONEINFO}"/{posix,right} + +for tz in etcetera southamerica northamerica europe africa antarctica \ + asia australasia backward; do + zic -L /dev/null -d "${ZONEINFO}" "${tz}" + zic -L /dev/null -d "${ZONEINFO}"/posix "${tz}" + zic -L leapseconds -d "${ZONEINFO}"/right "${tz}" +done + +cp -v zone.tab zone1970.tab iso3166.tab "${ZONEINFO}" +zic -d "${ZONEINFO}" -p America/New_York + +ln -sfv /usr/share/zoneinfo/America/Chicago /etc/localtime + +cat > /etc/ld.so.conf << "EOF" +# Begin /etc/ld.so.conf +/usr/local/lib +/opt/lib + +EOF + +cat >> /etc/ld.so.conf << "EOF" +# Add an include directory +include /etc/ld.so.conf.d/*.conf + +EOF +mkdir -pv /etc/ld.so.conf.d diff --git a/chapter8/gmp.sh b/chapter8/gmp.sh index 7a693aa..f853d52 100644 --- a/chapter8/gmp.sh +++ b/chapter8/gmp.sh @@ -1,3 +1,16 @@ #!/bin/bash +# Uncomment for generic libraries +# cp -v configfsf.guess config.guess +# cp -v configfsf.sub config.sub +./configure --prefix=/usr \ + --enable-cxx \ + --disable-static \ + --docdir=/usr/share/doc/gmp-"${VERSION}" + +make +make html + +make -j1 install +make -j1 install-html diff --git a/chapter8/gperf.sh b/chapter8/gperf.sh index 7a693aa..66c6e76 100644 --- a/chapter8/gperf.sh +++ b/chapter8/gperf.sh @@ -1,3 +1,7 @@ #!/bin/bash +./configure --prefix=/usr --docdir=/usr/share/doc/gperf-"${VERSION}" +make + +make -j1 install diff --git a/chapter8/grep.sh b/chapter8/grep.sh index 7a693aa..3c82a41 100644 --- a/chapter8/grep.sh +++ b/chapter8/grep.sh @@ -1,3 +1,7 @@ #!/bin/bash +./configure --prefix=/usr --bindir=/bin +make + +make -j1 install diff --git a/chapter8/groff.sh b/chapter8/groff.sh index 7a693aa..ec6b15c 100644 --- a/chapter8/groff.sh +++ b/chapter8/groff.sh @@ -1,3 +1,7 @@ #!/bin/bash +PAGE=letter ./configure --prefix=/usr +make + +make -j1 install diff --git a/chapter8/grub.sh b/chapter8/grub.sh index 7a693aa..edb7b3b 100644 --- a/chapter8/grub.sh +++ b/chapter8/grub.sh @@ -1,3 +1,15 @@ #!/bin/bash +sed "s/gold-version/& -R .note.gnu.property/" \ + -i Makefile.in grub-core/Makefile.in +./configure --prefix=/usr \ + --sbindir=/sbin \ + --sysconfdir=/etc \ + --disable-efiemu \ + --disable-werror + +make + +make -j1 install +mv -v /etc/bash_completion.d/grub /usr/share/bash-completion/completions diff --git a/chapter8/gzip.sh b/chapter8/gzip.sh index 7a693aa..dbf30a3 100644 --- a/chapter8/gzip.sh +++ b/chapter8/gzip.sh @@ -1,3 +1,9 @@ #!/bin/bash +./configure --prefix=/usr +make + +make -j1 install + +mv -v /usr/bin/gzip /bin diff --git a/chapter8/iana-etc.sh b/chapter8/iana-etc.sh index 7a693aa..8576a80 100644 --- a/chapter8/iana-etc.sh +++ b/chapter8/iana-etc.sh @@ -1,3 +1,3 @@ #!/bin/bash - +cp -v services protocols /etc diff --git a/chapter8/inetutils.sh b/chapter8/inetutils.sh index 7a693aa..3999fb7 100644 --- a/chapter8/inetutils.sh +++ b/chapter8/inetutils.sh @@ -1,3 +1,18 @@ #!/bin/bash +./configure --prefix=/usr \ + --localstatedir=/var \ + --disable-logger \ + --disable-whois \ + --disable-rcp \ + --disable-rexec \ + --disable-rlogin \ + --disable-rsh \ + --disable-servers +make + +make -j1 install + +mv -v /usr/bin/{hostname,ping,ping6,traceroute} /bin +mv -v /usr/bin/ifconfig /sbin diff --git a/chapter8/intltool.sh b/chapter8/intltool.sh index 7a693aa..0ab53c5 100644 --- a/chapter8/intltool.sh +++ b/chapter8/intltool.sh @@ -1,3 +1,10 @@ #!/bin/bash +sed -i 's:\\\${:\\\$\\{:' intltool-update.in +./configure --prefix=/usr + +make + +make -j1 install +install -v -Dm644 doc/I18N-HOWTO /usr/share/doc/intltool-"${VERSION}"/I18N-HOWTO diff --git a/chapter8/iproute2.sh b/chapter8/iproute2.sh index 7a693aa..efa8e3f 100644 --- a/chapter8/iproute2.sh +++ b/chapter8/iproute2.sh @@ -1,3 +1,10 @@ #!/bin/bash +sed -i /ARPD/d Makefile +rm -fv man/man8/arpd.8 +sed -i 's/.m_ipt.o//' tc/Makefile + +make + +make DOCDIR=/usr/share/doc/iproute2-"${VERSION}" -j1 install diff --git a/chapter8/isl.sh b/chapter8/isl.sh index 7a693aa..3a98da1 100644 --- a/chapter8/isl.sh +++ b/chapter8/isl.sh @@ -1,3 +1,11 @@ #!/bin/bash +./configure --prefix=/usr \ + --disable-static \ + --docdir=/usr/share/doc/isl-"${VERSION}" +make +make html + +make -j1 install +make -j1 install-html diff --git a/chapter8/kbd.sh b/chapter8/kbd.sh index 7a693aa..81b369c 100644 --- a/chapter8/kbd.sh +++ b/chapter8/kbd.sh @@ -1,3 +1,15 @@ #!/bin/bash +patch -Np1 -i ../kbd-"${VERSION}"-backspace-1.patch +sed -i '/RESIZECONS_PROGS=/s/yes/no/' configure +sed -i 's/resizecons.8 //' docs/man/man8/Makefile.in + +./configure --prefix=/usr --disable-vlock + +make + +make -j1 install + +mkdir -v /usr/share/doc/kbd-"${VERSION}" +cp -R -v docs/doc/* /usr/share/doc/kbd-"${VERSION}" diff --git a/chapter8/kmod.sh b/chapter8/kmod.sh index 7a693aa..65e3a5f 100644 --- a/chapter8/kmod.sh +++ b/chapter8/kmod.sh @@ -1,3 +1,19 @@ #!/bin/bash +./configure --prefix=/usr \ + --bindir=/bin \ + --sysconfdir=/etc \ + --with-rootlibdir=/lib \ + --with-xz \ + --with-zstd \ + --with-zlib +make + +make -j1 install + +for target in depmod insmod lsmod modinfo modprobe rmmod; do + ln -sfv ../bin/kmod /sbin/"${target}" +done + +ln -sfv kmod /bin/lsmod diff --git a/chapter8/less.sh b/chapter8/less.sh index 7a693aa..8bdbea9 100644 --- a/chapter8/less.sh +++ b/chapter8/less.sh @@ -1,3 +1,7 @@ #!/bin/bash +./configure --prefix=/usr --sysconfdir=/etc +make + +make -j1 install diff --git a/chapter8/libcap.sh b/chapter8/libcap.sh index 7a693aa..41ff39c 100644 --- a/chapter8/libcap.sh +++ b/chapter8/libcap.sh @@ -1,3 +1,12 @@ #!/bin/bash +sed -i '/install -m.*STA/d' libcap/Makefile +make prefix=/usr lib=lib + +make prefix=/usr lib=lib -j1 install +for libname in cap psx; do + mv -v /usr/lib/lib"${libname}".so.* /lib + ln -sfv ../../lib/lib"${libname}".so.2 /usr/lib/lib"${libname}".so + chmod -v 755 /lib/lib"${libname}".so.2.48 +done diff --git a/chapter8/libelf.sh b/chapter8/libelf.sh index 7a693aa..ef91c85 100644 --- a/chapter8/libelf.sh +++ b/chapter8/libelf.sh @@ -1,3 +1,12 @@ #!/bin/bash +./configure --prefix=/usr \ + --disable-debuginfod \ + --enable-libdebuginfod=dummy \ + --libdir=/lib +make + +make -C libelf -j1 install +install -vm644 config/libelf.pc /usr/lib/pkgconfig +rm /lib/libelf.a diff --git a/chapter8/libffi.sh b/chapter8/libffi.sh index 7a693aa..51846d6 100644 --- a/chapter8/libffi.sh +++ b/chapter8/libffi.sh @@ -1,3 +1,7 @@ #!/bin/bash +./configure --prefix=/usr --disable-static --with-gcc-arch=native +make + +make -j1 install diff --git a/chapter8/libpipeline.sh b/chapter8/libpipeline.sh index 7a693aa..c3588fd 100644 --- a/chapter8/libpipeline.sh +++ b/chapter8/libpipeline.sh @@ -1,3 +1,7 @@ #!/bin/bash +./configure --prefix=/usr +make + +make -j1 install diff --git a/chapter8/libtool.sh b/chapter8/libtool.sh index 7a693aa..819a697 100644 --- a/chapter8/libtool.sh +++ b/chapter8/libtool.sh @@ -1,3 +1,9 @@ #!/bin/bash +./configure --prefix=/usr +make + +make -j1 install + +rm -fv /usr/lib/libltdl.a diff --git a/chapter8/m4.sh b/chapter8/m4.sh index 7a693aa..1ccef8e 100644 --- a/chapter8/m4.sh +++ b/chapter8/m4.sh @@ -1,3 +1,8 @@ #!/bin/bash +sed -i 's/IO_ftrylockfile/IO_EOF_SEEN/' lib/*.c +echo "#define _IO_IN_BACKUP 0x100" >> lib/stdio-impl.h +./configure --prefix=/usr +make +make -j1 install diff --git a/chapter8/make.sh b/chapter8/make.sh index 7a693aa..c3588fd 100644 --- a/chapter8/make.sh +++ b/chapter8/make.sh @@ -1,3 +1,7 @@ #!/bin/bash +./configure --prefix=/usr +make + +make -j1 install diff --git a/chapter8/man-db.sh b/chapter8/man-db.sh index 7a693aa..be0d139 100644 --- a/chapter8/man-db.sh +++ b/chapter8/man-db.sh @@ -1,3 +1,16 @@ #!/bin/bash +./configure --prefix=/usr \ + --docdir=/usr/share/doc/man-db-"${VERSION}" \ + --sysconfdir=/etc \ + --disable-setuid \ + --enable-cache-owner=bin \ + --with-browser=/usr/bin/lynx \ + --with-vgrind=/usr/bin/vgrind \ + --with-grap=/usr/bin/grap \ + --with-systemdtmpfilesdir= \ + --with-systemdsystemunitdir= +make + +make -j1 install diff --git a/chapter8/man-pages.sh b/chapter8/man-pages.sh index 7a693aa..db9dad4 100644 --- a/chapter8/man-pages.sh +++ b/chapter8/man-pages.sh @@ -1,3 +1,3 @@ #!/bin/bash - +make -j1 install diff --git a/chapter8/meson.sh b/chapter8/meson.sh index 7a693aa..df3a017 100644 --- a/chapter8/meson.sh +++ b/chapter8/meson.sh @@ -1,3 +1,6 @@ #!/bin/bash +python3 setup.py build +python3 setup.py install --root=dest +cp -rv dest/* / diff --git a/chapter8/mpc.sh b/chapter8/mpc.sh index 7a693aa..8093f46 100644 --- a/chapter8/mpc.sh +++ b/chapter8/mpc.sh @@ -1,3 +1,11 @@ #!/bin/bash +./configure --prefix=/usr \ + --disable-static \ + --docdir=/usr/share/doc/mpc-"${VERSION}" +make +make html + +make -j1 install +make -j1 install-html diff --git a/chapter8/mpfr.sh b/chapter8/mpfr.sh index 7a693aa..f73b287 100644 --- a/chapter8/mpfr.sh +++ b/chapter8/mpfr.sh @@ -1,3 +1,12 @@ #!/bin/bash +./configure --prefix=/usr \ + --disable-static \ + --enable-thread-safe \ + --docdir=/usr/share/doc/mpfr-"${VERSION}" +make +make html + +make -j1 install +make -j1 install-html diff --git a/chapter8/ncurses.sh b/chapter8/ncurses.sh index 7a693aa..918c829 100644 --- a/chapter8/ncurses.sh +++ b/chapter8/ncurses.sh @@ -1,3 +1,29 @@ #!/bin/bash +./configure --prefix=/usr \ + --mandir=/usr/share/man \ + --with-shared \ + --without-debug \ + --without-normal \ + --enable-pc-files \ + --enable-widec +make +make -j1 install + +mv -v /usr/lib/libncursesw.so.6* /lib +ln -sfv ../../lib/"$(readlink /usr/lib/libncursesw.so)" /usr/lib/libncursesw.so +for lib in ncurses form panel menu ; do + rm -vf /usr/lib/lib"${lib}".so + echo "INPUT(-l${lib}w)" > /usr/lib/lib"${lib}".so + ln -sfv "${lib}"w.pc /usr/lib/pkgconfig/"${lib}".pc +done + +rm -vf /usr/lib/libcursesw.so +echo "INPUT(-lncursesw)" > /usr/lib/libcursesw.so +ln -sfv libncurses.so /usr/lib/libcurses.so + +rm -fv /usr/lib/libncurses++w.a + +mkdir -v /usr/share/doc/ncurses-"${VERSION}" +cp -v -R doc/* /usr/share/doc/ncurses-"${VERSION}" diff --git a/chapter8/ninja.sh b/chapter8/ninja.sh index 7a693aa..3f93e56 100644 --- a/chapter8/ninja.sh +++ b/chapter8/ninja.sh @@ -1,3 +1,16 @@ #!/bin/bash +export NINJAJOBS=4 +sed -i '/int Guess/a \ + int j = 0;\ + char* jobs = getenv( "NINJAJOBS" );\ + if ( jobs != NULL ) j = atoi( jobs );\ + if ( j > 0 ) return j;\ +' src/ninja.cc + +python3 configure.py --bootstrap + +install -vm755 ninja /usr/bin/ +install -vDm644 misc/bash-completion /usr/share/bash-completion/completions/ninja +install -vDm644 misc/zsh-completion /usr/share/zsh/site-functions/_ninja diff --git a/chapter8/openssl.sh b/chapter8/openssl.sh index 7a693aa..d7b5e9b 100644 --- a/chapter8/openssl.sh +++ b/chapter8/openssl.sh @@ -1,3 +1,16 @@ #!/bin/bash +./config --prefix=/usr \ + --openssldir=/etc/ssl \ + --libdir=lib \ + shared \ + zlib-dynamic +make + +sed -i '/INSTALL_LIBS/s/libcrypto.a libssl.a//' Makefile +make MANSUFFIX=ssl install + +mv -v /usr/share/doc/openssl /usr/share/doc/openssl-"${VERSION}" + +cp -vfr doc/* /usr/share/doc/openssl-"${VERSION}" diff --git a/chapter8/patch.sh b/chapter8/patch.sh index 7a693aa..c3588fd 100644 --- a/chapter8/patch.sh +++ b/chapter8/patch.sh @@ -1,3 +1,7 @@ #!/bin/bash +./configure --prefix=/usr +make + +make -j1 install diff --git a/chapter8/perl.sh b/chapter8/perl.sh index 7a693aa..c7afaaf 100644 --- a/chapter8/perl.sh +++ b/chapter8/perl.sh @@ -1,3 +1,26 @@ #!/bin/bash +MAJMIN="$(cut -d\. -f1,2 <<< "${VERSION}")" +export BUILD_ZLIB=False +export BUILD_BZIP2=0 + +sh Configure -des \ + -Dprefix=/usr \ + -Dvendorprefix=/usr \ + -Dprivlib=/usr/lib/perl5/"${MAJMIN}"/core_perl \ + -Darchlib=/usr/lib/perl5/"${MAJMIN}"/core_perl \ + -Dsitelib=/usr/lib/perl5/"${MAJMIN}"/site_perl \ + -Dsitearch=/usr/lib/perl5/"${MAJMIN}"/site_perl \ + -Dvendorlib=/usr/lib/perl5/"${MAJMIN}"/vendor_perl \ + -Dvendorarch=/usr/lib/perl5/"${MAJMIN}"/vendor_perl \ + -Dman1dir=/usr/share/man/man1 \ + -Dman3dir=/usr/share/man/man3 \ + -Dpager="/usr/bin/less -isR" \ + -Duseshrplib \ + -Dusethreads + +make + +make -j1 install +unset BUILD_ZLIB BUILD_BZIP2 diff --git a/chapter8/pkg-config.sh b/chapter8/pkg-config.sh index 7a693aa..395d190 100644 --- a/chapter8/pkg-config.sh +++ b/chapter8/pkg-config.sh @@ -1,3 +1,9 @@ #!/bin/bash +./configure --prefix=/usr \ + --with-internal-glib \ + --disable-host-tool \ + --docdir=/usr/share/doc/pkg-config-"${VERSION}" +make +make -j1 install diff --git a/chapter8/procps-ng.sh b/chapter8/procps-ng.sh index 7a693aa..a21e6e4 100644 --- a/chapter8/procps-ng.sh +++ b/chapter8/procps-ng.sh @@ -1,3 +1,15 @@ #!/bin/bash +./configure --prefix=/usr \ + --exec-prefix= \ + --libdir=/usr/lib \ + --docdir=/usr/share/doc/procps-ng-"${VERSION}" \ + --disable-static \ + --disable-kill +make + +make -j1 install + +mv -v /usr/lib/libprocps.so.* /lib +ln -sfv ../../lib/"$(readlink /usr/lib/libprocps.so)" /usr/lib/libprocps.so diff --git a/chapter8/psmisc.sh b/chapter8/psmisc.sh index 7a693aa..b57d459 100644 --- a/chapter8/psmisc.sh +++ b/chapter8/psmisc.sh @@ -1,3 +1,10 @@ #!/bin/bash +./configure --prefix=/usr +make + +make -j1 install + +mv -v /usr/bin/fuser /bin +mv -v /usr/bin/killall /bin diff --git a/chapter8/python.sh b/chapter8/python.sh index 7a693aa..f0e1ce9 100644 --- a/chapter8/python.sh +++ b/chapter8/python.sh @@ -1,3 +1,19 @@ #!/bin/bash +./configure --prefix=/usr \ + --enable-shared \ + --with-system-expat \ + --with-system-ffi \ + --with-ensurepip=yes +make + +make -j1 install + +install -v -dm755 /usr/share/doc/python-"${VERSION}"/html + +tar --strip-components=1 \ + --no-same-owner \ + --no-same-permissions \ + -C /usr/share/doc/python-"${VERSION}"/html \ + -xvf ../python-"${VERSION}"-docs-html.tar.bz2 diff --git a/chapter8/readline.sh b/chapter8/readline.sh index 7a693aa..be3dcc0 100644 --- a/chapter8/readline.sh +++ b/chapter8/readline.sh @@ -1,3 +1,18 @@ #!/bin/bash +sed -i '/MV.*old/d' Makefile.in +sed -i '/{OLDSUFF}/c:' support/shlib-install +./configure --prefix=/usr \ + --disable-static \ + --with-curses \ + --docdir=/usr/share/doc/readline-"${VERSION}" + +make SHLIB_LIBS="-lncursesw" +make SHLIB_LIBS="-lncursesw" -j1 install + +mv -v /usr/lib/lib{readline,history}.so.* /lib +ln -sfv ../../lib/"$(readlink /usr/lib/libreadline.so)" /usr/lib/libreadline.so +ln -sfv ../../lib/"$(readlink /usr/lib/libhistory.so )" /usr/lib/libhistory.so + +install -v -m644 doc/*.{ps,pdf,html,dvi} /usr/share/doc/readline-"${VERSION}" diff --git a/chapter8/sed.sh b/chapter8/sed.sh index 7a693aa..97e8197 100644 --- a/chapter8/sed.sh +++ b/chapter8/sed.sh @@ -1,3 +1,11 @@ #!/bin/bash +./configure --prefix=/usr --bindir=/bin +make +make html + +make -j1 install + +install -d -m755 /usr/share/doc/sed-"${VERSION}" +install -m644 doc/sed.html /usr/share/doc/sed-"${VERSION}" diff --git a/chapter8/shadow.sh b/chapter8/shadow.sh index 7a693aa..f0254de 100644 --- a/chapter8/shadow.sh +++ b/chapter8/shadow.sh @@ -1,3 +1,26 @@ #!/bin/bash +ROOTPW='$1$5RPAAd$oejpw8ErihLIB7vmGE4SV1' +sed -i 's/groups$(EXEEXT) //' src/Makefile.in +find man -name Makefile.in -exec sed -i 's/groups\.1 / /' {} \; +find man -name Makefile.in -exec sed -i 's/getspnam\.3 / /' {} \; +find man -name Makefile.in -exec sed -i 's/passwd\.5 / /' {} \; + +sed -e 's:#ENCRYPT_METHOD DES:ENCRYPT_METHOD SHA512:' \ + -e 's:/var/spool/mail:/var/mail:' \ + -i etc/login.defs + +sed -i 's/1000/999/' etc/useradd + +touch /usr/bin/passwd +./configure --sysconfdir=/etc \ + --with-group-name-max-length=32 + +make +make -j1 install + +pwconv +grpconv + +usermod -p "${ROOTPW}" root diff --git a/chapter8/sysklogd.sh b/chapter8/sysklogd.sh index 7a693aa..7d28f51 100644 --- a/chapter8/sysklogd.sh +++ b/chapter8/sysklogd.sh @@ -1,3 +1,22 @@ #!/bin/bash +sed -i '/Error loading kernel symbols/{n;n;d}' ksym_mod.c +sed -i 's/union wait/int/' syslogd.c +make + +make BINDIR=/sbin -j1 install + +cat > /etc/syslog.conf << "EOF" +# Begin /etc/syslog.conf + +auth,authpriv.* -/var/log/auth.log +*.*;auth,authpriv.none -/var/log/sys.log +daemon.* -/var/log/daemon.log +kern.* -/var/log/kern.log +mail.* -/var/log/mail.log +user.* -/var/log/user.log +*.emerg * + +# End /etc/syslog.conf +EOF diff --git a/chapter8/sysvinit.sh b/chapter8/sysvinit.sh index 7a693aa..563a21a 100644 --- a/chapter8/sysvinit.sh +++ b/chapter8/sysvinit.sh @@ -1,3 +1,7 @@ #!/bin/bash +patch -Np1 -i ../sysvinit-"${VERSION}"-consolidated-1.patch +make + +make -j1 install diff --git a/chapter8/tar.sh b/chapter8/tar.sh index 7a693aa..312a500 100644 --- a/chapter8/tar.sh +++ b/chapter8/tar.sh @@ -1,3 +1,10 @@ #!/bin/bash +FORCE_UNSAFE_CONFIGURE=1 \ +./configure --prefix=/usr \ + --bindir=/bin +make + +make -j1 install +make -C doc install-html docdir=/usr/share/doc/tar-"${VERSION}" diff --git a/chapter8/tcl.sh b/chapter8/tcl.sh index 7a693aa..688dc5e 100644 --- a/chapter8/tcl.sh +++ b/chapter8/tcl.sh @@ -1,3 +1,35 @@ #!/bin/bash +tar -xf ../tcl"${VERSION}"-html.tar.gz --strip-components=1 +SRCDIR=$(pwd) +cd unix || exit 1 +./configure --prefix=/usr \ + --mandir=/usr/share/man \ + "$([ "$(uname -m)" = x86_64 ] && echo --enable-64bit)" + +make + +sed -e "s|${SRCDIR}/unix|/usr/lib|" \ + -e "s|${SRCDIR}|/usr/include|" \ + -i tclConfig.sh + +sed -e "s|${SRCDIR}/unix/pkgs/tdbc1.1.2|/usr/lib/tdbc1.1.2|" \ + -e "s|${SRCDIR}/pkgs/tdbc1.1.2/generic|/usr/include|" \ + -e "s|${SRCDIR}/pkgs/tdbc1.1.2/library|/usr/lib/tcl8.6|" \ + -e "s|${SRCDIR}/pkgs/tdbc1.1.2|/usr/include|" \ + -i pkgs/tdbc1.1.2/tdbcConfig.sh + +sed -e "s|${SRCDIR}/unix/pkgs/itcl4.2.1|/usr/lib/itcl4.2.1|" \ + -e "s|${SRCDIR}/pkgs/itcl4.2.1/generic|/usr/include|" \ + -e "s|${SRCDIR}/pkgs/itcl4.2.1|/usr/include|" \ + -i pkgs/itcl4.2.1/itclConfig.sh + +unset SRCDIR + +make -j1 install + +chmod -v u+w /usr/lib/libtcl8.6.so +make -j1 install-private-headers +ln -sfv tclsh8.6 /usr/bin/tclsh +mv /usr/share/man/man3/{Thread,Tcl_Thread}.3 diff --git a/chapter8/texinfo.sh b/chapter8/texinfo.sh index 7a693aa..bfd324f 100644 --- a/chapter8/texinfo.sh +++ b/chapter8/texinfo.sh @@ -1,3 +1,9 @@ #!/bin/bash +./configure --prefix=/usr +make + +make -j1 install + +make TEXMF=/usr/share/texmf install-tex diff --git a/chapter8/util-linux.sh b/chapter8/util-linux.sh index 7a693aa..f44bb38 100644 --- a/chapter8/util-linux.sh +++ b/chapter8/util-linux.sh @@ -1,3 +1,20 @@ #!/bin/bash +./configure ADJTIME_PATH=/var/lib/hwclock/adjtime \ + --docdir=/usr/share/doc/util-linux-"${VERSION}" \ + --disable-chfn-chsh \ + --disable-login \ + --disable-nologin \ + --disable-su \ + --disable-setpriv \ + --disable-runuser \ + --disable-pylibmount \ + --disable-static \ + --without-python \ + --without-systemd \ + --without-systemdsystemunitdir \ + runstatedir=/run +make + +make -j1 install diff --git a/chapter8/vim.sh b/chapter8/vim.sh index 7a693aa..6543279 100644 --- a/chapter8/vim.sh +++ b/chapter8/vim.sh @@ -1,3 +1,34 @@ #!/bin/bash +echo '#define SYS_VIMRC_FILE "/etc/vimrc"' >> src/feature.h +./configure --prefix=/usr + +make + +make -j1 install + +ln -sv vim /usr/bin/vi +for L in /usr/share/man/{,*/}man1/vim.1; do + ln -sv vim.1 "$(dirname $L)"/vi.1 +done + +ln -sv ../vim/vim82/doc /usr/share/doc/vim-"${VERSION}" + +cat > /etc/vimrc << "EOF" +" Begin /etc/vimrc + +" Ensure defaults are set before customizing settings, not after +source $VIMRUNTIME/defaults.vim +let skip_defaults_vim=1 + +set nocompatible +set backspace=2 +set mouse= +syntax on +if (&term == "xterm") || (&term == "putty") + set background=dark +endif + +" End /etc/vimrc +EOF diff --git a/chapter8/xml-parser.sh b/chapter8/xml-parser.sh index 7a693aa..468c6f1 100644 --- a/chapter8/xml-parser.sh +++ b/chapter8/xml-parser.sh @@ -1,3 +1,7 @@ #!/bin/bash +perl Makefile.PL +make + +make -j1 install diff --git a/chapter8/xz.sh b/chapter8/xz.sh index 7a693aa..5204163 100644 --- a/chapter8/xz.sh +++ b/chapter8/xz.sh @@ -1,3 +1,12 @@ #!/bin/bash +./configure --prefix=/usr \ + --disable-static \ + --docdir=/usr/share/doc/xz-"${VERSION}" + +make +make -j1 install +mv -v /usr/bin/{lzma,unlzma,lzcat,xz,unxz,xzcat} /bin +mv -v /usr/lib/liblzma.so.* /lib +ln -svf ../../lib/"$(readlink /usr/lib/liblzma.so)" /usr/lib/liblzma.so diff --git a/chapter8/zlib.sh b/chapter8/zlib.sh index 7a693aa..47dfba2 100644 --- a/chapter8/zlib.sh +++ b/chapter8/zlib.sh @@ -1,3 +1,9 @@ #!/bin/bash +./configure --prefix=/usr +make +make -j1 install +mv -v /usr/lib/libz.so.* /lib +ln -sfv ../../lib/"$(readlink /usr/lib/libz.so)" /usr/lib/libz.so +rm -fv /usr/lib/libz.a diff --git a/chapter8/zstd.sh b/chapter8/zstd.sh index 7a693aa..56b5ddb 100644 --- a/chapter8/zstd.sh +++ b/chapter8/zstd.sh @@ -1,3 +1,8 @@ #!/bin/bash +make +make prefix=/usr -j1 install +rm -v /usr/lib/libzstd.a +mv -v /usr/lib/libzstd.so.* /lib +ln -sfv ../../lib/"$(readlink /usr/lib/libzstd.so)" /usr/lib/libzstd.so |