Blob Blame History Raw
# Generated by go2rpm 1
# Manually modified for fcct 0.5.0
%bcond_without check

# https://github.com/coreos/fcct
%global goipath         github.com/coreos/fcct
Version:                0.7.0

%gometa

%global common_description %{expand:The Fedora CoreOS Config Transpiler (FCCT) translates human-readable
Fedora CoreOS Configs (FCCs) into machine-readable Ignition configs
for provisioning Fedora CoreOS machines.}

%global golicenses      LICENSE
%global godocs          docs README.md NEWS

Name:           fedora-coreos-config-transpiler
Release:        1%{?dist}
Summary:        Fedora CoreOS Config Transpiler (FCCT)

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

# Users may know FCCT by its acronym and want to `dnf install fcct`
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
Provides: bundled(golang(github.com/coreos/ignition/v2/config/shared/errors)) = 2.7.0
Provides: bundled(golang(github.com/coreos/ignition/v2/config/shared/validations)) = 2.7.0
Provides: bundled(golang(github.com/coreos/ignition/v2/config/util)) = 2.7.0
Provides: bundled(golang(github.com/coreos/ignition/v2/config/v3_0/types)) = 2.7.0
Provides: bundled(golang(github.com/coreos/ignition/v2/config/v3_1/types)) = 2.7.0
Provides: bundled(golang(github.com/coreos/ignition/v2/config/v3_2/types)) = 2.7.0
Provides: bundled(golang(github.com/coreos/ignition/v2/config/v3_3_experimental/types)) = 2.7.0
Provides: bundled(golang(github.com/coreos/ignition/v2/config/validate)) = 2.7.0
Provides: bundled(golang(github.com/coreos/vcontext/json)) = 0.0.0-20191017033345.git260217907eb5
Provides: bundled(golang(github.com/coreos/vcontext/path)) = 0.0.0-20191017033345.git260217907eb5
Provides: bundled(golang(github.com/coreos/vcontext/report)) = 0.0.0-20191017033345.git260217907eb5
Provides: bundled(golang(github.com/coreos/vcontext/tree)) = 0.0.0-20191017033345.git260217907eb5
Provides: bundled(golang(github.com/coreos/vcontext/validate)) = 0.0.0-20191017033345.git260217907eb5
Provides: bundled(golang(github.com/coreos/vcontext/yaml)) = 0.0.0-20191017033345.git260217907eb5
Provides: bundled(golang(github.com/davecgh/go-spew/spew)) = 1.1.1
Provides: bundled(golang(github.com/spf13/pflag)) = 1.0.5
Provides: bundled(golang(github.com/stretchr/testify/assert)) = 1.5.1
Provides: bundled(golang(github.com/vincent-petithory/dataurl)) = 0.0.0-20160330182126.git9a301d65acbb
Provides: bundled(golang(gopkg.in/yaml.v3)) = 3.0.0-20191010095647.gitfc94e3f71652

%description
%{common_description}

%gopkg

%package nonlinux
Summary:       Fedora CoreOS Config Transpiler for macOS and Windows
License:       ASL 2.0
BuildArch:     noarch

%description nonlinux
%{common_description}

This package contains macOS and Windows fcct 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
FCCT GitHub releases page.

%prep
%goprep -k
# With GO111MODULE=off, as set by %%gobuild, `go build` can't find the pflag
# package in the vendor directory.  strace shows that it doesn't even look
# in vendor/.  This doesn't happen with other dependencies, and I have no
# explanation.  Hack around it by explicitly including pflag in the GOPATH.
mkdir -p %gobuilddir/src/github.com/spf13
ln -s ../../../../vendor/github.com/spf13/pflag %gobuilddir/src/github.com/spf13/pflag

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

echo "Building fcct..."
%gobuild -o ./fcct 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 fcct..."
GOARCH=amd64 GOOS=darwin %gocrossbuild -o fcct-x86_64-apple-darwin internal/main.go

echo "Building Windows fcct..."
GOARCH=amd64 GOOS=windows %gocrossbuild -o fcct-x86_64-pc-windows-gnu.exe internal/main.go

%install
install -d -p %{buildroot}%{_bindir}
install -p -m 0755 ./fcct %{buildroot}%{_bindir}
install -d -p %{buildroot}%{_datadir}/fcct
install -p -m 0644 ./fcct-x86_64-apple-darwin %{buildroot}%{_datadir}/fcct
install -p -m 0644 ./fcct-x86_64-pc-windows-gnu.exe %{buildroot}%{_datadir}/fcct

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

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

%files nonlinux
%license %{golicenses}
%dir %{_datadir}/fcct
%{_datadir}/fcct/fcct-x86_64-apple-darwin
%{_datadir}/fcct/fcct-x86_64-pc-windows-gnu.exe

%changelog
* Fri Oct 23 2020 Stephen Lowrie <slowrie@redhat.com> - 0.7.0-1
- New release

* Mon Jul 27 2020 Fedora Release Engineering <releng@fedoraproject.org> - 0.6.0-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild

* Fri May 29 2020 Benjamin Gilbert <bgilbert@redhat.com> - 0.6.0-1
- New release

* Mon Mar 23 2020 Benjamin Gilbert <bgilbert@redhat.com> - 0.5.0-1
- New release

* Wed Feb 05 2020 James Cassell <cyberpear@fedoraproject.org> - 0.4.0-5
- Include "FCCT" in the Summary to enable discovery by 'dnf search'

* Tue Feb 04 2020 Benjamin Gilbert <bgilbert@redhat.com> - 0.4.0-4
- Provide "fcct" to aid installation
- Minor improvement to -nonlinux description

* Sat Feb 01 2020 Benjamin Gilbert <bgilbert@redhat.com> - 0.4.0-3
- Avoid incorrect separate noarch build in koji
- Re-enable noarch package check; it was the wrong fix

* Fri Jan 31 2020 Benjamin Gilbert <bgilbert@redhat.com> - 0.4.0-2
- Disable noarch package check that was failing the build

* Thu Jan 30 2020 Benjamin Gilbert <bgilbert@redhat.com> - 0.4.0-1
- Initial package