swt2c / rpms / gazebo

Forked from rpms/gazebo 4 years ago
Clone
Blob Blame History Raw
%global abiversion 4.0

Name:           gazebo
Version:        4.0.2
Release:        1%{?dist}
Summary:        3D multi-robot simulator with dynamics

License:        ASL 2.0 and BSD
URL:            http://www.gazebosim.org
Source0:        http://gazebosim.org/assets/distributions/%{name}-%{version}.tar.bz2
Source1:        gazebo.desktop
# This patch unbundles libccd, skyx, and provides the correct search
# path to find ogre.  It also fixes a problem with avformat and avcodec
# not being found when ffmpeg is, and fixes the freeimage pkg-config
# version being used 
Patch0:         %{name}-4.0.2-fedora.patch
# Remove rpath in pkgconfig files
# Not submitted upstream
Patch2:         %{name}-4.0.2-rpath.patch
# Fix an exception that differs in behaviour because of boost differences
# Not submitted upstream
Patch3:         %{name}-2.2.2-connection.patch

# Gazebo requires tbb, which is not available on s390(x)
ExcludeArch:    s390 s390x

BuildRequires:  PyOpenGL
BuildRequires:  boost-devel
BuildRequires:  cmake
BuildRequires:  console-bridge-devel
BuildRequires:  desktop-file-utils
BuildRequires:  doxygen
BuildRequires:  freeimage-devel
BuildRequires:  gdal-devel
BuildRequires:  gperftools-devel
BuildRequires:  graphviz
BuildRequires:  gtest-devel
BuildRequires:  gts-devel
BuildRequires:  libccd-devel
BuildRequires:  libcurl-devel
BuildRequires:  libtar-devel
BuildRequires:  libtool-ltdl-devel
BuildRequires:  libXext-devel
BuildRequires:  libxml2-devel
BuildRequires:  ogre-devel
BuildRequires:  openal-soft-devel
BuildRequires:  protobuf-devel
BuildRequires:  qt-devel
BuildRequires:  rubygem-ronn
BuildRequires:  sdformat-devel >= 2.0.0
BuildRequires:  SkyX-devel
BuildRequires:  tbb-devel
BuildRequires:  tinyxml-devel
BuildRequires:  urdfdom-headers-devel
BuildRequires:  urdfdom-devel

Requires: %{name}-media = %{version}-%{release}
Requires: %{name}-libs%{?_isa} = %{version}-%{release}

%description
Gazebo is a multi-robot simulator for outdoor environments. It is capable of 
simulating a population of robots, sensors and objects in a three-dimensional 
world. It generates both realistic sensor feedback and physically plausible 
interactions between objects.  It includes an accurate simulation of rigid-body 
physics.


%package devel
Summary:        Development files for %{name}
Requires:       %{name}%{?_isa} = %{version}-%{release}
Requires:       %{name}-libs%{?_isa} = %{version}-%{release}
Requires:       %{name}-ode-devel%{?_isa} = %{version}-%{release}
Requires:       boost-devel
Requires:       freeimage-devel
Requires:       gdal-devel
Requires:       ogre-devel
Requires:       protobuf-devel
Requires:       qt-devel
Requires:       sdformat-devel
Requires:       tbb-devel

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

%package common
Summary:       Common directories for %{name}
BuildArch:     noarch

%description common
The %{name}-common package provides common directories for the %{name}
subpackages.

%package libs
Summary:      Shared libraries and plugins for %{name}
Requires:     %{name}-common

%description libs
The %{name}-libs package provides shared libraries and plugins required
at runtime for %{name} and other clients linked against %{name}

%package media
Summary:       Media files for %{name}
Requires:      %{name}-common = %{version}-%{release}
Requires:      %{name} = %{version}-%{release}
Requires:      SkyX
BuildArch:     noarch

%description media
Assets and media files for %{name}

%package ode
Summary:       Gazebo fork of the Open Dynamics Engine

%description ode
Gazebo fork of the Open Dynamics Engine physics library

%package ode-devel
Summary:      Development headers and libraries for gazebo-ode
Requires:     %{name}-ode%{?_isa} = %{version}-%{release}

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

%package -n player-%{name}
Summary:       Gazebo plugin driver for the Player robot server.
Requires:      %{name}-common = %{version}-%{release}
Requires:      %{name}-libs%{?_isa} = %{version}-%{release}
BuildRequires: player-devel

%description -n player-%{name}
Plugin driver for the Player robot server.  Translates gazebo interfaces
to be accessible through the Player server interfaces.

%package doc
Summary:       Development documentation for %{name}
Requires:      %{name} = %{version}-%{release}
BuildArch:     noarch

%description doc
Development documentation for %{name}

%prep
%setup -q
%patch0 -p0 -b .fedora
%patch2 -p0 -b .rpath
%patch3 -p0 -b .connection

# These are either unused, or replaced by system versions
rm -rf deps/ann
rm -rf deps/fcl
rm -rf deps/parallel_quickstep
rm -rf deps/libccd

%build
mkdir build
pushd build
%cmake  \
 -DCMAKE_VERBOSE_MAKEFILE=ON \
 -DLIB_INSTALL_DIR:STRING="%{_lib}" \
%ifnarch x86_64
 -DSSE2_FOUND=OFF \
%else
 -DSSE2_FOUND=ON \
%endif
 -DSSE3_FOUND=OFF \
 -DSSSE3_FOUND=OFF \
 -DSSE4_1_FOUND=OFF \
 -DSSE4_2_FOUND=OFF \
 -Dogre_library_dirs=%{_libdir} \
 -DCMAKE_BUILD_TYPE=RelWithDebInfo \
 -DUSE_UPSTREAM_CFLAGS=OFF \
 -DUSE_HOST_CFLAGS=ON \
 -DCMAKE_INSTALL_DATAROOTDIR=share \
 ..

make %{?_smp_mflags}
make doc %{?_smp_mflags} || exit 0;
mv doxygen_msgs/html{,_msgs}
popd

%install
pushd build
make install DESTDIR=%{buildroot}
popd

# Get rid of SkyX media files; symlink to the files that SkyX provides
rm -fr %{buildroot}%{_datadir}/%{name}-%{abiversion}/media/skyx
ln -s %{_datadir}/SKYX/Media/SkyX/ %{buildroot}%{_datadir}/%{name}-%{abiversion}/media/skyx

# Get rid of bundled fonts
rm -fr %{buildroot}%{_datadir}/%{name}-%{abiversion}/media/fonts/*.ttf

# Install the example files in the datadir.
cp -pr examples/ %{buildroot}%{_datadir}/%{name}-%{abiversion}

# Install the icon.
mkdir -p %{buildroot}%{_datadir}/icons/hicolor/scalable/apps/
# The icon needs to be square to display properly on some systems.
# Edit the shape of the svg and change the viewport so it looks the same.
sed 'N; s/width="\([0-9\.]*\)"\n\([ ]*\)height="\([0-9\.]*\)"/width="\3"\n\2height="\3"\n\2viewBox="0 0 \1 \3"/' \
    gazebo/gui/images/gazebo.svg > %{buildroot}%{_datadir}/icons/hicolor/scalable/apps/%{name}.svg

# Install uncompressed manpages
rm -f %{buildroot}/%{_mandir}/man1/*.gz
install -p -m 0644 build/tools/*[a-z].1 %{buildroot}%{_mandir}/man1/
install -p -m 0644 build/gazebo/*[a-z].1 %{buildroot}%{_mandir}/man1/
install -p -m 0644 build/gazebo/gui/*[a-z].1 %{buildroot}%{_mandir}/man1/

# Install the desktop file.
desktop-file-install  \
    --dir %{buildroot}%{_datadir}/applications \
    %{SOURCE1}

# Private plugin library: get rid of versioned symlinks,
# move into private subdirectory of libdir
mkdir -p %{buildroot}%{_libdir}/player
rm -f %{buildroot}/%{_libdir}/libgazebo_player.so
rm -f %{buildroot}/%{_libdir}/libgazebo_player.so.?
mv %{buildroot}/%{_libdir}/libgazebo_player.so.%{version} %{buildroot}%{_libdir}/player/libgazebo_player.so

%check
# Tests run for informational purposes only
pushd build

# Ignore some tests that will never succeed in the Fedora build system
cat << EOF > CTestCustom.cmake
SET(CTEST_CUSTOM_TESTS_IGNORE
    # OpenAL tests will fail if the builder doesn't have an audio device.
    UNIT_OpenAL_TEST
    check_UNIT_OpenAL_TEST
#    # Since the pkg-config and cmake config have absolute paths,
#    # these tests will fail as long as Gazebo is not actually
#    # installed on the system.
#    EXAMPLE_example_plugins
#    check_EXAMPLE_example_plugins
#    REGRESSION_config-cmake
#    check_REGRESSION_config-cmake
#    REGRESSION_config-pkgconfig
#    check_REGRESSION_config-pkgconfig
    )
EOF
export GAZEBO_RESOURCE_PATH=%{buildroot}%{_datadir}/gazebo-%{abiversion}
export LD_LIBRARY_PATH=%{buildroot}%{_libdir}
export PATH=$PATH:%{buildroot}%{_bindir}
make test || cat Testing/Temporary/LastTest.log
popd

%post
/sbin/ldconfig
/bin/touch --no-create %{_datadir}/icons/hicolor &>/dev/null || :

%postun
/sbin/ldconfig
if [ $1 -eq 0 ] ; then
    /bin/touch --no-create %{_datadir}/icons/hicolor &>/dev/null
    /usr/bin/gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || :
fi

%post ode -p /sbin/ldconfig

%postun ode -p /sbin/ldconfig

%posttrans
/usr/bin/gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || :

%files
%doc AUTHORS COPYING LICENSE
%{_bindir}/*
%{_datadir}/%{name}-%{abiversion}/setup.sh
%{_datadir}/%{name}/setup.sh
%{_datadir}/applications/%{name}.desktop
%{_datadir}/icons/hicolor/scalable/apps/%{name}.svg
%{_mandir}/man1/*.1.*

%files common
%dir %{_datadir}/%{name}-%{abiversion}
%dir %{_datadir}/%{name}-%{abiversion}/examples

%files libs
%exclude %{_libdir}/libgazebo_ode.so.*
%{_libdir}/*.so.*
%{_libdir}/%{name}-%{abiversion}
%{_datadir}/%{name}-%{abiversion}/worlds

%files -n player-%{name}
%{_libdir}/player/libgazebo_player.so
%{_datadir}/%{name}-%{abiversion}/examples/player

%files media
%{_datadir}/%{name}-%{abiversion}/media
%{_datadir}/%{name}-%{abiversion}/models
%files ode
%doc deps/opende/LICENSE-BSD.TXT
%{_libdir}/libgazebo_ode.so.*

%files ode-devel
%{_libdir}/libgazebo_ode.so
%{_libdir}/pkgconfig/gazebo_ode.pc
%dir %{_includedir}/%{name}-%{abiversion}/%{name}
%dir %{_includedir}/%{name}-%{abiversion}
%{_includedir}/%{name}-%{abiversion}/%{name}/ode

%files doc
%doc build/doxygen/html
%doc build/doxygen_msgs/html_msgs

%files devel
%{_datadir}/%{name}-%{abiversion}/examples/plugins
%{_datadir}/%{name}-%{abiversion}/examples/stand_alone
%{_libdir}/*.so
%exclude %{_includedir}/%{name}-%{abiversion}/%{name}/ode
%{_includedir}/%{name}-%{abiversion}
%{_libdir}/pkgconfig/gazebo.pc
%{_libdir}/pkgconfig/gazebo_transport.pc
%{_libdir}/cmake

%changelog
* Sun Nov 02 2014 Rich Mattes <richmattes@gmail.com> - 4.0.2-1
- Update to release 4.0.2

* Mon Oct 20 2014 Rich Mattes <richmattes@gmail.com> - 3.1.0-2
- Devel package requires ogre-devel (rhbz#1154450)

* Sun Sep 28 2014 Rich Mattes <richmattes@gmail.com> - 3.1.0-1
- Update to release 3.1.0

* Fri Sep 12 2014 Rich Mattes <richmattes@gmail.com> - 3.0.0-7
- Add gazebo library path to pkgconfig

* Sat Aug 16 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 3.0.0-6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild

* Wed Jul 23 2014 Rich Mattes <richmattes@gmail.com> - 3.0.0-5
- Add arch specific requirements

* Mon Jun 23 2014 Rich Mattes <richmattes@gmail.com> - 3.0.0-4
- Create a gazebo-common subpackage to own directories in datadir
- Have gazebo and gazebo-media depend on each other
- Remove rpath and other brokenness from pkgconfig and cmake scripts

* Mon Jun 09 2014 Rich Mattes <richmattes@gmail.com> - 3.0.0-3
- Update to address review comments, including:
- Remove libgazebo_player from link library list
- Add patch to gazebo transport to fix boost
- Add gdal-devel to -devel Requires
- Export path and library path before running tests
- Disable tests that don't have the proper build deps
- Dump test logs on test failure

* Wed May 21 2014 Rich Mattes <richmattes@gmail.com> - 3.0.0-2
- Remove fonts from media package

* Mon May 19 2014 Rich Mattes <richmattes@gmail.com> - 3.0.0-1
- Update to release 3.0.0
- Add ODE subpackage

* Mon Mar 03 2014 Rich Mattes <richmattes@gmail.com> - 2.2.1-3
- Fix issues with conflicting ownership of directories in datadir

* Mon Feb 10 2014 Rich Mattes <richmattes@gmail.com> - 2.2.1-2
- Remove libgazebo_player from link list

* Mon Jan 20 2014 Rich Mattes <richmattes@gmail.com> - 2.2.1-1
- Update to release 2.2.1
- Install desktop and icon files using Scott Logan's patch
- Fix gazebo-config.cmake so other CMake projects can build against Gazebo
- Add missing runtime dependencies to the -devel file

* Thu Jan 16 2014 Rich Mattes <richmattes@gmail.com> - 2.1.0-2
- Add patch to fix qreal usage on ARM (upstream issue 1007)

* Sun Jan 05 2014 Rich Mattes <richmattes@gmail.com> - 2.1.0-1
- Update to release 2.1.0

* Sun Oct 06 2013 Rich Mattes <richmattes@gmail.com> - 2.0.0-1
- Update to release 2.0.0

* Sat May 25 2013 Rich Mattes <richmattes@gmail.com> - 1.8.1-1
- Update to release 1.8.1

* Sat Apr 20 2013 Rich Mattes <richmattes@gmail.com> - 1.7.1-1
- Update to release 1.7.1

* Fri Apr 19 2013 Rich Mattes <richmattes@gmail.com> - 1.6.3-1
- Update to release 1.6.3

* Tue Mar 12 2013 Rich Mattes <richmattes@gmail.com> - 1.5.0-1
- Update to release 1.5.0

* Wed Jan 16 2013 Rich Mattes <richmattes@gmail.com> - 1.3.1-1
- Update to release 1.3.1

* Fri Nov 09 2012 Rich Mattes <richmattes@gmail.com> - 1.2.6-1
- Update to release 1.2.6

* Mon Oct 29 2012 Rich Mattes <richmattes@gmail.com> - 1.2.5-1
- Update to release 1.2.5

* Tue Oct 16 2012 Rich Mattes <richmattes@gmail.com> - 1.2.2-1
- Update to release 1.2.2

* Tue May 29 2012 Rich Mattes <richmattes@gmail.com> - 1.0.1-2
- Clean up patches, incorperate build system fixes to patches
- Add player subpackage

* Fri May 25 2012 Rich Mattes <richmattes@gmail.com> - 1.0.1-1
- Update to version 1.0.1

* Thu Apr 26 2012 Rich Mattes <richmattes@gmail.com> - 1.0.0-1
- Initial package