butane/butane.spec

186 lines
7.7 KiB
RPMSpec
Raw Normal View History

2021-04-09 21:45:17 +00:00
# Originally generated by go2rpm 1.3
%if 0%{?fedora}
2021-04-09 21:45:17 +00:00
%bcond_without check
%else
2022-01-25 18:36:48 +00:00
# %%gocheck isn't currently provided on CentOS/RHEL
# https://bugzilla.redhat.com/show_bug.cgi?id=1982298
%bcond_with check
%endif
2021-04-09 21:45:17 +00:00
# https://github.com/coreos/butane
%global goipath github.com/coreos/butane
%global gomodulesmode GO111MODULE=on
2022-06-27 20:45:45 +00:00
Version: 0.15.0
2021-04-09 21:45:17 +00:00
%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
2021-04-09 21:45:17 +00:00
Name: butane
Release: 2%{?dist}
2021-04-09 21:45:17 +00:00
Summary: Butane config transpiler
# Upstream license specification: Apache-2.0
License: ASL 2.0
URL: %{gourl}
Source0: %{gosource}
# Upgrade path from old FCCT package; can be dropped in Fedora 36
Provides: fedora-coreos-config-transpiler = %{version}-%{release}
Obsoletes: fedora-coreos-config-transpiler < 0.10.0-2
# Provided by FCCT package; can be dropped in Fedora 36
Provides: fcct = %{version}-%{release}
# Generated by go-mods-to-bundled-provides.py
Provides: bundled(golang(github.com/clarketm/json)) = 1.14.1
Provides: bundled(golang(github.com/coreos/go-semver/semver)) = 0.3.0
Provides: bundled(golang(github.com/coreos/go-systemd/unit)) = 0.0.0-20190321100706.git95778dfbb74e
Provides: bundled(golang(github.com/coreos/go-systemd/v22/unit)) = 0.0.0-20190321100706.git95778dfbb74e
2022-06-27 20:45:45 +00:00
Provides: bundled(golang(github.com/coreos/ignition/v2/config/merge)) = 2.14.0
Provides: bundled(golang(github.com/coreos/ignition/v2/config/shared/errors)) = 2.14.0
Provides: bundled(golang(github.com/coreos/ignition/v2/config/shared/validations)) = 2.14.0
Provides: bundled(golang(github.com/coreos/ignition/v2/config/util)) = 2.14.0
Provides: bundled(golang(github.com/coreos/ignition/v2/config/v3_0/types)) = 2.14.0
Provides: bundled(golang(github.com/coreos/ignition/v2/config/v3_1/types)) = 2.14.0
Provides: bundled(golang(github.com/coreos/ignition/v2/config/v3_2/types)) = 2.14.0
Provides: bundled(golang(github.com/coreos/ignition/v2/config/v3_3/types)) = 2.14.0
Provides: bundled(golang(github.com/coreos/ignition/v2/config/v3_4_experimental/types)) = 2.14.0
Provides: bundled(golang(github.com/coreos/ignition/v2/config/validate)) = 2.14.0
Provides: bundled(golang(github.com/coreos/vcontext/json)) = 0.0.0-20220603180515.git2076d8d16945
Provides: bundled(golang(github.com/coreos/vcontext/path)) = 0.0.0-20220603180515.git2076d8d16945
Provides: bundled(golang(github.com/coreos/vcontext/report)) = 0.0.0-20220603180515.git2076d8d16945
Provides: bundled(golang(github.com/coreos/vcontext/tree)) = 0.0.0-20220603180515.git2076d8d16945
Provides: bundled(golang(github.com/coreos/vcontext/validate)) = 0.0.0-20220603180515.git2076d8d16945
Provides: bundled(golang(github.com/coreos/vcontext/yaml)) = 0.0.0-20220603180515.git2076d8d16945
2021-04-09 21:45:17 +00:00
Provides: bundled(golang(github.com/davecgh/go-spew/spew)) = 1.1.1
2021-08-05 02:11:31 +00:00
Provides: bundled(golang(github.com/spf13/pflag)) = 1.0.6-0.20210604193023.gitd5e0c0615ace
2022-01-27 21:38:44 +00:00
Provides: bundled(golang(github.com/stretchr/testify/assert)) = 1.7.0
Provides: bundled(golang(github.com/vincent-petithory/dataurl)) = 1.0.0
2022-06-27 20:45:45 +00:00
Provides: bundled(golang(gopkg.in/yaml.v3)) = 3.0.1
2021-04-09 21:45:17 +00:00
%description
%{common_description}
%package redistributable
Summary: Statically built Butane for Linux, macOS and Windows
2021-04-09 21:45:17 +00:00
License: ASL 2.0
BuildArch: noarch
# In case someone has this subpackage installed, obsolete the old name
# Drop in Fedora 38
Obsoletes: butane-nonlinux < 0.13.1-3
%description redistributable
2021-04-09 21:45:17 +00:00
%{common_description}
This package contains statically linked Linux, macOS and Windows Butane
binaries built through cross-compilation. Do not install it. It is only
used for building release binaries to be signed by Fedora release
engineering and uploaded to the Butane GitHub releases page.
2021-04-09 21:45:17 +00:00
%prep
%goprep -k
%autopatch -p1
%build
export LDFLAGS="-X github.com/coreos/butane/internal/version.Raw=%{version} "
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 Linux Butane with static linking..."
CGO_ENABLED=0 GOARCH=arm64 GOOS=linux %gocrossbuild -o butane-aarch64-unknown-linux-gnu-static internal/main.go
CGO_ENABLED=0 GOARCH=ppc64le GOOS=linux %gocrossbuild -o butane-ppc64le-unknown-linux-gnu-static internal/main.go
CGO_ENABLED=0 GOARCH=s390x GOOS=linux %gocrossbuild -o butane-s390x-unknown-linux-gnu-static internal/main.go
CGO_ENABLED=0 GOARCH=amd64 GOOS=linux %gocrossbuild -o butane-x86_64-unknown-linux-gnu-static internal/main.go
2021-04-09 21:45:17 +00:00
echo "Building macOS Butane..."
GOARCH=amd64 GOOS=darwin %gocrossbuild -o butane-x86_64-apple-darwin internal/main.go
GOARCH=arm64 GOOS=darwin %gocrossbuild -o butane-aarch64-apple-darwin internal/main.go
2021-04-09 21:45:17 +00:00
echo "Building Windows Butane..."
GOARCH=amd64 GOOS=windows %gocrossbuild -o butane-x86_64-pc-windows-gnu.exe internal/main.go
%install
install -d -p %{buildroot}%{_bindir}
install -p -m 0755 ./butane %{buildroot}%{_bindir}
ln -s butane %{buildroot}%{_bindir}/fcct
install -d -p %{buildroot}%{_datadir}/butane
install -p -m 0644 ./butane-aarch64-apple-darwin %{buildroot}%{_datadir}/butane
install -p -m 0644 ./butane-aarch64-unknown-linux-gnu-static %{buildroot}%{_datadir}/butane
install -p -m 0644 ./butane-ppc64le-unknown-linux-gnu-static %{buildroot}%{_datadir}/butane
install -p -m 0644 ./butane-s390x-unknown-linux-gnu-static %{buildroot}%{_datadir}/butane
2021-04-09 21:45:17 +00:00
install -p -m 0644 ./butane-x86_64-apple-darwin %{buildroot}%{_datadir}/butane
install -p -m 0644 ./butane-x86_64-pc-windows-gnu.exe %{buildroot}%{_datadir}/butane
install -p -m 0644 ./butane-x86_64-unknown-linux-gnu-static %{buildroot}%{_datadir}/butane
2021-04-09 21:45:17 +00:00
%if %{with check}
%check
%gocheck
%endif
%files
%license %{golicenses}
%doc %{godocs}
%{_bindir}/butane
%{_bindir}/fcct
%files redistributable
2021-04-09 21:45:17 +00:00
%license %{golicenses}
%dir %{_datadir}/butane
%{_datadir}/butane/butane-aarch64-apple-darwin
%{_datadir}/butane/butane-aarch64-unknown-linux-gnu-static
%{_datadir}/butane/butane-ppc64le-unknown-linux-gnu-static
%{_datadir}/butane/butane-s390x-unknown-linux-gnu-static
2021-04-09 21:45:17 +00:00
%{_datadir}/butane/butane-x86_64-apple-darwin
%{_datadir}/butane/butane-x86_64-pc-windows-gnu.exe
%{_datadir}/butane/butane-x86_64-unknown-linux-gnu-static
2021-04-09 21:45:17 +00:00
%changelog
* Mon Jun 27 2022 Benjamin Gilbert <bgilbert@redhat.com> - 0.15.0-2
- Add macOS aarch64 binary to -redistributable
2022-06-27 20:45:45 +00:00
* Mon Jun 27 2022 Steven Presti <spresti@redhat.com> - 0.15.0-1
- New release
* Fri Jun 17 2022 Robert-André Mauchin <zebob.m@gmail.com> - 0.14.0-2
- Rebuilt for CVE-2022-1996, CVE-2022-24675, CVE-2022-28327, CVE-2022-27191,
CVE-2022-29526, CVE-2022-30629
2022-01-27 21:38:44 +00:00
* Thu Jan 27 2022 Benjamin Gilbert <bgilbert@redhat.com> - 0.14.0-1
- New release
2022-01-25 18:38:08 +00:00
* Tue Jan 25 2022 Benjamin Gilbert <bgilbert@redhat.com> - 0.13.1-3
- Rename -nonlinux subpackage to -redistributable
- Add static Linux binaries to -redistributable
- Enable %%gocheck only on Fedora
* Wed Jan 19 2022 Fedora Release Engineering <releng@fedoraproject.org> - 0.13.1-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild
2021-08-05 02:11:31 +00:00
* 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
2021-07-14 21:02:41 +00:00
* Wed Jul 14 2021 Benjamin Gilbert <bgilbert@redhat.com> - 0.13.0-1
- New release
2021-06-10 20:50:55 +00:00
* Thu Jun 10 2021 Benjamin Gilbert <bgilbert@redhat.com> - 0.12.1-1
- New release
2021-06-08 19:21:32 +00:00
* Tue Jun 08 2021 Sohan Kunkerkar <skunkerk@redhat.com> - 0.12.0-1
- New release
2021-04-09 21:45:17 +00:00
* Tue Apr 06 2021 Benjamin Gilbert <bgilbert@redhat.com> - 0.11.0-1
- Initial package