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