Blame SPECS/weldr-client.spec

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