Blob Blame History Raw
#define gitrev 342e334c

Name:           openni-primesense
Version:        5.0.3.3
Release:        2%{?gitrev}%{?dist}
Summary:        PrimeSensor/Kinect Modules for OpenNI
Group:          System Environment/Libraries
License:        LGPLv3+
URL:            https://github.com/PrimeSense/Sensor
# No official releases, yet. To reproduce tarball (adapt version and gitrev):
# git clone https://github.com/PrimeSense/Sensor.git
# cd Sensor
# git archive --format tar --prefix=openni-primesensor-5.0.3.3/ Stable-5.0.3.3 | tar -xC..
# cd ..
# rm -rf openni-primesensor-5.0.3.3/Platform/Win32
# tar cvfz openni-primesensor-5.0.3.3.tar.gz openni-primesensor-5.0.3.3
Source0:        openni-primesense-%{version}.tar.gz
Source1:        openni-primesense-55-primesense-usb.rules
Patch0:         openni-primesense-5.0.3.3-fedora.patch
Patch1:         openni-primesense-5.0.3.3-willowgarage.patch
Patch2:         openni-primesense-5.0.3.3-disable-sse.patch
BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
ExclusiveArch:  %{ix86} x86_64 

BuildRequires:  openni-devel >= 1.3.2.1, python
BuildRequires:  dos2unix
BuildRequires:  libjpeg-devel
Requires:       openni >= 1.3.2.1
Requires:       udev

%description
This modules enables OpenNI to make use of the PrimeSense, also known as
Kinect depth camera.

%package        devel
Summary:        Development files for %{name}
Group:          Development/Libraries
Requires:       %{name} = %{version}-%{release}
Requires:       openni-devel

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


%prep
%setup -q -n %{name}-%{version}
%patch0 -p1 -b .fedora
%patch1 -p1 -b .willow
%patch2 -p1 -b .disable-sse

dos2unix LGPL.txt
rm -rf Source/External/LibJPEG


%build
cd Platform/Linux-x86/CreateRedist
# Add SSE_GENERATION=2 (or 3) to enable SSE
sed -i 's|make PLATFORM=$PLATFORM -C ../Build|make PLATFORM=$PLATFORM -C ../Build CFLAGS_EXT="%{optflags} -Wno-unknown-pragmas" DEBUG=1|' RedistMaker
./RedistMaker


%install
rm -rf $RPM_BUILD_ROOT
pushd Platform/Linux-x86/Redist
INSTALL_LIB=$RPM_BUILD_ROOT%{_libdir} \
INSTALL_BIN=$RPM_BUILD_ROOT%{_bindir} \
INSTALL_ETC=$RPM_BUILD_ROOT%{_sysconfdir}/openni/primesense \
SERVER_LOGS_DIR=$RPM_BUILD_ROOT%{_var}/log/primesense \
INSTALL_RULES=$RPM_BUILD_ROOT%{_sysconfdir}/udev/rules.d \
./install.sh -n
popd

rm -rf $RPM_BUILD_ROOT%{_var}/log/primesense

rm $RPM_BUILD_ROOT%{_sysconfdir}/udev/rules.d/55-primesense-usb.rules
install -m 0644 %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/udev/rules.d/55-primesense-usb.rules


%clean
rm -rf $RPM_BUILD_ROOT


%post
/sbin/ldconfig
if [ $1 == 1 ]; then
  niReg -r %{_libdir}/libXnDeviceSensorV2.so
  niReg -r %{_libdir}/libXnDeviceFile.so
fi


%preun
if [ $1 == 0 ]; then
  niReg -u %{_libdir}/libXnDeviceSensorV2.so
  niReg -u %{_libdir}/libXnDeviceFile.so
fi


%postun -p /sbin/ldconfig


%files
%defattr(-,root,root,-)
%doc LGPL.txt
%dir %{_sysconfdir}/openni/primesense
%config(noreplace) %{_sysconfdir}/openni/primesense/*
%config(noreplace) %{_sysconfdir}/udev/rules.d/55-primesense-usb.rules
%{_libdir}/*.so
%{_bindir}/XnSensorServer

%changelog
* Fri Jan 13 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 5.0.3.3-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild

* Thu Dec 22 2011 Tim Niemueller <tim@niemueller.de> - 5.0.3.3-1
- Drop git suffix, we package a stable version
- Update udev file not to use deprecated SYSFS entries

* Mon Dec 19 2011 Tim Niemueller <tim@niemueller.de> - 5.0.3.3-0.2.git342e334c
- Disable SSE

* Thu Sep 01 2011 Tim Niemueller <tim@niemueller.de> - 5.0.3.3-0.1.git342e334c
- Update to 5.0.3.3, closer to upstream, including Willow Garage patch

* Mon Jun 27 2011 Rex Dieter <rdieter@fedoraproject.org> 5.0.0.25-0.5.git894cea01
- ExclusiveArch: %%ix86 x86_64 (#709720)

* Thu Mar 03 2011 Tim Niemueller <tim@niemueller.de> - 5.0.0.25-0.4.git894cea01
- Exclude arch ppc64 (openni not available)

* Sat Feb 26 2011 Tim Niemueller <tim@niemueller.de> - 5.0.0.25-0.3.git894cea01
- BuildRequire libjpeg-devel

* Sat Feb 19 2011 Tim Niemueller <tim@niemueller.de> - 5.0.0.25-0.2.git894cea01
- Fix version number according to guidelines
- Fix line endings of license file
- Do not package meaningless README file
- Use only SYSFS and not both, SYSFS and ATTRS in udev rules
- Remove jpeg lib coming with the package in setup phase, add according patch

* Thu Jan 20 2011 Tim Niemueller <tim@niemueller.de> - 5.0.0.25-0.1.git894cea01
- Initial revision