aboutsummaryrefslogtreecommitdiffstats
path: root/chapter7
diff options
context:
space:
mode:
Diffstat (limited to 'chapter7')
-rw-r--r--chapter7/backup.sh24
-rw-r--r--chapter7/bison.sh3
-rw-r--r--chapter7/cleanup.sh23
-rw-r--r--chapter7/gettext.sh5
-rw-r--r--chapter7/libstdc++.sh12
-rw-r--r--chapter7/perl.sh11
-rw-r--r--chapter7/python.sh5
-rw-r--r--chapter7/texinfo.sh3
-rw-r--r--chapter7/util-linux.sh15
9 files changed, 101 insertions, 0 deletions
diff --git a/chapter7/backup.sh b/chapter7/backup.sh
new file mode 100644
index 0000000..71ad3a0
--- /dev/null
+++ b/chapter7/backup.sh
@@ -0,0 +1,24 @@
+#!/bin/bash
+
+FILE="${LFS_VER}-ch7-backup.tar.xz"
+DIRS=(bin dev etc lib lib64 proc run sbin sources sys tools usr var)
+
+if [ -f "${LFS}/sources/chapter7/backup" ]; then
+ echo -e "${YLW}Chapter 7 ${GRN}Backup found. Remove manually to backup again.${RST}"
+else
+
+ echo -ne "${GRN}Backing up ${YLW}${LFS}${GRN} to ${YLW}${FILE}${RST}... "
+ pushd "${LFS}" > /dev/null || exit 1
+ sudo XZ_OPTS="-T${NUMPROCS} -e" tar cJpf "${HOME}"/"${FILE}" "${DIRS[@]}" & pid=$!
+ spinner "$pid"
+ retval=$?
+ if [ "$retval" -ne 0 ]; then
+ echo -e "${RED}Backup FAILED!${RST}"
+ else
+ echo -e "${GRN}OK${RST}"
+ fi
+ popd > /dev/null || exit 1
+
+ touch "${LFS}/sources/chapter7/backup"
+fi
+
diff --git a/chapter7/bison.sh b/chapter7/bison.sh
new file mode 100644
index 0000000..a2344a6
--- /dev/null
+++ b/chapter7/bison.sh
@@ -0,0 +1,3 @@
+./configure --prefix=/usr --docdir=/usr/share/doc/bison-3.7.5 &&
+make &&
+make -j1 install
diff --git a/chapter7/cleanup.sh b/chapter7/cleanup.sh
new file mode 100644
index 0000000..b300e7e
--- /dev/null
+++ b/chapter7/cleanup.sh
@@ -0,0 +1,23 @@
+#!/bin/bash
+
+if [ -f "${LFS}/sources/chapter7/cleanup" ]; then
+ echo -e "${YLW}Chapter 7 ${GRN}cleanup already performed.${RST}"
+else
+
+ echo -ne "${GRN}Cleaning up ${YLW}${LFS}${RST}... "
+
+ sudo find "${LFS}"/usr/lib -name \*.la -delete >/dev/null 2>&1
+ sudo find "${LFS}"/usr/libexec -name \*.la -delete >/dev/null 2>&1
+
+ sudo rm -rf "${LFS}"/usr/share/doc >/dev/null 2>&1
+ sudo rm -rf "${LFS}"/usr/share/info >/dev/null 2>&1
+ sudo rm -rf "${LFS}"/usr/share/man >/dev/null 2>&1
+
+ sudo strip --strip-debug "${LFS}"/usr/lib/* >/dev/null 2>&1
+ sudo strip --strip-unneeded "${LFS}"/usr/bin/* >/dev/null 2>&1
+ sudo strip --strip-unneeded "${LFS}"/usr/sbin/* >/dev/null 2>&1
+ sudo strip --strip-unneeded "${LFS}"/tools/bin/* >/dev/null 2>&1
+
+ echo -e "${GRN}OK${RST}"
+ touch "${LFS}"/sources/chapter7/cleanup >/dev/null 2>&1
+fi
diff --git a/chapter7/gettext.sh b/chapter7/gettext.sh
new file mode 100644
index 0000000..85bc7f4
--- /dev/null
+++ b/chapter7/gettext.sh
@@ -0,0 +1,5 @@
+./configure --disable-shared
+make &&
+cp -v gettext-tools/src/msgfmt /usr/bin
+cp -v gettext-tools/src/msgmerge /usr/bin
+cp -v gettext-tools/src/xgettext /usr/bin
diff --git a/chapter7/libstdc++.sh b/chapter7/libstdc++.sh
new file mode 100644
index 0000000..5e81693
--- /dev/null
+++ b/chapter7/libstdc++.sh
@@ -0,0 +1,12 @@
+ln -s gthr-posix.h libgcc/gthr-default.h
+mkdir build
+cd build
+../libstdc++-v3/configure \
+ CXXFLAGS="-g -O2 -D_GNU_SOURCE" \
+ --prefix=/usr \
+ --disable-multilib \
+ --disable-nls \
+ --host=$(uname -m)-lfs-linux-gnu \
+ --disable-libstdcxx-pch &&
+make &&
+make -j1 install
diff --git a/chapter7/perl.sh b/chapter7/perl.sh
new file mode 100644
index 0000000..2cb5245
--- /dev/null
+++ b/chapter7/perl.sh
@@ -0,0 +1,11 @@
+sh Configure -des \
+ -Dprefix=/usr \
+ -Dvendorprefix=/usr \
+ -Dprivlib=/usr/lib/perl5/5.32/core_perl \
+ -Darchlib=/usr/lib/perl5/5.32/core_perl \
+ -Dsitelib=/usr/lib/perl5/5.32/site_perl \
+ -Dsitearch=/usr/lib/perl5/5.32/site_perl \
+ -Dvendorlib=/usr/lib/perl5/5.32/vendor_perl \
+ -Dvendorarch=/usr/lib/perl5/5.32/vendor_perl &&
+make &&
+make -j1 install
diff --git a/chapter7/python.sh b/chapter7/python.sh
new file mode 100644
index 0000000..7d158b1
--- /dev/null
+++ b/chapter7/python.sh
@@ -0,0 +1,5 @@
+./configure --prefix=/usr \
+ --enable-shared \
+ --without-ensurepip &&
+make &&
+make -j1 install
diff --git a/chapter7/texinfo.sh b/chapter7/texinfo.sh
new file mode 100644
index 0000000..7f133fe
--- /dev/null
+++ b/chapter7/texinfo.sh
@@ -0,0 +1,3 @@
+./configure --prefix=/usr &&
+make &&
+make -j1 install
diff --git a/chapter7/util-linux.sh b/chapter7/util-linux.sh
new file mode 100644
index 0000000..170e3f5
--- /dev/null
+++ b/chapter7/util-linux.sh
@@ -0,0 +1,15 @@
+mkdir -p /var/lib/hwclock &&
+./configure ADJTIME_PATH=/var/lib/hwclock/adjtime \
+ --docdir=/usr/share/doc/util-linux-2.36.2 \
+ --disable-chfn-chsh \
+ --disable-login \
+ --disable-nologin \
+ --disable-su \
+ --disable-setpriv \
+ --disable-runuser \
+ --disable-pylibmount \
+ --disable-static \
+ --without-python \
+ runstatedir=/run &&
+make &&
+make -j1 install