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