diff options
author | Kelvin M. Klann <kmk3.code@protonmail.com> | 2024-02-08 06:24:35 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-02-08 06:24:35 +0000 |
commit | 3b89a75e608138ec2f8b0c9c3e2f8f4cf4524c21 (patch) | |
tree | f90e1b613fb7e0a45187d466a2a6f4922a5e8399 | |
parent | landlock: fix struct initialization (#6200) (diff) | |
parent | ci: remove unused configure arguments in rpm jobs (diff) | |
download | firejail-3b89a75e608138ec2f8b0c9c3e2f8f4cf4524c21.tar.gz firejail-3b89a75e608138ec2f8b0c9c3e2f8f4cf4524c21.tar.zst firejail-3b89a75e608138ec2f8b0c9c3e2f8f4cf4524c21.zip |
Merge pull request #6196 from kmk3/build-mkrpm-improvements
build: mkrpm.sh improvements
-rw-r--r-- | .gitlab-ci.yml | 4 | ||||
-rwxr-xr-x | platform/rpm/mkrpm.sh | 10 |
2 files changed, 8 insertions, 6 deletions
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 08b006f74..33835ba71 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml | |||
@@ -47,7 +47,7 @@ build_redhat_package: | |||
47 | - dnf update -y | 47 | - dnf update -y |
48 | - dnf install -y rpm-build gcc make | 48 | - dnf install -y rpm-build gcc make |
49 | - ./ci/printenv.sh | 49 | - ./ci/printenv.sh |
50 | - ./configure --prefix=/usr || (cat config.log; exit 1) | 50 | - ./configure || (cat config.log; exit 1) |
51 | - make rpms | 51 | - make rpms |
52 | - rpm -i firejail*.rpm | 52 | - rpm -i firejail*.rpm |
53 | - command -V firejail && firejail --version | 53 | - command -V firejail && firejail --version |
@@ -59,7 +59,7 @@ build_fedora_package: | |||
59 | - dnf update -y | 59 | - dnf update -y |
60 | - dnf install -y rpm-build gcc make | 60 | - dnf install -y rpm-build gcc make |
61 | - ./ci/printenv.sh | 61 | - ./ci/printenv.sh |
62 | - ./configure --prefix=/usr || (cat config.log; exit 1) | 62 | - ./configure || (cat config.log; exit 1) |
63 | - make rpms | 63 | - make rpms |
64 | - rpm -i firejail*.rpm | 64 | - rpm -i firejail*.rpm |
65 | - command -V firejail && firejail --version | 65 | - command -V firejail && firejail --version |
diff --git a/platform/rpm/mkrpm.sh b/platform/rpm/mkrpm.sh index 7fbc35575..0221fa607 100755 --- a/platform/rpm/mkrpm.sh +++ b/platform/rpm/mkrpm.sh | |||
@@ -8,6 +8,8 @@ | |||
8 | # Builds rpms in a temporary directory then places the result in the | 8 | # Builds rpms in a temporary directory then places the result in the |
9 | # current working directory. | 9 | # current working directory. |
10 | 10 | ||
11 | set -e | ||
12 | |||
11 | # shellcheck source=config.sh | 13 | # shellcheck source=config.sh |
12 | . "$(dirname "$0")/../../config.sh" || exit 1 | 14 | . "$(dirname "$0")/../../config.sh" || exit 1 |
13 | 15 | ||
@@ -36,9 +38,9 @@ trap cleanup EXIT | |||
36 | 38 | ||
37 | # Create the spec file | 39 | # Create the spec file |
38 | tmp_spec_file="${tmpdir}/SPECS/${name}.spec" | 40 | tmp_spec_file="${tmpdir}/SPECS/${name}.spec" |
39 | sed -e "s/__NAME__/${name}/g" \ | 41 | sed -e "s|__NAME__|${name}|g" \ |
40 | -e "s/__VERSION__/${version}/g" \ | 42 | -e "s|__VERSION__|${version}|g" \ |
41 | -e "s/__CONFIG_OPT__/${config_opt}/g" \ | 43 | -e "s|__CONFIG_OPT__|${config_opt}|g" \ |
42 | "platform/rpm/${name}.spec" >"${tmp_spec_file}" | 44 | "platform/rpm/${name}.spec" >"${tmp_spec_file}" |
43 | # FIXME: We could parse RELNOTES and create a %changelog section here | 45 | # FIXME: We could parse RELNOTES and create a %changelog section here |
44 | 46 | ||
@@ -47,7 +49,7 @@ tar --exclude='./.git*' --transform "s/^./${name}-${version}/" \ | |||
47 | -czf "${tmpdir}/SOURCES/${name}-${version}.tar.gz" . | 49 | -czf "${tmpdir}/SOURCES/${name}-${version}.tar.gz" . |
48 | 50 | ||
49 | # Build the files (rpm, debug rpm and source rpm) | 51 | # Build the files (rpm, debug rpm and source rpm) |
50 | rpmbuild --quiet --define "_topdir ${tmpdir}" -ba "${tmp_spec_file}" | 52 | rpmbuild --define "_topdir ${tmpdir}" -ba "${tmp_spec_file}" |
51 | 53 | ||
52 | # Copy the results to cwd | 54 | # Copy the results to cwd |
53 | mv "${tmpdir}/SRPMS"/*.rpm "${tmpdir}/RPMS"/*/*rpm . | 55 | mv "${tmpdir}/SRPMS"/*.rpm "${tmpdir}/RPMS"/*/*rpm . |