aboutsummaryrefslogtreecommitdiffstats
path: root/main/open-vm-tools-grsec/APKBUILD
blob: 2b5c5a98ee2666a487655fadda36780f6bbe5888 (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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>

_flavor=grsec
_kpkg=linux-$_flavor
_realname=open-vm-tools
_kver=4.4.44
_kpkgrel=1
_realver=10.1.0
_ver=${_realver/_p/-}
_mypkgrel=0

# source open-vm-tools version
if [ -f ../main/$_realname/APKBUILD ]; then
	. ../main/$_realname/APKBUILD
	[ "${_realver}" != "$pkgver" ] && pkgname=$_realname-$_flavor \
		&& die "please set _realver to $pkgver"
fi

# source the kernel version
if [ -f ../main/linux-${_flavor}/APKBUILD ]; then
        . ../main/linux-${_flavor}/APKBUILD
	[ "$_kver" != "$pkgver" ] && die "please set _kver to $pkgver"
	[ "$_kpkgrel" != "$pkgrel" ] && die "please set _kpkgrel to $pkgrel"
fi

_abiver="${_kver}-${_kpkgrel}"
_abi_releases="${_abiver}-${_flavor} ${_abiver}-virtgrsec"
_kernelver="$_kver-r$_kpkgrel"

pkgname="$_realname-$_flavor"
pkgver=$_kver
pkgrel=$(($_kpkgrel + $_mypkgrel))

pkgdesc="The Open Virtual Machine Tools are the open source implementation of VMware Tools."
url="https://github.com/vmware/open-vm-tools/"
arch="x86 x86_64"
license="LGPL"
subpackages="$_realname-virtgrsec:_virtgrsec"
depends="linux-${_flavor}=${_kernelver}"
depends_dev="bash glib-dev gettext-dev linux-${_flavor}-dev=${_kernelver} linux-virtgrsec-dev=${_kernelver}"
makedepends="$depends_dev autoconf automake libtool linux-headers"
source="https://github.com/vmware/open-vm-tools/archive/stable-$_ver.tar.gz
	0001-Fix-vmxnet-module-on-kernels-3.16.patch
	missing-config-dir.patch
	"
install_if="linux-${_flavor}=${_kernelver} open-vm-tools"

builddir="$srcdir/open-vm-tools-stable-$_ver"/open-vm-tools

prepare() {
	cd "$builddir"
	update_config_sub || return 1
	default_prepare || return 1
	autoreconf -vif || return 1
	for _abi in $_abi_releases; do
		mkdir ../build-$_abi
		cp -r * ../build-$_abi/
	done
}

build() {
	for _abi in $_abi_releases; do
		cd "$builddir"/../build-$_abi
		./configure \
			--build=$CBUILD \
			--host=$CHOST \
			--disable-deploypkg \
			--without-pam \
			--without-x \
			--without-dnet \
			--without-icu \
			--without-procps \
			--without-ssl \
			--with-kernel-release="${_abi}" \
			|| return 1
			make -j1 -C modules modules MODULES="vmxnet vmhgfs" \
				|| return 1
	done
}

package() {
	for _abi in $_abi_releases; do
		mkdir -p "$pkgdir"/lib/modules/${_abi}/misc/
		cd "$builddir"/../build-$_abi
		for module in $(find . -type f -name '*.ko'); do
			install -D -m644 $module "$pkgdir/lib/modules/${_abi}/misc/" || return 1
		done
	done
}

_virtgrsec() {
	pkgdesc="VMware guest modules for virtgrsec kernel"
	mkdir -p "$subpkgdir"/lib/modules
	mv "$pkgdir"/lib/modules/${_abiver}-virtgrsec "$subpkgdir"/lib/modules/ || return 1
}

md5sums="46f5a319275f63658f1a44b6c8755f6b  stable-10.1.0.tar.gz
3254b99481cea970acd6d65863ce6b48  0001-Fix-vmxnet-module-on-kernels-3.16.patch
5ab8e8249a65a8b750c5bf278f438351  missing-config-dir.patch"
sha256sums="2b76d8461022774f2c077b032fbe870f86046f20724eb24824cf9b6ccc4b5355  stable-10.1.0.tar.gz
85be67ed9827e685d55dd5cba25144d95296159ff1be73f491b343c395dd6a7d  0001-Fix-vmxnet-module-on-kernels-3.16.patch
fb7a4bb532ffc81c8be73c66008538f4119a1147bbbdbf32328d286f012b2035  missing-config-dir.patch"
sha512sums="f497b828510ebc2a88788ad5292047f20513c844e889b3f652ecce382efd6d4672560be7387b55dcb7300cfdde5c8eda407836c9b75614c018e058bb169b374d  stable-10.1.0.tar.gz
c445631b7faf8badfbf8e66518bfb70aec1049c1a0393ff038253e70190d7f8580cbcd3e7037c43664ee0ee48d26edd8f8eaca06383bbd7fa763a182050f9551  0001-Fix-vmxnet-module-on-kernels-3.16.patch
f77d3848d87d7c387d2cc1555ff3a39e547a8e8fcecee3aa1f785b828fd238c3779c1e5704f52ec46701b29a2ad9aec1cd5aef04677bc2a03b8a7780435f7fdd  missing-config-dir.patch"