3 %bcond_without apidocs # API documentation
4 %bcond_without java # Java wrappers
5 %bcond_with sse2 # use SSE2 instructions
6 %bcond_with sse3 # use SSE3 instructions
7 %bcond_with ssse3 # use SSE3 and SSSE3 instructions
12 Summary: OpenNI2 framework for Natural Interaction devices
13 Summary(pl.UTF-8): Szkielet OpenNI2 do urządzeń służących interakcji z naturą
17 Release: 0.%{subver}.2
20 Source0: https://github.com/occipital/OpenNI2/archive/2.2-%{subver}/%{name}-%{version}.tar.gz
21 # Source0-md5: 3f2cd6a64776821fb2837c442539f65b
22 Patch0: %{name}-system-libs.patch
23 Patch1: %{name}-nosse.patch
24 Patch2: %{name}-link.patch
25 Patch3: %{name}-paths.patch
26 Patch4: %{name}-soname.patch
27 Patch5: %{name}-norpath.patch
28 URL: http://structure.io/openni
29 BuildRequires: OpenGL-devel
30 BuildRequires: OpenGL-glut-devel >= 3
31 %{?with_apidocs:BuildRequires: doxygen}
32 %{?with_apidocs:BuildRequires: graphviz}
33 %{?with_java:BuildRequires: jdk >= 1.6.0}
34 BuildRequires: libjpeg-devel
35 BuildRequires: libstdc++-devel >= 6:4.0
36 BuildRequires: libusb-devel >= 1.0.8
37 BuildRequires: python >= 1:2.6
38 BuildRequires: rpmbuild(macros) >= 1.566
39 BuildRequires: sed >= 4.0
40 BuildRequires: udev-devel
41 # NOTE: other platforms need adding a dozen of defines in Include/Linux-*/*.h
42 ExclusiveArch: %{ix86} %{x8664} x32 arm
43 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
46 %define openni_platform x86
49 %define openni_platform x64
52 %define openni_platform Arm
56 OpenNI2 framework provides an application programming interface (API)
57 for writing applications utilizing natural interaction. This API
58 covers communication with both low level devices (e.g. vision and
59 audio sensors), as well as high-level middleware solutions (e.g. for
60 visual tracking using computer vision).
62 The OpenNI2 Framework provides the interface for physical devices and
63 for middleware components. The API enables modules to be registered in
64 the OpenNI2 framework and used to produce sensory data. Selecting the
65 hardware or middleware module is easy and flexible.
67 %description -l pl.UTF-8
68 Szkielet OpenNI2 zapewnia interfejs programistyczny (API) dla
69 aplikacji wykorzystujących interakcję z naturą. API to pokrywa
70 komunikację zarówno z urządzeniami niskiego poziomu (takimi jak
71 czujniki obrazu i dźwięku), jak i rozwiązaniami wysokiego poziomu
72 warstwy pośredniej (np. do wizualnego śledzenia przy użyciu obrazu
75 Szkielet OpenNI2 zapewnia interfejs dla fizycznych urządzeń oraz
76 komponentów warstwy pośredniej. API pozwala na rejestrowanie modułów w
77 szkielecie OpenNI2 i wykorzystywanie do tworzenia danych
78 sensorycznych. Wybór sprzętu i modułu pośredniego jest prosty i
82 Summary: Header files for OpenNI2 library
83 Summary(pl.UTF-8): Pliki nagłówkowe biblioteki OpenNI2
84 Group: Development/Libraries
85 Requires: %{name} = %{version}-%{release}
88 Header files for OpenNI2 library.
90 %description devel -l pl.UTF-8
91 Pliki nagłówkowe biblioteki OpenNI2.
94 Summary: OpenNI2 API documentation
95 Summary(pl.UTF-8): Dokumentacja API biblioteki OpenNI2
97 %if "%{_rpmversion}" >= "5"
102 API and internal documentation for OpenNI2 library.
104 %description apidocs -l pl.UTF-8
105 Dokumentacja API biblioteki OpenNI2.
107 %package -n java-OpenNI2
108 Summary: Java wrapper for OpenNI2
109 Summary(pl.UTF-8): Interfejs Javy do OpenNI2
110 Group: Libraries/Java
111 Requires: %{name} = %{version}-%{release}
112 Requires: jpackage-utils
113 Requires: jre >= 1.6.0
115 %description -n java-OpenNI2
116 Java wrapper for OpenNI2.
118 %description -n java-OpenNI2 -l pl.UTF-8
119 Interfejs Javy do OpenNI2.
122 %setup -q -n %{name}-2.2-%{subver}
131 export CFLAGS="%{rpmcflags} -Wno-unused-local-typedefs -Wno-enum-compare"
135 HOSTPLATFORM=%{openni_platform} \
136 SSE_GENERATION=%{?with_sse3:3}%{!?with_sse3:%{?with_sse2:2}} \
137 %{?with_ssse3:SSSE3_ENABLED=1} \
138 %{!?with_java:ALL_JAVA_PROJS= JAVA_SAMPLES=}
141 cd Source/Documentation
144 javadoc -d java $(find ../../Wrappers/java/OpenNI.java/src/org/openni -type f)
149 rm -rf $RPM_BUILD_ROOT
150 install -d $RPM_BUILD_ROOT{%{_bindir},%{_libdir}/OpenNI2/Drivers,%{_pkgconfigdir},%{_includedir}/openni2,/lib/udev/rules.d}
152 # upstream "install" - no FHS support
153 #Packaging/Harvest.py $RPM_BUILD_ROOT %{openni_platform}
155 BDIR=Bin/%{openni_platform}-Release
156 install -p ${BDIR}/{NiViewer,PS1080Console,PSLinkConsole} $RPM_BUILD_ROOT%{_bindir}
157 cp -dpr ${BDIR}/libOpenNI2.so* $RPM_BUILD_ROOT%{_libdir}
158 cp -p Config/OpenNI.ini $RPM_BUILD_ROOT%{_libdir}
159 install -p ${BDIR}/OpenNI2/Drivers/*.so $RPM_BUILD_ROOT%{_libdir}/OpenNI2/Drivers
160 cp -p Config/OpenNI2/Drivers/*.ini $RPM_BUILD_ROOT%{_libdir}/OpenNI2/Drivers
161 cp -p Packaging/Linux/primesense-usb.rules $RPM_BUILD_ROOT/lib/udev/rules.d/55-primesense-usb.rules
162 cp -p Include/*.h $RPM_BUILD_ROOT%{_includedir}/openni2
163 cp -pr Include/Driver $RPM_BUILD_ROOT%{_includedir}/openni2
164 %ifarch %{ix86} %{x8664}
165 cp -pr Include/Linux-x86 $RPM_BUILD_ROOT%{_includedir}/openni2
168 cp -pr Include/Linux-Arm $RPM_BUILD_ROOT%{_includedir}/openni2
171 cat >$RPM_BUILD_ROOT%{_pkgconfigdir}/libopenni2.pc <<'EOF'
174 includedir=%{_includedir}/openni2
177 Description: A general purpose driver for all OpenNI cameras.
178 Version: %{version}-%{subver}
179 Cflags: -I${includedir}
180 Libs: -L${libdir} -lOpenNI2
184 install -d $RPM_BUILD_ROOT%{_javadir}
185 install -p ${BDIR}/libOpenNI2.jni.so $RPM_BUILD_ROOT%{_libdir}
186 cp -p ${BDIR}/org.openni.jar $RPM_BUILD_ROOT%{_javadir}
190 rm -rf $RPM_BUILD_ROOT
192 %post -p /sbin/ldconfig
193 %postun -p /sbin/ldconfig
195 %post -n java-OpenNI2 -p /sbin/ldconfig
196 %postun -n java-OpenNI2 -p /sbin/ldconfig
199 %defattr(644,root,root,755)
200 %doc CHANGES.txt NOTICE README ReleaseNotes.txt
201 %attr(755,root,root) %{_bindir}/NiViewer
202 %attr(755,root,root) %{_bindir}/PS1080Console
203 %attr(755,root,root) %{_bindir}/PSLinkConsole
204 %attr(755,root,root) %{_libdir}/libOpenNI2.so.*.*
205 %{_libdir}/OpenNI.ini
206 %dir %{_libdir}/OpenNI2
207 %dir %{_libdir}/OpenNI2/Drivers
208 %attr(755,root,root) %{_libdir}/OpenNI2/Drivers/libDummyDevice.so
209 %attr(755,root,root) %{_libdir}/OpenNI2/Drivers/libOniFile.so
210 %attr(755,root,root) %{_libdir}/OpenNI2/Drivers/libPS1080.so
211 %attr(755,root,root) %{_libdir}/OpenNI2/Drivers/libPSLink.so
212 %{_libdir}/OpenNI2/Drivers/PS1080.ini
213 %{_libdir}/OpenNI2/Drivers/PSLink.ini
214 /lib/udev/rules.d/55-primesense-usb.rules
217 %defattr(644,root,root,755)
218 %attr(755,root,root) %{_libdir}/libOpenNI2.so
219 %{_includedir}/openni2
220 %{_pkgconfigdir}/libopenni2.pc
224 %defattr(644,root,root,755)
225 %doc Source/Documentation/html/*.{bmp,css,html,js,png}
229 %files -n java-OpenNI2
230 %defattr(644,root,root,755)
231 %attr(755,root,root) %{_libdir}/libOpenNI2.jni.so
232 %{_javadir}/org.openni.jar