-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgolang-github-opencontainers-umoci.spec
147 lines (114 loc) · 3.9 KB
/
golang-github-opencontainers-umoci.spec
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
%bcond_without check
%if 0%{?centos} && 0%{?centos} < 9
%global debug_package %{nil}
%endif
# https://github.com/opencontainers/umoci
%global goipath github.com/opencontainers/umoci
Version: 0.4.7
%if 0%{?fedora} || 0%{?centos} >= 8
%gometa
%endif
%global common_description %{expand:
umoci modifies Open Container images.}
%global golicenses COPYING
%global godocs CHANGELOG.md CODE_OF_CONDUCT.md CONTRIBUTING.md GOVERNANCE.md MAINTAINERS README.md
%if 0%{?centos} && 0%{?centos} < 8
Name: golang-github-opencontainers-umoci
%else
Name: %{goname}
%endif
Release: 0.3%{?dist}
Summary: umoci modifies Open Container images
License: ASL 2.0
URL: https://umo.ci/
Source0: https://github.com/opencontainers/%{name}/archive/v%{version}.tar.gz
Patch0: v0.4.7-test-Remove-racy-TestInvalidDigest.patch
%if 0%{?centos} && 0%{?centos} < 8
BuildRequires: %{?go_compiler:compiler(go-compiler)}%{!?go_compiler:golang}
%endif
BuildRequires: go-md2man
Provides: umoci = %{version}-%{release}
Obsoletes: umoci < %{version}-%{release}
%description
%{common_description}
umoci is a manipulation tool for OCI images. In particular, it is an
alternative to oci-image-tools provided by the OCI.
%gopkg
%prep
%if 0%{?centos} && 0%{?centos} < 9
%autosetup -n umoci-%{version} -p1
%else
# Keep vendor code
%goprep -k
%patch 0 -p1
%endif
%build
%if 0%{?centos}
%if 0%{?centos} < 8
%define gobuild(o:) go build -tags="$BUILDTAGS rpm_crashtraceback" -ldflags "${LDFLAGS:-} -B 0x$(head -c20 /dev/urandom|od -An -tx1|tr -d ' \\n')" -a -v -x %{?**};
%endif
%if 0%{?centos} < 9
%define gobuilddir %{_builddir}/_build
%endif
%endif
export LDFLAGS="${LDFLAGS} -X %{goipath}.version=%{version}"
for cmd in cmd/* ; do
%gobuild -o %{gobuilddir}/bin/$(basename $cmd) %{goipath}/$cmd
done
for manpage in doc/man/*.md; do
go-md2man -in ${manpage} -out "${manpage%%.md}"
done
%install
%if 0%{?fedora}
%gopkginstall
%endif
install -m 0755 -vd %{buildroot}%{_bindir}
install -m 0755 -vp %{gobuilddir}/bin/* %{buildroot}%{_bindir}/
for file in doc/man/*.1; do
install -D -p -m 0644 $file "%{buildroot}/%{_mandir}/man1/$(basename $file)"
done
%if %{with check}
%check
%if 0%{?centos} && 0%{?centos} < 9
%global gotest go test
%gotest ./...
%else
%gocheck
%endif
%endif
%files
%license %{golicenses}
%doc %{godocs}
%{_bindir}/*
%{_mandir}/man1/umoci*
%if 0%{?fedora}
%gopkgfiles
%endif
%changelog
* Sun Nov 24 2024 Reto Gantenbein <[email protected]> 0.4.7-0.3
- Disable racy test
* Wed Jun 19 2024 Reto Gantenbein <[email protected]> 0.4.7-0.2
- Rebuild for EPEL 9
* Sat May 29 2021 Reto Gantenbein <[email protected]> 0.4.7-0.1
- Update to 0.4.7.
- Rename to match Golang packaging guidelines
* Fri May 28 2021 Reto Gantenbein <[email protected]> 0.4.6-0.1
- Update to 0.4.6.
- Complete spec file rewrite with new macros but keep minimal EPEL compatibility.
* Sun Apr 12 2020 Reto Gantenbein <[email protected]> 0.4.5-0.1
- Update to 0.4.5.
* Sun Feb 17 2019 Reto Gantenbein <[email protected]> 0.4.4-0.1
- Update to 0.4.4
* Mon Nov 12 2018 Reto Gantenbein <[email protected]> 0.4.3-0.2
- Set GO111MODULE=off to fix build on Fedora 29 and rawhide
* Sun Nov 11 2018 Reto Gantenbein <[email protected]> 0.4.3-0.1
- Update to 0.4.3
* Tue Sep 11 2018 Reto Gantenbein <[email protected]> 0.4.2-0.1
- Update to 0.4.2
* Tue Sep 04 2018 Reto Gantenbein <[email protected]> 0.4.1-0.1
- Update to 0.4.1
* Fri Apr 13 2018 Reto Gantenbein <[email protected]> 0.4.0-0.2
- Disable failing test (see openSUSE/umoci#235)
- Don't set commit hash for stable release
* Wed Apr 11 2018 Reto Gantenbein <[email protected]> 0.4.0-0.1
- Initial package