[Bug 1945771] Review Request: weldr-client - command line utility for osbuild-composer

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



https://bugzilla.redhat.com/show_bug.cgi?id=1945771



--- Comment #2 from Robert-André Mauchin 🐧 <zebob.m@xxxxxxxxx> ---
Slight change so that the integration tag is not left off:

# Generated by go2rpm 1.3
# Pass --with tests to rpmbuild to build composer-cli-tests
%bcond_with tests

%if 0%{?rhel}
%bcond_without vendor
%ifnarch ppc64
  %global gobuildflags -buildmode pie -compiler gc -tags=\\\"rpm_crashtraceback
${BUILDTAGS:-}\\\" -ldflags \\\"${LDFLAGS:-}%{?currentgoldflags} -B 0x$(head
-c20 /dev/urandom|od -An -tx1|tr -d ' \\n') -extldflags '%__global_ldflags
%{?__golang_extldflags}' -compressdwarf=false\\\" -a -v -x
%else
  %global gobuildflags                -compiler gc -tags=\\\"rpm_crashtraceback
${BUILDTAGS:-}\\\" -ldflags \\\"${LDFLAGS:-}%{?currentgoldflags} -B 0x$(head
-c20 /dev/urandom|od -An -tx1|tr -d ' \\n') -extldflags '%__global_ldflags
%{?__golang_extldflags}' -compressdwarf=false\\\" -a -v -x
%endif
%endif

%define setgoconfig() %{expand:
# On Fedora, turn off go modules and set the path to the one into which
# the golang-* packages install source code.
  %if %{without vendor}
    export GOPATH="%{gobuilddir}:${GOPATH:+${GOPATH}:}%{?gopath}"
    export GO111MODULE=off
  %else
    export GO111MODULE=on
    export GOFLAGS=-mod=vendor
  %endif
  export LDFLAGS="-X
github.com/osbuild/weldr-client/cmd/composer-cli/root.Version=%{version} "
}

# https://github.com/osbuild/weldr-client
%global goipath         github.com/osbuild/weldr-client
Version:                35.0

%if %{without vendor}
%gometa
%endif

%global common_description %{expand:
Command line utility to control osbuild-composer.}

Name:           weldr-client
Release:        1%{?dist}
Summary:        Command line utility to control osbuild-composer

# Upstream license specification: Apache-2.0
License:        ASL 2.0
URL:            https://github.com/osbuild/weldr-client
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://keyserver.ubuntu.com/pks/lookup?op=get&search=0xB4C6B451E4FA8B4232CA191E117E8C168EFE3A7F#/bcl-gpg.key
# git clone https://github.com/osbuild/weldr-client
# cd weldr-client
# git checkout v%%{version}
# go mod vendor
# tar czvf vendor-%%{version}.tar.gz vendor/
Source10:       vendor-%{version}.tar.gz

Obsoletes:      composer-cli < 34.0
Provides:       composer-cli = %{version}-%{release}

%if %{without vendor}
BuildRequires:  golang(github.com/BurntSushi/toml)
BuildRequires:  golang(github.com/spf13/cobra)
BuildRequires:  golang(github.com/spf13/cobra/doc)

%if %{with tests}
# Tests
BuildRequires:  golang(github.com/stretchr/testify/assert)
BuildRequires:  golang(github.com/stretchr/testify/require)
%endif
%else
BuildRequires:  %{?go_compiler:compiler(go-compiler)}%{!?go_compiler:golang}
%endif

BuildRequires:  git-core
BuildRequires:  make
BuildRequires:  gnupg2

%description
%{common_description}

%prep
%{gpgverify} --keyring='%{SOURCE2}' --signature='%{SOURCE1}'
--data='%{SOURCE0}'
%if %{without vendor}
%goprep
%else
%forgeautosetup -p1
%setup -q -T -D -a 10 -n %{name}-%{version}
%endif

# Makefile modification
# 1. We pass tags already through BUILDTAGS in gobuildflags
# 2. We export LDFLAGS in the SPEC so it is used in gobuildflags
# 3. -v is already present in gobuildflags
sed -i "s|go test -c -tags=integration|go test -c |; \
        s|\${BUILDFLAGS}||; \
        s|-v -covermode=atomic |-covermode=atomic |;" \
        Makefile

%build
%setgoconfig
export GOBUILDFLAGS="%{gobuildflags}"
%make_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.
export BUILDTAGS="integration"
export GOBUILDFLAGS="%{gobuildflags}"
%make_build integration
%endif

%install
%make_install

%if %{with tests} || 0%{?rhel}
make DESTDIR=%{buildroot} install-tests
%endif

%if %{with tests}
%check
%setgoconfig
export GOBUILDFLAGS="%{gobuildflags}"
make test
%endif

%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 01 2021 Brian C. Lane <bcl@xxxxxxxxxx> - 35.0-1
- 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)


-- 
You are receiving this mail because:
You are on the CC list for the bug.
You are always notified about changes to this product and component
_______________________________________________
package-review mailing list -- package-review@xxxxxxxxxxxxxxxxxxxxxxx
To unsubscribe send an email to package-review-leave@xxxxxxxxxxxxxxxxxxxxxxx
Fedora Code of Conduct: https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: https://lists.fedoraproject.org/archives/list/package-review@xxxxxxxxxxxxxxxxxxxxxxx
Do not reply to spam on the list, report it: https://pagure.io/fedora-infrastructure




[Index of Archives]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Yosemite Conditions]     [KDE Users]

  Powered by Linux