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