summaryrefslogtreecommitdiffstats
path: root/main/musl
diff options
context:
space:
mode:
authorTimo Teräs <timo.teras@iki.fi>2013-07-04 08:40:47 +0000
committerNatanael Copa <ncopa@alpinelinux.org>2013-07-08 11:40:49 +0000
commit1a26d9b5a86dc04d32a5bd7cb0ab47b49c884727 (patch)
treefc2d67a60431c448143066df90075bde03fa342e /main/musl
parent411a2782aaa756b3a8f3988763ac592cff1257b3 (diff)
downloadaports-1a26d9b5a86dc04d32a5bd7cb0ab47b49c884727.tar.bz2
aports-1a26d9b5a86dc04d32a5bd7cb0ab47b49c884727.tar.xz
main/musl: fixes for using as default libc
- create musl-utils so libc-utils can depend on it - provide ldd symlink in it also - provide getent based on uclibc - cherry-pick NFDBITS patch for sudo
Diffstat (limited to 'main/musl')
-rw-r--r--main/musl/0003-add-NFDBITS-in-sys-select.h-with-appropriate-feature.patch30
-rw-r--r--main/musl/APKBUILD24
-rwxr-xr-xmain/musl/getent41
3 files changed, 90 insertions, 5 deletions
diff --git a/main/musl/0003-add-NFDBITS-in-sys-select.h-with-appropriate-feature.patch b/main/musl/0003-add-NFDBITS-in-sys-select.h-with-appropriate-feature.patch
new file mode 100644
index 000000000..dc5cc287e
--- /dev/null
+++ b/main/musl/0003-add-NFDBITS-in-sys-select.h-with-appropriate-feature.patch
@@ -0,0 +1,30 @@
+From ca9aff6a1646c7fc106bfbb9399b3a1bcb14f18b Mon Sep 17 00:00:00 2001
+From: Rich Felker <dalias@aerifal.cx>
+Date: Sat, 6 Jul 2013 01:12:28 -0400
+Subject: [PATCH] add NFDBITS in sys/select.h with appropriate feature tests
+
+the main use for this macro seems to be knowing the correct allocation
+granularity for dynamic-sized fd_set objects. such usage is
+non-conforming and results in undefined behavior, but it is widespread
+in applications.
+---
+ include/sys/select.h | 3 +++
+ 1 file changed, 3 insertions(+)
+
+diff --git a/include/sys/select.h b/include/sys/select.h
+index c5a2877..e25257d 100644
+--- a/include/sys/select.h
++++ b/include/sys/select.h
+@@ -32,6 +32,9 @@ typedef struct
+ int select (int, fd_set *__restrict, fd_set *__restrict, fd_set *__restrict, struct timeval *__restrict);
+ int pselect (int, fd_set *__restrict, fd_set *__restrict, fd_set *__restrict, const struct timespec *__restrict, const sigset_t *__restrict);
+
++#if defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
++#define NFDBITS (8*(int)sizeof(long))
++#endif
+
+ #ifdef __cplusplus
+ }
+--
+1.8.3.2
+
diff --git a/main/musl/APKBUILD b/main/musl/APKBUILD
index 8fce3b43b..f693d63f4 100644
--- a/main/musl/APKBUILD
+++ b/main/musl/APKBUILD
@@ -2,7 +2,7 @@
# Maintainer: William Pitcock <nenolod@dereferenced.org>
pkgname=musl
pkgver=0.9.11
-pkgrel=0
+pkgrel=1
pkgdesc="the musl c library (libc) implementation"
url="http://www.musl-libc.org/"
arch="x86 x86_64 arm armel"
@@ -11,12 +11,14 @@ depends=""
depends_dev=""
makedepends="$depends_dev"
install=""
-subpackages="$pkgname-dev"
+subpackages="$pkgname-dev $pkgname-utils"
[ "${CTARGET#*musl}" = "$CTARGET" ] && subpackages="$subpackages musl-gcc:crosstool"
source="http://www.musl-libc.org/releases/musl-$pkgver.tar.gz
0001-fix-Makefile-so-make-install-works-before-include-bi.patch
0002-add-stubs-for-additional-legacy-ether.h-functions.patch
+ 0003-add-NFDBITS-in-sys-select.h-with-appropriate-feature.patch
crt-arm-Scrt1.s
+ getent
"
_builddir="$srcdir"/musl-$pkgver
@@ -52,6 +54,12 @@ package() {
rm -f "$pkgdir"/usr/lib/*.la
}
+utils() {
+ mkdir -p "$subpkgdir"/usr/bin
+ ln -s /lib/libc.so "$subpkgdir"/usr/bin/ldd
+ install -D "$srcdir"/getent "$subpkgdir"/usr/bin/getent
+}
+
crosstool() {
mkdir -p "$subpkgdir"/usr/bin
mv "$pkgdir"/usr/bin/musl-gcc "$subpkgdir"/usr/bin
@@ -60,12 +68,18 @@ crosstool() {
md5sums="70b17ca5c847e74e1c77fe8284bb1fa4 musl-0.9.11.tar.gz
1565f77513aa6779057ff184a2f91073 0001-fix-Makefile-so-make-install-works-before-include-bi.patch
76e0b13d63a6665b3f9ea3d3b00fecdb 0002-add-stubs-for-additional-legacy-ether.h-functions.patch
-da55f98744cdcdaf59efac116403c790 crt-arm-Scrt1.s"
+726f0c448aaf042157c83513c1b2faf0 0003-add-NFDBITS-in-sys-select.h-with-appropriate-feature.patch
+da55f98744cdcdaf59efac116403c790 crt-arm-Scrt1.s
+ef81489a6258501cf45db58dfc6d5211 getent"
sha256sums="8b81fd9b71becb7b674ea93fd65d82a039fab79ab738957a5e9ee47ba08a13fd musl-0.9.11.tar.gz
60e38a633d35eb44c7b12b3a2b0ea570c9462af7f966a9fcea4382fe6e6e6c6f 0001-fix-Makefile-so-make-install-works-before-include-bi.patch
6c916f34bb2dc89fc3de6786d9b7e2d2b829d9020e97097e46b97071be09405a 0002-add-stubs-for-additional-legacy-ether.h-functions.patch
-636788dda68b3aed647b3a30b06401823c90c2cf8ce085b270ce27c77e8919f3 crt-arm-Scrt1.s"
+577307cae7d00ab2f5a9e2530f462b417bf7112f739a0a0cd3327d7f793edb65 0003-add-NFDBITS-in-sys-select.h-with-appropriate-feature.patch
+636788dda68b3aed647b3a30b06401823c90c2cf8ce085b270ce27c77e8919f3 crt-arm-Scrt1.s
+d6996273f5aaaed429058257e4646b243d9e3a4d8609522f802762453f5be4cb getent"
sha512sums="7ca852eda3be7b34bfdaf1eb9e7d435987d5177f865737b211e62f4037825cc322436e1ff49c3f875b3a20679f6f21ba5ffff271d03d3d03c7a97854f4f51832 musl-0.9.11.tar.gz
80d9e3594c4f7471ea404216b40a44831bfa930f81792e566e83d7e1a158ee5d5f75129b67536c969f10fbe96aa549326ba461229fb0a08e0a3fd1bc569f95fc 0001-fix-Makefile-so-make-install-works-before-include-bi.patch
24415afa48c9e918c4c7a0c1e5a38bd150d03e92cde6bf709460c713de49a61128ea93103af601a54a6cf164bcedd304aa34933e97053e1b4ab41584ce44f768 0002-add-stubs-for-additional-legacy-ether.h-functions.patch
-2bcc69f766e0d841938b7d357b54878597fed97a6b6401b666aa07834ca3c773b9d262103ab0b129e18df00f38e51244c9966e1c138b06cbbf181e32be3ae078 crt-arm-Scrt1.s"
+3e2164caf37f973e470832198dc8a4cdafe599cdd787c5e6e46a6a55367eb1db4032f56fb1165ddf1232df1468f276488c2d8269f530d93f249d659b62b76e8e 0003-add-NFDBITS-in-sys-select.h-with-appropriate-feature.patch
+2bcc69f766e0d841938b7d357b54878597fed97a6b6401b666aa07834ca3c773b9d262103ab0b129e18df00f38e51244c9966e1c138b06cbbf181e32be3ae078 crt-arm-Scrt1.s
+4d92f934d760cf5157d80f19fd766be6b673c65317229b32ac824d9d192f6abcc414e2382b2416dfd5c2f757b46ced98c18e4762bf91f5a48647e0ee61813b06 getent"
diff --git a/main/musl/getent b/main/musl/getent
new file mode 100755
index 000000000..d11befaf8
--- /dev/null
+++ b/main/musl/getent
@@ -0,0 +1,41 @@
+#!/bin/sh
+# $Header: /var/cvs/uClibc/extra/scripts/getent,v 1.2 2005/02/02 14:18:01 solar Exp $
+#
+# Closely (not perfectly) emulate the behavior of glibc's getent utility
+#
+#passwd|shadow|group|aliases|hosts|networks|ethers|netgroup|protocols|services|rpc
+# only returns the first match (by design)
+# dns based search is not supported (hosts,networks)
+# case-insensitive matches not supported (ethers; others?)
+# may return false-positives (hosts,protocols,rpc,services,ethers)
+
+export PATH="${PATH}:/bin:/usr/bin"
+
+file="/etc/$1"
+case $1 in
+ passwd|group|shadow)
+ match="^$2:" ;;
+ networks|netgroup)
+ match="^[[:space:]]*$2\>" ;;
+ hosts|protocols|rpc|services|ethers)
+ match="\<$2\>" ;;
+ aliases)
+ match="^[[:space:]]*$2[[:space:]]*:" ;;
+ ""|-h|--help)
+ echo "USAGE: $0 database [key]"
+ exit 0 ;;
+ *)
+ echo "$0: Unknown database: $1" 1>&2
+ exit 1 ;;
+esac
+
+if [ ! -f "$file" ] ; then
+ echo "$0: Could not find database file for $1" 1>&2
+ exit 1
+fi
+
+if [ $# -eq 1 ] ; then
+ exec cat "$file"
+else
+ sed "s/#.*//; /$match/q; d" "$file" | grep . || exit 2
+fi