summaryrefslogtreecommitdiff
path: root/~lukeshu/openni-git/PKGBUILD
blob: 86734fef0e6891055307b88fd9041977d0124936 (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
# Maintainer: Luke Shumaker <lukeshu@sbcglobal.net>
# Contributor: Sven Schneider <archlinux.sandmann@googlemail.com>
# Contributor: bugix
# Contributor: Lubosz Sarnecki <lubosz at gmail>

_pkgname=openni
pkgname=${_pkgname}-git
pkgver=20111115
pkgrel=3
pkgdesc="The OpenNI Framework provides the interface for physical devices and for middleware components"
arch=('i686' 'x86_64')
url="http://www.openni.org/"
license=('GPL')
depends=('freeglut' 'libusb' 'java-environment')
makedepends=('git')
provides=($_pkgname)
conflicts=($_pkgname)
install="openni.install"
source=()
md5sums=()

_gitroot="git://github.com/OpenNI/OpenNI.git"
_gitname="openni"
_gitbranch="unstable"
#_gitbranch="master"

if [ "${CARCH}" = "x86_64" ]; then
  _platform=x64
else
  _platform=x86
fi

build() {
  cd "${srcdir}"
  msg "Connecting to GIT server...."

  if [ -d ${_gitname} ] ; then
    cd ${_gitname} && git pull origin
    msg "The local files are updated."
  else
    git clone -b ${_gitbranch} ${_gitroot} ${_gitname}
  fi

  msg "GIT checkout done or server timeout"
  msg "Starting make..."

  rm -rf "${srcdir}/${_gitname}-build"
  git clone "${srcdir}/${_gitname}" "${srcdir}/${_gitname}-build"
  cd "${srcdir}/${_gitname}-build/Platform/Linux/Build"

  # BUILD
  make -j1 || return 1
}

package() {
  install -d -m755 "${pkgdir}/usr/"{lib,bin,include/ni/Linux-${_platform}}
  install -d -m755 "${pkgdir}/var/lib/ni"

  cd "${srcdir}/${_gitname}-build/Include"
  install *.h "${pkgdir}/usr/include/ni"
  install Linux-${_platform}/* "${pkgdir}/usr/include/ni/Linux-${_platform}"

  cd "${srcdir}/${_gitname}-build/Platform/Linux/Bin/${_platform}-Release"
  install niLicense niReg "${pkgdir}/usr/bin"

  install libnimCodecs.so libnimMockNodes.so libnimRecorder.so libOpenNI.so "${pkgdir}/usr/lib"
}