summaryrefslogtreecommitdiff
path: root/community-testing/open-vm-tools-modules/PKGBUILD
blob: 41d09db9163b088104bd186088d47af0799aadbe (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
# $Id: PKGBUILD 57352 2011-10-26 12:09:45Z spupykin $
# Maintainer: Sergej Pupykin <pupykin.s+arch@gmail.com>
# Contributor: Krzysztof Raczkowski <raczkow@gmail.com>

pkgname=open-vm-tools-modules
pkgver=2011.09.23
_pkgsubver=491607
pkgrel=2
pkgdesc="The Open Virtual Machine Tools (open-vm-tools) are the open source implementation of VMware Tools"
arch=('i686' 'x86_64')
url="http://open-vm-tools.sourceforge.net/"
license=('GPL')
makedepends=('libdnet' 'icu' 'uriparser' 'linux-headers')
depends=("linux")
install=$pkgname.install
source=("http://downloads.sourceforge.net/open-vm-tools/open-vm-tools-$pkgver-${_pkgsubver}.tar.gz")
md5sums=('599342eee8d531b35ca1cc948b61868f')

build() {
  _kernver=`pacman -Q linux | cut -d . -f 2 | cut -f 1 -d -`
  KERNEL_RELEASE=`cat /lib/modules/extramodules-3.${_kernver}-ARCH/version`

  cd "$srcdir/open-vm-tools-${pkgver}-${_pkgsubver}"
  [ $NOEXTRACT -eq 1 ] || ./configure --prefix=/usr \
	--without-x --with-kernel-release=$KERNEL_RELEASE
  (cd modules && make modules)
}

package() {
  _kernver=`pacman -Q linux | cut -d . -f 2 | cut -f 1 -d -`
  depends=("linux>=3.${_kernver}" "linux<3.`expr ${_kernver} + 1`")
  KERNEL_VERSION=`cat /lib/modules/extramodules-3.${_kernver}-ARCH/version`
  msg "Kernel = $KERNEL_VERSION"

  cd "$srcdir/open-vm-tools-${pkgver}-${_pkgsubver}"
  mkdir -p $pkgdir/lib/modules/extramodules-3.${_kernver}-ARCH/
  for MOD in `find -type f -name '*.ko'`; do
    install -D -m644 $MOD $pkgdir/lib/modules/extramodules-3.${_kernver}-ARCH/
  done
  sed -i -e "s/KERNEL_VERSION='.*'/KERNEL_VERSION='$KERNEL_VERSION'/" $startdir/$pkgname.install
}