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