summaryrefslogtreecommitdiff
path: root/user
diff options
context:
space:
mode:
Diffstat (limited to 'user')
-rw-r--r--user/pciutils/APKBUILD49
-rw-r--r--user/pciutils/fix-linking-pci-malloc-Makefile.patch11
-rw-r--r--user/pciutils/pread.patch13
3 files changed, 73 insertions, 0 deletions
diff --git a/user/pciutils/APKBUILD b/user/pciutils/APKBUILD
new file mode 100644
index 000000000..a58a509e4
--- /dev/null
+++ b/user/pciutils/APKBUILD
@@ -0,0 +1,49 @@
+# Contributor: Leonardo Arena <rnalrd@alpinelinux.org>
+# Maintainer:
+pkgname=pciutils
+pkgver=3.6.1
+pkgrel=0
+pkgdesc="PCI bus configuration space access library and tools"
+url="http://mj.ucw.cz/pciutils.html"
+arch="all"
+options="!check" # No test suite.
+license="GPL-2.0-only"
+depends="hwdata-pci"
+makedepends="linux-headers"
+subpackages="$pkgname-doc $pkgname-dev $pkgname-libs"
+source="https://www.kernel.org/pub/software/utils/$pkgname/$pkgname-$pkgver.tar.gz
+ fix-linking-pci-malloc-Makefile.patch
+ pread.patch
+ "
+
+build() {
+ cd "$builddir"
+ sed -i -e "106s/^/\#/" Makefile
+ make OPT="$CFLAGS" ZLIB=no \
+ SHARED=yes \
+ PREFIX=/usr \
+ SHAREDIR=/usr/share/hwdata \
+ MANDIR=/usr/share/man \
+ all
+}
+
+package() {
+ cd "$builddir"
+ make PREFIX="$pkgdir"/usr \
+ SHARED=yes \
+ SHAREDIR="$pkgdir"/usr/share/hwdata \
+ MANDIR="$pkgdir"/usr/share/man \
+ install
+
+ install -d "$pkgdir"/usr/lib
+ ln -s libpci.so.${pkgver%%.*} "$pkgdir"/usr/lib/libpci.so
+ install -D -m 644 lib/libpci.pc "$pkgdir"/usr/lib/pkgconfig/libpci.pc
+ for i in config.h header.h pci.h types.h; do
+ install -D -m 644 lib/${i} "$pkgdir"/usr/include/pci/${i}
+ done
+
+}
+
+sha512sums="c45ba5b42c6f03a50df75f4f4f33ec1feef8f0cae1217802e6c4351e88da23431e0273f6776fa076f4d1f8c73ed20433392bc11fe1478db98dc482d2de75dd92 pciutils-3.6.1.tar.gz
+520b39602078e4325d7dac2d460547b360f7b52c668d88cf3d776c59246c8cfcb537b7b4f50575da9d2fcea1e207b3e99626ce4f23df890d2565b7dac1db2d94 fix-linking-pci-malloc-Makefile.patch
+aa1d3272500180256929b39a5fc4ea38ddb6a9fad090d732832ded9cc396303cf56efc91cfdeb76edbcfefc9a7c8eb058562c3c2b09a9090a59d3e68c27cec62 pread.patch"
diff --git a/user/pciutils/fix-linking-pci-malloc-Makefile.patch b/user/pciutils/fix-linking-pci-malloc-Makefile.patch
new file mode 100644
index 000000000..a2b5f01f1
--- /dev/null
+++ b/user/pciutils/fix-linking-pci-malloc-Makefile.patch
@@ -0,0 +1,11 @@
+--- pciutils-3.2.1/Makefile.orig
++++ pciutils-3.2.1/Makefile
+@@ -2,7 +2,7 @@
+ # (c) 1998--2013 Martin Mares <mj@ucw.cz>
+
+ OPT=-O2
+-CFLAGS=$(OPT) -Wall -W -Wno-parentheses -Wstrict-prototypes -Wmissing-prototypes
++CFLAGS=$(OPT) -Wall -W -Wno-parentheses -Wstrict-prototypes -Wmissing-prototypes -fPIC
+
+ VERSION=3.2.1
+ DATE=2013-11-10
diff --git a/user/pciutils/pread.patch b/user/pciutils/pread.patch
new file mode 100644
index 000000000..6e0843a6c
--- /dev/null
+++ b/user/pciutils/pread.patch
@@ -0,0 +1,13 @@
+--- ./lib/pread.h.orig
++++ ./lib/pread.h
+@@ -12,8 +12,8 @@
+ * don't define it.
+ */
+
+-#if defined(__GLIBC__) && __GLIBC__ == 2 && __GLIBC_MINOR__ > 0
+-/* glibc 2.1 or newer -> pread/pwrite supported automatically */
++#if (defined(__GLIBC__) && __GLIBC__ == 2 && __GLIBC_MINOR__ > 0) || (_POSIX_VERSION >= 200809L)
++ /* glibc 2.1 or newer or posix 2008 -> pread/pwrite supported automatically */
+
+ #elif defined(i386) && defined(__GLIBC__)
+ /* glibc 2.0 on i386 -> call syscalls directly */