]> git.pld-linux.org Git - packages/OpenNI.git/blame - OpenNI.spec
- added c++ patch (fix define conflict with C++ standard library)
[packages/OpenNI.git] / OpenNI.spec
CommitLineData
15e3f957
JB
1#
2# Conditional build:
3%bcond_without apidocs # API documentation
4%bcond_without java # Java wrappers
5%bcond_without mono # Mono/.NET wrappers
6%bcond_with sse2 # use SSE2 instructions
7%bcond_with sse3 # use SSE3 instructions
8%bcond_with ssse3 # use SSE3 and SSSE3 instructions
becca253 9
f2483281 10%if %{with ssse3}
15e3f957
JB
11%define with_sse3 1
12%endif
22ca4e6e
JR
13%ifarch x32
14%undefine with_mono
15%endif
15e3f957
JB
16Summary: OpenNI framework for Natural Interaction devices
17Summary(pl.UTF-8): Szkielet OpenNI do urządzeń służących interakcji z naturą
18Name: OpenNI
29ecaae7 19Version: 1.5.7.10
e9319efd 20Release: 4
d426bf90 21License: Apache v2.0
15e3f957 22Group: Libraries
29ecaae7
JB
23Source0: https://github.com/OpenNI/OpenNI/tarball/Stable-%{version}/%{name}-%{version}.tar.gz
24# Source0-md5: 5c6072e875a72180a696ee60460ba347
aa6fbcd3 25Source1: libopenni.pc
15e3f957 26Patch0: %{name}-system-libs.patch
29ecaae7 27Patch1: %{name}-nosse.patch
df230194
JB
28Patch2: %{name}-c++.patch
29Patch3: %{name}-mono.patch
30URL: https://github.com/OpenNI/OpenNI/
15e3f957 31BuildRequires: OpenGL-devel
5317508f
JB
32# for examples
33BuildRequires: OpenGL-glut-devel >= 3
15e3f957 34%{?with_apidocs:BuildRequires: doxygen}
15e3f957
JB
35%{?with_apidocs:BuildRequires: graphviz}
36%{?with_java:BuildRequires: jdk >= 1.6.0}
37BuildRequires: libjpeg-devel
38BuildRequires: libstdc++-devel >= 6:4.0
39BuildRequires: libusb-devel >= 1.0.8
40%{?with_mono:BuildRequires: mono-csharp}
41BuildRequires: python >= 1:2.6
4c5a3ffd 42BuildRequires: rpmbuild(macros) >= 1.566
15e3f957 43BuildRequires: sed >= 4.0
7c20a007 44# NOTE: other platforms need adding a dozen of defines in Include/Linux-*/*.h
22ca4e6e 45ExclusiveArch: %{ix86} %{x8664} x32 arm
15e3f957
JB
46BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
47
48%ifarch %{ix86}
49%define openni_platform x86
50%endif
22ca4e6e 51%ifarch %{x8664} x32
15e3f957
JB
52%define openni_platform x64
53%endif
54%ifarch arm
55%define openni_platform Arm
56%endif
57
58%description
59OpenNI framework provides an application programming interface (API)
60for writing applications utilizing natural interaction. This API
61covers communication with both low level devices (e.g. vision and
62audio sensors), as well as high-level middleware solutions (e.g. for
63visual tracking using computer vision).
64
65The OpenNI Framework provides the interface for physical devices and
66for middleware components. The API enables modules to be registered in
67the OpenNI framework and used to produce sensory data. Selecting the
68hardware or middleware module is easy and flexible.
69
70%description -l pl.UTF-8
71Szkielet OpenNI zapewnia interfejs programistyczny (API) dla aplikacji
72wykorzystujących interakcję z naturą. API to pokrywa komunikację
73zarówno z urządzeniami niskiego poziomu (takimi jak czujniki obrazu i
74dźwięku), jak i rozwiązaniami wysokiego poziomu warstwy pośredniej
75(np. do wizualnego śledzenia przy użyciu obrazu komputerowego).
76
77Szkielet OpenNI zapewnia interfejs dla fizycznych urządzeń oraz
78komponentów warstwy pośredniej. API pozwala na rejestrowanie modułów w
79szkielecie OpenNI i wykorzystywanie do tworzenia danych sensorycznych.
80Wybór sprzętu i modułu pośredniego jest prosty i elastyczny.
81
82%package devel
83Summary: Header files for OpenNI library
84Summary(pl.UTF-8): Pliki nagłówkowe biblioteki OpenNI
85Group: Development/Libraries
86Requires: %{name} = %{version}-%{release}
87
88%description devel
89Header files for OpenNI library.
90
91%description devel -l pl.UTF-8
92Pliki nagłówkowe biblioteki OpenNI.
93
94%package doc
95Summary: OpenNI user guide
96Summary(pl.UTF-8): Podręcznik użytkownika OpenNI
97Group: Documentation
58eba6fb
ER
98%if "%{_rpmversion}" >= "5"
99BuildArch: noarch
100%endif
15e3f957
JB
101
102%description doc
103OpenNI user guide in PDF format.
104
105%description doc -l pl.UTF-8
106Podręcznik użytkownika OpenNI w formacie PDF.
107
108%package apidocs
109Summary: OpenNI API documentation
110Summary(pl.UTF-8): Dokumentacja API biblioteki OpenNI
111Group: Documentation
becca253
ER
112%if "%{_rpmversion}" >= "5"
113BuildArch: noarch
114%endif
15e3f957
JB
115
116%description apidocs
117API and internal documentation for OpenNI library.
118
119%description apidocs -l pl.UTF-8
120Dokumentacja API biblioteki OpenNI.
121
122%package -n java-OpenNI
123Summary: Java wrapper for OpenNI
124Summary(pl.UTF-8): Interfejs Javy do OpenNI
125Group: Libraries/Java
126Requires: %{name} = %{version}-%{release}
127Requires: jpackage-utils
128Requires: jre >= 1.6.0
129
130%description -n java-OpenNI
131Java wrapper for OpenNI.
132
133%description -n java-OpenNI -l pl.UTF-8
134Interfejs Javy do OpenNI.
135
136%package -n dotnet-OpenNI
137Summary: .NET wrapper for OpenNI
138Summary(pl.UTF-8): Interfejs .NET do OpenNI
139Group: Libraries
140Requires: %{name} = %{version}-%{release}
141Requires: mono
142
143%description -n dotnet-OpenNI
144.NET wrapper for OpenNI.
145
146%description -n dotnet-OpenNI -l pl.UTF-8
147Interfejs .NET do OpenNI.
148
149%prep
aa6fbcd3 150%setup -q -n %{name}-%{name}-1e9524f
4c5a3ffd 151%undos Platform/Linux/Build/Samples/NiUserTracker/Makefile
15e3f957
JB
152%patch0 -p1
153%patch1 -p1
df230194
JB
154%patch2 -p1
155%patch3 -p1
15e3f957
JB
156
157%build
158%{__make} -C Platform/Linux/Build clean
159export CFLAGS="%{rpmcflags}"
160%{__make} -C Platform/Linux/Build \
161 CFG=PLD \
162 CXX="%{__cxx}" \
163 HOSTPLATFORM=%{openni_platform} \
164 SSE_GENERATION=%{?with_sse3:3}%{!?with_sse3:%{?with_sse2:2}} \
165 %{?with_ssse3:SSSE3_ENABLED=1} \
df230194
JB
166 %{!?with_java:ALL_JAVA_PROJS= JAVA_SAMPLES=} \
167 MONO_INSTALLED=%{?with_mono:1}
15e3f957
JB
168
169%if %{with apidocs}
170cd Source/DoxyGen
171doxygen Doxyfile
172%endif
173
174%install
175rm -rf $RPM_BUILD_ROOT
176install -d $RPM_BUILD_ROOT{%{_bindir},%{_libdir},%{_includedir}/ni,/var/lib/ni}
177
178BDIR=Platform/Linux/Bin/%{openni_platform}-PLD
becca253
ER
179install -p ${BDIR}/ni{Reg,License} $RPM_BUILD_ROOT%{_bindir}
180install -p ${BDIR}/libOpenNI.so $RPM_BUILD_ROOT%{_libdir}
181install -p ${BDIR}/libnim{Codecs,MockNodes,Recorder}.so $RPM_BUILD_ROOT%{_libdir}
15e3f957 182cp -p Include/*.h $RPM_BUILD_ROOT%{_includedir}/ni
22ca4e6e 183%ifarch %{ix86} %{x8664} x32
15e3f957
JB
184cp -pr Include/Linux-x86 $RPM_BUILD_ROOT%{_includedir}/ni
185%endif
186%ifarch arm
187cp -pr Include/Linux-Arm $RPM_BUILD_ROOT%{_includedir}/ni
188%endif
189
190%if %{with java}
191install -d $RPM_BUILD_ROOT%{_javadir}
becca253 192install -p ${BDIR}/libOpenNI.jni.so $RPM_BUILD_ROOT%{_libdir}
29ecaae7 193cp -p ${BDIR}/org.openni.jar $RPM_BUILD_ROOT%{_javadir}
15e3f957
JB
194%endif
195
196%if %{with mono}
197gacutil -i ${BDIR}/OpenNI.net.dll -package 2.0 -root $RPM_BUILD_ROOT%{_prefix}/lib
198%endif
199
aa6fbcd3
AM
200install -d $RPM_BUILD_ROOT%{_pkgconfigdir}
201sed -e 's![@]prefix[@]!%{_prefix}!g' \
202 -e 's![@]exec_prefix[@]!%{_exec_prefix}!g' \
203 -e 's![@]libdir[@]!%{_libdir}!g' \
204 -e 's![@]includedir[@]!%{_includedir}!g' \
205 -e 's![@]version[@]!%{version}!g' \
206 %{SOURCE1} > $RPM_BUILD_ROOT%{_pkgconfigdir}/libopenni.pc
207
15e3f957
JB
208%clean
209rm -rf $RPM_BUILD_ROOT
210
211%post
212/sbin/ldconfig
becca253 213for mod in libnimMockNodes.so libnimCodecs.so libnimRecorder.so; do
15e3f957
JB
214 %{_bindir}/niReg -r %{_libdir}/$mod
215done
216
217%preun
218if [ "$1" = "0" ]; then
becca253 219 for mod in libnimMockNodes.so libnimCodecs.so libnimRecorder.so; do
15e3f957
JB
220 %{_bindir}/niReg -u %{_libdir}/$mod
221 done
222fi
223
224%postun -p /sbin/ldconfig
225
f2483281
JB
226%post -n java-OpenNI -p /sbin/ldconfig
227%postun -n java-OpenNI -p /sbin/ldconfig
228
15e3f957
JB
229%files
230%defattr(644,root,root,755)
29ecaae7 231%doc CHANGES NOTICE README
15e3f957
JB
232%attr(755,root,root) %{_bindir}/niLicense
233%attr(755,root,root) %{_bindir}/niReg
234%attr(755,root,root) %{_libdir}/libOpenNI.so
235%attr(755,root,root) %{_libdir}/libnimCodecs.so
236%attr(755,root,root) %{_libdir}/libnimMockNodes.so
237%attr(755,root,root) %{_libdir}/libnimRecorder.so
c714cde4 238%dir /var/lib/ni
15e3f957
JB
239
240%files devel
241%defattr(644,root,root,755)
242%{_includedir}/ni
aa6fbcd3 243%{_pkgconfigdir}/libopenni.pc
15e3f957
JB
244
245%files doc
246%defattr(644,root,root,755)
247%doc Documentation/OpenNI_UserGuide.pdf
248
249%if %{with apidocs}
250%files apidocs
251%defattr(644,root,root,755)
252%doc Source/DoxyGen/html/*.{bmp,css,html,js,png}
253%endif
254
255%if %{with java}
256%files -n java-OpenNI
257%defattr(644,root,root,755)
258%attr(755,root,root) %{_libdir}/libOpenNI.jni.so
29ecaae7 259%{_javadir}/org.openni.jar
15e3f957
JB
260%endif
261
262%if %{with mono}
263%files -n dotnet-OpenNI
264%defattr(644,root,root,755)
265%{_prefix}/lib/mono/2.0/OpenNI.net.dll
266%{_prefix}/lib/mono/gac/OpenNI.net
267%endif
This page took 0.638026 seconds and 4 git commands to generate.