pkgname="glibc" pkgver=2.40 sources=("glibc-2.40.tar.xz" "glibc-2.40-fhs-1.patch" "nsswitch.conf" "ld.so.conf" "tzdata2024a.tar.gz" ) urls=("https://ftp.gnu.org/gnu/glibc/glibc-2.40.tar.xz" "https://www.linuxfromscratch.org/patches/lfs/12.2/glibc-2.40-fhs-1.patch" "https://gitea.phywyj.dynv6.net/wyj/LFS-PKGBUILDs/raw/branch/main/sys/glibc-2.40/nsswitch.conf" "https://gitea.phywyj.dynv6.net/wyj/LFS-PKGBUILDs/raw/branch/main/sys/glibc-2.40/ld.so.conf" "https://www.iana.org/time-zones/repository/releases/tzdata2024a.tar.gz" ) md5sums=("b390feef233022114950317f10c4fa97" "9a5997c3452909b1769918c759eff8a2" "4caf37ca10aacf7f7bfabddf915e9d25" "79220f5a36182b7160e0cf567dc64129" "2349edd8335245525cc082f2755d5bf4" ) license=(GPL-2.0-or-later LGPL-2.1-or-later) src_prepare() { tar -xf ${DIST_DIR}/${pkgname}-${pkgver}/${sources[0]} --strip-components=1 patch -Np1 -i "${DIST_DIR}/${pkgname}-${pkgver}/${sources[1]}" } src_build() { mkdir -pv build cd build echo "rootsbindir=/usr/sbin" > configparms ../configure --prefix=/usr \ --disable-werror \ --enable-kernel=4.19 \ --enable-stack-protector=strong \ --disable-nscd \ libc_cv_slibdir=/usr/lib make } _skip_test() { test=${1} file=${2} sed -i "/\b${test} /d" "${srcdir}/${file}" } src_check() { _skip_test tst-lchmod io/Makefile make check } src_install() { cd "${srcdir}/build" install -d "${pkgdir}/etc" touch "${pkgdir}/etc/ld.so.conf" sed '/test-installation/s@$(PERL)@echo not running@' -i ../Makefile make DESTDIR="${pkgdir}" install sed '/RTLDLIST=/s@/usr@@g' -i "${pkgdir}/usr/bin/ldd" if [ ! -f /etc/nsswitch.conf ]; then install -m644 "${DIST_DIR}/${pkgname}-${pkgver}/nsswitch.conf" "${pkgdir}/etc/nsswitch.conf" fi tar -xf "${DIST_DIR}/${pkgname}-${pkgver}/tzdata2024a.tar.gz" ZONEINFO=${pkgdir}/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 unset ZONEINFO if [ ! -f /etc/ld.so.conf ]; then install -m644 "${DIST_DIR}/${pkgname}-${pkgver}/ld.so.conf" "${pkgdir}/etc/ld.so.conf" fi } src_preinstall() { install -vm755 "${pkgdir}"/usr/lib/*.so.* /usr/lib }