]> git.pld-linux.org Git - packages/OpenNI2.git/blame - OpenNI2.spec
- fix packaging on x32
[packages/OpenNI2.git] / OpenNI2.spec
CommitLineData
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
12Summary: OpenNI2 framework for Natural Interaction devices
13Summary(pl.UTF-8): Szkielet OpenNI2 do urządzeń służących interakcji z naturą
14Name: OpenNI2
15Version: 2.2.0.33
16%define subver beta2
09d9d1fc 17Release: 0.%{subver}.3
8662bb34
JB
18License: Apache v2.0
19Group: Libraries
20Source0: https://github.com/occipital/OpenNI2/archive/2.2-%{subver}/%{name}-%{version}.tar.gz
21# Source0-md5: 3f2cd6a64776821fb2837c442539f65b
22Patch0: %{name}-system-libs.patch
23Patch1: %{name}-nosse.patch
24Patch2: %{name}-link.patch
25Patch3: %{name}-paths.patch
26Patch4: %{name}-soname.patch
27Patch5: %{name}-norpath.patch
28URL: http://structure.io/openni
29BuildRequires: OpenGL-devel
30BuildRequires: OpenGL-glut-devel >= 3
31%{?with_apidocs:BuildRequires: doxygen}
32%{?with_apidocs:BuildRequires: graphviz}
33%{?with_java:BuildRequires: jdk >= 1.6.0}
34BuildRequires: libjpeg-devel
35BuildRequires: libstdc++-devel >= 6:4.0
36BuildRequires: libusb-devel >= 1.0.8
37BuildRequires: python >= 1:2.6
38BuildRequires: rpmbuild(macros) >= 1.566
39BuildRequires: sed >= 4.0
40BuildRequires: udev-devel
41# NOTE: other platforms need adding a dozen of defines in Include/Linux-*/*.h
576d6160 42ExclusiveArch: %{ix86} %{x8664} x32 arm
8662bb34
JB
43BuildRoot: %{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
56OpenNI2 framework provides an application programming interface (API)
57for writing applications utilizing natural interaction. This API
58covers communication with both low level devices (e.g. vision and
59audio sensors), as well as high-level middleware solutions (e.g. for
60visual tracking using computer vision).
61
62The OpenNI2 Framework provides the interface for physical devices and
63for middleware components. The API enables modules to be registered in
64the OpenNI2 framework and used to produce sensory data. Selecting the
65hardware or middleware module is easy and flexible.
66
67%description -l pl.UTF-8
68Szkielet OpenNI2 zapewnia interfejs programistyczny (API) dla
69aplikacji wykorzystujących interakcję z naturą. API to pokrywa
70komunikację zarówno z urządzeniami niskiego poziomu (takimi jak
71czujniki obrazu i dźwięku), jak i rozwiązaniami wysokiego poziomu
72warstwy pośredniej (np. do wizualnego śledzenia przy użyciu obrazu
73komputerowego).
74
75Szkielet OpenNI2 zapewnia interfejs dla fizycznych urządzeń oraz
76komponentów warstwy pośredniej. API pozwala na rejestrowanie modułów w
77szkielecie OpenNI2 i wykorzystywanie do tworzenia danych
78sensorycznych. Wybór sprzętu i modułu pośredniego jest prosty i
79elastyczny.
80
81%package devel
82Summary: Header files for OpenNI2 library
83Summary(pl.UTF-8): Pliki nagłówkowe biblioteki OpenNI2
84Group: Development/Libraries
85Requires: %{name} = %{version}-%{release}
86
87%description devel
88Header files for OpenNI2 library.
89
90%description devel -l pl.UTF-8
91Pliki nagłówkowe biblioteki OpenNI2.
92
93%package apidocs
94Summary: OpenNI2 API documentation
95Summary(pl.UTF-8): Dokumentacja API biblioteki OpenNI2
96Group: Documentation
97%if "%{_rpmversion}" >= "5"
98BuildArch: noarch
99%endif
100
101%description apidocs
102API and internal documentation for OpenNI2 library.
103
104%description apidocs -l pl.UTF-8
105Dokumentacja API biblioteki OpenNI2.
106
107%package -n java-OpenNI2
108Summary: Java wrapper for OpenNI2
109Summary(pl.UTF-8): Interfejs Javy do OpenNI2
110Group: Libraries/Java
111Requires: %{name} = %{version}-%{release}
112Requires: jpackage-utils
113Requires: jre >= 1.6.0
114
115%description -n java-OpenNI2
116Java wrapper for OpenNI2.
117
118%description -n java-OpenNI2 -l pl.UTF-8
119Interfejs 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
131export 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}
141cd Source/Documentation
142doxygen Doxyfile
143%if %{with java}
144javadoc -d java $(find ../../Wrappers/java/OpenNI.java/src/org/openni -type f)
145%endif
146%endif
147
148%install
149rm -rf $RPM_BUILD_ROOT
150install -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
155BDIR=Bin/%{openni_platform}-Release
156install -p ${BDIR}/{NiViewer,PS1080Console,PSLinkConsole} $RPM_BUILD_ROOT%{_bindir}
157cp -dpr ${BDIR}/libOpenNI2.so* $RPM_BUILD_ROOT%{_libdir}
158cp -p Config/OpenNI.ini $RPM_BUILD_ROOT%{_libdir}
159install -p ${BDIR}/OpenNI2/Drivers/*.so $RPM_BUILD_ROOT%{_libdir}/OpenNI2/Drivers
160cp -p Config/OpenNI2/Drivers/*.ini $RPM_BUILD_ROOT%{_libdir}/OpenNI2/Drivers
161cp -p Packaging/Linux/primesense-usb.rules $RPM_BUILD_ROOT/lib/udev/rules.d/55-primesense-usb.rules
162cp -p Include/*.h $RPM_BUILD_ROOT%{_includedir}/openni2
163cp -pr Include/Driver $RPM_BUILD_ROOT%{_includedir}/openni2
09d9d1fc 164%ifarch %{ix86} %{x8664} x32
8662bb34
JB
165cp -pr Include/Linux-x86 $RPM_BUILD_ROOT%{_includedir}/openni2
166%endif
167%ifarch arm
168cp -pr Include/Linux-Arm $RPM_BUILD_ROOT%{_includedir}/openni2
169%endif
170
171cat >$RPM_BUILD_ROOT%{_pkgconfigdir}/libopenni2.pc <<'EOF'
172prefix=%{_prefix}
173libdir=%{_libdir}
174includedir=%{_includedir}/openni2
175
176Name: OpenNI2
177Description: A general purpose driver for all OpenNI cameras.
178Version: %{version}-%{subver}
179Cflags: -I${includedir}
180Libs: -L${libdir} -lOpenNI2
181EOF
182
183%if %{with java}
184install -d $RPM_BUILD_ROOT%{_javadir}
185install -p ${BDIR}/libOpenNI2.jni.so $RPM_BUILD_ROOT%{_libdir}
186cp -p ${BDIR}/org.openni.jar $RPM_BUILD_ROOT%{_javadir}
187%endif
188
189%clean
190rm -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
This page took 0.129591 seconds and 4 git commands to generate.