diff options
-rw-r--r-- | .gitignore | 1 | ||||
-rw-r--r-- | generate-parameter-library-example-fix-install-name.patch | 76 | ||||
-rw-r--r-- | generate-parameter-library-example.spec | 106 | ||||
-rw-r--r-- | sources | 1 |
4 files changed, 184 insertions, 0 deletions
@@ -0,0 +1 @@ +/ros-humble-generate-parameter-library-example_0.3.3.orig.tar.gz diff --git a/generate-parameter-library-example-fix-install-name.patch b/generate-parameter-library-example-fix-install-name.patch new file mode 100644 index 0000000..5ae4a77 --- /dev/null +++ b/generate-parameter-library-example-fix-install-name.patch @@ -0,0 +1,76 @@ +diff -Naur ros-humble-generate-parameter-library-example-0.3.3/CMakeLists.txt ros-humble-generate-parameter-library-example-0.3.3.bk/CMakeLists.txt +--- ros-humble-generate-parameter-library-example-0.3.3/CMakeLists.txt 2023-04-14 11:42:15.000000000 +0800 ++++ ros-humble-generate-parameter-library-example-0.3.3.bk/CMakeLists.txt 2024-06-22 21:52:24.060412848 +0800 +@@ -6,72 +6,9 @@ + find_package(rclcpp REQUIRED) + find_package(rclcpp_components REQUIRED) + +-generate_parameter_library(admittance_controller_parameters +- src/parameters.yaml +- include/generate_parameter_library_example/example_validators.hpp +-) +- +-add_library(minimal_publisher SHARED +- src/minimal_publisher.cpp +-) +-target_include_directories(minimal_publisher PUBLIC +- $<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/include> +- $<INSTALL_INTERFACE:include/generate_parameter_library_example> +-) +-target_link_libraries(minimal_publisher +- PUBLIC +- admittance_controller_parameters +- rclcpp::rclcpp +- rclcpp_components::component +-) +-rclcpp_components_register_node(minimal_publisher +- PLUGIN "admittance_controller::MinimalPublisher" +- EXECUTABLE test_node +-) +- +-if(BUILD_TESTING) +- find_package(ament_lint_auto REQUIRED) +- set(ament_cmake_cpplint_FOUND TRUE) # Conflicts with clang-foramt +- set(ament_cmake_flake8_FOUND TRUE) # Conflicts with black +- set(ament_cmake_uncrustify_FOUND TRUE) # Conflicts with clang-format +- ament_lint_auto_find_test_dependencies() +- +- find_package(ament_cmake_gtest REQUIRED) +- # example_test_gtest +- add_rostest_with_parameters_gtest(test_example_gtest test/example_test_gtest.cpp +- ${CMAKE_CURRENT_SOURCE_DIR}/test/example_params.yaml) +- target_include_directories(test_example_gtest PRIVATE include) +- target_link_libraries(test_example_gtest admittance_controller_parameters rclcpp::rclcpp) +- # descriptor_test_gtest +- add_rostest_with_parameters_gtest(test_descriptor_gtest test/descriptor_test_gtest.cpp +- ${CMAKE_CURRENT_SOURCE_DIR}/test/example_params.yaml) +- target_include_directories(test_descriptor_gtest PRIVATE include) +- target_link_libraries(test_descriptor_gtest admittance_controller_parameters rclcpp::rclcpp) +- +- find_package(ament_cmake_gmock REQUIRED) +- add_rostest_with_parameters_gmock(test_example_gmock test/example_test_gmock.cpp +- ${CMAKE_CURRENT_SOURCE_DIR}/test/example_params.yaml) +- target_include_directories(test_example_gmock PRIVATE include) +- target_link_libraries(test_example_gmock admittance_controller_parameters rclcpp::rclcpp) +-endif() +- + install( + DIRECTORY include/ + DESTINATION include/generate_parameter_library_example + ) + +-install(TARGETS minimal_publisher admittance_controller_parameters +- EXPORT export_generate_parameter_library_example +- ARCHIVE DESTINATION lib +- LIBRARY DESTINATION lib +- RUNTIME DESTINATION bin +-) +- +-install( +- TARGETS test_node +- DESTINATION lib/generate_parameter_library_example +-) +- +-ament_export_targets(export_generate_parameter_library_example HAS_LIBRARY_TARGET) +-ament_export_dependencies(rclcpp rclcpp_components) + ament_package() diff --git a/generate-parameter-library-example.spec b/generate-parameter-library-example.spec new file mode 100644 index 0000000..864c942 --- /dev/null +++ b/generate-parameter-library-example.spec @@ -0,0 +1,106 @@ +%bcond_without tests +%bcond_without weak_deps + +%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}/.*$ +%global debug_package %{nil} + +%define RosPkgName generate-parameter-library-example +%define ros_distro humble + +Name: ros-%{ros_distro}-%{RosPkgName} +Version: 0.3.3 +Release: 1%{?dist}%{?release_suffix} +Summary: Example usage of generate_parameter_library. + +License: BSD-3-Clause +Source0: %{name}_%{version}.orig.tar.gz +Patch0: generate-parameter-library-example-fix-install-name.patch + +Requires: ros-%{ros_distro}-generate-parameter-library +Requires: ros-%{ros_distro}-rclcpp +Requires: ros-%{ros_distro}-rclcpp-components +Requires: ros-%{ros_distro}-ament-cmake-core +Requires: ros-%{ros_distro}-ros-workspace + +BuildRequires: ros-%{ros_distro}-generate-parameter-library +BuildRequires: ros-%{ros_distro}-rclcpp +BuildRequires: ros-%{ros_distro}-rclcpp-components +BuildRequires: ros-%{ros_distro}-ament-cmake +BuildRequires: ros-%{ros_distro}-ros-workspace + +%if 0%{?with_tests} +BuildRequires: ros-%{ros_distro}-ament-lint-auto +BuildRequires: ros-%{ros_distro}-ament-lint-common +%endif + +Provides: %{name}-devel = %{version}-%{release} +Provides: %{name}-doc = %{version}-%{release} +Provides: %{name}-runtime = %{version}-%{release} + +%description +Example usage of generate_parameter_library. + +%prep +%autosetup -p1 + +%build +# Needed to bootstrap since the ros_workspace package does not yet exist. +export PYTHONPATH=/opt/ros/%{ros_distro}/lib/python%{python3_version}/site-packages + +# 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 +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/ros/%{ros_distro}" \ + -DAMENT_PREFIX_PATH="/opt/ros/%{ros_distro}" \ + -DCMAKE_PREFIX_PATH="/opt/ros/%{ros_distro}" \ + -DSETUPTOOLS_DEB_LAYOUT=OFF \ +%if !0%{?with_tests} + -DBUILD_TESTING=OFF \ +%endif + .. + +%make_build + +%install +# Needed to bootstrap since the ros_workspace package does not yet exist. +export PYTHONPATH=/opt/ros/%{ros_distro}/lib/python%{python3_version}/site-packages + +# 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 +%make_install -C .obj-%{_target_platform} + +%if 0%{?with_tests} +%check +# Needed to bootstrap since the ros_workspace package does not yet exist. +export PYTHONPATH=/opt/ros/%{ros_distro}/lib/python%{python3_version}/site-packages + +# 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/ros/%{ros_distro}/setup.sh" ]; then . "/opt/ros/%{ros_distro}/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/ros/%{ros_distro} + +%changelog +* Thu May 04 2023 Paul Gesel paul.gesel@picknik.ai - 0.3.3-1 +- Autogenerated by ros-porting-tools @@ -0,0 +1 @@ +38d9dd823f0a98b0fb855d02f4e26ff8 ros-humble-generate-parameter-library-example_0.3.3.orig.tar.gz |