weldr-client/weldr-client.spec

151 lines
4.7 KiB
RPMSpec
Raw Normal View History

2021-04-12 21:52:47 +00:00
# Pass --with tests to rpmbuild to build composer-cli-tests
%bcond_with tests
# Pass --without signed to skip gpg signed tar.gz (DO NOT DO THAT IN PRODUCTION)
%bcond_without signed
2021-04-12 21:52:47 +00:00
- New release: 35.3 (bcl) - spec: Adjust build methods for RHEL 8 (bcl) - github: Run build-in-podman to test building package (bcl) - spec: Use v2 module (bcl) - Makefile: Use v2 module (bcl) - Makefile: Add a build-in-podman target (bcl) - tests: Add JSON and error result testing to status (bcl) - tests: Add JSON and error result testing to sources (bcl) - tests: Add JSON and error result testing to projects (bcl) - tests: Add JSON and error result testing to modules (bcl) - tests: Add JSON and error result testing to distros (bcl) - tests: Add JSON and error result testing to compose (bcl) - tests: Add JSON and error result testing to blueprints (bcl) - test: Fix test client setup and output capture code (bcl) - test: Close output capture in printwrap_test (bcl) - test: reset the root flags on every ExecuteTest call (bcl) - status: Use ExecutionErrors for API errors (bcl) - sources: Use ExecutionErrors for API errors (bcl) - projects: Use ExecutionErrors for API errors (bcl) - modules: Use ExecutionErrors for API errors (bcl) - distros: Use ExecutionErrors for API errors (bcl) - compose: Use ExecutionErrors for API errors (bcl) - blueprints: Use ExecutionErrors for API errors (bcl) - composer-cli: Turn off normal command Stdout when --json is used (bcl) - weldr: Fix Stringer interface on API messages (bcl) - weldr: Clean up error message return code (bcl) - weldr: Move Unmarshal error to error position (bcl) - root: Add a helper function to print a list of errors (bcl) - Use GetFilePath for ComposeImage (bcl) - Use GetFilePath for ComposeResults (bcl) - Use GetFilePath for ComposerMetadata (bcl) - Use GetFilePath for ComposeLogs (bcl) - weldr: Add GetFilePath to download a file to a path (bcl) - Creating v2 module for breaking API changes (bcl) - Makefile: Add update-mods target (bcl) - vendor: Update the modules and vendor directory (bcl) - Bump go version to 1.15 (bcl) - Limit dependabot to 1 PR (bcl) - Enable Dependabot service (atodorov) - tests: Fix integration tests (bcl)
2021-10-04 21:34:04 +00:00
%global goipath github.com/osbuild/weldr-client/v2
2021-04-12 21:52:47 +00:00
Name: weldr-client
Version: 35.5
Release: 2%{?dist}
2021-04-12 21:52:47 +00:00
# Upstream license specification: Apache-2.0
License: ASL 2.0
Summary: Command line utility to control osbuild-composer
Url: %{gourl}
Source0: https://github.com/osbuild/weldr-client/releases/download/v%{version}/%{name}-%{version}.tar.gz
%if %{with signed}
2021-04-12 21:52:47 +00:00
Source1: https://github.com/osbuild/weldr-client/releases/download/v%{version}/%{name}-%{version}.tar.gz.asc
Source2: https://keys.openpgp.org/vks/v1/by-fingerprint/117E8C168EFE3A7F#/gpg-117E8C168EFE3A7F.key
%endif
2021-04-12 21:52:47 +00:00
Obsoletes: composer-cli < 35.0
2021-04-12 21:52:47 +00:00
Provides: composer-cli = %{version}-%{release}
%gometa
BuildRequires: %{?go_compiler:compiler(go-compiler)}%{!?go_compiler:golang}
%if 0%{?fedora}
BuildRequires: golang(github.com/BurntSushi/toml)
BuildRequires: golang(github.com/spf13/cobra)
# Required for tests and %check
BuildRequires: golang(github.com/stretchr/testify/assert)
BuildRequires: golang(github.com/stretchr/testify/require)
%endif
BuildRequires: git-core
BuildRequires: make
BuildRequires: gnupg2
%description
Command line utility to control osbuild-composer
%prep
%if %{with signed}
2021-04-12 21:52:47 +00:00
%{gpgverify} --keyring='%{SOURCE2}' --signature='%{SOURCE1}' --data='%{SOURCE0}'
%endif
2021-04-12 21:52:47 +00:00
%if 0%{?rhel}
%forgeautosetup -p1
%else
%goprep
%endif
%build
- New release: 35.3 (bcl) - spec: Adjust build methods for RHEL 8 (bcl) - github: Run build-in-podman to test building package (bcl) - spec: Use v2 module (bcl) - Makefile: Use v2 module (bcl) - Makefile: Add a build-in-podman target (bcl) - tests: Add JSON and error result testing to status (bcl) - tests: Add JSON and error result testing to sources (bcl) - tests: Add JSON and error result testing to projects (bcl) - tests: Add JSON and error result testing to modules (bcl) - tests: Add JSON and error result testing to distros (bcl) - tests: Add JSON and error result testing to compose (bcl) - tests: Add JSON and error result testing to blueprints (bcl) - test: Fix test client setup and output capture code (bcl) - test: Close output capture in printwrap_test (bcl) - test: reset the root flags on every ExecuteTest call (bcl) - status: Use ExecutionErrors for API errors (bcl) - sources: Use ExecutionErrors for API errors (bcl) - projects: Use ExecutionErrors for API errors (bcl) - modules: Use ExecutionErrors for API errors (bcl) - distros: Use ExecutionErrors for API errors (bcl) - compose: Use ExecutionErrors for API errors (bcl) - blueprints: Use ExecutionErrors for API errors (bcl) - composer-cli: Turn off normal command Stdout when --json is used (bcl) - weldr: Fix Stringer interface on API messages (bcl) - weldr: Clean up error message return code (bcl) - weldr: Move Unmarshal error to error position (bcl) - root: Add a helper function to print a list of errors (bcl) - Use GetFilePath for ComposeImage (bcl) - Use GetFilePath for ComposeResults (bcl) - Use GetFilePath for ComposerMetadata (bcl) - Use GetFilePath for ComposeLogs (bcl) - weldr: Add GetFilePath to download a file to a path (bcl) - Creating v2 module for breaking API changes (bcl) - Makefile: Add update-mods target (bcl) - vendor: Update the modules and vendor directory (bcl) - Bump go version to 1.15 (bcl) - Limit dependabot to 1 PR (bcl) - Enable Dependabot service (atodorov) - tests: Fix integration tests (bcl)
2021-10-04 21:34:04 +00:00
export LDFLAGS="-X %{goipath}/cmd/composer-cli/root.Version=%{version} "
2021-04-12 21:52:47 +00:00
%if 0%{?rhel}
GO_BUILD_PATH=$PWD/_build
install -m 0755 -vd $(dirname $GO_BUILD_PATH/src/%{goipath})
ln -fs $PWD $GO_BUILD_PATH/src/%{goipath}
cd $GO_BUILD_PATH/src/%{goipath}
install -m 0755 -vd _bin
export PATH=$PWD/_bin${PATH:+:$PATH}
export GOPATH=$GO_BUILD_PATH:%{gopath}
export GOFLAGS=-mod=vendor
%else
export GOPATH="%{gobuilddir}:${GOPATH:+${GOPATH}:}%{?gopath}"
export GO111MODULE=off
%endif
%gobuild -o composer-cli %{goipath}/cmd/composer-cli
2021-04-12 21:52:47 +00:00
## TODO
##make man
%if %{with tests} || 0%{?rhel}
- New release: 35.3 (bcl) - spec: Adjust build methods for RHEL 8 (bcl) - github: Run build-in-podman to test building package (bcl) - spec: Use v2 module (bcl) - Makefile: Use v2 module (bcl) - Makefile: Add a build-in-podman target (bcl) - tests: Add JSON and error result testing to status (bcl) - tests: Add JSON and error result testing to sources (bcl) - tests: Add JSON and error result testing to projects (bcl) - tests: Add JSON and error result testing to modules (bcl) - tests: Add JSON and error result testing to distros (bcl) - tests: Add JSON and error result testing to compose (bcl) - tests: Add JSON and error result testing to blueprints (bcl) - test: Fix test client setup and output capture code (bcl) - test: Close output capture in printwrap_test (bcl) - test: reset the root flags on every ExecuteTest call (bcl) - status: Use ExecutionErrors for API errors (bcl) - sources: Use ExecutionErrors for API errors (bcl) - projects: Use ExecutionErrors for API errors (bcl) - modules: Use ExecutionErrors for API errors (bcl) - distros: Use ExecutionErrors for API errors (bcl) - compose: Use ExecutionErrors for API errors (bcl) - blueprints: Use ExecutionErrors for API errors (bcl) - composer-cli: Turn off normal command Stdout when --json is used (bcl) - weldr: Fix Stringer interface on API messages (bcl) - weldr: Clean up error message return code (bcl) - weldr: Move Unmarshal error to error position (bcl) - root: Add a helper function to print a list of errors (bcl) - Use GetFilePath for ComposeImage (bcl) - Use GetFilePath for ComposeResults (bcl) - Use GetFilePath for ComposerMetadata (bcl) - Use GetFilePath for ComposeLogs (bcl) - weldr: Add GetFilePath to download a file to a path (bcl) - Creating v2 module for breaking API changes (bcl) - Makefile: Add update-mods target (bcl) - vendor: Update the modules and vendor directory (bcl) - Bump go version to 1.15 (bcl) - Limit dependabot to 1 PR (bcl) - Enable Dependabot service (atodorov) - tests: Fix integration tests (bcl)
2021-10-04 21:34:04 +00:00
export BUILDTAGS="integration"
2021-04-12 21:52:47 +00:00
# Build test binaries with `go test -c`, so that they can take advantage of
- New release: 35.3 (bcl) - spec: Adjust build methods for RHEL 8 (bcl) - github: Run build-in-podman to test building package (bcl) - spec: Use v2 module (bcl) - Makefile: Use v2 module (bcl) - Makefile: Add a build-in-podman target (bcl) - tests: Add JSON and error result testing to status (bcl) - tests: Add JSON and error result testing to sources (bcl) - tests: Add JSON and error result testing to projects (bcl) - tests: Add JSON and error result testing to modules (bcl) - tests: Add JSON and error result testing to distros (bcl) - tests: Add JSON and error result testing to compose (bcl) - tests: Add JSON and error result testing to blueprints (bcl) - test: Fix test client setup and output capture code (bcl) - test: Close output capture in printwrap_test (bcl) - test: reset the root flags on every ExecuteTest call (bcl) - status: Use ExecutionErrors for API errors (bcl) - sources: Use ExecutionErrors for API errors (bcl) - projects: Use ExecutionErrors for API errors (bcl) - modules: Use ExecutionErrors for API errors (bcl) - distros: Use ExecutionErrors for API errors (bcl) - compose: Use ExecutionErrors for API errors (bcl) - blueprints: Use ExecutionErrors for API errors (bcl) - composer-cli: Turn off normal command Stdout when --json is used (bcl) - weldr: Fix Stringer interface on API messages (bcl) - weldr: Clean up error message return code (bcl) - weldr: Move Unmarshal error to error position (bcl) - root: Add a helper function to print a list of errors (bcl) - Use GetFilePath for ComposeImage (bcl) - Use GetFilePath for ComposeResults (bcl) - Use GetFilePath for ComposerMetadata (bcl) - Use GetFilePath for ComposeLogs (bcl) - weldr: Add GetFilePath to download a file to a path (bcl) - Creating v2 module for breaking API changes (bcl) - Makefile: Add update-mods target (bcl) - vendor: Update the modules and vendor directory (bcl) - Bump go version to 1.15 (bcl) - Limit dependabot to 1 PR (bcl) - Enable Dependabot service (atodorov) - tests: Fix integration tests (bcl)
2021-10-04 21:34:04 +00:00
# golang's testing package. The RHEL golang rpm macros don't support building them
2021-04-12 21:52:47 +00:00
# directly. Thus, do it manually, taking care to also include a build id.
#
# On Fedora go modules have already been turned off, and the path set to the one into which
2021-04-12 21:52:47 +00:00
# the golang-* packages install source code.
export LDFLAGS="${LDFLAGS:-} -linkmode=external -compressdwarf=false -B 0x$(od -N 20 -An -tx1 -w100 /dev/urandom | tr -d ' ')"
go test -c -tags=integration -buildmode pie -compiler gc -ldflags="${LDFLAGS}" -o composer-cli-tests %{goipath}/weldr
- New release: 35.3 (bcl) - spec: Adjust build methods for RHEL 8 (bcl) - github: Run build-in-podman to test building package (bcl) - spec: Use v2 module (bcl) - Makefile: Use v2 module (bcl) - Makefile: Add a build-in-podman target (bcl) - tests: Add JSON and error result testing to status (bcl) - tests: Add JSON and error result testing to sources (bcl) - tests: Add JSON and error result testing to projects (bcl) - tests: Add JSON and error result testing to modules (bcl) - tests: Add JSON and error result testing to distros (bcl) - tests: Add JSON and error result testing to compose (bcl) - tests: Add JSON and error result testing to blueprints (bcl) - test: Fix test client setup and output capture code (bcl) - test: Close output capture in printwrap_test (bcl) - test: reset the root flags on every ExecuteTest call (bcl) - status: Use ExecutionErrors for API errors (bcl) - sources: Use ExecutionErrors for API errors (bcl) - projects: Use ExecutionErrors for API errors (bcl) - modules: Use ExecutionErrors for API errors (bcl) - distros: Use ExecutionErrors for API errors (bcl) - compose: Use ExecutionErrors for API errors (bcl) - blueprints: Use ExecutionErrors for API errors (bcl) - composer-cli: Turn off normal command Stdout when --json is used (bcl) - weldr: Fix Stringer interface on API messages (bcl) - weldr: Clean up error message return code (bcl) - weldr: Move Unmarshal error to error position (bcl) - root: Add a helper function to print a list of errors (bcl) - Use GetFilePath for ComposeImage (bcl) - Use GetFilePath for ComposeResults (bcl) - Use GetFilePath for ComposerMetadata (bcl) - Use GetFilePath for ComposeLogs (bcl) - weldr: Add GetFilePath to download a file to a path (bcl) - Creating v2 module for breaking API changes (bcl) - Makefile: Add update-mods target (bcl) - vendor: Update the modules and vendor directory (bcl) - Bump go version to 1.15 (bcl) - Limit dependabot to 1 PR (bcl) - Enable Dependabot service (atodorov) - tests: Fix integration tests (bcl)
2021-10-04 21:34:04 +00:00
%endif
2021-04-12 21:52:47 +00:00
%install
make DESTDIR=%{buildroot} install
%if %{with tests} || 0%{?rhel}
make DESTDIR=%{buildroot} install-tests
%endif
%check
%if 0%{?fedora}
export GOPATH="%{gobuilddir}:${GOPATH:+${GOPATH}:}%{?gopath}"
export GO111MODULE=off
%endif
- New release: 35.3 (bcl) - spec: Adjust build methods for RHEL 8 (bcl) - github: Run build-in-podman to test building package (bcl) - spec: Use v2 module (bcl) - Makefile: Use v2 module (bcl) - Makefile: Add a build-in-podman target (bcl) - tests: Add JSON and error result testing to status (bcl) - tests: Add JSON and error result testing to sources (bcl) - tests: Add JSON and error result testing to projects (bcl) - tests: Add JSON and error result testing to modules (bcl) - tests: Add JSON and error result testing to distros (bcl) - tests: Add JSON and error result testing to compose (bcl) - tests: Add JSON and error result testing to blueprints (bcl) - test: Fix test client setup and output capture code (bcl) - test: Close output capture in printwrap_test (bcl) - test: reset the root flags on every ExecuteTest call (bcl) - status: Use ExecutionErrors for API errors (bcl) - sources: Use ExecutionErrors for API errors (bcl) - projects: Use ExecutionErrors for API errors (bcl) - modules: Use ExecutionErrors for API errors (bcl) - distros: Use ExecutionErrors for API errors (bcl) - compose: Use ExecutionErrors for API errors (bcl) - blueprints: Use ExecutionErrors for API errors (bcl) - composer-cli: Turn off normal command Stdout when --json is used (bcl) - weldr: Fix Stringer interface on API messages (bcl) - weldr: Clean up error message return code (bcl) - weldr: Move Unmarshal error to error position (bcl) - root: Add a helper function to print a list of errors (bcl) - Use GetFilePath for ComposeImage (bcl) - Use GetFilePath for ComposeResults (bcl) - Use GetFilePath for ComposerMetadata (bcl) - Use GetFilePath for ComposeLogs (bcl) - weldr: Add GetFilePath to download a file to a path (bcl) - Creating v2 module for breaking API changes (bcl) - Makefile: Add update-mods target (bcl) - vendor: Update the modules and vendor directory (bcl) - Bump go version to 1.15 (bcl) - Limit dependabot to 1 PR (bcl) - Enable Dependabot service (atodorov) - tests: Fix integration tests (bcl)
2021-10-04 21:34:04 +00:00
# Run the unit tests
export LDFLAGS="-X %{goipath}/cmd/composer-cli/root.Version=%{version} "
make test
2021-04-12 21:52:47 +00:00
%files
%license LICENSE
%doc examples HACKING.md README.md
%{_bindir}/composer-cli
%dir %{_sysconfdir}/bash_completion.d
%{_sysconfdir}/bash_completion.d/composer-cli
%{_mandir}/man1/composer-cli*
%if %{with tests} || 0%{?rhel}
%package tests
Summary: Integration tests for composer-cli
%description tests
Integration tests to be run on a pristine-dedicated system to test the
composer-cli package.
%files tests
%license LICENSE
%{_libexecdir}/tests/composer-cli/
%endif
%changelog
* Sat Jun 18 2022 Robert-André Mauchin <zebob.m@gmail.com> - 35.5-2
- Rebuilt for CVE-2022-1996, CVE-2022-24675, CVE-2022-28327, CVE-2022-27191,
CVE-2022-29526, CVE-2022-30629
* Mon Feb 14 2022 Brian C. Lane <bcl@redhat.com> - 35.5-1
- New release: 35.5 (bcl)
- docs: Explain how to undo blueprints delete (bcl)
- test: server status no longer returns devel (bcl)
- Use GetFrozenBlueprintsTOML for blueprints freeze save (bcl)
- Add a test for float uid/gid in frozen blueprint (bcl)
- Use GetBlueprintsTOML for blueprints save (bcl)
- test: Add a test for float uid/gid in saved blueprint (bcl)
- build(deps): bump github.com/BurntSushi/toml from 0.4.1 to 1.0.0 (49699333+dependabot[bot])
- tests: trigger on push to main (jrusz)
- build(deps): bump github.com/spf13/cobra from 1.2.1 to 1.3.0 (49699333+dependabot[bot])
- ci: add keystore for sonarqube (jrusz)
- spec: Switch to using %%gobuild macro on Fedora (bcl)
- ci: change workflow name (jrusz)
- ci: add gitlab-ci and sonarqube (jrusz)
- doc: fix example links from the README (tdecacqu)
- build(deps): bump actions/checkout from 2.3.4 to 2.4.0 (49699333+dependabot[bot])
- ci: Enable Coverity Scan tool (atodorov)