Blob Blame History Raw
%{!?python_sitearch: %define python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib(1)")}

Name:           player
Version:        2.1.1
Release:        6%{?dist}
Summary:        Cross-platform robot device interface and server

Group:          Applications/System
License:        GPLv2+ and LGPLv2+
URL:            http://playerstage.sourceforge.net
Source0:        http://mesh.dl.sourceforge.net/sourceforge/playerstage/%{name}-%{version}.tar.bz2
Source1:        playernav.desktop 
Source2:        playercam.desktop 
Source3:        playerv.desktop 
Patch0:         %{name}-2.1.1-gcc43.patch
Patch1:         %{name}-2.1.1-norpath.patch
Patch2:         %{name}-2.1.0rc2-paths.patch
Patch3:         %{name}-2.1.1-plugindir.patch
Patch4:         %{name}-2.1.1-pkgconfig.patch
BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)

BuildRequires:  autoconf, automake
BuildRequires:  libtool, libtool-ltdl-devel
%if 0%{?fedora} <= 9
BuildRequires:  geos-devel
%endif
BuildRequires:  libraw1394-devel, libdc1394-devel
BuildRequires:  opencv-devel
BuildRequires:  alsa-lib-devel
BuildRequires:  libstatgrab-devel
BuildRequires:  libpqxx-devel
BuildRequires:  gsl-devel
BuildRequires:  python, python-devel, swig
BuildRequires:  libjpeg-devel
BuildRequires:  openssl-devel
BuildRequires:  ImageMagick-devel
BuildRequires:  gtk2-devel, libgnomecanvas-devel
BuildRequires:  mesa-libGL-devel, freeglut-devel
BuildRequires:  boost-devel
BuildRequires:  avahi-compat-howl-devel
BuildRequires:  zlib-devel
BuildRequires:  doxygen, graphviz
BuildRequires:  desktop-file-utils

%description
Player is a network server for robot control. Running on your robot, Player
provides a clean and simple interface to the robot's sensors and actuators
over the IP network. Your client program talks to Player over a TCP socket,
reading data from sensors, writing commmands to actuators, and configuring
devices on the fly. Player supports a variety of robot hardware.


%package devel
Summary: Header files and libraries for %{name}
Group: Development/Libraries
Requires: %{name} = %{version}-%{release}
Requires: pkgconfig

%description devel
This package contains the header files and libraries
for %{name}. If you like to develop programs using %{name},
you will need to install %{name}-devel.

%package doc
Summary: Development documentation for Player
Group: Documentation

%description doc
This package contains the development documentation for Player.

%package python
Summary: Player Python bindings
Group: Development/Libraries
Requires: %{name} = %{version}-%{release}
Requires: python >= 2.5

%description python
This package contains the Python bindings for %{name}.
If you like to develop programs using %{name} in Python
you will need to install this package.

%package examples
Summary:  Examples for Player
Group:    Development/Tools
Requires: %{name} = %{version}-%{release}

%description examples
This package contains examples for Player.

%package static
Summary: Static libraries for %{name}
Group: Development/Libraries
Requires: %{name}-devel = %{version}-%{release}

%description static
This package contains static libraries that can be used to
compile static binaries using Player.


%prep
%setup -q -n %{name}-%{version}
%patch0 -p1 -b .gcc43
%patch1 -p1 -b .norpath
%patch2 -p1 -b .paths
%patch3 -p1 -b .plugindir
%patch4 -p1 -b .pkgconfig


%build
# Required because patches modify .am files
aclocal
autoreconf
# Broken: --enable-alsa --enable-sonartoranger --enable-lasertoranger
find ./ -name '*.c' -exec chmod a-x {} \;
find ./ -name '*.cc' -exec chmod a-x {} \;
find ./ -name '*.cpp' -exec chmod a-x {} \;
find ./ -name '*.h' -exec chmod a-x {} \;
%configure --enable-playersd
# Get rid of rpath
sed -i 's|^hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=""|g' libtool
sed -i 's|^runpath_var=LD_RUN_PATH|runpath_var=DIE_RPATH_DIE|g' libtool
# no smp flags, does not work properly: %{?_smp_mflags}
make
pushd doc
doxygen player.dox
popd


%install
rm -rf $RPM_BUILD_ROOT
make install DESTDIR=$RPM_BUILD_ROOT
for f in `ls $RPM_BUILD_ROOT%{_bindir}/player*.py`; do mv $f $RPM_BUILD_ROOT%{_bindir}/`basename $f | awk -F. '{ print $1 }'`; done
rm -rf $RPM_BUILD_ROOT%{_datadir}/player/java
find $RPM_BUILD_ROOT -name '*.la' -exec rm {} \;
rm -f $RPM_BUILD_ROOT%{_bindir}/*.pyc
rm -f $RPM_BUILD_ROOT%{_bindir}/*.pyo
#mv $RPM_BUILD_ROOT%{_libdir}/player/examples $RPM_BUILD_ROOT%{_datadir}/player/examples

mkdir -p $RPM_BUILD_ROOT%{_libdir}/%{name}
mv $RPM_BUILD_ROOT%{_libdir}/liblododriver.so.?.?.? $RPM_BUILD_ROOT%{_libdir}/%{name}/liblododriver.so
rm -rf $RPM_BUILD_ROOT%{_libdir}/liblododriver.so*

desktop-file-install --vendor="fedora"               \
--dir=${RPM_BUILD_ROOT}%{_datadir}/applications         \
%{SOURCE1}

desktop-file-install --vendor="fedora"               \
--dir=${RPM_BUILD_ROOT}%{_datadir}/applications         \
%{SOURCE2}

desktop-file-install --vendor="fedora"               \
--dir=${RPM_BUILD_ROOT}%{_datadir}/applications         \
%{SOURCE3}

%clean
rm -rf $RPM_BUILD_ROOT


%post -p /sbin/ldconfig

%postun -p /sbin/ldconfig

%files
%defattr(-,root,root,-)
%doc COPYING COPYING.lib README AUTHORS
%config(noreplace) %{_sysconfdir}/player
%{_bindir}/player*
%{_bindir}/pmaptest
%{_libdir}/*.so.*
%dir %{_datadir}/player
%dir %{_libdir}/player
%{_datadir}/applications/*.desktop
%dir %{_libdir}/%{name}
%{_libdir}/%{name}

%files python
%defattr(-,root,root,-)
%{python_sitearch}/*

%files devel
%defattr(-,root,root,-)
%{_includedir}/player-2.1
%{_libdir}/*.so
%{_libdir}/pkgconfig/*

%files examples
%defattr(-,root,root,-)
%{_libdir}/player/examples

%files doc
%defattr(-,root,root,-)
%doc doc/*.txt
%doc doc/*.html
%doc doc/player-docs

%files static
%defattr(-,root,root,-)
%{_libdir}/*.a

%changelog
* Mon Sep 29 2008 Tim Niemueller <tim@niemueller.de> - 2.1.1-6
- Added pkgconfig patch

* Tue Sep 02 2008 Tim Niemueller <tim@niemueller.de> - 2.1.1-5
- Added plugindir patch

* Fri Aug 15 2008 Tim Niemueller <tim@niemueller.de> - 2.1.1-4
- Changed norpath patch, fixes build problem on Fedora 8
- Added libtool BR
- Added autotools BR, needed because for patches of .am files

* Mon Aug 08 2008 Jef Spaleta <jspaleta at fedoraproject dot org> - 2.1.1-3
- Review clean-ups

* Tue Aug 05 2008 Tim Niemueller <tim@niemueller.de> - 2.1.1-2
- Only BR geos-devel on Fedora 9

* Fri Aug 01 2008 Tim Niemueller <tim@niemueller.de> - 2.1.1-1
- Upgrade to 2.1.1

* Mon Jun 23 2008 Jef Spaleta <jspaleta at fedoraproject dot org> - 2.1.0-0.3.rc2.fc9
- Review clean-ups

* Thu May 22 2008 Tim Niemueller <tim@niemueller.de> - 2.1.0-0.2.rc2.fc9
- Added subpackages for doc and examples
- Remove *.la files
- Fix BuildRequires

* Thu May 08 2008 Tim Niemueller <tim@niemueller.de> - 2.1.0-0.1.rc2.fc9
- Initial spec file