Blame SPECS/weldr-client.spec

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