Blob Blame History Raw
%global commit baec1501c703c731f32eac2bf97c28c77b51fdd8
%global shortcommit %(c=%{commit}; echo ${c:0:7})

%{?filter_setup:
%filter_provides_in %{python_sitearch}/.*\.so$
%filter_setup
}

Name:           libfreenect
Version:        0.5.3
Release:        4%{?dist}
Summary:        Device driver for the Kinect
License:        GPLv2+ or ASL 2.0
URL:            http://www.openkinect.org/

Source0:        https://github.com/OpenKinect/%{name}/archive/%{commit}/%{name}-%{commit}.tar.gz
# Fix python installation path discovery
Patch0:         %{name}-0.5.2-cmake30.patch
# Freenect openni driver is a plugin lib, and doesn't need soversion symlinks
Patch1:         %{name}-0.4.1-openni2.patch
# Detect aarch64
Patch2:         %{name}-0.4.2-aarch64.patch
# Allow for proper libdir
Patch3:         %{name}-0.4.2-libdir.patch
# BZ: https://bugzilla.redhat.com/show_bug.cgi?id=1143912
Patch4:         secarch.patch
# Catch exception in freenect-cppview when a freenect device is not presenet
Patch5:         %{name}-0.5.3-noabort.patch
# Fix const/constexpr usage for c++11
Patch6:         %{name}-0.5.3-cpp11.patch

BuildRequires:  cmake
BuildRequires:  Cython
BuildRequires:  doxygen
BuildRequires:  freeglut-devel
BuildRequires:  libusb1-devel
BuildRequires:  libGL-devel
BuildRequires:  libXi-devel
BuildRequires:  libXmu-devel
BuildRequires:  numpy
BuildRequires:  opencv-devel
BuildRequires:  python-devel

Requires:       udev

%description
libfreenect is a free and open source library that provides access to the
Kinect device.  Currently, the library supports the RGB webcam, the depth
image, the LED, and the tilt motor.


%package        devel
Summary:        Development files for %{name}
Requires:       %{name}%{?_isa} = %{version}-%{release}

%description    devel
The %{name}-devel package contains libraries and header files for
developing applications that use %{name}.

%package        static
Summary:        Development files for %{name}
Requires:       %{name}-devel%{?_isa} = %{version}-%{release}

%description    static
The %{name}-static package contains static libraries for
developing applications that use %{name}.

%package        fakenect
Summary:        Library to play back recorded data for %{name}
Requires:       %{name}%{?_isa} = %{version}-%{release}

%description    fakenect
Fakenect consists of a "record" program to save dumps from the kinect sensor 
and a library that can be linked to, providing an interface compatible with 
freenect.  This allows you to save data and repeat for experiments, debug 
problems, share datasets, and experiment with the kinect without having one.

%package        opencv
Summary:        OpenCV bindings for %{name}
Requires:       %{name}%{?_isa} = %{version}-%{release}

%description    opencv
The %{name}-opencv package contains the libfreenect binding
library for OpenCV development.

%package        python
Summary:        Python bindings for %{name}
Requires:       %{name}%{?_isa} = %{version}-%{release}
Requires:       numpy

%description    python
The %{name}-python package contains python bindings for %{name}

%package        openni
Summary:        OpenNI2 driver for the Kinect

%description    openni
The OpenNI2-FreenectDriver is a bridge to libfreenect implemented as an 
OpenNI2 driver. It allows OpenNI2 to use Kinect hardware on Linux and OSX. 
It was originally a separate project but is now distributed with libfreenect.

%prep
%setup -qn %{name}-%{commit}
rm -rf platform/windows
%patch0 -p0 -b .cmake30
%patch1 -p0 -b .openni2
%patch2 -p0 -b .aarch64
%patch3 -p0 -b .libdir
%patch4 -p1 -b .secarch
%patch5 -p0 -b .noabort
%if 0%{fedora} > 23
%patch6 -p0 -b .cpp11
%endif

%build
mkdir build
pushd build
%cmake .. \
  -DBUILD_AUDIO=ON \
  -DBUILD_C_SYNC=ON \
  -DBUILD_CV=ON \
  -DBUILD_REDIST_PACKAGE=ON \
  -DBUILD_EXAMPLES=ON \
  -DBUILD_FAKENECT=ON \
  -DBUILD_PYTHON=ON  \
  -DBUILD_OPENNI2_DRIVER=ON 

make %{?_smp_mflags} VERBOSE=1
popd

pushd doc
doxygen Doxyfile
popd

%install
rm -rf %{buildroot}
make -C build install DESTDIR=%{buildroot}

# Install the kinect udev rule
mkdir -p %{buildroot}/lib/udev/rules.d
mkdir -p %{buildroot}%{_libdir}/openni2
install -p -m 0644 platform/linux/udev/51-kinect.rules %{buildroot}/lib/udev/rules.d

# Delete libtool archives
find %{buildroot} -name '*.la' -exec rm -f {} ';'

# Move the fwfetcher script to the correct datadir
mkdir -p %{buildroot}%{_datadir}/%{name}
mv %{buildroot}%{_datadir}/fwfetcher.py   %{buildroot}%{_datadir}/%{name}
# Get rid of the hashbang in the fwfetcher song
sed -i "s|#!/usr/bin/env python||" %{buildroot}%{_datadir}/%{name}/fwfetcher.py

# Move openni plugin: rhbz#1094787
mv %{buildroot}%{_libdir}/OpenNI2-FreenectDriver %{buildroot}%{_libdir}/openni2/Drivers

%post -p /sbin/ldconfig

%postun -p /sbin/ldconfig

%post opencv -p /sbin/ldconfig

%postun opencv -p /sbin/ldconfig

%files
%doc APACHE20 GPL2 README.md CONTRIB
/lib/udev/rules.d/*
%{_libdir}/libfreenect.so.*
%{_libdir}/libfreenect_sync.so.*
%exclude %{_bindir}/freenect-cvdemo
%exclude %{_bindir}/fakenect
%{_bindir}/freenect-*
%{_datadir}/%{name}

%files opencv
%{_bindir}/freenect-cvdemo
%{_libdir}/libfreenect_cv.so.*

%files devel
%doc doc/html
%doc examples/*.c wrappers/cpp/cppview.cpp
%{_includedir}/libfreenect
%{_libdir}/*.so
%{_libdir}/pkgconfig/*
%{_libdir}/fakenect/*.so

%files static
%{_libdir}/*.a

%files python
%{python_sitearch}/*.so

%files fakenect
%dir %{_libdir}/fakenect
%{_bindir}/fakenect-record
%{_libdir}/fakenect/*.so.*
%{_bindir}/fakenect
%{_mandir}/man1/fakenect*1.*

%files openni
%{_libdir}/openni2

%changelog
* Tue Jul 19 2016 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.5.3-4
- https://fedoraproject.org/wiki/Changes/Automatic_Provides_for_Python_RPM_Packages

* Sat May 14 2016 Rich Mattes <richmattes@gmail.com> - 0.5.3-3
- Rebuild for opencv-3.1 changes

* Mon May 02 2016 Ralf Corsépius <corsepiu@fedoraproject.org> - 0.5.3-2
- Rebuild for opencv-3.1.0.

* Sun Feb 21 2016 Rich Mattes <richmattes@gmail.com> - 0.5.3-1
- Update to release 0.5.3 (rhbz#1272803)
- Fix rawhide FTBFS (rhbz#1307722)
- Patch freenct-cppview to catch exception when no freenect device is present (rhbz#1310356)

* Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 0.5.2-6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild

* Sat Sep 26 2015 Rich Mattes <richmattes@gmail.com> - 0.5.2-5
- Add dependency on numpy (rhbz#1265472)

* Wed Jun 17 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.5.2-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild

* Sat May 02 2015 Kalev Lember <kalevlember@gmail.com> - 0.5.2-3
- Rebuilt for GCC 5 C++11 ABI change

* Wed Mar 04 2015 Rich Mattes <richmattes@gmail.com> - 0.5.2-1
- Add patch for s390 and ppc (rhbz#1143912)

* Wed Mar 04 2015 Rich Mattes <richmattes@gmail.com> - 0.5.2-1
- Update to release 0.5.2 (rhbz#1160258)

* Tue Aug 19 2014 Jiri Kastner <jkastner /at/ redhat /dot/ com> - 0.5.0-1
- update to release 0.5.0 (rhbz#1124171)
- Move openni plugin to libdir/openni2/Drivers (rhbz#1094787)
 
* Sun Aug 17 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.4.3-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild

* Sat Jun 07 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.4.3-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild

* Sun Jun 01 2014 Rich Mattes <richmattes@gmail.com> - 0.4.3-1
- Update to release 0.4.3
- Move openni plugin to libdir/openni2/ (rhbz#1094787)

* Mon May 05 2014 Rich Mattes <richmattes@gmail.com> - 0.4.2-1
- Update to release 0.4.2
- Add platform detection for aarch64

* Fri May 02 2014 Rich Mattes <richmattes@gmail.com> - 0.4.1-1
- Update to release 0.4.1

* Fri Nov 22 2013 Rich Mattes <richmattes@gmail.com> - 0.2.0-1
- Update to release 0.2.0

* Sat Aug 03 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.1.2-6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild

* Thu Feb 14 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.1.2-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild

* Wed Jan 09 2013 Dan Horák <dan[at]danny.cz> - 0.1.2-4
- fixes for secondary arches

* Sat Nov 10 2012 Rich Mattes <richmattes@gmail.com> - 0.1.2-3
- Rebuild for new OpenCV

* Wed Aug 15 2012 Rich Mattes <richmattes@gmail.com> - 0.1.2-2
- Filtered private python lib provides
- Clarified that freenect_generate_tarball.sh works with a git tag

* Thu Apr 26 2012 Rich Mattes <richmattes@gmail.com> - 0.1.2-1
- Update to git tag 0.1.2
- Create OpenCV wrapper sub-package
- Create fakenect library sub-package

* Thu Mar 24 2011 Rich Mattes <richmattes@gmail.com> - 0-0.3.4a159fgit
- Force cmake to honor rpm optflags
- Change to out-of-tree build

* Thu Mar 24 2011 Rich Mattes <richmattes@gmail.com> - 0-0.2.4a159fgit
- Update to latest snapshot

* Mon Jan 31 2011 Rich Mattes <richmattes@gmail.com> - 0-0.1.687b2da5git
- Initial package