testing/hwinfo: new aport

https://github.com/openSUSE/hwinfo
Hardware information tool
This commit is contained in:
Jakub Jirutka 2018-02-20 02:04:35 +01:00
parent ca927f3cb2
commit 17e281c168
2 changed files with 117 additions and 0 deletions

51
testing/hwinfo/APKBUILD Normal file
View File

@ -0,0 +1,51 @@
# Contributor: Jakub Jirutka <jakub@jirutka.cz>
# Maintainer: Jakub Jirutka <jakub@jirutka.cz>
pkgname=hwinfo
pkgver=21.52
pkgrel=0
pkgdesc="Hardware information tool"
url="https://github.com/openSUSE/hwinfo"
arch="all"
license="GPL-2.0-or-later"
makedepends="$depends_dev flex perl libx86emu-dev linux-headers"
subpackages="$pkgname-dev $pkgname-doc $pkgname-libs"
source="$pkgname-$pkgver.tar.gz::https://github.com/openSUSE/$pkgname/archive/$pkgver.tar.gz
respect-flags.patch"
builddir="$srcdir/$pkgname-$pkgver"
options="!check" # no tests provided
export HWINFO_VERSION=$pkgver
build() {
cd "$builddir"
# Build full and tiny static libraries.
make tinystatic
make static
cp src/libhd*.a .
make clean
# Build full shared library.
make shared LIBDIR=/usr/lib
}
package() {
cd "$builddir"
make install \
LIBDIR=/usr/lib \
DESTDIR="$pkgdir"
rmdir "$pkgdir"/sbin "$pkgdir"/usr/lib || true
install -m 644 -t "$pkgdir"/usr/lib/ libhd.a libhd_tiny.a
mkdir -p "$pkgdir"/usr/share/man/man1
cp doc/*.1 "$pkgdir"/usr/share/man/man1/
mkdir -p "$pkgdir"/usr/share/man/man8
cp doc/*.8 "$pkgdir"/usr/share/man/man8/
}
sha512sums="a0d15d548fdbb02a1d0250e0a125b1d53e65b58e5325cff6f1c8a84b9b67a3da5f7575701c065214650523ef6ec59ed6c26f531a0878ea528099c6c06b6f48ae hwinfo-21.52.tar.gz
1a78d21c97bb2b699804c20622b7309573ba3d8dcfdaa8c2c31be42cba42a342e4a4fb451551ee4d1af9384ba455363727cc37839a26550871cca139b5a0ba20 respect-flags.patch"

View File

@ -0,0 +1,66 @@
--- a/Makefile.common
+++ b/Makefile.common
@@ -18,11 +18,9 @@
LIBHD_MINOR_VERSION := $(shell cut -d . -f 2 $(TOPDIR)/VERSION)
LIBHD_MAJOR_VERSION := $(shell cut -d . -f 1 $(TOPDIR)/VERSION)
-RPM_OPT_FLAGS ?= -O2
-
CC ?= gcc
LD = ld
-CFLAGS += $(RPM_OPT_FLAGS) -Wall -Wno-pointer-sign -pipe -g $(SHARED_FLAGS) $(EXTRA_FLAGS) -I$(TOPDIR)/src/hd
+CFLAGS += -Wall -Wno-pointer-sign $(SHARED_FLAGS) $(EXTRA_FLAGS) -I$(TOPDIR)/src/hd
SHARED_FLAGS = -fPIC
LDFLAGS += -Lsrc
--- a/src/Makefile
+++ b/src/Makefile
@@ -12,7 +12,7 @@
#endif
$(LIBHD): $(OBJS)
- ar r $@ $?
+ $(AR) r $@ $?
@rm -f $(LIBHD_D)
ifdef SHARED_FLAGS
--- a/src/hd/Makefile
+++ b/src/hd/Makefile
@@ -12,4 +12,4 @@
@perl -pi -e "s/define\s+HD_MINOR_VERSION\s+\d+/define HD_MINOR_VERSION\t$(LIBHD_MINOR_VERSION)/" $@
$(LIBHD_D): $(OBJS)
- ar r $(LIBHD) $?
+ $(AR) r $(LIBHD) $?
--- a/src/ids/Makefile
+++ b/src/ids/Makefile
@@ -48,10 +48,10 @@
IDFILES += src/pci src/storage src/sound src/mouse src/braille
$(LIBHD_D): hd_ids.o
- ar r $(LIBHD) $?
+ $(AR) r $(LIBHD) $?
check_hd: check_hd.c
- $(CC) $(CFLAGS) $< -o $@
+ $(CC) $(LDFLAGS) $(CFLAGS) $< -o $@
hd_ids.c: hd_ids.h hd_ids_tiny.h
--- a/src/isdn/Makefile
+++ b/src/isdn/Makefile
@@ -5,5 +5,5 @@
include $(TOPDIR)/Makefile.common
$(LIBHD_D): $(OBJS)
- ar r $(LIBHD) $?
+ $(AR) r $(LIBHD) $?
--- a/src/smp/Makefile
+++ b/src/smp/Makefile
@@ -4,4 +4,4 @@
include $(TOPDIR)/Makefile.common
$(LIBHD_D): $(OBJS)
- ar r $(LIBHD) $?
+ $(AR) r $(LIBHD) $?