summaryrefslogtreecommitdiff
path: root/community/osinfo-db/APKBUILD
blob: bf3eef09e3b7dab8e6b66279361cfa89b4da21fa (plain)
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
76
77
78
79
80
81
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=osinfo-db
pkgver=20170813
pkgrel=1
pkgdesc="osinfo database files"
url="http://libosinfo.org/"
arch="noarch"
license="LGPL-2.0-or-later"
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">
      <minimum>
        <cpu>1000000000</cpu>
	<n-cpus>1</n-cpus>
	<ram>134217728</ram>
	<storage>1073741824</storage>
      </minimum>
      <recommended>
        <cpu>1000000000</cpu>
	<n-cpus>1</n-cpus>
	<ram>805306368</ram>
	<storage>4294967296</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="0ae4906b5c3eb400ca397f0c3baf5146b8197ee2dc712b1b89dd2f443f9505aee208327f008118628407b54ce52390a8b6138425f3f6f974b94f4a8d79955653  osinfo-db-20170813.tar.xz
f56cc5598fcc426e1c1b03814c9e6167602d7ebb096f7a0288ba6c432910405d26692135d7edd13c9d3de11507d1b361a1951056952a462f951d9b75be71f17f  0001-Add-alpine-linux-3.5-and-3.6.patch"