9
9
10
10
# RHEL 8's default %%gobuild macro doesn't account for the BUILDTAGS variable, so we
11
11
# set it separately here and do not depend on RHEL 8's go-srpm-macros package.
12
- %if ! 0%{? fedora } && 0%{?rhel } < = 8
12
+ %if %{defined rhel } && 0%{?rhel } = = 8
13
13
%define gobuild(o:) go build -buildmode pie -compiler gc -tags= "rpm_crashtraceback libtrust_openssl ${BUILDTAGS:-}" -ldflags "-linkmode= external -compressdwarf= false ${LDFLAGS:-} -B 0x$(head -c20 /dev/urandom|od -An -tx1|tr -d ' \\n') -extldflags '%__global_ldflags'" -a -v -x %{?**};
14
14
%endif
15
15
16
16
%global gomodulesmode GO111MODULE= on
17
17
18
- # NOTE: For conditionals %%bcond_with and %%bcond_without,
19
- # See: https://rpm-software-management.github.io/rpm/manual/conditionalbuilds.html
20
-
21
- # copr_username is only set on copr environments, not on others like koji
22
- %if "%{?copr_username }" != "rhcontainerbot"
23
- %bcond_with copr
24
- %else
25
- %bcond_without copr
26
- %endif
27
-
28
- %if 0%{?rhel }
29
- %bcond_with btrfs
30
- %else
31
- %bcond_without btrfs
32
- %endif
33
-
34
- # go-rpm-macros package and autochangelog exists for fedora and rhel9
35
- %if 0%{?fedora } || 0%{?rhel } >= 9
36
- %bcond_without go_rpm_macros
37
- %bcond_without manual_changelog
38
- %else
39
- %bcond_with go_rpm_macros
40
- %bcond_without manual_changelog
18
+ # No btrfs on RHEL
19
+ %if %{defined fedora }
20
+ %define build_with_btrfs 1
41
21
%endif
42
22
43
23
# Only used in official koji builds
44
24
# Copr builds set a separate epoch for all environments
45
- %if 0%{? fedora } && ! 0%{? rhel }
25
+ %if %{defined fedora }
46
26
%define conditional_epoch 1
47
27
%else
48
28
%define conditional_epoch 2
49
29
%endif
50
30
51
- %global provider github
52
- %global provider_tld com
53
- %global project containers
54
- %global repo skopeo
55
- # https://github.com/containers/skopeo
56
- %global import_path %{provider }.%{provider_tld }/%{project }/%{repo }
57
- %global git0 https://%{import_path }
58
-
59
- Name: %{repo }
60
- %if %{with copr }
31
+ Name: skopeo
32
+ %if %{defined copr_username }
61
33
Epoch: 102
62
34
%else
63
35
Epoch: %{conditional_epoch }
@@ -77,16 +49,16 @@ ExclusiveArch: %{golang_arches_future}
77
49
ExclusiveArch: aarch64 ppc64le s390x x86_64
78
50
%endif
79
51
Summary: Inspect container images and repositories on registries
80
- URL: %{ git0 }
52
+ URL: https://github.com/containers/%{ name }
81
53
# Tarball fetched from upstream
82
54
Source0: %{url }/archive/v%{version }.tar.gz
83
55
BuildRequires: go-md2man
84
- %if %{with btrfs }
56
+ %if %{defined build_with_btrfs }
85
57
BuildRequires: btrfs-progs-devel
86
58
%endif
87
59
BuildRequires: git-core
88
60
BuildRequires: golang
89
- %if %{with go_rpm_macros }
61
+ %if ! %{defined gobuild }
90
62
BuildRequires: go-rpm-macros
91
63
%endif
92
64
BuildRequires: gpgme-devel
@@ -146,7 +118,7 @@ export CGO_CFLAGS="$CGO_CFLAGS -m64 -mtune=generic -fcf-protection=full"
146
118
%endif
147
119
148
120
BASEBUILDTAGS= "$(hack/libdm_tag.sh) $(hack/libsubid_tag.sh)"
149
- %if %{with btrfs }
121
+ %if %{defined build_with_btrfs }
150
122
export BUILDTAGS= "$BASEBUILDTAGS $(hack/btrfs_tag.sh) $(hack/btrfs_installed_tag.sh)"
151
123
%else
152
124
export BUILDTAGS= "$BASEBUILDTAGS btrfs_noversion exclude_graphdriver_btrfs"
@@ -189,12 +161,12 @@ cp -pav systemtest/* %{buildroot}/%{_datadir}/%{name}/test/system/
189
161
%{_datadir }/%{name }/test
190
162
191
163
%changelog
192
- %if %{with manual_changelog}
164
+ %if %{defined autochangelog}
165
+ %autochangelog
166
+ %else
193
167
# NOTE: This changelog will be visible on CentOS 8 Stream builds
194
168
# Other envs are capable of handling autochangelog
195
169
* Tue Jun 13 2023 RH Container Bot <rhcontainerbot@fedoraproject.org>
196
170
- Placeholder changelog for envs that are not autochangelog-ready.
197
171
- Contact upstream if you need to report an issue with the build.
198
- %else
199
- %autochangelog
200
172
%endif
0 commit comments