%bcond_without tests
%bcond_without weak_deps

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

%define RosPkgName      ros2cli
%define ros_distro      humble

Name:           ros-%{ros_distro}-%{RosPkgName}
Version:        0.18.6
Release:        1%{?dist}%{?release_suffix}
Summary:        ROS ros2cli package

License:        Apache License 2.0
Source0:        %{name}_%{version}.orig.tar.gz

Requires: python3-argcomplete
Requires: python3-importlib-metadata
Requires: python3-netifaces
Requires: python3-packaging
Requires: python3-setuptools
Requires: ros-%{ros_distro}-rclpy
Requires: ros-%{ros_distro}-ros-workspace

BuildRequires: ros-%{ros_distro}-ros-workspace

%if 0%{?with_tests}
BuildRequires: ros-%{ros_distro}-ament-copyright
BuildRequires: ros-%{ros_distro}-ament-flake8
BuildRequires: ros-%{ros_distro}-ament-pep257
BuildRequires: ros-%{ros_distro}-ament-xmllint
BuildRequires: python3-pytest
BuildRequires: python3-pytest-timeout
BuildRequires: ros-%{ros_distro}-test-msgs
%endif

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

%description

    Framework for ROS 2 command line tools.
  

%prep
%autosetup -p1

%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/ros/%{ros_distro}/setup.sh" ]; then . "/opt/ros/%{ros_distro}/setup.sh"; fi
%py3_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/ros/%{ros_distro}/setup.sh" ]; then . "/opt/ros/%{ros_distro}/setup.sh"; fi
%py3_install -- --prefix "/opt/ros/%{ros_distro}"

%if 0%{?with_tests}
%check
# Look for a directory with a name indicating that it contains tests
TEST_TARGET=$(ls -d * | grep -m1 "\(test\|tests\)" ||:)
if [ -n "$TEST_TARGET" ] && %__python3 -m pytest --version; 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/ros/%{ros_distro}/setup.sh" ]; then . "/opt/ros/%{ros_distro}/setup.sh"; fi
%__python3 -m pytest $TEST_TARGET || echo "RPM TESTS FAILED"
else echo "RPM TESTS SKIPPED"; fi
%endif

%files
/opt/ros/%{ros_distro}

%changelog
* Thu May 04 2023 Aditya Pande aditya.pande@openrobotics.org - 0.18.6-1
- Autogenerated by ros-porting-tools