Skip to content

Commit

Permalink
added debian scripts and Makefile
Browse files Browse the repository at this point in the history
  • Loading branch information
rbrusu committed Oct 19, 2012
1 parent 67e038a commit 6680aa9
Show file tree
Hide file tree
Showing 5 changed files with 161 additions and 0 deletions.
11 changes: 11 additions & 0 deletions CONTROL/openni.pc
@@ -0,0 +1,11 @@
prefix=/usr
exec_prefix=${prefix}
libdir=${exec_prefix}/lib
includedir=${prefix}/include/openni

Name: OpenNI
Description: A general purpose driver for all OpenNI cameras.
Version: __VERSION__
Requires: libusb-1.0 >= 1.0.8
Cflags: -I${includedir}
Libs: -L${libdir} -lOpenNI
8 changes: 8 additions & 0 deletions CONTROL/openni_control
@@ -0,0 +1,8 @@
Package: openni-dev
Version: __VERSION__
Section: devel
Priority: optional
Architecture: __ARCHITECTURE__
Depends: libstdc++6 (>= 4.4), libusb-1.0-0 (>= 1.0.8)
Maintainer: Open Perception, Inc (http://www.openperception.org)
Description: OpenNI developer package
47 changes: 47 additions & 0 deletions CONTROL/openni_postinst
@@ -0,0 +1,47 @@
#!/bin/sh
# postinst script for openni
#
# see: dh_installdeb(1)

set -e

# summary of how this script can be called:
# * <postinst> `configure' <most-recently-configured-version>
# * <old-postinst> `abort-upgrade' <new version>
# * <conflictor's-postinst> `abort-remove' `in-favour' <package>
# <new-version>
# * <postinst> `abort-remove'
# * <deconfigured's-postinst> `abort-deconfigure' `in-favour'
# <failed-install-package> <version> `removing'
# <conflicting-package> <version>
# for details, see http://www.debian.org/doc/debian-policy/ or
# the debian-policy package


case "$1" in
configure)
/usr/bin/niReg -r /usr/lib/libnimCodecs.so /etc/openni
/usr/bin/niReg -r /usr/lib/libnimMockNodes.so /etc/openni
/usr/bin/niReg -r /usr/lib/libnimRecorder.so /etc/openni
if [ -d /etc/primesense ]; then
rm -rf /etc/primesense
echo "Removing old /etc/primesense folder (files are now handled in /etc/openni)."
echo "Maybe you have to upgrade ps-engine and nite as well."
fi
;;

abort-upgrade|abort-remove|abort-deconfigure)
;;

*)
echo "postinst called with unknown argument \`$1'" >&2
exit 1
;;
esac

# dh_installdeb will replace this with shell code automatically
# generated by other debhelper scripts.

#DEBHELPER#

exit 0
42 changes: 42 additions & 0 deletions CONTROL/openni_prerm
@@ -0,0 +1,42 @@
#!/bin/sh
# prerm script for openni
#
# see: dh_installdeb(1)

set -e

# summary of how this script can be called:
# * <prerm> `remove'
# * <old-prerm> `upgrade' <new-version>
# * <new-prerm> `failed-upgrade' <old-version>
# * <conflictor's-prerm> `remove' `in-favour' <package> <new-version>
# * <deconfigured's-prerm> `deconfigure' `in-favour'
# <package-being-installed> <version> `removing'
# <conflicting-package> <version>
# for details, see http://www.debian.org/doc/debian-policy/ or
# the debian-policy package


case "$1" in
remove)
rm -f /etc/openni/modules.xml
rm -f /etc/openni/licenses.xml
;;
upgrade|deconfigure)
;;

failed-upgrade)
;;

*)
echo "prerm called with unknown argument \`$1'" >&2
exit 1
;;
esac

# dh_installdeb will replace this with shell code automatically
# generated by other debhelper scripts.

#DEBHELPER#

exit 0
53 changes: 53 additions & 0 deletions Makefile
@@ -0,0 +1,53 @@
BUILD_NUMBER=1
OPENNI_VERSION=1.5.4.0

ARCHITECTURE=$(shell uname -m)

ifeq (${ARCHITECTURE},x86_64)
ARCH=amd64
OPENNI_ARCH=x64
else
ARCH=i386
OPENNI_ARCH=xx
endif

DISTRO=$(shell lsb_release -sc)

OPENNI_PACKAGE_NAME=ros-openni-dev-${OPENNI_VERSION}~${DISTRO}_$(ARCH)${BUILD_NUMBER}
OPENNI_REDISTNAME=OpenNI-Bin-Dev-Linux-${OPENNI_ARCH}-v${OPENNI_VERSION}

all: debian

debian: debian_openni

debian_openni : $(OPENNI_PACKAGE_NAME).deb

$(OPENNI_PACKAGE_NAME).deb: ./CONTROL/openni_control ./CONTROL/openni_postinst ./CONTROL/openni_prerm openni_lib
mkdir -p $(OPENNI_PACKAGE_NAME)/DEBIAN \
$(OPENNI_PACKAGE_NAME)/usr/bin \
$(OPENNI_PACKAGE_NAME)/usr/include/openni \
$(OPENNI_PACKAGE_NAME)/usr/lib \
$(OPENNI_PACKAGE_NAME)/etc/openni \
$(OPENNI_PACKAGE_NAME)/usr/lib/pkgconfig \
$(OPENNI_PACKAGE_NAME)/usr/share/openni/doc \
$(OPENNI_PACKAGE_NAME)/usr/share/openni/samples
cp -f ./CONTROL/openni_postinst $(OPENNI_PACKAGE_NAME)/DEBIAN/postinst
cp -f ./CONTROL/openni_prerm $(OPENNI_PACKAGE_NAME)/DEBIAN/prerm
cp -f ./Platform/Linux/Redist/${OPENNI_REDISTNAME}/Samples/Config/* $(OPENNI_PACKAGE_NAME)/etc/openni/
cp -f ./Platform/Linux/Redist/${OPENNI_REDISTNAME}/Lib/*.so $(OPENNI_PACKAGE_NAME)/usr/lib/
cp -r ./Platform/Linux/Redist/${OPENNI_REDISTNAME}/Include/* $(OPENNI_PACKAGE_NAME)/usr/include/openni/
cp -f ./Platform/Linux/Redist/${OPENNI_REDISTNAME}/Bin/* $(OPENNI_PACKAGE_NAME)/usr/bin/
cp -f ./Platform/Linux/Redist/${OPENNI_REDISTNAME}/Documentation/html/* $(OPENNI_PACKAGE_NAME)/usr/share/openni/doc/
cp -f ./Platform/Linux/Redist/${OPENNI_REDISTNAME}/Samples/Bin/${OPENNI_ARCH}-Release/Sample-* $(OPENNI_PACKAGE_NAME)/usr/share/openni/samples/
cp -f ./Platform/Linux/Redist/${OPENNI_REDISTNAME}/Samples/Bin/${OPENNI_ARCH}-Release/NiViewer $(OPENNI_PACKAGE_NAME)/usr/share/openni/samples/
@sed s/__VERSION__/${OPENNI_VERSION}~${DISTRO}/ ./CONTROL/openni_control | sed s/__ARCHITECTURE__/$(ARCH)/ > $(OPENNI_PACKAGE_NAME)/DEBIAN/control
@sed s/__VERSION__/${OPENNI_VERSION}~${DISTRO}/ ./CONTROL/openni.pc > $(OPENNI_PACKAGE_NAME)/usr/lib/pkgconfig/openni-dev.pc
@dpkg-deb -b $(OPENNI_PACKAGE_NAME)

openni_lib:
cd Platform/Linux/CreateRedist && bash RedistMaker && cd -

clean:
rm -rf $(OPENNI_PACKAGE_NAME)
rm -f $(OPENNI_PACKAGE_NAME).deb

0 comments on commit 6680aa9

Please sign in to comment.