From fdf609670a45f4ebaf36b16eda872f17234eb87e Mon Sep 17 00:00:00 2001 From: aliriza Date: Wed, 9 Nov 2022 15:58:45 +0000 Subject: [PATCH] fix sysconf glibc and locale-gen added --- system/base/base-files/ympbuild | 2 +- system/base/glibc/glibc.sysconf | 2 +- system/base/glibc/locale-gen | 42 +++++++++++++++++++++++++++++++++ system/base/glibc/ympbuild | 13 ++++++---- 4 files changed, 53 insertions(+), 6 deletions(-) create mode 100644 system/base/glibc/locale-gen diff --git a/system/base/base-files/ympbuild b/system/base/base-files/ympbuild index 41d079d0..d1ccd096 100644 --- a/system/base/base-files/ympbuild +++ b/system/base/base-files/ympbuild @@ -8,7 +8,7 @@ email='parduscix@yandex.ru' maintainer='sulincix' license=('GPLv3') source=("https://gitlab.com/sulix/devel/sources/base-files/-/archive/$version/base-files-$version.zip") -md5sums=('009efca6fc8897379ac844b786bfb585') +md5sums=('3f58695b0babbca2691a8bbcadd2d131') arch=(x86_64) group=(system.base) diff --git a/system/base/glibc/glibc.sysconf b/system/base/glibc/glibc.sysconf index 4a4a2458..4be8c583 100644 --- a/system/base/glibc/glibc.sysconf +++ b/system/base/glibc/glibc.sysconf @@ -1,2 +1,2 @@ #!/bin/sh -ldconfig +/sbin/ldconfig diff --git a/system/base/glibc/locale-gen b/system/base/glibc/locale-gen new file mode 100644 index 00000000..ee888807 --- /dev/null +++ b/system/base/glibc/locale-gen @@ -0,0 +1,42 @@ +#!/bin/sh + +set -e + +LOCALEGEN=/etc/locale.gen +LOCALES=/usr/share/i18n/locales +if [ -n "$POSIXLY_CORRECT" ]; then + unset POSIXLY_CORRECT +fi + + +[ -f $LOCALEGEN -a -s $LOCALEGEN ] || exit 0; + +# Remove all old locale dir and locale-archive before generating new +# locale data. +rm -rf /usr/lib/locale/locale-archive || true + +umask 022 + +is_entry_ok() { + if [ -n "$locale" -a -n "$charset" ] ; then + true + else + echo "error: Bad entry '$locale $charset'" + false + fi +} + +echo "Generating locales..." +while read locale charset; do \ + case $locale in \#*) continue;; "") continue;; esac; \ + is_entry_ok || continue + echo -n " `echo $locale | sed 's/\([^.\@]*\).*/\1/'`"; \ + echo -n ".$charset"; \ + echo -n `echo $locale | sed 's/\([^\@]*\)\(\@.*\)*/\2/'`; \ + echo -n '...'; \ + if [ -f $LOCALES/$locale ]; then input=$locale; else \ + input=`echo $locale | sed 's/\([^.]*\)[^@]*\(.*\)/\1\2/'`; fi; \ + localedef -i $input -c -f $charset -A /usr/share/locale/locale.alias $locale; \ + echo ' done'; \ +done < $LOCALEGEN +echo "Generation complete." diff --git a/system/base/glibc/ympbuild b/system/base/glibc/ympbuild index 7caf5969..37ac53f2 100644 --- a/system/base/glibc/ympbuild +++ b/system/base/glibc/ympbuild @@ -14,6 +14,7 @@ source=('https://ftp.gnu.org/gnu/glibc/glibc-2.36.tar.xz' 'x86_64-linux-gnu.conf' 'glibc.sysconf' 'reenable_DT_HASH.patch' + 'locale-gen' ) md5sums=('00e9b89e043340f688bc93ec03239b57' 'SKIP' @@ -21,6 +22,7 @@ md5sums=('00e9b89e043340f688bc93ec03239b57' 'SKIP' 'SKIP' 'SKIP' + 'SKIP' ) group=(system.base) @@ -32,7 +34,7 @@ setup(){ # Thx archlinux patch -Np1 -i "../reenable_DT_HASH.patch" opts=( - --prefix=/ + --prefix=/usr --mandir=/share/man --infodir=/share/info --with-bugurl=http://gitlab.com/sulix/main/issues @@ -41,6 +43,7 @@ setup(){ --enable-lock-elision --enable-multi-arch --enable-static-pie + --enable-static-nss --enable-stack-protector=all --enable-kernel=5.10.0 --enable-stackguard-randomization @@ -65,8 +68,8 @@ setup(){ cd glibc-build pwd ../configure ${opts[@]} \ - --libdir=/lib \ - --libexecdir=/lib/glibc + --libdir=/lib64 \ + --libexecdir=/lib64/glibc cd .. } build(){ @@ -90,7 +93,7 @@ package(){ make -C $bdir install -j$(nproc --all) fi done - mkdir -p ${DESTDIR}/etc/ld.so.conf.d/ ${DESTDIR}/etc/sysconf.d/ + mkdir -p ${DESTDIR}/etc/ld.so.conf.d/ ${DESTDIR}/etc/sysconf.d/ ${DESTDIR}/bin install ../ld.so.conf ${DESTDIR}/etc/ld.so.conf install ../usr-support.conf ${DESTDIR}/etc/ld.so.conf.d/ install ../x86_64-linux-gnu.conf ${DESTDIR}/etc/ld.so.conf.d/ @@ -98,5 +101,7 @@ package(){ rm -f ${DESTDIR}/etc/ld.so.cache # install sysconf trigger install ../glibc.sysconf ${DESTDIR}/etc/sysconf.d/glibc + # install extra tools + install ../locale-gen ${DESTDIR}/bin/locale-gen }