aboutsummaryrefslogtreecommitdiffstats
path: root/main/open-vm-tools-grsec/APKBUILD
blob: 1c59e78223dd030dba617c660030de93a9afbab6 (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
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>

_flavor=grsec
_kpkg=linux-$_flavor
_realname=open-vm-tools
_kver=4.4.8
_kpkgrel=2
_realver=10.0.7
_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

_abi_release=${_kver}-${_kpkgrel}-${_flavor}
_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=""
depends="linux-${_flavor}=${_kernelver}"
depends_dev="bash glib-dev gettext-dev linux-${_flavor}-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
	"
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
        for i in $source; do
                case $i in
                *.patch) msg $i; patch -p1 -i "$srcdir"/$i || return 1;;
                esac
        done
	libtoolize && aclocal && autoconf && automake --add-missing
}

build() {
	export GCC_SPECS=hardenednopie.specs
	cd "$_builddir"
	./configure \
		--build=$CBUILD \
		--host=$CHOST \
		--disable-deploypkg \
		--without-pam \
		--without-x \
		--without-dnet \
		--without-icu \
		--without-procps \
		--without-ssl \
		--with-kernel-release="${_abi_release}" \
		|| return 1
	cd "$_builddir"/modules
	make -j1 modules MODULES="vmxnet vmhgfs" || return 1
}

package() {
	cd "$_builddir"
	mkdir -p "$pkgdir"/etc/modules-load.d/
	cat >"$pkgdir"/etc/modules-load.d/open-vm-tools<<EOF
vmblock
vmci
vmhgfs
vmsync
vmxnet
vsock
vmw_balloon
EOF
	mkdir -p $pkgdir/lib/modules/${_abi_release}/misc/
	cd "$_builddir"/modules
	for module in `find . -type f -name '*.ko'`; do
		install -D -m644 $module "$pkgdir/lib/modules/${_abi_release}/misc/"
	done
}

md5sums="f865c9cfc9732360f6e1b08cdbd16483  stable-10.0.7.tar.gz
3254b99481cea970acd6d65863ce6b48  0001-Fix-vmxnet-module-on-kernels-3.16.patch"
sha256sums="87d76dc3affd39dccfae80c7210ac89e8f14cb493a651709780f67b1b5a92ec8  stable-10.0.7.tar.gz
85be67ed9827e685d55dd5cba25144d95296159ff1be73f491b343c395dd6a7d  0001-Fix-vmxnet-module-on-kernels-3.16.patch"
sha512sums="d91fcc9a30ba6fbe34ea8440106ef3d9c0b9bf04e5c40a787179735f534f93a1aaff43fb3b91fe33377b00b84f07b2dc91d7129cf0bbf82774b04a19a531223f  stable-10.0.7.tar.gz
c445631b7faf8badfbf8e66518bfb70aec1049c1a0393ff038253e70190d7f8580cbcd3e7037c43664ee0ee48d26edd8f8eaca06383bbd7fa763a182050f9551  0001-Fix-vmxnet-module-on-kernels-3.16.patch"