File python3-python-qt-binding.spec of Package python3-python-qt-binding

%bcond_without tests
%bcond_without weak_deps

%global reponame python_qt_binding

%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:           python3-python-qt-binding
Version:        2.4.0
Release:        1%{?dist}%{?release_suffix}
Summary:        ROS python_qt_binding package

License:        BSD
URL:            http://ros.org/wiki/python_qt_binding
%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:         0001-Allow-to-specify-the-used-Python-version.patch
#Patch1:         0002-workaround-for-new-path-sip-dir-in-pyqt5-5.15.0-dfsg.patch

# No devel repos for pure exec
Requires:       libXext
Requires:       python3-qt5
###Requires:       python3-sip
# Why is this here?
#Requires:       redhat-rpm-config
Requires:       ros2-workspace
BuildRequires:  libXext-devel
BuildRequires:  python3-qt5-devel
BuildRequires:  python3-sip-devel
BuildRequires:  qt5-qtbase-devel
#BuildRequires:  redhat-rpm-config
BuildRequires:  ament-cmake
BuildRequires:  ros2-workspace

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

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

%description
This stack provides Python bindings for Qt. There are two providers: pyside and
pyqt. PySide2 is available under the GPL, LGPL and a commercial license. PyQt is
released under the GPL. Both the bindings and tools to build bindings are
included from each available provider. For PySide, it is called
"Shiboken". For PyQt, this is called "SIP". Also provided is
adapter code to make the user's Python code independent of which binding
provider was actually used which makes it very easy to switch between these.

%global debug_package %{nil}
%prep
%if 0%{?commit:1}
# TODO: This line seems to be not correct ...  it is need to have always the reponame
%autosetup -p1
%else
%autosetup -p1 -n %{reponame}-%{version}
%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 \
%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
* Mon Dec 06 2021 Shane Loretz <sloretz@openrobotics.org> - 1.0.8-1
- Autogenerated by Bloom

* Tue Apr 20 2021 Shane Loretz <sloretz@openrobotics.org> - 1.0.7-2
- Autogenerated by Bloom

* Thu Mar 18 2021 Shane Loretz <sloretz@openrobotics.org> - 1.0.7-1
- Autogenerated by Bloom

* Wed Mar 10 2021 Claire Wang <clairewang@openrobotics.org> - 1.0.6-2
- Autogenerated by Bloom

* Mon Mar 08 2021 Claire Wang <clairewang@openrobotics.org> - 1.0.6-1
- Autogenerated by Bloom

openSUSE Build Service is sponsored by