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