aboutsummaryrefslogtreecommitdiffstats
path: root/main/hwids/APKBUILD
blob: c5236384b62b2026864012ff17cbb769914af24c (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
# Contributor: A. Wilcox <awilfox@adelielinux.org>
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=hwids
pkgver=20210613
pkgrel=0
pkgdesc="Hardware identification databases"
url="https://github.com/gentoo/hwids/"
arch="noarch"
options="!check"  # No test suite, just databases.
license="BSD-3-Clause OR GPL-2.0-or-later"
makedepends="eudev-dev"
subpackages="$pkgname-net $pkgname-pci $pkgname-udev $pkgname-usb"
depends="$subpackages"
subpackages="$subpackages $pkgname-doc"
source="https://github.com/gentoo/hwids/archive/hwids-$pkgver.tar.gz"
builddir="$srcdir/hwids-hwids-$pkgver"

build() {
	make UDEV=yes
}

package() {
	make DESTDIR="$pkgdir" DOCDIR="/usr/share/doc/$pkgname-$pkgver" \
		MISCDIR="/usr/share/hwdata" UDEV=yes install
}

_mv() {
	local _file
	pkgdesc="$pkgdesc ($1)"
	shift
	depends=""
	mkdir -p "$subpkgdir"/usr/share/hwdata
	for _file in $*; do
		mv "$pkgdir"/usr/share/hwdata/$_file "$subpkgdir"/usr/share/hwdata
	done
}

usb() {
	replaces="hwdata-usb"
	provides="hwdata-usb=$pkgver-r$pkgrel"
	_mv "USB IDs" usb.ids
}

pci() {
	replaces="hwdata-pci"
	provides="hwdata-pci=$pkgver-r$pkgrel"
	_mv "PCI IDs" pci.ids
}

net() {
	replaces="hwdata-oui hwdata"
	provides="hwdata-oui=$pkgver-r$pkgrel"
	license="Public-Domain"
	_mv "Networking OUIs" oui.txt iab.txt
}

udev() {
	install_if="hwids=$pkgver-r$pkgrel eudev"
	install_if="hwids-pci=$pkgver-r$pkgrel eudev"
	install_if="hwids-usb=$pkgver-r$pkgrel eudev"
	pkgdesc="$pkgdesc (udev integration)"

	mkdir -p "$subpkgdir"/
	mv "$pkgdir"/lib "$subpkgdir"/
	mv "$pkgdir"/etc "$subpkgdir"/
}

sha512sums="
4568f6b8c0ca80ec772bd2785d4dc169d1d13a721472a15399158d9a7f31abbe414c5c8cfdf1a3b81cce4e33742a4b6e005e97e3e907643d0afdc8e953624fea  hwids-20210613.tar.gz
"