[SCM] openni/master: Simplify config file handling

eighthave at users.alioth.debian.org eighthave at users.alioth.debian.org
Mon May 20 03:25:49 UTC 2013


The following commit has been merged in the master branch:
commit 8b3cc785d2a23497378ff8cbe9b1c07608db598b
Author: Jochen Sprickerhof <jochen at sprickerhof.de>
Date:   Fri Jul 6 14:18:41 2012 +0200

    Simplify config file handling
    
    - Add patch to move config files to /etc/openni.
    - Add generated xml config files instead of calling niLicense/niReg in
      postinst/prerm so debhelper will recognise them as config files.
      Bonus: libopenni0 doesn't depend on openni-utils anymore (breaks
      cyclic dependency).

diff --git a/debian/control b/debian/control
index 556f4fc..4cef8fe 100644
--- a/debian/control
+++ b/debian/control
@@ -23,7 +23,6 @@ Architecture: any
 Depends: ${shlibs:Depends},
          ${misc:Depends},
          libusb-1.0-0,
-         openni-utils
 Description: framework for sensor-based 'Natural Interaction'
  OpenNI is a framework for getting data to support 'Natural Interaction',
  i.e. skeleton tracking, gesture tracking, and similar ways of getting data
diff --git a/debian/libopenni0.install b/debian/libopenni0.install
index e026912..1c25869 100644
--- a/debian/libopenni0.install
+++ b/debian/libopenni0.install
@@ -1 +1,4 @@
 Platform/Linux/Bin/*-Release/lib*.so.* usr/lib/
+Data/SamplesConfig.xml etc/openni/
+debian/licenses.xml etc/openni/
+debian/modules.xml etc/openni/
diff --git a/debian/licenses.xml b/debian/licenses.xml
new file mode 100644
index 0000000..e5967fd
--- /dev/null
+++ b/debian/licenses.xml
@@ -0,0 +1,3 @@
+<Licenses>
+    <License vendor="PrimeSense" key="0KOIk2JeIBYClPWVnMoRKn5cdY4=" />
+</Licenses>
diff --git a/debian/modules.xml b/debian/modules.xml
new file mode 100644
index 0000000..b00f7fe
--- /dev/null
+++ b/debian/modules.xml
@@ -0,0 +1,5 @@
+<Modules>
+    <Module path="/usr/lib/libnimMockNodes.so.0" configDir="/etc/openni" />
+    <Module path="/usr/lib/libnimCodecs.so.0" configDir="/etc/openni" />
+    <Module path="/usr/lib/libnimRecorder.so.0" configDir="/etc/openni" />
+</Modules>
diff --git a/debian/openni-utils.dirs b/debian/openni-utils.dirs
deleted file mode 100644
index 4902f86..0000000
--- a/debian/openni-utils.dirs
+++ /dev/null
@@ -1,2 +0,0 @@
-var/lib/ni
-etc/primesense
diff --git a/debian/openni-utils.postinst b/debian/openni-utils.postinst
deleted file mode 100644
index 0b6e417..0000000
--- a/debian/openni-utils.postinst
+++ /dev/null
@@ -1,12 +0,0 @@
-#!/bin/sh
-
-set -e
-
-if [ "$1" = "configure" ]; then
-	niLicense -r PrimeSense 0KOIk2JeIBYClPWVnMoRKn5cdY4=
-	niReg -r /usr/lib/libnimMockNodes.so /etc/primesense
-	niReg -r /usr/lib/libnimCodecs.so /etc/primesense
-	niReg -r /usr/lib/libnimRecorder.so /etc/primesense
-fi
-
-#DEBHELPER#
diff --git a/debian/openni-utils.prerm b/debian/openni-utils.prerm
deleted file mode 100644
index 6ca0561..0000000
--- a/debian/openni-utils.prerm
+++ /dev/null
@@ -1,12 +0,0 @@
-#!/bin/sh
-
-set -e
-
-if [ "$1" = "configure" ]; then
-	niLicense -u PrimeSense 0KOIk2JeIBYClPWVnMoRKn5cdY4=
-	niReg -u /usr/lib/libnimMockNodes.so /etc/primesense
-	niReg -u /usr/lib/libnimCodecs.so /etc/primesense
-	niReg -u /usr/lib/libnimRecorder.so /etc/primesense
-fi
-
-#DEBHELPER#
diff --git a/debian/patches/0003-Change-path-of-config-files-to-etc-openni.patch b/debian/patches/0003-Change-path-of-config-files-to-etc-openni.patch
new file mode 100644
index 0000000..5d8ae44
--- /dev/null
+++ b/debian/patches/0003-Change-path-of-config-files-to-etc-openni.patch
@@ -0,0 +1,175 @@
+From: Jochen Sprickerhof <jochen at sprickerhof.de>
+Date: Wed, 4 Jul 2012 17:40:33 +0200
+Subject: Change path of config files to /etc/openni
+
+---
+ Samples/NiAudioSample/NiAudioSample.cpp         |    2 +-
+ Samples/NiCRead/NiCRead.c                       |    2 +-
+ Samples/NiHandTracker/main.cpp                  |    2 +-
+ Samples/NiRecordRaw/NiRecordRaw.cpp             |    2 +-
+ Samples/NiRecordSynthetic/NiRecordSynthetic.cpp |    2 +-
+ Samples/NiSimpleRead/NiSimpleRead.cpp           |    2 +-
+ Samples/NiSimpleSkeleton/NiSimpleSkeleton.cpp   |    2 +-
+ Samples/NiSimpleViewer/NiSimpleViewer.cpp       |    2 +-
+ Samples/NiUserSelection/UserTracker.cpp         |    2 +-
+ Samples/NiUserTracker/main.cpp                  |    2 +-
+ Samples/NiViewer/NiViewer.cpp                   |    2 +-
+ Source/OpenNI/XnOpenNI.cpp                      |    2 +-
+ 12 files changed, 12 insertions(+), 12 deletions(-)
+
+diff --git a/Samples/NiAudioSample/NiAudioSample.cpp b/Samples/NiAudioSample/NiAudioSample.cpp
+index 2205b96..5e5213b 100644
+--- a/Samples/NiAudioSample/NiAudioSample.cpp
++++ b/Samples/NiAudioSample/NiAudioSample.cpp
+@@ -31,7 +31,7 @@
+ //---------------------------------------------------------------------------
+ // Defines
+ //---------------------------------------------------------------------------
+-#define SAMPLE_XML_PATH "../../../../Data/SamplesConfig.xml"
++#define SAMPLE_XML_PATH "/etc/openni/SamplesConfig.xml"
+ 
+ #define NUMBER_OF_AUDIO_BUFFERS 100
+ 
+diff --git a/Samples/NiCRead/NiCRead.c b/Samples/NiCRead/NiCRead.c
+index 89051ed..9967b10 100644
+--- a/Samples/NiCRead/NiCRead.c
++++ b/Samples/NiCRead/NiCRead.c
+@@ -27,7 +27,7 @@
+ //---------------------------------------------------------------------------
+ // Defines
+ //---------------------------------------------------------------------------
+-#define SAMPLE_XML_PATH "../../../../Data/SamplesConfig.xml"
++#define SAMPLE_XML_PATH "/etc/openni/SamplesConfig.xml"
+ 
+ //---------------------------------------------------------------------------
+ // Macros
+diff --git a/Samples/NiHandTracker/main.cpp b/Samples/NiHandTracker/main.cpp
+index d5ca19e..f80a8e6 100644
+--- a/Samples/NiHandTracker/main.cpp
++++ b/Samples/NiHandTracker/main.cpp
+@@ -28,7 +28,7 @@
+ //---------------------------------------------------------------------------
+ // Defines
+ //---------------------------------------------------------------------------
+-#define SAMPLE_XML_PATH "../../../../Data/SamplesConfig.xml"
++#define SAMPLE_XML_PATH "/etc/openni/SamplesConfig.xml"
+ 
+ 
+ //---------------------------------------------------------------------------
+diff --git a/Samples/NiRecordRaw/NiRecordRaw.cpp b/Samples/NiRecordRaw/NiRecordRaw.cpp
+index bfa1a80..00a7713 100644
+--- a/Samples/NiRecordRaw/NiRecordRaw.cpp
++++ b/Samples/NiRecordRaw/NiRecordRaw.cpp
+@@ -30,7 +30,7 @@
+ //---------------------------------------------------------------------------
+ // Defines
+ //---------------------------------------------------------------------------
+-#define SAMPLE_XML_PATH "../../../../Data/SamplesConfig.xml"
++#define SAMPLE_XML_PATH "/etc/openni/SamplesConfig.xml"
+ #define RECORDING_FILE_NAME "recordingWithRaw.oni"
+ #define RAW_NODE_NAME "Raw1"
+ 
+diff --git a/Samples/NiRecordSynthetic/NiRecordSynthetic.cpp b/Samples/NiRecordSynthetic/NiRecordSynthetic.cpp
+index 93579d3..f4caa2a 100644
+--- a/Samples/NiRecordSynthetic/NiRecordSynthetic.cpp
++++ b/Samples/NiRecordSynthetic/NiRecordSynthetic.cpp
+@@ -30,7 +30,7 @@
+ //---------------------------------------------------------------------------
+ // Defines
+ //---------------------------------------------------------------------------
+-#define SAMPLE_XML_PATH "../../../../Data/SamplesConfig.xml"
++#define SAMPLE_XML_PATH "/etc/openni/SamplesConfig.xml"
+ 
+ //---------------------------------------------------------------------------
+ // Macros
+diff --git a/Samples/NiSimpleRead/NiSimpleRead.cpp b/Samples/NiSimpleRead/NiSimpleRead.cpp
+index 44351a7..dd9e57b 100644
+--- a/Samples/NiSimpleRead/NiSimpleRead.cpp
++++ b/Samples/NiSimpleRead/NiSimpleRead.cpp
+@@ -30,7 +30,7 @@
+ //---------------------------------------------------------------------------
+ // Defines
+ //---------------------------------------------------------------------------
+-#define SAMPLE_XML_PATH "../../../../Data/SamplesConfig.xml"
++#define SAMPLE_XML_PATH "/etc/openni/SamplesConfig.xml"
+ #define SAMPLE_XML_PATH_LOCAL "SamplesConfig.xml"
+ 
+ //---------------------------------------------------------------------------
+diff --git a/Samples/NiSimpleSkeleton/NiSimpleSkeleton.cpp b/Samples/NiSimpleSkeleton/NiSimpleSkeleton.cpp
+index 2b8ee3c..21aeb10 100644
+--- a/Samples/NiSimpleSkeleton/NiSimpleSkeleton.cpp
++++ b/Samples/NiSimpleSkeleton/NiSimpleSkeleton.cpp
+@@ -27,7 +27,7 @@
+ //---------------------------------------------------------------------------
+ // Defines
+ //---------------------------------------------------------------------------
+-#define SAMPLE_XML_PATH "../../../../Data/SamplesConfig.xml"
++#define SAMPLE_XML_PATH "/etc/openni/SamplesConfig.xml"
+ #define SAMPLE_XML_PATH_LOCAL "SamplesConfig.xml"
+ 
+ //---------------------------------------------------------------------------
+diff --git a/Samples/NiSimpleViewer/NiSimpleViewer.cpp b/Samples/NiSimpleViewer/NiSimpleViewer.cpp
+index 583cb9e..df98cdc 100644
+--- a/Samples/NiSimpleViewer/NiSimpleViewer.cpp
++++ b/Samples/NiSimpleViewer/NiSimpleViewer.cpp
+@@ -36,7 +36,7 @@ using namespace xn;
+ //---------------------------------------------------------------------------
+ // Defines
+ //---------------------------------------------------------------------------
+-#define SAMPLE_XML_PATH "../../../../Data/SamplesConfig.xml"
++#define SAMPLE_XML_PATH "/etc/openni/SamplesConfig.xml"
+ 
+ #define GL_WIN_SIZE_X 1280
+ #define GL_WIN_SIZE_Y 1024
+diff --git a/Samples/NiUserSelection/UserTracker.cpp b/Samples/NiUserSelection/UserTracker.cpp
+index b22e17b..3bf5c8f 100644
+--- a/Samples/NiUserSelection/UserTracker.cpp
++++ b/Samples/NiUserSelection/UserTracker.cpp
+@@ -31,7 +31,7 @@
+ // the filename for saving/loading calibration.
+ #define XN_CALIBRATION_FILE_NAME "UserCalibration.bin"
+ 
+-#define SAMPLE_XML_PATH "../../../../Data/SamplesConfig.xml"
++#define SAMPLE_XML_PATH "/etc/openni/SamplesConfig.xml"
+ 
+ 
+ float *UserTracker::s_pDepthHist=NULL;
+diff --git a/Samples/NiUserTracker/main.cpp b/Samples/NiUserTracker/main.cpp
+index 491d140..c27cb7d 100644
+--- a/Samples/NiUserTracker/main.cpp
++++ b/Samples/NiUserTracker/main.cpp
+@@ -304,7 +304,7 @@ void glInit (int * pargc, char ** argv)
+ }
+ #endif // USE_GLES
+ 
+-#define SAMPLE_XML_PATH "../../../../Data/SamplesConfig.xml"
++#define SAMPLE_XML_PATH "/etc/openni/SamplesConfig.xml"
+ 
+ #define CHECK_RC(nRetVal, what)										\
+ 	if (nRetVal != XN_STATUS_OK)									\
+diff --git a/Samples/NiViewer/NiViewer.cpp b/Samples/NiViewer/NiViewer.cpp
+index 3e3e342..41d0f1a 100644
+--- a/Samples/NiViewer/NiViewer.cpp
++++ b/Samples/NiViewer/NiViewer.cpp
+@@ -84,7 +84,7 @@ using namespace glh;
+ // --------------------------------
+ // Defines
+ // --------------------------------
+-#define SAMPLE_XML_PATH "../../../../Data/SamplesConfig.xml"
++#define SAMPLE_XML_PATH "/etc/openni/SamplesConfig.xml"
+ 
+ // --------------------------------
+ // Types
+diff --git a/Source/OpenNI/XnOpenNI.cpp b/Source/OpenNI/XnOpenNI.cpp
+index 9600580..1678dc2 100644
+--- a/Source/OpenNI/XnOpenNI.cpp
++++ b/Source/OpenNI/XnOpenNI.cpp
+@@ -6993,7 +6993,7 @@ XN_C_API XnStatus xnScriptNodeRun(XnNodeHandle hScript, XnEnumerationErrors* pEr
+ #elif (CE4100)
+ 	#define XN_OPEN_NI_FILES_LOCATION "/usr/etc/ni/"
+ #elif (XN_PLATFORM == XN_PLATFORM_LINUX_X86 || XN_PLATFORM == XN_PLATFORM_LINUX_ARM || XN_PLATFORM == XN_PLATFORM_MACOSX)
+-	#define XN_OPEN_NI_FILES_LOCATION "/var/lib/ni/"
++	#define XN_OPEN_NI_FILES_LOCATION "/etc/openni/"
+ #elif (XN_PLATFORM == XN_PLATFORM_ANDROID_ARM)
+ 	#define XN_OPEN_NI_FILES_LOCATION "/data/ni/"
+ #else
diff --git a/debian/patches/series b/debian/patches/series
index d33028f..fd424b5 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,2 +1,3 @@
 0001-do-not-build-mono-samples.patch
 0002-Add-SONAME-to-libraries.patch
+0003-Change-path-of-config-files-to-etc-openni.patch

-- 
openni packaging



More information about the pkg-multimedia-commits mailing list