File tree 2 files changed +20
-7
lines changed
2 files changed +20
-7
lines changed Original file line number Diff line number Diff line change 1
1
#! /usr/bin/env bash
2
2
3
3
# This script handles any custom processing of the spec file using the `fix-spec-file`
4
- # action in .packit.yaml.
4
+ # action in .packit.yaml. These steps only work on copr builds, not on official
5
+ # Fedora builds.
5
6
6
7
set -eox pipefail
7
8
@@ -40,8 +41,8 @@ sed -i "s/^Source0:.*.tar.gz/Source0: $PACKAGE-$VERSION.tar.gz/" $SPEC_FILE
40
41
# Update setup macro to use the correct build dir
41
42
sed -i " s/^%autosetup.*/%autosetup -Sgit -n %{name}-$VERSION /" $SPEC_FILE
42
43
43
- # podman --version should show short sha
44
- sed -i " s/^const RawVersion = \" $VERSION \" /const RawVersion = \" $VERSION - $ SHORT_SHA\" / " version/rawversion/version.go
45
-
46
- # use ParseTolerant to allow short sha in version
47
- sed -i " s/^var Version.*/var Version, err = semver.ParseTolerant(rawversion.RawVersion) /" version/version.go
44
+ # Update relevant sed entries in spec file with the actual VERSION and SHORT_SHA
45
+ # This allows podman --version to also show the SHORT_SHA along with the
46
+ # VERSION
47
+ sed -i " s/##VERSION##/ $VERSION / " $SPEC_FILE
48
+ sed -i " s/##SHORT_SHA##/ $SHORT_SHA /" $SPEC_FILE
Original file line number Diff line number Diff line change 31
31
%define build_with_btrfs 1
32
32
%endif
33
33
34
+ %if %{defined copr_username }
35
+ %define copr_build 1
36
+ %endif
37
+
34
38
%global container_base_path github.com/containers
35
39
%global container_base_url https://%{container_base_path }
36
40
48
52
%global import_path_plugins %{container_base_path }/%{repo_plugins }
49
53
50
54
Name: podman
51
- %if %{defined copr_username }
55
+ %if %{defined copr_build }
52
56
Epoch: 102
53
57
%else
54
58
Epoch: 5
@@ -203,6 +207,14 @@ when `%{_bindir}/%{name}sh` is set as a login shell or set as os.Args[0].
203
207
%autosetup -Sgit -n %{name }-%{version }
204
208
sed -i ' s;@@PODMAN@@\;$(BINDIR);@@PODMAN@@\;%{_bindir};' Makefile
205
209
210
+ # These changes are only meant for copr builds
211
+ %if %{defined copr_build }
212
+ # podman --version should show short sha
213
+ sed -i "s/^const RawVersion = .*/const RawVersion = \"##VERSION##-##SHORT_SHA##\"/" version/rawversion/version.go
214
+ # use ParseTolerant to allow short sha in version
215
+ sed -i "s/^var Version.*/var Version, err = semver.ParseTolerant(rawversion.RawVersion)/" version/version.go
216
+ %endif
217
+
206
218
# untar dnsname
207
219
tar zxf %{SOURCE1 }
208
220
You can’t perform that action at this time.
0 commit comments