Skip to content

Commit 0321b00

Browse files
authored
Merge branch 'master' into refactor_generator
2 parents 8c23028 + 07d8f1c commit 0321b00

File tree

3 files changed

+44
-34
lines changed

3 files changed

+44
-34
lines changed

bloom/generators/rpm/generator.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,10 @@ def generate_package(self, package, os_version):
126126
execute_command('git rm -rf ' + ' '.join("'{}'".format(t) for t in template_files))
127127
# Add changes to the rpm folder
128128
execute_command('git add ' + self.package_manager)
129+
# Add marker file to tell mock to archive the sources
130+
open('.write_tar', 'a').close()
131+
# Add marker file changes to the rpm folder
132+
execute_command('git add .write_tar ' + rpm_dir)
129133
# Commit changes
130134
execute_command('git commit -m "Generated {0} files for {1}"'
131135
.format(self.package_manager, os_version))

bloom/generators/rpm/templates/catkin/template.spec.em

Lines changed: 20 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
1+
%global __os_install_post %(echo '%{__os_install_post}' | sed -e 's!/usr/lib[^[:space:]]*/brp-python-bytecompile[[:space:]].*$!!g')
2+
%global __provides_exclude_from ^@(InstallationPrefix)/.*$
3+
%global __requires_exclude_from ^@(InstallationPrefix)/.*$
4+
15
Name: @(Package)
26
Version: @(Version)
37
Release: @(Inc)%{?dist}
48
Summary: ROS @(Name) package
59

6-
Group: Development/Libraries
710
License: @(License)
811
@[if Homepage and Homepage != '']URL: @(Homepage)@\n@[end if]Source0: %{name}-%{version}.tar.gz
912
@[if NoArch]@\nBuildArch: noarch@\n@[end if]
@@ -12,35 +15,35 @@ License: @(License)
1215
@(Description)
1316

1417
%prep
15-
%setup -q
18+
%autosetup
1619

1720
%build
1821
# In case we're installing to a non-standard location, look for a setup.sh
1922
# in the install tree that was dropped by catkin, and source it. It will
2023
# set things like CMAKE_PREFIX_PATH, PKG_CONFIG_PATH, and PYTHONPATH.
2124
if [ -f "@(InstallationPrefix)/setup.sh" ]; then . "@(InstallationPrefix)/setup.sh"; fi
2225
mkdir -p obj-%{_target_platform} && cd obj-%{_target_platform}
23-
%cmake .. \
24-
-UINCLUDE_INSTALL_DIR \
25-
-ULIB_INSTALL_DIR \
26-
-USYSCONF_INSTALL_DIR \
27-
-USHARE_INSTALL_PREFIX \
28-
-ULIB_SUFFIX \
29-
-DCMAKE_INSTALL_LIBDIR="lib" \
30-
-DCMAKE_INSTALL_PREFIX="@(InstallationPrefix)" \
31-
-DCMAKE_PREFIX_PATH="@(InstallationPrefix)" \
32-
-DSETUPTOOLS_DEB_LAYOUT=OFF \
33-
-DCATKIN_BUILD_BINARY_PACKAGE="1" \
34-
35-
make %{?_smp_mflags}
26+
%cmake3 \
27+
-UINCLUDE_INSTALL_DIR \
28+
-ULIB_INSTALL_DIR \
29+
-USYSCONF_INSTALL_DIR \
30+
-USHARE_INSTALL_PREFIX \
31+
-ULIB_SUFFIX \
32+
-DCMAKE_INSTALL_LIBDIR="lib" \
33+
-DCMAKE_INSTALL_PREFIX="@(InstallationPrefix)" \
34+
-DCMAKE_PREFIX_PATH="@(InstallationPrefix)" \
35+
-DSETUPTOOLS_DEB_LAYOUT=OFF \
36+
-DCATKIN_BUILD_BINARY_PACKAGE="1" \
37+
..
38+
39+
%make_build
3640

3741
%install
3842
# In case we're installing to a non-standard location, look for a setup.sh
3943
# in the install tree that was dropped by catkin, and source it. It will
4044
# set things like CMAKE_PREFIX_PATH, PKG_CONFIG_PATH, and PYTHONPATH.
4145
if [ -f "@(InstallationPrefix)/setup.sh" ]; then . "@(InstallationPrefix)/setup.sh"; fi
42-
cd obj-%{_target_platform}
43-
make %{?_smp_mflags} install DESTDIR=%{buildroot}
46+
%make_install -C obj-%{_target_platform}
4447

4548
%files
4649
@(InstallationPrefix)

bloom/generators/rpm/templates/cmake/template.spec.em

Lines changed: 20 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
1+
%global __os_install_post %(echo '%{__os_install_post}' | sed -e 's!/usr/lib[^[:space:]]*/brp-python-bytecompile[[:space:]].*$!!g')
2+
%global __provides_exclude_from ^@(InstallationPrefix)/.*$
3+
%global __requires_exclude_from ^@(InstallationPrefix)/.*$
4+
15
Name: @(Package)
26
Version: @(Version)
37
Release: @(Inc)%{?dist}
48
Summary: ROS @(Name) package
59

6-
Group: Development/Libraries
710
License: @(License)
811
@[if Homepage and Homepage != '']URL: @(Homepage)@\n@[end if]Source0: %{name}-%{version}.tar.gz
912
@[if NoArch]@\nBuildArch: noarch@\n@[end if]
@@ -12,35 +15,35 @@ License: @(License)
1215
@(Description)
1316

1417
%prep
15-
%setup -q
18+
%autosetup
1619

1720
%build
1821
# In case we're installing to a non-standard location, look for a setup.sh
1922
# in the install tree that was dropped by catkin, and source it. It will
2023
# set things like CMAKE_PREFIX_PATH, PKG_CONFIG_PATH, and PYTHONPATH.
2124
if [ -f "@(InstallationPrefix)/setup.sh" ]; then . "@(InstallationPrefix)/setup.sh"; fi
2225
mkdir -p obj-%{_target_platform} && cd obj-%{_target_platform}
23-
%cmake .. \
24-
-UINCLUDE_INSTALL_DIR \
25-
-ULIB_INSTALL_DIR \
26-
-USYSCONF_INSTALL_DIR \
27-
-USHARE_INSTALL_PREFIX \
28-
-ULIB_SUFFIX \
29-
-DCMAKE_INSTALL_LIBDIR="lib" \
30-
-DCMAKE_INSTALL_PREFIX="@(InstallationPrefix)" \
31-
-DCMAKE_PREFIX_PATH="@(InstallationPrefix)" \
32-
-DSETUPTOOLS_DEB_LAYOUT=OFF \
33-
-DCATKIN_BUILD_BINARY_PACKAGE="1" \
34-
35-
make %{?_smp_mflags}
26+
%cmake3 \
27+
-UINCLUDE_INSTALL_DIR \
28+
-ULIB_INSTALL_DIR \
29+
-USYSCONF_INSTALL_DIR \
30+
-USHARE_INSTALL_PREFIX \
31+
-ULIB_SUFFIX \
32+
-DCMAKE_INSTALL_LIBDIR="lib" \
33+
-DCMAKE_INSTALL_PREFIX="@(InstallationPrefix)" \
34+
-DCMAKE_PREFIX_PATH="@(InstallationPrefix)" \
35+
-DSETUPTOOLS_DEB_LAYOUT=OFF \
36+
-DCATKIN_BUILD_BINARY_PACKAGE="1" \
37+
..
38+
39+
%make_build
3640

3741
%install
3842
# In case we're installing to a non-standard location, look for a setup.sh
3943
# in the install tree that was dropped by catkin, and source it. It will
4044
# set things like CMAKE_PREFIX_PATH, PKG_CONFIG_PATH, and PYTHONPATH.
4145
if [ -f "@(InstallationPrefix)/setup.sh" ]; then . "@(InstallationPrefix)/setup.sh"; fi
42-
cd obj-%{_target_platform}
43-
make %{?_smp_mflags} install DESTDIR=%{buildroot}
46+
%make_install -C obj-%{_target_platform}
4447

4548
%files
4649
@(InstallationPrefix)

0 commit comments

Comments
 (0)