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