# Tanım: Açık Sanal Makine Araçları çekirdek modülleri
# URL: http://open-vm-tools.sourceforge.net/
# Paketçi: milisarge
# Gerekler: kernel
# Grup: sistem

isim=open-vm-tools-kernel
_isim=open-vm-tools
surum=10.0.0
_altsurum=3000743
_surum="${surum}-${_altsurum}"
_tamisim="${_isim}-${_surum}"
_dkms_surum='2015.01.29'
devir=1
kaynak=(http://downloads.sourceforge.net/open-vm-tools/open-vm-tools-10.0.0-3000743.tar.gz
		0001-Fix-vmxnet-module-on-kernels-3.16.patch
		0004-Support-backing-dev-info-kernel-4.0.patch
		0005-Remove-new_sync-for-Linux-4.1.patch
		0006-vmhgfs-support-linux-4.2.x-kernel.patch)

derle() {
  patch -d "$SRC/${_tamisim}" -Np2 -i "$SRC/0001-Fix-vmxnet-module-on-kernels-3.16.patch"
  patch -d "$SRC/${_tamisim}" -Np2 -i "$SRC/0004-Support-backing-dev-info-kernel-4.0.patch"
  patch -d "$SRC/${_tamisim}" -Np2 -i "$SRC/0005-Remove-new_sync-for-Linux-4.1.patch"
  patch -d "$SRC/${_tamisim}" -Np2 -i "$SRC/0006-vmhgfs-support-linux-4.2.x-kernel.patch"
  cd "$SRC/${_tamisim}"
  [ -f /usr/src/linux-$(uname -r)/vmlinux ] && rm /usr/src/linux-$(uname -r)/vmlinux
  sed -i "s/${_dkms_surum}/${surum}/g" ./modules/linux/dkms.sh
  sh ./modules/linux/dkms.sh ./ "${PKG}/usr/src"
  for _module in {"vmblock","vmci","vmsync","vsock"}; do
   rm -rf "${PKG}/usr/src/${_isim}-${surum}/${_module}"
  done
}
