aboutsummaryrefslogtreecommitdiffstats
path: root/chapter7
diff options
context:
space:
mode:
Diffstat (limited to 'chapter7')
-rw-r--r--chapter7/backup.sh24
-rw-r--r--chapter7/bison.sh5
-rw-r--r--chapter7/cleanup.sh23
-rw-r--r--chapter7/gettext.sh7
-rw-r--r--chapter7/libstdc++.sh14
-rw-r--r--chapter7/perl.sh15
-rw-r--r--chapter7/python.sh7
-rw-r--r--chapter7/texinfo.sh5
-rw-r--r--chapter7/util-linux.sh17
9 files changed, 117 insertions, 0 deletions
diff --git a/chapter7/backup.sh b/chapter7/backup.sh
new file mode 100644
index 0000000..68b9824
--- /dev/null
+++ b/chapter7/backup.sh
@@ -0,0 +1,24 @@
+#!/bin/bash
+
+file="${LFS_VER}-ch7-backup.tar.xz"
+directories=(bin dev etc lib lib64 proc run sbin sys tools usr var)
+
+if [ -f "${LFS}/sources/chapter7/backup" ]; then
+ echo -e " ${IGRN}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}" "${directories[@]}" >/dev/null 2>&1 & pid=$!
+ spinner "$pid" "${SPINNER}"
+ retval=$?
+ if [ "${retval}" -ne 0 ]; then
+ echo -e "${RED}FAILED!${RST}"
+ exit "${retval}"
+ 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..2385d22
--- /dev/null
+++ b/chapter7/bison.sh
@@ -0,0 +1,5 @@
+#!/bin/bash
+
+./configure --prefix=/usr --docdir=/usr/share/doc/bison-"${VERSION}" &&
+make &&
+make -j1 install
diff --git a/chapter7/cleanup.sh b/chapter7/cleanup.sh
new file mode 100644
index 0000000..95e1449
--- /dev/null
+++ b/chapter7/cleanup.sh
@@ -0,0 +1,23 @@
+#!/bin/bash
+
+if [ -f "${LFS}/sources/chapter7/cleanup" ]; then
+ echo -e " ${IGRN}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..49fbf15
--- /dev/null
+++ b/chapter7/gettext.sh
@@ -0,0 +1,7 @@
+#!/bin/bash
+
+./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..c2ef63b
--- /dev/null
+++ b/chapter7/libstdc++.sh
@@ -0,0 +1,14 @@
+#!/bin/bash
+
+ln -s gthr-posix.h libgcc/gthr-default.h
+mkdir build
+cd build || exit 1
+../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..970e17c
--- /dev/null
+++ b/chapter7/perl.sh
@@ -0,0 +1,15 @@
+#!/bin/bash
+
+MAJMIN="$(cut -d\. -f1,2 <<< "${VERSION}")"
+
+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 &&
+make &&
+make -j1 install
diff --git a/chapter7/python.sh b/chapter7/python.sh
new file mode 100644
index 0000000..daf1677
--- /dev/null
+++ b/chapter7/python.sh
@@ -0,0 +1,7 @@
+#!/bin/bash
+
+./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..1935156
--- /dev/null
+++ b/chapter7/texinfo.sh
@@ -0,0 +1,5 @@
+#!/bin/bash
+
+./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..7a00c8c
--- /dev/null
+++ b/chapter7/util-linux.sh
@@ -0,0 +1,17 @@
+#!/bin/bash
+
+mkdir -p /var/lib/hwclock &&
+./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 \
+ runstatedir=/run &&
+make &&
+make -j1 install