summaryrefslogtreecommitdiff
path: root/community/open-vm-tools-modules/PKGBUILD
blob: d0ce60605a6ce4d36d579e88846d69edabaf1297 (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
# $Id: PKGBUILD 62251 2012-01-18 19:54:06Z spupykin $
# Maintainer: Sergej Pupykin <pupykin.s+arch@gmail.com>
# Contributor: Krzysztof Raczkowski <raczkow@gmail.com>

pkgname=open-vm-tools-modules
pkgver=2011.12.20
_pkgsubver=562307
pkgrel=3
pkgdesc="kernel modules for the open source implementation of VMware Tools"
arch=('i686' 'x86_64' 'mips64el')
url="http://open-vm-tools.sourceforge.net/"
license=('GPL')
makedepends=('libdnet' 'icu' 'uriparser' 'linux-headers')
depends=("linux")
install=$pkgname.install
options=('!strip')
source=("http://downloads.sourceforge.net/open-vm-tools/open-vm-tools-$pkgver-${_pkgsubver}.tar.gz"
	"modprobe.conf")
md5sums=('529c15cb6cfa2972a96664c504dee560'
         'ac9b8e3cb798f5056ca92767ec705117')

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
#  echo '#define COMPAT_LINUX_VERSION_CHECK_LT(a, b, c) 1' >>linux/shared/compat_version.h
  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 -Dm644 $MOD $pkgdir/lib/modules/extramodules-3.${_kernver}-ARCH/
  done
  gzip $pkgdir/lib/modules/extramodules-3.${_kernver}-ARCH/*.ko

  install -D -m 644 ${srcdir}/modprobe.conf ${pkgdir}/etc/modprobe.d/${pkgname}.conf
  sed -i "s|extramodules-.*-ARCH|extramodules-3.${_kernver}-ARCH|" $startdir/$pkgname.install
}