summaryrefslogtreecommitdiff
path: root/angles.spec
blob: 76d03de974cd80058908547d8da768cbd18f1070 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
%bcond_without tests
%bcond_without weak_deps

%define ros_distro      humble

%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      angles

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

Url:            http://wiki.ros.org/angles
License:        BSD
Source0:        https://github.com/ros/angles/archive/refs/tags/%{version}.tar.gz

Requires: ros-%{ros_distro}-ament-cmake
Requires: ros-%{ros_distro}-ros-workspace

BuildRequires: ros-%{ros_distro}-ament-cmake
BuildRequires: ros-%{ros_distro}-ament-cmake-python
BuildRequires: python3-setuptools
BuildRequires: ros-%{ros_distro}-ros-workspace

%if 0%{?with_tests}
%endif

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

%description
This package provides a set of simple math utilities to work
        with angles. The utilities cover simple things like
        normalizing an angle and conversion between degrees and
        radians. But even if you're trying to calculate things like
        the shortest angular distance between two joint space
        positions of your robot, but the joint motion is constrained
        by joint limits, this package is what you need. The code in
        this package is stable and well tested. There are no plans for
        major changes in the near future.

%prep
%autosetup -n %{RosPkgName}-%{version}
cd angles
# Fix setup.py to use correct package directory for GitHub tar structure
sed -i "s|package_dir={'': 'src'}|package_dir={'': '.'}|" setup.py
# Create resource directory for ament (not in GitHub tar)
mkdir -p resource
touch resource/angles

%build
cd angles

# 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
cd angles
# 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
* Wed Mar 25 2026 Tully Foote tfoote@osrfoundation.org - 1.15.0-1
- Autogenerated by ros-porting-tools