# Pass --with tests to rpmbuild to build composer-cli-tests %bcond_with tests %global goipath github.com/osbuild/weldr-client Name: weldr-client Version: 35.0 Release: 3%{?dist} # 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 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 Obsoletes: composer-cli < 34.0 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) %endif BuildRequires: git-core BuildRequires: make BuildRequires: gnupg2 # Required for tests and %check BuildRequires: golang(github.com/stretchr/testify/assert) BuildRequires: golang(github.com/stretchr/testify/require) %description Command line utility to control osbuild-composer %prep %{gpgverify} --keyring='%{SOURCE2}' --signature='%{SOURCE1}' --data='%{SOURCE0}' %if 0%{?rhel} %forgeautosetup -p1 %else %goprep %endif %build %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 export LDFLAGS="-X github.com/osbuild/weldr-client/cmd/composer-cli/root.Version=%{version} " make GOBUILDFLAGS="%{gobuildflags}" build ## TODO ##make man %if %{with tests} || 0%{?rhel} # Build test binaries with `go test -c`, so that they can take advantage of # golang's testing package. The golang rpm macros don't support building them # directly. Thus, do it manually, taking care to also include a build id. # # On Fedora, also turn off go modules and set the path to the one into which # the golang-* packages install source code. %if 0%{?fedora} export GOPATH="%{gobuilddir}:${GOPATH:+${GOPATH}:}%{?gopath}" export GO111MODULE=off %endif export LDFLAGS="-X github.com/osbuild/weldr-client/cmd/composer-cli/root.Version=%{version} " export BUILDTAGS="integration" make GOBUILDFLAGS="%{gobuildflags}" integration %endif %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 export LDFLAGS="-X github.com/osbuild/weldr-client/cmd/composer-cli/root.Version=%{version} " make GOBUILDFLAGS="%{gotestflags}" test %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 * Thu Apr 08 2021 Brian C. Lane - 35.0-1 - spec: Bump release to 2 (bcl) - spec: Fix BuildRequires for tests (bcl) - Makefile: Remove executable from bash completion (bcl) - Makefile: Only use GOBUILDFLAGS (bcl) - spec: Bump release to 2 (bcl) - spec: Add doc files (bcl) - spec: Add gpg signature verification (bcl) - spec: Use git-core instead of git (bcl) - spec: Set License to Apache 2.0 (bcl) - spec: Update Source urls with new project location (bcl) - Makefile: Start with version 35.0 (bcl) - Makefile: Move test binary to an install-tests target (bcl) - Makefile: Drop -race from test target, conflicts with -pie in Fedora build (bcl) - Move the project to github.com/osbuild/weldr-client/ (bcl) - README: Add documentation and examples (bcl) - composer-cli: Update the json output with more details (bcl) - composer-cli: Add sources commands and tests (bcl) - weldr: Add sources functions and tests (bcl) - composer-cli: Add modules info command and test (bcl) - weldr: Add ModulesInfo function and tests (bcl) - composer-cli: Add projects info command and tests (bcl) - weldr: Add ProjectsInfo function and tests (bcl) - composer-cli: Add projects list command (bcl) - weldr: Add ListProjects function (bcl) - composer-cli: Add helper function to word-wrap output (bcl) - composer-cli: Add support for modules list command (bcl) - weldr: Add ListModules function and tests (bcl) - actions: Install golangci-lint (bcl) - actions: Move to go 1.14 (bcl) - weldr: Remove unused code from GetComposeTypes (bcl) - Makefile: Add golangci-lint to make check, and coverage to make test (bcl) - composer-cli: Add compose info output (bcl) - weldr: Add ComposeInfo function and tests (bcl) - weldr: Add Compose Info structs to apischema (bcl) - composer-cli: Add compose image command and tests (bcl) - weldr: Add ComposeImage function and tests (bcl) - composer-cli: Add compose results command and test (bcl) - weldr: Add ComposeResults function and tests (bcl) - maint: Update go.mod with 'go mod tidy' and set version to 1.14 (bcl) - composer-cli: Add compose metadata command and test (bcl) - weldr: Add ComposeMetadata function and tests (bcl) - weldr: Use http for ostree url tests (bcl) - composer-cli: Add compose logs command to download log tarfile (bcl) - weldr: Add MoveFile function (bcl) - weldr: Use GetContentFilename in ComposeLogs (bcl) - weldr: Add GetContentFilename helper function and tests (bcl) - weldr: Add ComposeLogs function and testing (bcl) - weldr: Add GetFile and tests (bcl) - composer-cli: Add compose log command (bcl) - weldr: Add support for retrieving running compose's log (bcl) - composer-cli: Fix compose list handling of multiple filters (bcl) - weldr: Add test for IsStringInSlice (bcl) - weldr: Make IsStringInSlice public (bcl) - weldr: Some errors use http.StatusInternalServerError(500) (bcl) - composer-cli: Add compose start-ostree command (bcl) - composer-cli: Add upload support to compose start (bcl) - weldr: Add upload functions to ComposeStart (bcl) - weldr: Add functions to start ostree composes (bcl) - Fix running composer-cli with no arguments (bcl) - Add manpages to the rpm (bcl) - Add composer-cli bash completion support (bcl) - Makefile: Adding release, srpm, and rpm creation support (bcl) - Set repo to github.com/weldr/weldr-client (bcl) - tests: Remove localtime from compose status test (bcl) - blueprints: Add json output to freeze, show, and changes (bcl) - compose: Clean up error handling (bcl) - blueprints: Add blueprints undo command and tests (bcl) - blueprints: Add blueprints tag command and tests (bcl) - blueprints: Add test for blueprints workspace command (bcl) - blueprints: Clean up error handling (bcl) - blueprints: Add test for blueprints show (bcl) - blueprints: Add test for blueprints save (bcl) - blueprints: Add test for blueprints push (bcl) - weldr: Add tests for Frozen TOML and JSON functions (bcl) - Cleanup some make check complaints (bcl) - blueprints: Add depsolve command and test (bcl) - weldr: Add DepsolveBlueprints function and test (bcl) - blueprints: Add tests for blueprints delete command (bcl) - blueprints: Add test for changes command (bcl) - Add HACKING.md document for developers (bcl) - weldr: Convert compose tests to integration tests (bcl) - weldr: Catch HTTP Status 500 and decode an APIError response (bcl) - weldr: Use integration tests for status test (bcl) - weldr: Use GetJSONAllFnTotal for changes and add cmdline use of it (bcl) - weldr: Add new GetJSONAllFnTotal function (bcl) - blueprints: Convert blueprint tests to integration tests (bcl) - weldr: Add GetBlueprintsChanges function (bcl) - composer-cli: Print uuid when compose started (bcl) - weldr: Add json output to DELETE requests (bcl) - composer-cli: Add cancel command and tests (bcl) - weldr: Add CancelCompose and tests (bcl) - composer-cli: Add compose status command and test (bcl) - weldr: Add function to sort ComposeStatusV0 structs (bcl) - Cleanup lint warnings for weldr/ (bcl) - Cleanup lint warnings for root.go (bcl) - check: Exit with a 1 if golint finds problems (bcl) - Setup github actions for make check and make test (bcl) - composer-cli: Add compose delete command and tests (bcl) - weldr: Add DeleteComposes function and tests (bcl) - composer-cli: Add compose start command and tests (bcl) - weldr: Add StartCompose function and tests (bcl) - composer-cli: Add compose types command and test (bcl) - weldr: Add GetComposeTypes function and test (bcl) - composer-cli: Sort the output of blueprints list (bcl) - composer-cli: Add compose list command (bcl) - weldr: Add ListComposes function and test (bcl) - Add a .gitignore file (bcl) - Add Apache 2.0 License file (bcl) - Add blueprints subcommands (bcl) - Add status show command and test (bcl) - composer-cli: Add the core command processing code (bcl) - weldr: Add blueprint functions (bcl) - weldr: Add server status function (bcl) - weldr: Add API schema for error responses, status, and blueprint lists (bcl)