Blame SPECS/butane.spec

5dbe05
# Originally generated by go2rpm 1.3
5dbe05
%if 0%{?fedora}
5dbe05
%bcond_without check
5dbe05
%else
5dbe05
# %%gocheck isn't currently provided on CentOS/RHEL
5dbe05
# https://bugzilla.redhat.com/show_bug.cgi?id=1982298
5dbe05
%bcond_with check
5dbe05
%endif
5dbe05
5dbe05
# https://github.com/coreos/butane
5dbe05
%global goipath         github.com/coreos/butane
5dbe05
%global gomodulesmode   GO111MODULE=on
4010e5
Version:                0.17.0
5dbe05
5dbe05
%gometa
5dbe05
5dbe05
%global common_description %{expand:
5dbe05
Butane translates human-readable Butane Configs into machine-readable Ignition
5dbe05
configs for provisioning operating systems that use Ignition.}
5dbe05
5dbe05
%global golicenses      LICENSE
4010e5
%global godocs          docs README.md
5dbe05
5dbe05
Name:           butane
5dbe05
Release:        1%{?dist}
5dbe05
Summary:        Butane config transpiler
5dbe05
5dbe05
# Upstream license specification: Apache-2.0
5dbe05
License:        ASL 2.0
5dbe05
URL:            %{gourl}
5dbe05
Source0:        %{gosource}
5dbe05
5dbe05
5dbe05
# Generated by go-mods-to-bundled-provides.py
4010e5
Provides: bundled(golang(github.com/clarketm/json)) = 1.17.1
5dbe05
Provides: bundled(golang(github.com/coreos/go-semver/semver)) = 0.3.0
4010e5
Provides: bundled(golang(github.com/coreos/go-systemd/v22/unit)) = 22.5.0
4010e5
Provides: bundled(golang(github.com/coreos/ignition/v2/config/merge)) = 2.14.0
4010e5
Provides: bundled(golang(github.com/coreos/ignition/v2/config/shared/errors)) = 2.14.0
4010e5
Provides: bundled(golang(github.com/coreos/ignition/v2/config/shared/validations)) = 2.14.0
4010e5
Provides: bundled(golang(github.com/coreos/ignition/v2/config/util)) = 2.14.0
4010e5
Provides: bundled(golang(github.com/coreos/ignition/v2/config/v3_0/types)) = 2.14.0
4010e5
Provides: bundled(golang(github.com/coreos/ignition/v2/config/v3_1/types)) = 2.14.0
4010e5
Provides: bundled(golang(github.com/coreos/ignition/v2/config/v3_2/types)) = 2.14.0
4010e5
Provides: bundled(golang(github.com/coreos/ignition/v2/config/v3_3/types)) = 2.14.0
4010e5
Provides: bundled(golang(github.com/coreos/ignition/v2/config/v3_4_experimental/types)) = 2.14.0
4010e5
Provides: bundled(golang(github.com/coreos/ignition/v2/config/validate)) = 2.14.0
4010e5
Provides: bundled(golang(github.com/coreos/vcontext/json)) = 0.0.0-20220810162454.git88bd546c634c
4010e5
Provides: bundled(golang(github.com/coreos/vcontext/path)) = 0.0.0-20220810162454.git88bd546c634c
4010e5
Provides: bundled(golang(github.com/coreos/vcontext/report)) = 0.0.0-20220810162454.git88bd546c634c
4010e5
Provides: bundled(golang(github.com/coreos/vcontext/tree)) = 0.0.0-20220810162454.git88bd546c634c
4010e5
Provides: bundled(golang(github.com/coreos/vcontext/validate)) = 0.0.0-20220810162454.git88bd546c634c
4010e5
Provides: bundled(golang(github.com/coreos/vcontext/yaml)) = 0.0.0-20220810162454.git88bd546c634c
5dbe05
Provides: bundled(golang(github.com/spf13/pflag)) = 1.0.6-0.20210604193023.gitd5e0c0615ace
4010e5
Provides: bundled(golang(github.com/stretchr/testify/assert)) = 1.8.1
4010e5
Provides: bundled(golang(github.com/vincent-petithory/dataurl)) = 1.0.0
4010e5
Provides: bundled(golang(gopkg.in/yaml.v3)) = 3.0.1
5dbe05
5dbe05
%description
5dbe05
%{common_description}
5dbe05
5dbe05
%package redistributable
5dbe05
Summary:       Butane for macOS and Windows
5dbe05
License:       ASL 2.0
5dbe05
BuildArch:     noarch
5dbe05
5dbe05
%description redistributable
5dbe05
%{common_description}
5dbe05
5dbe05
This package contains macOS and Windows Butane binaries built through
5dbe05
cross-compilation.
5dbe05
5dbe05
%prep
5dbe05
%goprep -k
5dbe05
%autopatch -p1
5dbe05
5dbe05
%build
5dbe05
export LDFLAGS="-X github.com/coreos/butane/internal/version.Raw=%{version} $LDFLAGS"
5dbe05
export GOFLAGS="-mod=vendor"
5dbe05
5dbe05
echo "Building butane..."
5dbe05
%gobuild -o ./butane internal/main.go
5dbe05
5dbe05
%global gocrossbuild go build -ldflags "${LDFLAGS:-} -B 0x$(head -c20 /dev/urandom|od -An -tx1|tr -d ' \\n')" -a -v -x 
5dbe05
5dbe05
echo "Building macOS Butane..."
5dbe05
GOARCH=amd64 GOOS=darwin %gocrossbuild -o butane-darwin-amd64 internal/main.go
5dbe05
5dbe05
echo "Building Windows Butane..."
5dbe05
GOARCH=amd64 GOOS=windows %gocrossbuild -o butane-windows-amd64.exe internal/main.go
5dbe05
5dbe05
%install
5dbe05
install -d -p %{buildroot}%{_bindir}
5dbe05
install -p -m 0755 ./butane %{buildroot}%{_bindir}
5dbe05
install -d -p %{buildroot}%{_datadir}/butane-redistributable
5dbe05
install -p -m 0644 ./butane-darwin-amd64 %{buildroot}%{_datadir}/butane-redistributable
5dbe05
install -p -m 0644 ./butane-windows-amd64.exe %{buildroot}%{_datadir}/butane-redistributable
5dbe05
5dbe05
%if %{with check}
5dbe05
%check
5dbe05
%gocheck
5dbe05
%endif
5dbe05
5dbe05
%files
5dbe05
%license %{golicenses}
5dbe05
%doc %{godocs}
5dbe05
%{_bindir}/butane
5dbe05
5dbe05
%files redistributable
5dbe05
%license %{golicenses}
5dbe05
%dir %{_datadir}/butane-redistributable
5dbe05
%{_datadir}/butane-redistributable/butane-darwin-amd64
5dbe05
%{_datadir}/butane-redistributable/butane-windows-amd64.exe
5dbe05
5dbe05
%changelog
4010e5
* Mon Jan 09 2023 Sohan Kunkerkar <skunkerk@redhat.com> - 0.17.0-1
4010e5
- New release
4010e5
4010e5
* Mon Oct 17 2022 Benjamin Gilbert <bgilbert@redhat.com> - 0.16.0-1
4010e5
- New release
4010e5
4010e5
* Thu Jan 27 2022 Benjamin Gilbert <bgilbert@redhat.com> - 0.14.0-1
4010e5
- New release
4010e5
5dbe05
* Wed Aug 04 2021 Benjamin Gilbert <bgilbert@redhat.com> - 0.13.1-1
5dbe05
- New release
5dbe05
5dbe05
* Wed Jul 21 2021 Fedora Release Engineering <releng@fedoraproject.org> - 0.13.0-2
5dbe05
- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild
5dbe05
5dbe05
* Wed Jul 14 2021 Benjamin Gilbert <bgilbert@redhat.com> - 0.13.0-1
5dbe05
- New release
5dbe05
5dbe05
* Thu Jun 10 2021 Benjamin Gilbert <bgilbert@redhat.com> - 0.12.1-1
5dbe05
- New release
5dbe05
5dbe05
* Tue Jun 08 2021 Sohan Kunkerkar <skunkerk@redhat.com> - 0.12.0-1
5dbe05
- New release
5dbe05
5dbe05
* Tue Apr 06 2021 Benjamin Gilbert <bgilbert@redhat.com> - 0.11.0-1
5dbe05
- Initial package