Created
October 2, 2018 19:12
-
-
Save samuelsadok/a7791b6326522d3ad2e5958934d1f7c7 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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