aboutsummaryrefslogtreecommitdiffstats
path: root/community/osinfo-db/APKBUILD
blob: 90223414fb6108941f7d79e0cd3a75bce93c8a6c (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
71
72
73
74
75
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=osinfo-db
pkgver=20170423
pkgrel=3
pkgdesc="osinfo database files"
url="http://libosinfo.org/"
arch="noarch"
license="LGPLv2+"
depends=""
makedepends="osinfo-db-tools"
install=""
subpackages=""
source="https://releases.pagure.org/libosinfo/osinfo-db-$pkgver.tar.xz
	0001-Add-alpine-linux-3.5-and-3.6.patch
	"
builddir="$srcdir/osinfo-db-$pkgver"

build() {
	cd "$builddir"
}

check() {
	osinfo-db-validate --dir "$builddir"
}


mk_xml() {
	local ver="$1"
	cat <<EOF
<?xml version="1.0" encoding="UTF-8"?>
<libosinfo version="0.0.1">

  <os id="http://alpinelinux.org/alpinelinux/$ver">
    <short-id>alpinelinux$ver</short-id>
    <name>Alpine Linux $ver</name>
    <version>$ver</version>
    <vendor>Alpine Linux Project</vendor>
    <family>linux</family>
    <distro>alpinelinux</distro>
    <resources arch="all">
      <recommended>
        <cpu>1000000000</cpu>
	<n-cpus>1</n-cpus>
	<ram>1073741824</ram>
	<storage>5368709120</storage>
      </recommended>
    </resources>
    <media arch="i686">
      <iso>
        <volume-id>alpine-.* $ver.\d.* x86.*</volume-id>
      </iso>
    </media>
    <media arch="x86_64">
      <iso>
        <volume-id>alpine-.* $ver.\d.* x86_64.*</volume-id>
      </iso>
    </media>
  </os>
</libosinfo>
EOF
}

package() {
	local ver=
	cd "$builddir"
	osinfo-db-import --root "$pkgdir" \
		--dir /usr/share/osinfo "$srcdir"/osinfo-db-$pkgver.tar.xz
	mkdir -p "$pkgdir"/usr/share/osinfo/os/alpinelinux.org
	for ver in 3.6 3.7; do
		mk_xml $ver > "$pkgdir"/usr/share/osinfo/os/alpinelinux.org/alpinelinux-$ver.xml
	done
}

sha512sums="5ca13ced160f19dced65f3552e17a0379a47a05f1aa3bdd533550022f0023050b6cc1b43b2da6cff3fa10451f81560fbb0db241a11ed072b9f101db1bd301833  osinfo-db-20170423.tar.xz
f56cc5598fcc426e1c1b03814c9e6167602d7ebb096f7a0288ba6c432910405d26692135d7edd13c9d3de11507d1b361a1951056952a462f951d9b75be71f17f  0001-Add-alpine-linux-3.5-and-3.6.patch"