diff --git a/bloom/generators/rpm/generator.py b/bloom/generators/rpm/generator.py index 29dca7d3..62ef8641 100644 --- a/bloom/generators/rpm/generator.py +++ b/bloom/generators/rpm/generator.py @@ -126,6 +126,10 @@ def generate_package(self, package, os_version): execute_command('git rm -rf ' + ' '.join("'{}'".format(t) for t in template_files)) # Add changes to the rpm folder execute_command('git add ' + self.package_manager) + # Add marker file to tell mock to archive the sources + open('.write_tar', 'a').close() + # Add marker file changes to the rpm folder + execute_command('git add .write_tar ' + rpm_dir) # Commit changes execute_command('git commit -m "Generated {0} files for {1}"' .format(self.package_manager, os_version)) diff --git a/bloom/generators/rpm/templates/catkin/template.spec.em b/bloom/generators/rpm/templates/catkin/template.spec.em index 6a71ad36..816f949f 100644 --- a/bloom/generators/rpm/templates/catkin/template.spec.em +++ b/bloom/generators/rpm/templates/catkin/template.spec.em @@ -1,9 +1,12 @@ +%global __os_install_post %(echo '%{__os_install_post}' | sed -e 's!/usr/lib[^[:space:]]*/brp-python-bytecompile[[:space:]].*$!!g') +%global __provides_exclude_from ^@(InstallationPrefix)/.*$ +%global __requires_exclude_from ^@(InstallationPrefix)/.*$ + Name: @(Package) Version: @(Version) Release: @(Inc)%{?dist} Summary: ROS @(Name) package -Group: Development/Libraries License: @(License) @[if Homepage and Homepage != '']URL: @(Homepage)@\n@[end if]Source0: %{name}-%{version}.tar.gz @[if NoArch]@\nBuildArch: noarch@\n@[end if] @@ -12,7 +15,7 @@ License: @(License) @(Description) %prep -%setup -q +%autosetup %build # In case we're installing to a non-standard location, look for a setup.sh @@ -20,27 +23,27 @@ License: @(License) # set things like CMAKE_PREFIX_PATH, PKG_CONFIG_PATH, and PYTHONPATH. if [ -f "@(InstallationPrefix)/setup.sh" ]; then . "@(InstallationPrefix)/setup.sh"; fi mkdir -p obj-%{_target_platform} && cd obj-%{_target_platform} -%cmake .. \ - -UINCLUDE_INSTALL_DIR \ - -ULIB_INSTALL_DIR \ - -USYSCONF_INSTALL_DIR \ - -USHARE_INSTALL_PREFIX \ - -ULIB_SUFFIX \ - -DCMAKE_INSTALL_LIBDIR="lib" \ - -DCMAKE_INSTALL_PREFIX="@(InstallationPrefix)" \ - -DCMAKE_PREFIX_PATH="@(InstallationPrefix)" \ - -DSETUPTOOLS_DEB_LAYOUT=OFF \ - -DCATKIN_BUILD_BINARY_PACKAGE="1" \ - -make %{?_smp_mflags} +%cmake3 \ + -UINCLUDE_INSTALL_DIR \ + -ULIB_INSTALL_DIR \ + -USYSCONF_INSTALL_DIR \ + -USHARE_INSTALL_PREFIX \ + -ULIB_SUFFIX \ + -DCMAKE_INSTALL_LIBDIR="lib" \ + -DCMAKE_INSTALL_PREFIX="@(InstallationPrefix)" \ + -DCMAKE_PREFIX_PATH="@(InstallationPrefix)" \ + -DSETUPTOOLS_DEB_LAYOUT=OFF \ + -DCATKIN_BUILD_BINARY_PACKAGE="1" \ + .. + +%make_build %install # In case we're installing to a non-standard location, look for a setup.sh # in the install tree that was dropped by catkin, and source it. It will # set things like CMAKE_PREFIX_PATH, PKG_CONFIG_PATH, and PYTHONPATH. if [ -f "@(InstallationPrefix)/setup.sh" ]; then . "@(InstallationPrefix)/setup.sh"; fi -cd obj-%{_target_platform} -make %{?_smp_mflags} install DESTDIR=%{buildroot} +%make_install -C obj-%{_target_platform} %files @(InstallationPrefix) diff --git a/bloom/generators/rpm/templates/cmake/template.spec.em b/bloom/generators/rpm/templates/cmake/template.spec.em index 6a71ad36..816f949f 100644 --- a/bloom/generators/rpm/templates/cmake/template.spec.em +++ b/bloom/generators/rpm/templates/cmake/template.spec.em @@ -1,9 +1,12 @@ +%global __os_install_post %(echo '%{__os_install_post}' | sed -e 's!/usr/lib[^[:space:]]*/brp-python-bytecompile[[:space:]].*$!!g') +%global __provides_exclude_from ^@(InstallationPrefix)/.*$ +%global __requires_exclude_from ^@(InstallationPrefix)/.*$ + Name: @(Package) Version: @(Version) Release: @(Inc)%{?dist} Summary: ROS @(Name) package -Group: Development/Libraries License: @(License) @[if Homepage and Homepage != '']URL: @(Homepage)@\n@[end if]Source0: %{name}-%{version}.tar.gz @[if NoArch]@\nBuildArch: noarch@\n@[end if] @@ -12,7 +15,7 @@ License: @(License) @(Description) %prep -%setup -q +%autosetup %build # In case we're installing to a non-standard location, look for a setup.sh @@ -20,27 +23,27 @@ License: @(License) # set things like CMAKE_PREFIX_PATH, PKG_CONFIG_PATH, and PYTHONPATH. if [ -f "@(InstallationPrefix)/setup.sh" ]; then . "@(InstallationPrefix)/setup.sh"; fi mkdir -p obj-%{_target_platform} && cd obj-%{_target_platform} -%cmake .. \ - -UINCLUDE_INSTALL_DIR \ - -ULIB_INSTALL_DIR \ - -USYSCONF_INSTALL_DIR \ - -USHARE_INSTALL_PREFIX \ - -ULIB_SUFFIX \ - -DCMAKE_INSTALL_LIBDIR="lib" \ - -DCMAKE_INSTALL_PREFIX="@(InstallationPrefix)" \ - -DCMAKE_PREFIX_PATH="@(InstallationPrefix)" \ - -DSETUPTOOLS_DEB_LAYOUT=OFF \ - -DCATKIN_BUILD_BINARY_PACKAGE="1" \ - -make %{?_smp_mflags} +%cmake3 \ + -UINCLUDE_INSTALL_DIR \ + -ULIB_INSTALL_DIR \ + -USYSCONF_INSTALL_DIR \ + -USHARE_INSTALL_PREFIX \ + -ULIB_SUFFIX \ + -DCMAKE_INSTALL_LIBDIR="lib" \ + -DCMAKE_INSTALL_PREFIX="@(InstallationPrefix)" \ + -DCMAKE_PREFIX_PATH="@(InstallationPrefix)" \ + -DSETUPTOOLS_DEB_LAYOUT=OFF \ + -DCATKIN_BUILD_BINARY_PACKAGE="1" \ + .. + +%make_build %install # In case we're installing to a non-standard location, look for a setup.sh # in the install tree that was dropped by catkin, and source it. It will # set things like CMAKE_PREFIX_PATH, PKG_CONFIG_PATH, and PYTHONPATH. if [ -f "@(InstallationPrefix)/setup.sh" ]; then . "@(InstallationPrefix)/setup.sh"; fi -cd obj-%{_target_platform} -make %{?_smp_mflags} install DESTDIR=%{buildroot} +%make_install -C obj-%{_target_platform} %files @(InstallationPrefix)