summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 3b86f9f5a25fde70fdeec1d190ef0daac40c0c57 (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
# Maintainer: Sven Schneider <archlinux.sandmann@googlemail.com>
# Contributor: bugix
# Contributor: Lubosz Sarnecki <lubosz at gmail>

pkgname=openni-git
pkgver=20130205
pkgrel=2
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' 'mesa' 'libusb' 'java-environment')
makedepends=('git')
provides=('openni')
conflicts=('openni')
install="openni.install"
source=()
md5sums=()

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


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"
  
  find "${srcdir}/${_gitname}-build/Samples" -type f -exec sed -i 's#../../../../Data/SamplesConfig.xml#/usr/share/openni/SamplesConfig.xml#g' {} \;
  
  cd "${srcdir}/${_gitname}-build/Platform/Linux/Build"
  
  if [ -f Common ]; then ln -fs `cat Common` Common; fi
  
  # BUILD
  LDFLAGS+=' -lGL' make
}

package() {
  install -dm755 "${pkgdir}/usr/"{lib,bin,share/openni,include/ni/Linux-x86}
  install -dm755 "${pkgdir}/var/lib/ni"

  cd "${srcdir}/${_gitname}-build/Include"
  install *.h "${pkgdir}/usr/include/ni"
  install Linux-x86/* "${pkgdir}/usr/include/ni/Linux-x86"
  
  cd "${srcdir}/${_gitname}-build/Data"
  install SamplesConfig.xml "${pkgdir}/usr/share/openni"

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

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