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ą
18 Release: 0.%{subver}.%{rel}
21 #Source0Download: https://github.com/structureio/OpenNI2/tags
22 Source0: https://github.com/structureio/OpenNI2/archive/2.2-%{subver}/%{name}-%{version}.tar.gz
23 # Source0-md5: 3f2cd6a64776821fb2837c442539f65b
24 Patch0: %{name}-system-libs.patch
25 Patch1: %{name}-nosse.patch
26 Patch2: %{name}-link.patch
27 Patch3: %{name}-paths.patch
28 Patch4: %{name}-soname.patch
29 Patch5: %{name}-norpath.patch
30 Patch6: %{name}-defines.patch
31 Patch7: %{name}-nowarn.patch
32 Patch8: %{name}-c++.patch
33 URL: http://structure.io/openni
34 BuildRequires: OpenGL-devel
35 BuildRequires: OpenGL-glut-devel >= 3
36 %{?with_apidocs:BuildRequires: doxygen}
37 %{?with_apidocs:BuildRequires: graphviz}
38 %{?with_java:BuildRequires: jdk >= 1.6.0}
39 BuildRequires: libjpeg-devel
40 BuildRequires: libstdc++-devel >= 6:4.0
41 BuildRequires: libusb-devel >= 1.0.8
42 BuildRequires: python >= 1:2.6
43 BuildRequires: rpm-build >= 4.6
44 BuildRequires: rpmbuild(macros) >= 1.566
45 BuildRequires: sed >= 4.0
46 BuildRequires: udev-devel
47 # NOTE: other platforms need adding a dozen of defines in Include/Linux-*/*.h
48 ExclusiveArch: %{ix86} %{x8664} x32 %{arm}
49 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
52 %define openni_platform x86
55 %define openni_platform x64
58 %define openni_platform Arm
62 OpenNI2 framework provides an application programming interface (API)
63 for writing applications utilizing natural interaction. This API
64 covers communication with both low level devices (e.g. vision and
65 audio sensors), as well as high-level middleware solutions (e.g. for
66 visual tracking using computer vision).
68 The OpenNI2 Framework provides the interface for physical devices and
69 for middleware components. The API enables modules to be registered in
70 the OpenNI2 framework and used to produce sensory data. Selecting the
71 hardware or middleware module is easy and flexible.
73 %description -l pl.UTF-8
74 Szkielet OpenNI2 zapewnia interfejs programistyczny (API) dla
75 aplikacji wykorzystujących interakcję z naturą. API to pokrywa
76 komunikację zarówno z urządzeniami niskiego poziomu (takimi jak
77 czujniki obrazu i dźwięku), jak i rozwiązaniami wysokiego poziomu
78 warstwy pośredniej (np. do wizualnego śledzenia przy użyciu obrazu
81 Szkielet OpenNI2 zapewnia interfejs dla fizycznych urządzeń oraz
82 komponentów warstwy pośredniej. API pozwala na rejestrowanie modułów w
83 szkielecie OpenNI2 i wykorzystywanie do tworzenia danych
84 sensorycznych. Wybór sprzętu i modułu pośredniego jest prosty i
88 Summary: Header files for OpenNI2 library
89 Summary(pl.UTF-8): Pliki nagłówkowe biblioteki OpenNI2
90 Group: Development/Libraries
91 Requires: %{name} = %{version}-%{release}
94 Header files for OpenNI2 library.
96 %description devel -l pl.UTF-8
97 Pliki nagłówkowe biblioteki OpenNI2.
100 Summary: OpenNI2 API documentation
101 Summary(pl.UTF-8): Dokumentacja API biblioteki OpenNI2
106 API and internal documentation for OpenNI2 library.
108 %description apidocs -l pl.UTF-8
109 Dokumentacja API biblioteki OpenNI2.
111 %package -n java-OpenNI2
112 Summary: Java wrapper for OpenNI2
113 Summary(pl.UTF-8): Interfejs Javy do OpenNI2
114 Group: Libraries/Java
115 Requires: %{name} = %{version}-%{release}
116 Requires: jpackage-utils
117 Requires: jre >= 1.6.0
119 %description -n java-OpenNI2
120 Java wrapper for OpenNI2.
122 %description -n java-OpenNI2 -l pl.UTF-8
123 Interfejs Javy do OpenNI2.
126 %setup -q -n %{name}-2.2-%{subver}
138 export CFLAGS="%{rpmcflags} -Wno-unused-local-typedefs -Wno-enum-compare -Wno-unused-local-typedefs -Wno-misleading-indentation"
139 export CXXFLAGS="%{rpmcxxflags} -Wno-unused-local-typedefs -Wno-enum-compare -Wno-unused-local-typedefs -Wno-misleading-indentation"
143 HOSTPLATFORM=%{openni_platform} \
144 SSE_GENERATION=%{?with_sse3:3}%{!?with_sse3:%{?with_sse2:2}} \
145 %{?with_ssse3:SSSE3_ENABLED=1} \
146 %{!?with_java:ALL_JAVA_PROJS= JAVA_SAMPLES=}
149 cd Source/Documentation
152 # fails with "unknown tag" errors since Java 8
153 #javadoc -d java $(find ../../Wrappers/java/OpenNI.java/src/org/openni -type f)
158 rm -rf $RPM_BUILD_ROOT
159 install -d $RPM_BUILD_ROOT{%{_bindir},%{_libdir}/OpenNI2/Drivers,%{_pkgconfigdir},%{_includedir}/openni2,/lib/udev/rules.d}
161 # upstream "install" - no FHS support
162 #Packaging/Harvest.py $RPM_BUILD_ROOT %{openni_platform}
164 BDIR=Bin/%{openni_platform}-Release
165 install -p ${BDIR}/{NiViewer,PS1080Console,PSLinkConsole} $RPM_BUILD_ROOT%{_bindir}
166 cp -dpr ${BDIR}/libOpenNI2.so* $RPM_BUILD_ROOT%{_libdir}
167 cp -p Config/OpenNI.ini $RPM_BUILD_ROOT%{_libdir}
168 install -p ${BDIR}/OpenNI2/Drivers/*.so $RPM_BUILD_ROOT%{_libdir}/OpenNI2/Drivers
169 cp -p Config/OpenNI2/Drivers/*.ini $RPM_BUILD_ROOT%{_libdir}/OpenNI2/Drivers
170 cp -p Packaging/Linux/primesense-usb.rules $RPM_BUILD_ROOT/lib/udev/rules.d/55-primesense-usb.rules
171 cp -p Include/*.h $RPM_BUILD_ROOT%{_includedir}/openni2
172 cp -pr Include/Driver $RPM_BUILD_ROOT%{_includedir}/openni2
173 %ifarch %{ix86} %{x8664} x32
174 cp -pr Include/Linux-x86 $RPM_BUILD_ROOT%{_includedir}/openni2
177 cp -pr Include/Linux-Arm $RPM_BUILD_ROOT%{_includedir}/openni2
180 cat >$RPM_BUILD_ROOT%{_pkgconfigdir}/libopenni2.pc <<'EOF'
183 includedir=%{_includedir}/openni2
186 Description: A general purpose driver for all OpenNI cameras.
187 Version: %{version}-%{subver}
188 Cflags: -I${includedir}
189 Libs: -L${libdir} -lOpenNI2
193 install -d $RPM_BUILD_ROOT%{_javadir}
194 install -p ${BDIR}/libOpenNI2.jni.so $RPM_BUILD_ROOT%{_libdir}
195 cp -p ${BDIR}/org.openni.jar $RPM_BUILD_ROOT%{_javadir}
199 rm -rf $RPM_BUILD_ROOT
201 %post -p /sbin/ldconfig
202 %postun -p /sbin/ldconfig
204 %post -n java-OpenNI2 -p /sbin/ldconfig
205 %postun -n java-OpenNI2 -p /sbin/ldconfig
208 %defattr(644,root,root,755)
209 %doc CHANGES.txt NOTICE README ReleaseNotes.txt
210 %attr(755,root,root) %{_bindir}/NiViewer
211 %attr(755,root,root) %{_bindir}/PS1080Console
212 %attr(755,root,root) %{_bindir}/PSLinkConsole
213 %attr(755,root,root) %{_libdir}/libOpenNI2.so.*.*
214 %{_libdir}/OpenNI.ini
215 %dir %{_libdir}/OpenNI2
216 %dir %{_libdir}/OpenNI2/Drivers
217 %attr(755,root,root) %{_libdir}/OpenNI2/Drivers/libDummyDevice.so
218 %attr(755,root,root) %{_libdir}/OpenNI2/Drivers/libOniFile.so
219 %attr(755,root,root) %{_libdir}/OpenNI2/Drivers/libPS1080.so
220 %attr(755,root,root) %{_libdir}/OpenNI2/Drivers/libPSLink.so
221 %{_libdir}/OpenNI2/Drivers/PS1080.ini
222 %{_libdir}/OpenNI2/Drivers/PSLink.ini
223 /lib/udev/rules.d/55-primesense-usb.rules
226 %defattr(644,root,root,755)
227 %attr(755,root,root) %{_libdir}/libOpenNI2.so
228 %{_includedir}/openni2
229 %{_pkgconfigdir}/libopenni2.pc
233 %defattr(644,root,root,755)
234 %doc Source/Documentation/html/*.{bmp,css,html,js,png}
238 %files -n java-OpenNI2
239 %defattr(644,root,root,755)
240 %attr(755,root,root) %{_libdir}/libOpenNI2.jni.so
241 %{_javadir}/org.openni.jar