aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLibravatar Kelvin M. Klann <kmk3.code@protonmail.com>2024-02-08 06:24:35 +0000
committerLibravatar GitHub <noreply@github.com>2024-02-08 06:24:35 +0000
commit3b89a75e608138ec2f8b0c9c3e2f8f4cf4524c21 (patch)
treef90e1b613fb7e0a45187d466a2a6f4922a5e8399
parentlandlock: fix struct initialization (#6200) (diff)
parentci: remove unused configure arguments in rpm jobs (diff)
downloadfirejail-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.yml4
-rwxr-xr-xplatform/rpm/mkrpm.sh10
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
11set -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
38tmp_spec_file="${tmpdir}/SPECS/${name}.spec" 40tmp_spec_file="${tmpdir}/SPECS/${name}.spec"
39sed -e "s/__NAME__/${name}/g" \ 41sed -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)
50rpmbuild --quiet --define "_topdir ${tmpdir}" -ba "${tmp_spec_file}" 52rpmbuild --define "_topdir ${tmpdir}" -ba "${tmp_spec_file}"
51 53
52# Copy the results to cwd 54# Copy the results to cwd
53mv "${tmpdir}/SRPMS"/*.rpm "${tmpdir}/RPMS"/*/*rpm . 55mv "${tmpdir}/SRPMS"/*.rpm "${tmpdir}/RPMS"/*/*rpm .