Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions bloom/generators/dynrpm/generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,8 @@ def generate_substitutions_from_package(
pass
elif build_type == 'cmake':
pass
elif build_type == 'meson':
pass
elif build_type == 'ament_cmake':
pass
elif build_type == 'ament_python':
Expand Down
92 changes: 92 additions & 0 deletions bloom/generators/dynrpm/templates/meson/template.spec.em
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
%{?!ros_distro:%global ros_distro @(Rosdistro)}
%global pkg_name @(Name)
%global normalized_pkg_name %{lua:return (string.gsub(rpm.expand('%{pkg_name}'), '_', '-'))}

Name: @(Package)
Version: @(Version)
Release: @(RPMInc)%{?dist}
Summary: ROS %{pkg_name} package

License: @(License)
@[if Homepage and Homepage != '']URL: @(Homepage)@\n@[end if]@
Source0: %{name}-%{version}.tar.gz
@[if NoArch]@\nBuildArch: noarch@\n@[end if]@

BuildRequires: bloom-rpm-macros
BuildRequires: meson

%{?bloom_package}

%description
@(Description)


%package devel
Release: %{release}%{?release_suffix}
Summary: %{summary}
Provides: %{name} = %{version}-%{release}
@[if not NoArch]Provides: %{name}%{?_isa} = %{version}-%{release}@\n@[end if]@
Requires: %{name}-runtime@[if not NoArch]%{?_isa}@[end if] = %{version}-%{release}

%description devel
@(Description)


%package runtime
Release: %{release}
Summary: %{summary}

%description runtime
@(Description)


%prep
%autosetup -p1


%generate_buildrequires
%bloom_buildrequires


%build
# override macro
%define __meson_auto_features auto

# call meson executable instead of using the 'meson' macro to use default paths
%__meson setup \
--prefix="%{bloom_prefix}" \
--cmake-prefix-path="%{bloom_prefix}" \
--libdir=lib \
--libexecdir=lib \
%{_vpath_builddir}
%meson_build


%install
%meson_install


%if 0%{?with_tests}
%check
# Look for a Makefile target with a name indicating that it runs tests
TEST_TARGET=$(%__ninja -C %{_vpath_builddir} -t targets | sed "s/^\(test\|check\):.*/\\1/;t f;d;:f;q0")
if [ -n "$TEST_TARGET" ]; then
%meson_test || echo "RPM TESTS FAILED"
else echo "RPM TESTS SKIPPED"; fi
%endif


%files devel
%dir %{bloom_prefix}
%ghost %{bloom_prefix}/share/%{pkg_name}/package.xml


%files runtime
@[for lf in LicenseFiles]%license @lf@\n@[end for]@
%{bloom_prefix}


%changelog@[for change_version, (change_date, main_name, main_email) in changelogs]
* @(change_date) @(main_name) <@(main_email)> - @(change_version)
- Autogenerated by Bloom
@[end for]@
Loading