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