Blame SPECS/weldr-client.spec

777404
# Pass --with tests to rpmbuild to build composer-cli-tests
777404
%bcond_with tests
777404
# Pass --without signed to skip gpg signed tar.gz (DO NOT DO THAT IN PRODUCTION)
777404
%bcond_without signed
777404
777404
%global goipath         github.com/osbuild/weldr-client/v2
777404
777404
Name:      weldr-client
17787f
Version:   35.9
17787f
Release:   2%{?dist}
777404
# Upstream license specification: Apache-2.0
777404
License:   ASL 2.0
777404
Summary:   Command line utility to control osbuild-composer
17787f
17787f
%gometa
777404
Url:       %{gourl}
777404
Source0:   https://github.com/osbuild/weldr-client/releases/download/v%{version}/%{name}-%{version}.tar.gz
777404
%if %{with signed}
777404
Source1:   https://github.com/osbuild/weldr-client/releases/download/v%{version}/%{name}-%{version}.tar.gz.asc
777404
Source2:   https://keys.openpgp.org/vks/v1/by-fingerprint/117E8C168EFE3A7F#/gpg-117E8C168EFE3A7F.key
777404
%endif
777404
777404
Obsoletes: composer-cli < 35.0
777404
Provides: composer-cli = %{version}-%{release}
777404
17787f
Requires: diffutils
777404
777404
BuildRequires:  %{?go_compiler:compiler(go-compiler)}%{!?go_compiler:golang}
777404
%if 0%{?fedora}
777404
BuildRequires:  golang(github.com/BurntSushi/toml)
777404
BuildRequires:  golang(github.com/spf13/cobra)
777404
# Required for tests and %check
777404
BuildRequires:  golang(github.com/stretchr/testify/assert)
777404
BuildRequires:  golang(github.com/stretchr/testify/require)
777404
%endif
777404
777404
BuildRequires: git-core
777404
BuildRequires: make
777404
BuildRequires: gnupg2
777404
777404
777404
%description
777404
Command line utility to control osbuild-composer
777404
777404
%prep
777404
%if %{with signed}
777404
%{gpgverify} --keyring='%{SOURCE2}' --signature='%{SOURCE1}' --data='%{SOURCE0}'
777404
%endif
777404
%if 0%{?rhel}
777404
%forgeautosetup -p1
777404
%else
777404
%goprep
777404
%endif
777404
777404
%build
777404
export LDFLAGS="-X %{goipath}/cmd/composer-cli/root.Version=%{version} "
777404
777404
%if 0%{?rhel}
777404
GO_BUILD_PATH=$PWD/_build
777404
install -m 0755 -vd $(dirname $GO_BUILD_PATH/src/%{goipath})
777404
ln -fs $PWD $GO_BUILD_PATH/src/%{goipath}
777404
cd $GO_BUILD_PATH/src/%{goipath}
777404
install -m 0755 -vd _bin
777404
export PATH=$PWD/_bin${PATH:+:$PATH}
777404
export GOPATH=$GO_BUILD_PATH:%{gopath}
777404
export GOFLAGS=-mod=vendor
777404
%else
777404
export GOPATH="%{gobuilddir}:${GOPATH:+${GOPATH}:}%{?gopath}"
777404
export GO111MODULE=off
777404
%endif
777404
%gobuild -o composer-cli %{goipath}/cmd/composer-cli
777404
777404
777404
## TODO
777404
##make man
777404
777404
%if %{with tests} || 0%{?rhel}
777404
export BUILDTAGS="integration"
777404
777404
# Build test binaries with `go test -c`, so that they can take advantage of
777404
# golang's testing package. The RHEL golang rpm macros don't support building them
777404
# directly. Thus, do it manually, taking care to also include a build id.
777404
#
777404
# On Fedora go modules have already been turned off, and the path set to the one into which
777404
# the golang-* packages install source code.
777404
export LDFLAGS="${LDFLAGS:-} -linkmode=external -compressdwarf=false -B 0x$(od -N 20 -An -tx1 -w100 /dev/urandom | tr -d ' ')"
777404
go test -c -tags=integration -buildmode pie -compiler gc -ldflags="${LDFLAGS}" -o composer-cli-tests %{goipath}/weldr
777404
%endif
777404
777404
%install
777404
make DESTDIR=%{buildroot} install
777404
777404
%if %{with tests} || 0%{?rhel}
777404
make DESTDIR=%{buildroot} install-tests
777404
%endif
777404
777404
%check
777404
%if 0%{?fedora}
777404
export GOPATH="%{gobuilddir}:${GOPATH:+${GOPATH}:}%{?gopath}"
777404
export GO111MODULE=off
777404
%endif
777404
777404
# Run the unit tests
777404
export LDFLAGS="-X %{goipath}/cmd/composer-cli/root.Version=%{version} "
777404
make test
777404
777404
777404
%files
777404
%license LICENSE
777404
%doc examples HACKING.md README.md
777404
%{_bindir}/composer-cli
777404
%dir %{_sysconfdir}/bash_completion.d
777404
%{_sysconfdir}/bash_completion.d/composer-cli
777404
%{_mandir}/man1/composer-cli*
777404
777404
%if %{with tests} || 0%{?rhel}
777404
%package tests
777404
Summary:    Integration tests for composer-cli
777404
17787f
Requires: createrepo_c
17787f
777404
%description tests
777404
Integration tests to be run on a pristine-dedicated system to test the
777404
composer-cli package.
777404
777404
%files tests
777404
%license LICENSE
777404
%{_libexecdir}/tests/composer-cli/
777404
%endif
777404
777404
777404
%changelog
17787f
* Tue Feb 14 2023 Brian C. Lane <bcl@redhat.com> - 35.9-2
17787f
- tests: Remove default repos before running tests
17787f
  Related: rhbz#2168666
17787f
17787f
* Wed Nov 30 2022 Brian C. Lane <bcl@redhat.com> - 35.9-1
17787f
- Copy rhel-88.json test repository from osbuild-composer
17787f
- Update osbuild-composer test repositories from osbuild-composer
17787f
- New release: 35.9 (bcl)
17787f
  Resolves: rhbz#2168666
17787f
- tests: Replace os.MkdirTemp with t.TempDir (bcl)
17787f
- blueprint save: Allow overriding bad blueprint names (bcl)
17787f
- tests: Clean up checking err in tests (bcl)
17787f
- composer-cli: Implement blueprints diff (bcl)
17787f
- saveBlueprint: Return the filename to the caller (bcl)
17787f
- composer-cli: Add tests for using --commit with old servers (bcl)
17787f
- weldr: Return error about the blueprints change route (bcl)
17787f
- weldr: Save the http status code as part of APIResponse (bcl)
17787f
- Add --commit support to blueprints save (bcl)
17787f
- Add --commit to blueprints show (bcl)
17787f
- gitleaks: Exclude the test password used in tests (bcl)
17787f
- ci: add tags to AWS instances (tlavocat)
17787f
- Update github.com/BurntSushi/toml to 1.2.1
17787f
- Update github.com/stretchr/testify to 1.8.1
17787f
- Update bump github.com/spf13/cobra to 1.6.1
17787f
- New release: 35.8 (bcl)
17787f
- completion: Remove providers from bash completion script (bcl)
17787f
- completion: Filter out new headers from compose list (bcl)
17787f
- docs: Remove unneeded Long descriptions (bcl)
17787f
- docs: Use a custom help template (bcl)
17787f
- docs: Add more command documentation (bcl)
17787f
- cmdline: Add package glob support to modules list command (bcl)
17787f
- workflow: Add govulncheck on go v1.18 (bcl)
17787f
- tests: Update to use golangci-lint 1.49.0 (bcl)
17787f
- New release: 35.7 (bcl)
17787f
- spec: Move %%gometa macro above %%gourl (bcl)
17787f
- weldr: When starting a compose pass size as bytes, not MiB (bcl)
17787f
- tests: Use correct size value in bytes for test (bcl)
17787f
- workflow: Add Go 1.18 to text matrix (bcl)
17787f
- Replace deprecated ioutil functions (bcl)
17787f
- New release: 35.6 (bcl)
17787f
- tests: Update tests for osbuild-composer changes (bcl)
17787f
- CMD: Compose status format (eloy.coto)
17787f
- CMD: Compose list format (eloy.coto)
17787f
- tests: Update tests to check for JSON list output (bcl)
17787f
- composer-cli: Change JSON output to be a list of objects (bcl)
17787f
- weldr: Simplify the old ComposeLog, etc. functions (bcl)
17787f
- composer-cli: Add --filename to blueprints freeze save command (bcl)
17787f
- composer-cli: Add --filename to blueprints save command (bcl)
17787f
- composer-cli: Add --filename to compose logs command (bcl)
17787f
- composer-cli: Add --filename to compose image command (bcl)
17787f
- composer-cli: Add --filename to compose metadata command (bcl)
17787f
- composer-cli: Add --filename to compose results command (bcl)
17787f
- weldr: Add saving to a new filename to GetFilePath function (bcl)
17787f
- github: Fix issue with codecov and forced pushes in PRs (bcl)
17787f
- Use golangci-lint 1.45.2 in workflow (bcl)
17787f
- Run workflow tests for go 1.16.x and 1.17.x (bcl)
17787f
- Move go.mod to go 1.16 (bcl)
17787f
- workflows/trigger-gitlab: run Gitlab CI in new image-builder project (jrusz)
17787f
- Update GitHub actions/setup-go to 3
17787f
- Update GitHub actions/checkout to 3
17787f
17787f
* Tue Aug 16 2022 Brian C. Lane <bcl@redhat.com> - 35.5-4
17787f
- tests: Update tests for osbuild composer changes
17787f
  Resolves: rhbz#2118829
17787f
17787f
* Tue Aug 16 2022 Brian C. Lane <bcl@redhat.com> - 35.5-3
17787f
- tests: Update repositories so tests will run
17787f
  Related: rhbz#2116773
17787f
17787f
* Tue Aug 16 2022 Brian C. Lane <bcl@redhat.com> - 35.5-2
17787f
- Rebuild with golang 1.18.4 for multiple golang CVEs
17787f
  Resolves: rhbz#2116773
17787f
777404
* Tue Feb 15 2022 Brian C. Lane <bcl@redhat.com> - 35.5-1
777404
- New release: 35.5 (bcl)
777404
  Resolves: rhbz#2052604
777404
- docs: Explain how to undo blueprints delete (bcl)
777404
- test: server status no longer returns devel (bcl)
777404
- Use GetFrozenBlueprintsTOML for blueprints freeze save (bcl)
777404
- Add a test for float uid/gid in frozen blueprint (bcl)
777404
- Use GetBlueprintsTOML for blueprints save (bcl)
777404
- test: Add a test for float uid/gid in saved blueprint (bcl)
777404
- build(deps): bump github.com/BurntSushi/toml from 0.4.1 to 1.0.0 (49699333+dependabot[bot])
777404
- tests: trigger on push to main (jrusz)
777404
- build(deps): bump github.com/spf13/cobra from 1.2.1 to 1.3.0 (49699333+dependabot[bot])
777404
- ci: add keystore for sonarqube (jrusz)
777404
- spec: Switch to using %%gobuild macro on Fedora (bcl)
777404
- ci: change workflow name (jrusz)
777404
- ci: add gitlab-ci and sonarqube (jrusz)
777404
- doc: fix example links from the README (tdecacqu)
777404
- build(deps): bump actions/checkout from 2.3.4 to 2.4.0 (49699333+dependabot[bot])
777404
- ci: Enable Coverity Scan tool (atodorov)