File ros-qt-gui-cpp.spec of Package ros-qt-gui-cpp

%bcond_without tests
%bcond_without weak_deps

%global reponame qt_gui_core
%global subreponame qt_gui_cpp

%global __os_install_post %(echo '%{__os_install_post}' | sed -e 's!/usr/lib[^[:space:]]*/brp-python-bytecompile[[:space:]].*$!!g')
%global __provides_exclude_from ^/opt/ros2/.*$
%global __requires_exclude_from ^/opt/ros2/.*$

Name:           ros-qt-gui-cpp
Version:        2.0.1
Release:        1%{?dist}%{?release_suffix}
Summary:        ROS qt_gui_cpp package

License:        BSD
URL:            http://ros.org/wiki/qt_gui_cpp
%if 0%{?commit:1}
Source0:        https://github.com/ros-visualization/%{reponame}/archive/%{commit}/%{reponame}-%{commit}.tar.gz
%else
Source0:        https://github.com/ros-visualization/%{reponame}/archive/%{version}/%{reponame}-%{version}.tar.gz
%endif
Patch0:         qt_gui_cpp-Remove-vendor-packages-from-qt_gui_cpp-for-the-distr.patch

BuildRequires:  ament-index-cpp
Requires:       ros-pluginlib >= 1.9.23
##Requires:       ros-pluginlib
Requires:       ros-qt-gui >= 0.3.0
##Requires:       ros-qt-gui
Requires:       rcpputils
Requires:       tinyxml2
Requires:       ros2-workspace
#BuildRequires:  pkgconfig
BuildRequires:  qt5-qtbase-devel
BuildRequires:  ament-cmake
# ...-index-cpp-devel
BuildRequires:  ament-index-cpp
BuildRequires:  console-bridge-devel
BuildRequires:  libXext-devel
BuildRequires:  ros-pluginlib >= 1.9.23
##BuildRequires:  ros-pluginlib
BuildRequires:  python3-python-qt-binding >= 0.3.0
##BuildRequires:  python3-python-qt-binding
BuildRequires:  python3-devel
BuildRequires:  python3-sip-devel
BuildRequires:  python3-qt5-devel
BuildRequires:  rcpputils
BuildRequires:  tinyxml2-devel
BuildRequires:  ros2-workspace

Provides:       %{name}-devel = %{version}-%{release}
Provides:       %{name}-doc = %{version}-%{release}
Provides:       %{name}-runtime = %{version}-%{release}

%if 0%{?with_tests:0}
BuildRequires:  ament-cmake-pytest
%endif

%description
qt_gui_cpp provides the foundation for C++-bindings for qt_gui and creates
bindings for every generator available. At least one specific binding must be
available in order to use C++-plugins.

%global debug_package %{nil}
%prep
%if 0%{?commit:1}
%autosetup -p1 -n %{subreponame}
#autosetup -p1
%else
#autosetup -p1 -n %{reponame}-%{version}/%{subreponame}
%setup -q -n %{reponame}-%{version}
%autopatch -p1
%endif

%build
# In case we're installing to a non-standard location, look for a setup.sh
# in the install tree and source it.  It will set things like
# CMAKE_PREFIX_PATH, PKG_CONFIG_PATH, and PYTHONPATH.
if [ -f "/opt/ros2/setup.sh" ]; then . "/opt/ros2/setup.sh"; fi
#mkdir -p obj-%{_target_platform} && cd obj-%{_target_platform}
%cmake3 \
    -UINCLUDE_INSTALL_DIR \
    -ULIB_INSTALL_DIR \
    -USYSCONF_INSTALL_DIR \
    -USHARE_INSTALL_PREFIX \
    -ULIB_SUFFIX \
    -DCMAKE_INSTALL_PREFIX="/opt/ros2" \
    -DAMENT_PREFIX_PATH="/opt/ros2" \
    -DCMAKE_PREFIX_PATH="/opt/ros2" \
    -DSETUPTOOLS_DEB_LAYOUT=OFF \
    -S %{subreponame} \
%if 0%{?with_tests:0}
%else
    -DBUILD_TESTING=OFF
%endif

#make_build
%cmake3_build

%install
# In case we're installing to a non-standard location, look for a setup.sh
# in the install tree and source it.  It will set things like
# CMAKE_PREFIX_PATH, PKG_CONFIG_PATH, and PYTHONPATH.
if [ -f "/opt/ros2/setup.sh" ]; then . "/opt/ros2/setup.sh"; fi
%if 0%{?redhat} == 8 || 0%{?centos} == 8
%make_install -C obj-%{_target_platform}
%else
%cmake3_install
%endif

%if 0%{?with_tests:0}
%check
# Look for a Makefile target with a name indicating that it runs tests
TEST_TARGET=$(%__make -qp -C obj-%{_target_platform} | sed "s/^\(test\|check\):.*/\\1/;t f;d;:f;q0")
if [ -n "$TEST_TARGET" ]; then
# In case we're installing to a non-standard location, look for a setup.sh
# in the install tree and source it.  It will set things like
# CMAKE_PREFIX_PATH, PKG_CONFIG_PATH, and PYTHONPATH.
if [ -f "/opt/ros2/setup.sh" ]; then . "/opt/ros2/setup.sh"; fi
CTEST_OUTPUT_ON_FAILURE=1 \
    %make_build -C obj-%{_target_platform} $TEST_TARGET || echo "RPM TESTS FAILED"
else echo "RPM TESTS SKIPPED"; fi
%endif

%files
/opt/ros2

%changelog
* Thu Apr 29 2021 Dirk Thomas <dthomas@osrfoundation.org> - 2.0.1-1
- Autogenerated by Bloom

* Tue Apr 20 2021 Dirk Thomas <dthomas@osrfoundation.org> - 2.0.0-5
- Autogenerated by Bloom

* Wed Apr 07 2021 Dirk Thomas <dthomas@osrfoundation.org> - 2.0.0-4
- Autogenerated by Bloom

* Thu Mar 11 2021 Dirk Thomas <dthomas@osrfoundation.org> - 2.0.0-3
- Autogenerated by Bloom

* Wed Mar 10 2021 Dirk Thomas <dthomas@osrfoundation.org> - 2.0.0-2
- Autogenerated by Bloom

* Mon Mar 08 2021 Dirk Thomas <dthomas@osrfoundation.org> - 2.0.0-1
- Autogenerated by Bloom

openSUSE Build Service is sponsored by