summaryrefslogtreecommitdiffstats
path: root/testing/fts
diff options
context:
space:
mode:
Diffstat (limited to 'testing/fts')
-rw-r--r--testing/fts/APKBUILD50
-rw-r--r--testing/fts/fts-uclibc.patch43
2 files changed, 93 insertions, 0 deletions
diff --git a/testing/fts/APKBUILD b/testing/fts/APKBUILD
new file mode 100644
index 000000000..c11f7c78c
--- /dev/null
+++ b/testing/fts/APKBUILD
@@ -0,0 +1,50 @@
+# Contributor: William Pitcock <nenolod@dereferenced.org>
+# Maintainer: William Pitcock <nenolod@dereferenced.org>
+pkgname=fts
+pkgver=0
+pkgrel=0
+pkgdesc="keith bostic's POSIX file tree stream operations library"
+url="http://bostic.com/"
+arch="all"
+license="BSD"
+depends=
+depends_dev=
+makedepends="$depends_dev wget"
+install=""
+subpackages="$pkgname-dev $pkgname-doc"
+source="saveas-https://sites.google.com/a/bostic.com/keithbostic/files/fts.tar.gz?attredirects=0/fts.tar.gz
+ fts-uclibc.patch"
+
+_builddir="${srcdir}/${pkgname}"
+prepare() {
+ local i
+ cd "$_builddir"
+ for i in $source; do
+ case $i in
+ *.patch) msg $i; patch -p1 -i "$srcdir"/$i || return 1;;
+ esac
+ done
+}
+
+build() {
+ cd "$_builddir"
+ gcc -I. -fPIC -shared -o libfts.so -Wl,-soname,libfts.so.${pkgver} fts.c
+}
+
+package() {
+ cd "$_builddir"
+
+ install -d "$pkgdir"/usr/lib
+
+ install -m 755 libfts.so "$pkgdir"/usr/lib/libfts.so.${pkgver}
+ ln -sf libfts.so.${pkgver} "$pkgdir"/usr/lib/libfts.so
+
+ install -d "$pkgdir"/usr/include
+ install -m 644 fts.h "$pkgdir"/usr/include/fts.h
+
+ install -d "$pkgdir"/usr/share/man/man3
+ install -m 644 fts.3 "$pkgdir"/usr/share/man/man3/fts.3
+}
+
+md5sums="120c14715485ec6ced14f494d059d20a fts.tar.gz
+ba391410e4d9b80a374e5974c7ad859f fts-uclibc.patch"
diff --git a/testing/fts/fts-uclibc.patch b/testing/fts/fts-uclibc.patch
new file mode 100644
index 000000000..18b48efb9
--- /dev/null
+++ b/testing/fts/fts-uclibc.patch
@@ -0,0 +1,43 @@
+--- fts.orig/fts.c
++++ fts/fts.c
+@@ -31,6 +31,8 @@
+ * SUCH DAMAGE.
+ */
+
++#define ALIGNBYTES (alignof(long double) - 1)
++#define alignof(TYPE) ((int) &((struct { char dummy1; TYPE dummy2; } *) 0)->dummy2)
+ #if defined(LIBC_SCCS) && !defined(lint)
+ static char sccsid[] = "@(#)fts.c 8.6 (Berkeley) 8/14/94";
+ #endif /* LIBC_SCCS and not lint */
+@@ -652,10 +654,10 @@
+ if (!ISSET(FTS_SEEDOT) && ISDOT(dp->d_name))
+ continue;
+
+- if ((p = fts_alloc(sp, dp->d_name, (int)dp->d_namlen)) == NULL)
++ if ((p = fts_alloc(sp, dp->d_name, (int)dp->d_reclen)) == NULL)
+ goto mem1;
+- if (dp->d_namlen > maxlen) {
+- if (fts_palloc(sp, (size_t)dp->d_namlen)) {
++ if (dp->d_reclen > maxlen) {
++ if (fts_palloc(sp, (size_t)dp->d_reclen)) {
+ /*
+ * No more memory for path or structures. Save
+ * errno, free up the current structure and the
+@@ -675,7 +677,7 @@
+ maxlen = sp->fts_pathlen - sp->fts_cur->fts_pathlen - 1;
+ }
+
+- p->fts_pathlen = len + dp->d_namlen + 1;
++ p->fts_pathlen = len + dp->d_reclen + 1;
+ p->fts_parent = sp->fts_cur;
+ p->fts_level = level;
+
+@@ -784,7 +786,7 @@
+ /* If user needs stat info, stat buffer already allocated. */
+ sbp = ISSET(FTS_NOSTAT) ? &sb : p->fts_statp;
+
+-#ifdef DT_WHT
++#ifdef S_IFWHT
+ /*
+ * Whited-out files don't really exist. However, there's stat(2) file
+ * mask for them, so we set it so that programs (i.e., find) don't have