]>
Commit | Line | Data |
---|---|---|
8662bb34 JB |
1 | # |
2 | # Conditional build: | |
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 | |
8 | ||
9 | %if %{with ssse3} | |
10 | %define with_sse3 1 | |
11 | %endif | |
12 | Summary: OpenNI2 framework for Natural Interaction devices | |
13 | Summary(pl.UTF-8): Szkielet OpenNI2 do urządzeń służących interakcji z naturą | |
14 | Name: OpenNI2 | |
15 | Version: 2.2.0.33 | |
16 | %define subver beta2 | |
09d9d1fc | 17 | Release: 0.%{subver}.3 |
8662bb34 JB |
18 | License: Apache v2.0 |
19 | Group: Libraries | |
20 | Source0: https://github.com/occipital/OpenNI2/archive/2.2-%{subver}/%{name}-%{version}.tar.gz | |
21 | # Source0-md5: 3f2cd6a64776821fb2837c442539f65b | |
22 | Patch0: %{name}-system-libs.patch | |
23 | Patch1: %{name}-nosse.patch | |
24 | Patch2: %{name}-link.patch | |
25 | Patch3: %{name}-paths.patch | |
26 | Patch4: %{name}-soname.patch | |
27 | Patch5: %{name}-norpath.patch | |
28 | URL: http://structure.io/openni | |
29 | BuildRequires: OpenGL-devel | |
30 | BuildRequires: OpenGL-glut-devel >= 3 | |
31 | %{?with_apidocs:BuildRequires: doxygen} | |
32 | %{?with_apidocs:BuildRequires: graphviz} | |
33 | %{?with_java:BuildRequires: jdk >= 1.6.0} | |
34 | BuildRequires: libjpeg-devel | |
35 | BuildRequires: libstdc++-devel >= 6:4.0 | |
36 | BuildRequires: libusb-devel >= 1.0.8 | |
37 | BuildRequires: python >= 1:2.6 | |
38 | BuildRequires: rpmbuild(macros) >= 1.566 | |
39 | BuildRequires: sed >= 4.0 | |
40 | BuildRequires: udev-devel | |
41 | # NOTE: other platforms need adding a dozen of defines in Include/Linux-*/*.h | |
576d6160 | 42 | ExclusiveArch: %{ix86} %{x8664} x32 arm |
8662bb34 JB |
43 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
44 | ||
45 | %ifarch %{ix86} | |
46 | %define openni_platform x86 | |
47 | %endif | |
576d6160 | 48 | %ifarch %{x8664} x32 |
8662bb34 JB |
49 | %define openni_platform x64 |
50 | %endif | |
51 | %ifarch arm | |
52 | %define openni_platform Arm | |
53 | %endif | |
54 | ||
55 | %description | |
56 | OpenNI2 framework provides an application programming interface (API) | |
57 | for writing applications utilizing natural interaction. This API | |
58 | covers communication with both low level devices (e.g. vision and | |
59 | audio sensors), as well as high-level middleware solutions (e.g. for | |
60 | visual tracking using computer vision). | |
61 | ||
62 | The OpenNI2 Framework provides the interface for physical devices and | |
63 | for middleware components. The API enables modules to be registered in | |
64 | the OpenNI2 framework and used to produce sensory data. Selecting the | |
65 | hardware or middleware module is easy and flexible. | |
66 | ||
67 | %description -l pl.UTF-8 | |
68 | Szkielet OpenNI2 zapewnia interfejs programistyczny (API) dla | |
69 | aplikacji wykorzystujących interakcję z naturą. API to pokrywa | |
70 | komunikację zarówno z urządzeniami niskiego poziomu (takimi jak | |
71 | czujniki obrazu i dźwięku), jak i rozwiązaniami wysokiego poziomu | |
72 | warstwy pośredniej (np. do wizualnego śledzenia przy użyciu obrazu | |
73 | komputerowego). | |
74 | ||
75 | Szkielet OpenNI2 zapewnia interfejs dla fizycznych urządzeń oraz | |
76 | komponentów warstwy pośredniej. API pozwala na rejestrowanie modułów w | |
77 | szkielecie OpenNI2 i wykorzystywanie do tworzenia danych | |
78 | sensorycznych. Wybór sprzętu i modułu pośredniego jest prosty i | |
79 | elastyczny. | |
80 | ||
81 | %package devel | |
82 | Summary: Header files for OpenNI2 library | |
83 | Summary(pl.UTF-8): Pliki nagłówkowe biblioteki OpenNI2 | |
84 | Group: Development/Libraries | |
85 | Requires: %{name} = %{version}-%{release} | |
86 | ||
87 | %description devel | |
88 | Header files for OpenNI2 library. | |
89 | ||
90 | %description devel -l pl.UTF-8 | |
91 | Pliki nagłówkowe biblioteki OpenNI2. | |
92 | ||
93 | %package apidocs | |
94 | Summary: OpenNI2 API documentation | |
95 | Summary(pl.UTF-8): Dokumentacja API biblioteki OpenNI2 | |
96 | Group: Documentation | |
97 | %if "%{_rpmversion}" >= "5" | |
98 | BuildArch: noarch | |
99 | %endif | |
100 | ||
101 | %description apidocs | |
102 | API and internal documentation for OpenNI2 library. | |
103 | ||
104 | %description apidocs -l pl.UTF-8 | |
105 | Dokumentacja API biblioteki OpenNI2. | |
106 | ||
107 | %package -n java-OpenNI2 | |
108 | Summary: Java wrapper for OpenNI2 | |
109 | Summary(pl.UTF-8): Interfejs Javy do OpenNI2 | |
110 | Group: Libraries/Java | |
111 | Requires: %{name} = %{version}-%{release} | |
112 | Requires: jpackage-utils | |
113 | Requires: jre >= 1.6.0 | |
114 | ||
115 | %description -n java-OpenNI2 | |
116 | Java wrapper for OpenNI2. | |
117 | ||
118 | %description -n java-OpenNI2 -l pl.UTF-8 | |
119 | Interfejs Javy do OpenNI2. | |
120 | ||
121 | %prep | |
122 | %setup -q -n %{name}-2.2-%{subver} | |
123 | %patch0 -p1 | |
124 | %patch1 -p1 | |
125 | %patch2 -p1 | |
126 | %patch3 -p1 | |
127 | %patch4 -p1 | |
128 | %patch5 -p1 | |
129 | ||
130 | %build | |
131 | export CFLAGS="%{rpmcflags} -Wno-unused-local-typedefs -Wno-enum-compare" | |
132 | %{__make} \ | |
133 | CFG=Release \ | |
134 | CXX="%{__cxx}" \ | |
135 | HOSTPLATFORM=%{openni_platform} \ | |
136 | SSE_GENERATION=%{?with_sse3:3}%{!?with_sse3:%{?with_sse2:2}} \ | |
137 | %{?with_ssse3:SSSE3_ENABLED=1} \ | |
138 | %{!?with_java:ALL_JAVA_PROJS= JAVA_SAMPLES=} | |
139 | ||
140 | %if %{with apidocs} | |
141 | cd Source/Documentation | |
142 | doxygen Doxyfile | |
143 | %if %{with java} | |
144 | javadoc -d java $(find ../../Wrappers/java/OpenNI.java/src/org/openni -type f) | |
145 | %endif | |
146 | %endif | |
147 | ||
148 | %install | |
149 | rm -rf $RPM_BUILD_ROOT | |
150 | install -d $RPM_BUILD_ROOT{%{_bindir},%{_libdir}/OpenNI2/Drivers,%{_pkgconfigdir},%{_includedir}/openni2,/lib/udev/rules.d} | |
151 | ||
152 | # upstream "install" - no FHS support | |
153 | #Packaging/Harvest.py $RPM_BUILD_ROOT %{openni_platform} | |
154 | ||
155 | BDIR=Bin/%{openni_platform}-Release | |
156 | install -p ${BDIR}/{NiViewer,PS1080Console,PSLinkConsole} $RPM_BUILD_ROOT%{_bindir} | |
157 | cp -dpr ${BDIR}/libOpenNI2.so* $RPM_BUILD_ROOT%{_libdir} | |
158 | cp -p Config/OpenNI.ini $RPM_BUILD_ROOT%{_libdir} | |
159 | install -p ${BDIR}/OpenNI2/Drivers/*.so $RPM_BUILD_ROOT%{_libdir}/OpenNI2/Drivers | |
160 | cp -p Config/OpenNI2/Drivers/*.ini $RPM_BUILD_ROOT%{_libdir}/OpenNI2/Drivers | |
161 | cp -p Packaging/Linux/primesense-usb.rules $RPM_BUILD_ROOT/lib/udev/rules.d/55-primesense-usb.rules | |
162 | cp -p Include/*.h $RPM_BUILD_ROOT%{_includedir}/openni2 | |
163 | cp -pr Include/Driver $RPM_BUILD_ROOT%{_includedir}/openni2 | |
09d9d1fc | 164 | %ifarch %{ix86} %{x8664} x32 |
8662bb34 JB |
165 | cp -pr Include/Linux-x86 $RPM_BUILD_ROOT%{_includedir}/openni2 |
166 | %endif | |
167 | %ifarch arm | |
168 | cp -pr Include/Linux-Arm $RPM_BUILD_ROOT%{_includedir}/openni2 | |
169 | %endif | |
170 | ||
171 | cat >$RPM_BUILD_ROOT%{_pkgconfigdir}/libopenni2.pc <<'EOF' | |
172 | prefix=%{_prefix} | |
173 | libdir=%{_libdir} | |
174 | includedir=%{_includedir}/openni2 | |
175 | ||
176 | Name: OpenNI2 | |
177 | Description: A general purpose driver for all OpenNI cameras. | |
178 | Version: %{version}-%{subver} | |
179 | Cflags: -I${includedir} | |
180 | Libs: -L${libdir} -lOpenNI2 | |
181 | EOF | |
182 | ||
183 | %if %{with java} | |
184 | install -d $RPM_BUILD_ROOT%{_javadir} | |
185 | install -p ${BDIR}/libOpenNI2.jni.so $RPM_BUILD_ROOT%{_libdir} | |
186 | cp -p ${BDIR}/org.openni.jar $RPM_BUILD_ROOT%{_javadir} | |
187 | %endif | |
188 | ||
189 | %clean | |
190 | rm -rf $RPM_BUILD_ROOT | |
191 | ||
192 | %post -p /sbin/ldconfig | |
193 | %postun -p /sbin/ldconfig | |
194 | ||
195 | %post -n java-OpenNI2 -p /sbin/ldconfig | |
196 | %postun -n java-OpenNI2 -p /sbin/ldconfig | |
197 | ||
198 | %files | |
199 | %defattr(644,root,root,755) | |
200 | %doc CHANGES.txt NOTICE README ReleaseNotes.txt | |
201 | %attr(755,root,root) %{_bindir}/NiViewer | |
202 | %attr(755,root,root) %{_bindir}/PS1080Console | |
203 | %attr(755,root,root) %{_bindir}/PSLinkConsole | |
204 | %attr(755,root,root) %{_libdir}/libOpenNI2.so.*.* | |
205 | %{_libdir}/OpenNI.ini | |
206 | %dir %{_libdir}/OpenNI2 | |
207 | %dir %{_libdir}/OpenNI2/Drivers | |
208 | %attr(755,root,root) %{_libdir}/OpenNI2/Drivers/libDummyDevice.so | |
209 | %attr(755,root,root) %{_libdir}/OpenNI2/Drivers/libOniFile.so | |
210 | %attr(755,root,root) %{_libdir}/OpenNI2/Drivers/libPS1080.so | |
211 | %attr(755,root,root) %{_libdir}/OpenNI2/Drivers/libPSLink.so | |
212 | %{_libdir}/OpenNI2/Drivers/PS1080.ini | |
213 | %{_libdir}/OpenNI2/Drivers/PSLink.ini | |
214 | /lib/udev/rules.d/55-primesense-usb.rules | |
215 | ||
216 | %files devel | |
217 | %defattr(644,root,root,755) | |
218 | %attr(755,root,root) %{_libdir}/libOpenNI2.so | |
219 | %{_includedir}/openni2 | |
220 | %{_pkgconfigdir}/libopenni2.pc | |
221 | ||
222 | %if %{with apidocs} | |
223 | %files apidocs | |
224 | %defattr(644,root,root,755) | |
225 | %doc Source/Documentation/html/*.{bmp,css,html,js,png} | |
226 | %endif | |
227 | ||
228 | %if %{with java} | |
229 | %files -n java-OpenNI2 | |
230 | %defattr(644,root,root,755) | |
231 | %attr(755,root,root) %{_libdir}/libOpenNI2.jni.so | |
232 | %{_javadir}/org.openni.jar | |
233 | %endif |