Blame SPECS/weldr-client.spec

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