summaryrefslogtreecommitdiff
path: root/butane.spec
blob: 13f560e9d8fcc059eabf1aaeda394f97dd6a9097 (plain)
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
147
148
149
150
151
152
153
154
155
156
# Originally generated by go2rpm 1.3
%if 0%{?fedora}
%bcond_without check
%else
# %%gocheck isn't currently provided on CentOS/RHEL
# https://bugzilla.redhat.com/show_bug.cgi?id=1982298
%bcond_with check
%endif

# https://github.com/coreos/butane
%global goipath         github.com/coreos/butane
%global gomodulesmode   GO111MODULE=on
Version:                0.21.0

%gometa

%global common_description %{expand:
Butane translates human-readable Butane Configs into machine-readable Ignition
configs for provisioning operating systems that use Ignition.}

%global golicenses      LICENSE
%global godocs          docs README.md

Name:           butane
Release:        1%{?dist}
Summary:        Butane config transpiler

# Upstream license specification: Apache-2.0
License:        ASL 2.0
URL:            %{gourl}
Source0:        %{gosource}


# Generated by go-mods-to-bundled-provides.py
Provides: bundled(golang(github.com/clarketm/json)) = 1.17.1
Provides: bundled(golang(github.com/coreos/go-semver/semver)) = 0.3.1
Provides: bundled(golang(github.com/coreos/go-systemd/v22/unit)) = 22.5.0
Provides: bundled(golang(github.com/coreos/ignition/v2/config/doc)) = 2.17.0
Provides: bundled(golang(github.com/coreos/ignition/v2/config/merge)) = 2.17.0
Provides: bundled(golang(github.com/coreos/ignition/v2/config/shared/errors)) = 2.17.0
Provides: bundled(golang(github.com/coreos/ignition/v2/config/shared/parse)) = 2.17.0
Provides: bundled(golang(github.com/coreos/ignition/v2/config/shared/validations)) = 2.17.0
Provides: bundled(golang(github.com/coreos/ignition/v2/config/util)) = 2.17.0
Provides: bundled(golang(github.com/coreos/ignition/v2/config/v3_0/types)) = 2.17.0
Provides: bundled(golang(github.com/coreos/ignition/v2/config/v3_1/types)) = 2.17.0
Provides: bundled(golang(github.com/coreos/ignition/v2/config/v3_2/types)) = 2.17.0
Provides: bundled(golang(github.com/coreos/ignition/v2/config/v3_3/types)) = 2.17.0
Provides: bundled(golang(github.com/coreos/ignition/v2/config/v3_4/types)) = 2.17.0
Provides: bundled(golang(github.com/coreos/ignition/v2/config/v3_5_experimental/types)) = 2.17.0
Provides: bundled(golang(github.com/coreos/ignition/v2/config/validate)) = 2.17.0
Provides: bundled(golang(github.com/coreos/vcontext/json)) = 0.0.0-20230201181013.gitd72178a18687
Provides: bundled(golang(github.com/coreos/vcontext/path)) = 0.0.0-20230201181013.gitd72178a18687
Provides: bundled(golang(github.com/coreos/vcontext/report)) = 0.0.0-20230201181013.gitd72178a18687
Provides: bundled(golang(github.com/coreos/vcontext/tree)) = 0.0.0-20230201181013.gitd72178a18687
Provides: bundled(golang(github.com/coreos/vcontext/validate)) = 0.0.0-20230201181013.gitd72178a18687
Provides: bundled(golang(github.com/coreos/vcontext/yaml)) = 0.0.0-20230201181013.gitd72178a18687
Provides: bundled(golang(github.com/spf13/pflag)) = 1.0.6-0.20210604193023.gitd5e0c0615ace
Provides: bundled(golang(github.com/stretchr/testify/assert)) = 1.8.4
Provides: bundled(golang(github.com/vincent-petithory/dataurl)) = 1.0.0
Provides: bundled(golang(gopkg.in/yaml.v3)) = 3.0.1

%description
%{common_description}

%package redistributable
Summary:       Butane for macOS and Windows
License:       ASL 2.0
BuildArch:     noarch

%description redistributable
%{common_description}

This package contains macOS and Windows Butane binaries built through
cross-compilation.

%prep
%goprep -k
%autopatch -p1

%build
export LDFLAGS="-X github.com/coreos/butane/internal/version.Raw=%{version} $LDFLAGS"
export GOFLAGS="-mod=vendor"

echo "Building butane..."
%gobuild -o ./butane internal/main.go

%global gocrossbuild go build -ldflags "${LDFLAGS:-} -B 0x$(head -c20 /dev/urandom|od -An -tx1|tr -d ' \\n')" -a -v -x 

echo "Building macOS Butane..."
GOARCH=amd64 GOOS=darwin %gocrossbuild -o butane-darwin-amd64 internal/main.go

echo "Building Windows Butane..."
GOARCH=amd64 GOOS=windows %gocrossbuild -o butane-windows-amd64.exe internal/main.go

%install
install -d -p %{buildroot}%{_bindir}
install -p -m 0755 ./butane %{buildroot}%{_bindir}
install -d -p %{buildroot}%{_datadir}/butane-redistributable
install -p -m 0644 ./butane-darwin-amd64 %{buildroot}%{_datadir}/butane-redistributable
install -p -m 0644 ./butane-windows-amd64.exe %{buildroot}%{_datadir}/butane-redistributable

%if %{with check}
%check
%gocheck
%endif

%files
%license %{golicenses}
%doc %{godocs}
%{_bindir}/butane

%files redistributable
%license %{golicenses}
%dir %{_datadir}/butane-redistributable
%{_datadir}/butane-redistributable/butane-darwin-amd64
%{_datadir}/butane-redistributable/butane-windows-amd64.exe

%changelog
* Mon Jun 10 2024 Yasmin Valim <ydesouza@redhat.com> - 0.21.0-1
- new version

* Wed Feb 21 2024 Yasmin Valim <ydesouza@redhat.com> - 0.20.0-1
- new version

* Wed Oct 18 2023 Steven Presti <spresti@redhat.com> - 0.19.0-1
- new version

* Thu Apr 06 2023 Steven Presti <spresti@redhat.com> - 0.18.0-1
- New version

* Mon Jan 09 2023 Sohan Kunkerkar <skunkerk@redhat.com> - 0.17.0-1
- New release

* Mon Oct 17 2022 Benjamin Gilbert <bgilbert@redhat.com> - 0.16.0-1
- New release

* Thu Jan 27 2022 Benjamin Gilbert <bgilbert@redhat.com> - 0.14.0-1
- New release

* Wed Aug 04 2021 Benjamin Gilbert <bgilbert@redhat.com> - 0.13.1-1
- New release

* Wed Jul 21 2021 Fedora Release Engineering <releng@fedoraproject.org> - 0.13.0-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild

* Wed Jul 14 2021 Benjamin Gilbert <bgilbert@redhat.com> - 0.13.0-1
- New release

* Thu Jun 10 2021 Benjamin Gilbert <bgilbert@redhat.com> - 0.12.1-1
- New release

* Tue Jun 08 2021 Sohan Kunkerkar <skunkerk@redhat.com> - 0.12.0-1
- New release

* Tue Apr 06 2021 Benjamin Gilbert <bgilbert@redhat.com> - 0.11.0-1
- Initial package