Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
diff --git a/PKGBUILD b/PKGBUILD
index 3e937e3..d4b86cf 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -52,7 +52,7 @@ prepare() {
build() {
local _configure_flags=(
- --prefix=/usr
+ --prefix=/opt/glibc-2.27/usr
--with-headers=/usr/include
--with-bugurl=https://bugs.archlinux.org/
--enable-add-ons
@@ -68,17 +68,18 @@ build() {
cd "$srcdir/glibc-build"
- echo "slibdir=/usr/lib" >> configparms
- echo "rtlddir=/usr/lib" >> configparms
- echo "sbindir=/usr/bin" >> configparms
- echo "rootsbindir=/usr/bin" >> configparms
+ echo "" > configparms
+ echo "slibdir=/opt/glibc-2.27/usr/lib" >> configparms
+ echo "rtlddir=/opt/glibc-2.27/usr/lib" >> configparms
+ echo "sbindir=/opt/glibc-2.27/usr/bin" >> configparms
+ echo "rootsbindir=/opt/glibc-2.27/usr/bin" >> configparms
# remove fortify for building libraries
CPPFLAGS=${CPPFLAGS/-D_FORTIFY_SOURCE=2/}
"$srcdir/glibc/configure" \
- --libdir=/usr/lib \
- --libexecdir=/usr/lib \
+ --libdir=/opt/glibc-2.27/usr/lib \
+ --libexecdir=/opt/glibc-2.27/usr/lib \
${_configure_flags[@]}
# build libraries with fortify disabled
@@ -104,35 +105,35 @@ check() {
}
package() {
- install -dm755 "$pkgdir/etc"
- touch "$pkgdir/etc/ld.so.conf"
+ install -dm755 "$pkgdir/opt/glibc-2.27/etc"
+ touch "$pkgdir/opt/glibc-2.27/etc/ld.so.conf"
make -C glibc-build install_root="$pkgdir" install
- rm -f "$pkgdir"/etc/ld.so.{cache,conf}
+ rm -f "$pkgdir"/opt/glibc-2.27/etc/ld.so.{cache,conf}
cd glibc
- install -dm755 "$pkgdir"/usr/lib/{locale,systemd/system,tmpfiles.d}
- install -m644 nscd/nscd.conf "$pkgdir/etc/nscd.conf"
- install -m644 nscd/nscd.service "$pkgdir/usr/lib/systemd/system"
- install -m644 nscd/nscd.tmpfiles "$pkgdir/usr/lib/tmpfiles.d/nscd.conf"
- install -dm755 "$pkgdir/var/db/nscd"
+ install -dm755 "$pkgdir"/opt/glibc-2.27/usr/lib/{locale,systemd/system,tmpfiles.d}
+ install -m644 nscd/nscd.conf "$pkgdir/opt/glibc-2.27/etc/nscd.conf"
+ install -m644 nscd/nscd.service "$pkgdir/opt/glibc-2.27/usr/lib/systemd/system"
+ install -m644 nscd/nscd.tmpfiles "$pkgdir/opt/glibc-2.27/usr/lib/tmpfiles.d/nscd.conf"
+ install -dm755 "$pkgdir/opt/glibc-2.27/var/db/nscd"
- install -m644 posix/gai.conf "$pkgdir"/etc/gai.conf
+ install -m644 posix/gai.conf "$pkgdir"/opt/glibc-2.27/etc/gai.conf
- install -m755 "$srcdir/locale-gen" "$pkgdir/usr/bin"
+ install -m755 "$srcdir/locale-gen" "$pkgdir/opt/glibc-2.27/usr/bin"
# Create /etc/locale.gen
- install -m644 "$srcdir/locale.gen.txt" "$pkgdir/etc/locale.gen"
+ install -m644 "$srcdir/locale.gen.txt" "$pkgdir/opt/glibc-2.27/etc/locale.gen"
sed -e '1,3d' -e 's|/| |g' -e 's|\\| |g' -e 's|^|#|g' \
- "$srcdir/glibc/localedata/SUPPORTED" >> "$pkgdir/etc/locale.gen"
+ "$srcdir/glibc/localedata/SUPPORTED" >> "$pkgdir/opt/glibc-2.27/etc/locale.gen"
if check_option 'debug' n; then
- find "$pkgdir"/usr/bin -type f -executable -exec strip $STRIP_BINARIES {} + 2> /dev/null || true
- find "$pkgdir"/usr/lib -name '*.a' -type f -exec strip $STRIP_STATIC {} + 2> /dev/null || true
+ find "$pkgdir"/opt/glibc-2.27/usr/bin -type f -executable -exec strip $STRIP_BINARIES {} + 2> /dev/null || true
+ find "$pkgdir"/opt/glibc-2.27/usr/lib -name '*.a' -type f -exec strip $STRIP_STATIC {} + 2> /dev/null || true
# Do not strip these for gdb and valgrind functionality, but strip the rest
- find "$pkgdir"/usr/lib \
+ find "$pkgdir"/opt/glibc-2.27/usr/lib \
-not -name 'ld-*.so' \
-not -name 'libc-*.so' \
-not -name 'libpthread-*.so' \
@@ -140,11 +141,5 @@ package() {
-name '*-*.so' -type f -exec strip $STRIP_SHARED {} + 2> /dev/null || true
fi
- # Finally move everything to /opt
- _pkgdir="$pkgdir/opt/glibc-2.27"
- install -dm755 "$_pkgdir"
- for dir in etc usr var; do
- mv "$pkgdir/$dir" "$_pkgdir"
- done
- rm -rf "$_pkgdir/usr/share/info"
+ rm -rf "$pkgdir/opt/glibc-2.27/usr/share/info"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.