]> 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 BuildArch:      noarch
99
100 %description doc
101 OpenNI user guide in PDF format.
102
103 %description doc -l pl.UTF-8
104 Podręcznik użytkownika OpenNI w formacie PDF.
105
106 %package apidocs
107 Summary:        OpenNI API documentation
108 Summary(pl.UTF-8):      Dokumentacja API biblioteki OpenNI
109 Group:          Documentation
110 BuildArch:      noarch
111
112 %description apidocs
113 API and internal documentation for OpenNI library.
114
115 %description apidocs -l pl.UTF-8
116 Dokumentacja API biblioteki OpenNI.
117
118 %package -n java-OpenNI
119 Summary:        Java wrapper for OpenNI
120 Summary(pl.UTF-8):      Interfejs Javy do OpenNI
121 Group:          Libraries/Java
122 Requires:       %{name} = %{version}-%{release}
123 Requires:       jpackage-utils
124 Requires:       jre >= 1.6.0
125
126 %description -n java-OpenNI
127 Java wrapper for OpenNI.
128
129 %description -n java-OpenNI -l pl.UTF-8
130 Interfejs Javy do OpenNI.
131
132 %package -n dotnet-OpenNI
133 Summary:        .NET wrapper for OpenNI
134 Summary(pl.UTF-8):      Interfejs .NET do OpenNI
135 Group:          Libraries
136 Requires:       %{name} = %{version}-%{release}
137 Requires:       mono
138
139 %description -n dotnet-OpenNI
140 .NET wrapper for OpenNI.
141
142 %description -n dotnet-OpenNI -l pl.UTF-8
143 Interfejs .NET do OpenNI.
144
145 %prep
146 %setup -q -n %{name}-%{name}-1e9524f
147 %undos Platform/Linux/Build/Samples/NiUserTracker/Makefile
148 %patch0 -p1
149 %patch1 -p1
150 %patch2 -p1
151 %patch3 -p1
152
153 %build
154 %{__make} -C Platform/Linux/Build clean
155 export CFLAGS="%{rpmcflags}"
156 %{__make} -C Platform/Linux/Build \
157         CFG=PLD \
158         CXX="%{__cxx}" \
159         HOSTPLATFORM=%{openni_platform} \
160         SSE_GENERATION=%{?with_sse3:3}%{!?with_sse3:%{?with_sse2:2}} \
161         %{?with_ssse3:SSSE3_ENABLED=1} \
162         %{!?with_java:ALL_JAVA_PROJS= JAVA_SAMPLES=} \
163         MONO_INSTALLED=%{?with_mono:1}
164
165 %if %{with apidocs}
166 cd Source/DoxyGen
167 doxygen Doxyfile
168 %endif
169
170 %install
171 rm -rf $RPM_BUILD_ROOT
172 install -d $RPM_BUILD_ROOT{%{_bindir},%{_libdir},%{_includedir}/ni,/var/lib/ni}
173
174 BDIR=Platform/Linux/Bin/%{openni_platform}-PLD
175 install -p ${BDIR}/ni{Reg,License} $RPM_BUILD_ROOT%{_bindir}
176 install -p ${BDIR}/libOpenNI.so $RPM_BUILD_ROOT%{_libdir}
177 install -p ${BDIR}/libnim{Codecs,MockNodes,Recorder}.so $RPM_BUILD_ROOT%{_libdir}
178 cp -p Include/*.h $RPM_BUILD_ROOT%{_includedir}/ni
179 %ifarch %{ix86} %{x8664} x32
180 cp -pr Include/Linux-x86 $RPM_BUILD_ROOT%{_includedir}/ni
181 %endif
182 %ifarch arm
183 cp -pr Include/Linux-Arm $RPM_BUILD_ROOT%{_includedir}/ni
184 %endif
185
186 %if %{with java}
187 install -d $RPM_BUILD_ROOT%{_javadir}
188 install -p ${BDIR}/libOpenNI.jni.so $RPM_BUILD_ROOT%{_libdir}
189 cp -p ${BDIR}/org.openni.jar $RPM_BUILD_ROOT%{_javadir}
190 %endif
191
192 %if %{with mono}
193 gacutil -i ${BDIR}/OpenNI.net.dll -package 4.5 -root $RPM_BUILD_ROOT%{_prefix}/lib
194 %endif
195
196 install -d $RPM_BUILD_ROOT%{_pkgconfigdir}
197 sed -e 's![@]prefix[@]!%{_prefix}!g' \
198     -e 's![@]exec_prefix[@]!%{_exec_prefix}!g' \
199     -e 's![@]libdir[@]!%{_libdir}!g' \
200     -e 's![@]includedir[@]!%{_includedir}!g' \
201     -e 's![@]version[@]!%{version}!g' \
202     %{SOURCE1} > $RPM_BUILD_ROOT%{_pkgconfigdir}/libopenni.pc
203
204 %clean
205 rm -rf $RPM_BUILD_ROOT
206
207 %post
208 /sbin/ldconfig
209 for mod in libnimMockNodes.so libnimCodecs.so libnimRecorder.so; do
210         %{_bindir}/niReg -r %{_libdir}/$mod
211 done
212
213 %preun
214 if [ "$1" = "0" ]; then
215         for mod in libnimMockNodes.so libnimCodecs.so libnimRecorder.so; do
216                 %{_bindir}/niReg -u %{_libdir}/$mod
217         done
218 fi
219
220 %postun -p /sbin/ldconfig
221
222 %post   -n java-OpenNI -p /sbin/ldconfig
223 %postun -n java-OpenNI -p /sbin/ldconfig
224
225 %files
226 %defattr(644,root,root,755)
227 %doc CHANGES NOTICE README
228 %attr(755,root,root) %{_bindir}/niLicense
229 %attr(755,root,root) %{_bindir}/niReg
230 %attr(755,root,root) %{_libdir}/libOpenNI.so
231 %attr(755,root,root) %{_libdir}/libnimCodecs.so
232 %attr(755,root,root) %{_libdir}/libnimMockNodes.so
233 %attr(755,root,root) %{_libdir}/libnimRecorder.so
234 %dir /var/lib/ni
235
236 %files devel
237 %defattr(644,root,root,755)
238 %{_includedir}/ni
239 %{_pkgconfigdir}/libopenni.pc
240
241 %files doc
242 %defattr(644,root,root,755)
243 %doc Documentation/OpenNI_UserGuide.pdf
244
245 %if %{with apidocs}
246 %files apidocs
247 %defattr(644,root,root,755)
248 %doc Source/DoxyGen/html/*.{bmp,css,html,js,png}
249 %endif
250
251 %if %{with java}
252 %files -n java-OpenNI
253 %defattr(644,root,root,755)
254 %attr(755,root,root) %{_libdir}/libOpenNI.jni.so
255 %{_javadir}/org.openni.jar
256 %endif
257
258 %if %{with mono}
259 %files -n dotnet-OpenNI
260 %defattr(644,root,root,755)
261 %{_prefix}/lib/mono/4.5/OpenNI.net.dll
262 %{_prefix}/lib/mono/gac/OpenNI.net
263 %endif
This page took 0.113848 seconds and 4 git commands to generate.