import osbuild-composer-40-1.el9

This commit is contained in:
CentOS Sources 2022-01-11 12:03:50 -05:00 committed by Stepan Oksanichenko
parent 7ea7216fbf
commit 808cccd5f4
3 changed files with 62 additions and 20 deletions

2
.gitignore vendored
View File

@ -1 +1 @@
SOURCES/osbuild-composer-33.3.tar.gz
SOURCES/osbuild-composer-40.tar.gz

View File

@ -1 +1 @@
dc7e4c6864e1f23c1250b7cffd8f2e5c8b346af7 SOURCES/osbuild-composer-33.3.tar.gz
7d5fe0ccb1502ae71f0332bc50d0f489c4e1d92d SOURCES/osbuild-composer-40.tar.gz

View File

@ -4,7 +4,7 @@
%global goipath github.com/osbuild/osbuild-composer
Version: 33.3
Version: 40
%gometa
@ -20,9 +20,8 @@ Name: osbuild-composer
Release: 1%{?dist}
Summary: An image building service based on osbuild
# osbuild-composer doesn't have support for building i686 images
# and also RHEL and Fedora has now only limited support for this arch.
ExcludeArch: i686
# osbuild-composer doesn't have support for building i686 and armv7hl images
ExcludeArch: i686 armv7hl
# Upstream license specification: Apache-2.0
License: ASL 2.0
@ -46,6 +45,7 @@ BuildRequires: golang(github.com/coreos/go-semver/semver)
BuildRequires: golang(github.com/coreos/go-systemd/activation)
BuildRequires: golang(github.com/deepmap/oapi-codegen/pkg/codegen)
BuildRequires: golang(github.com/go-chi/chi)
BuildRequires: golang(github.com/golang-jwt/jwt)
BuildRequires: golang(github.com/google/uuid)
BuildRequires: golang(github.com/jackc/pgx/v4)
BuildRequires: golang(github.com/julienschmidt/httprouter)
@ -56,6 +56,8 @@ BuildRequires: golang(github.com/gobwas/glob)
BuildRequires: golang(github.com/google/go-cmp/cmp)
BuildRequires: golang(github.com/gophercloud/gophercloud)
BuildRequires: golang(github.com/prometheus/client_golang/prometheus/promhttp)
BuildRequires: golang(github.com/openshift-online/ocm-sdk-go)
BuildRequires: golang(github.com/segmentio/ksuid)
BuildRequires: golang(github.com/stretchr/testify/assert)
BuildRequires: golang(github.com/ubccr/kerby)
BuildRequires: golang(github.com/vmware/govmomi)
@ -80,9 +82,11 @@ Conflicts: lorax-composer
Obsoletes: lorax-composer < 34.3
%endif
# remove in F34
# Remove when we stop releasing into Fedora 33
%if 0%{?fedora} <= 33
Obsoletes: golang-github-osbuild-composer < %{version}-%{release}
Provides: golang-github-osbuild-composer = %{version}-%{release}
%endif
# remove when F34 is EOL
Obsoletes: osbuild-composer-koji <= 23
@ -103,10 +107,13 @@ Obsoletes: osbuild-composer-koji <= 23
# generated code compatible by applying some sed magic.
#
# Remove when F33 is EOL
sed -i "s/openapi3.Swagger/openapi3.T/;s/openapi3.NewSwaggerLoader().LoadSwaggerFromData/openapi3.NewLoader().LoadFromData/" internal/cloudapi/openapi.gen.go
sed -i "s/openapi3.Swagger/openapi3.T/;s/openapi3.NewSwaggerLoader().LoadSwaggerFromData/openapi3.NewLoader().LoadFromData/" internal/cloudapi/v1/openapi.v1.gen.go
sed -i "s/openapi3.Swagger/openapi3.T/;s/openapi3.NewSwaggerLoader().LoadSwaggerFromData/openapi3.NewLoader().LoadFromData/" internal/cloudapi/v2/openapi.v2.gen.go
sed -i "s/openapi3.Swagger/openapi3.T/;s/openapi3.NewSwaggerLoader().LoadSwaggerFromData/openapi3.NewLoader().LoadFromData/" internal/worker/api/api.gen.go
%endif
%build
export GOFLAGS="-buildmode=pie"
%if 0%{?rhel}
GO_BUILD_PATH=$PWD/_build
install -m 0755 -vd $(dirname $GO_BUILD_PATH/src/%{goipath})
@ -115,9 +122,17 @@ 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
export GOFLAGS+=" -mod=vendor"
%endif
# Set the commit hash so that composer can report what source version
# was used to build it. This has to be set explicitly when calling rpmbuild,
# this script will not attempt to automatically discover it.
%if %{?commit:1}0
export LDFLAGS="${LDFLAGS} -X 'github.com/osbuild/osbuild-composer/internal/common.GitRev=%{commit}'"
%endif
export LDFLAGS="${LDFLAGS} -X 'github.com/osbuild/osbuild-composer/internal/common.RpmVersion=%{name}-%{?epoch:%epoch:}%{version}-%{release}.%{_arch}'"
%gobuild -o _bin/osbuild-composer %{goipath}/cmd/osbuild-composer
%gobuild -o _bin/osbuild-worker %{goipath}/cmd/osbuild-worker
@ -145,7 +160,9 @@ go test -c -tags=integration -ldflags="${TEST_LDFLAGS}" -o _bin/osbuild-image-te
go test -c -tags=integration -ldflags="${TEST_LDFLAGS}" -o _bin/osbuild-auth-tests %{goipath}/cmd/osbuild-auth-tests
go test -c -tags=integration -ldflags="${TEST_LDFLAGS}" -o _bin/osbuild-koji-tests %{goipath}/cmd/osbuild-koji-tests
go test -c -tags=integration -ldflags="${TEST_LDFLAGS}" -o _bin/osbuild-composer-dbjobqueue-tests %{goipath}/cmd/osbuild-composer-dbjobqueue-tests
go test -c -tags=integration -ldflags="${TEST_LDFLAGS}" -o _bin/osbuild-composer-manifest-tests %{goipath}/cmd/osbuild-composer-manifest-tests
go build -tags=integration -ldflags="${TEST_LDFLAGS}" -o _bin/cloud-cleaner %{goipath}/cmd/cloud-cleaner
go build -tags=integration -ldflags="${TEST_LDFLAGS}" -o _bin/osbuild-mock-openid-provider %{goipath}/cmd/osbuild-mock-openid-provider
%endif
@ -209,7 +226,9 @@ install -m 0755 -vp _bin/osbuild-image-tests %{buildroot}%{_l
install -m 0755 -vp _bin/osbuild-auth-tests %{buildroot}%{_libexecdir}/osbuild-composer-test/
install -m 0755 -vp _bin/osbuild-koji-tests %{buildroot}%{_libexecdir}/osbuild-composer-test/
install -m 0755 -vp _bin/osbuild-composer-dbjobqueue-tests %{buildroot}%{_libexecdir}/osbuild-composer-test/
install -m 0755 -vp _bin/osbuild-composer-manifest-tests %{buildroot}%{_libexecdir}/osbuild-composer-test/
install -m 0755 -vp _bin/cloud-cleaner %{buildroot}%{_libexecdir}/osbuild-composer-test/
install -m 0755 -vp _bin/osbuild-mock-openid-provider %{buildroot}%{_libexecdir}/osbuild-composer-test/
install -m 0755 -vp tools/define-compose-url.sh %{buildroot}%{_libexecdir}/osbuild-composer-test/
install -m 0755 -vp tools/provision.sh %{buildroot}%{_libexecdir}/osbuild-composer-test/
install -m 0755 -vp tools/gen-certs.sh %{buildroot}%{_libexecdir}/osbuild-composer-test/
@ -218,6 +237,7 @@ install -m 0755 -vp tools/image-info %{buildroot}%{_l
install -m 0755 -vp tools/run-koji-container.sh %{buildroot}%{_libexecdir}/osbuild-composer-test/
install -m 0755 -vp tools/koji-compose.py %{buildroot}%{_libexecdir}/osbuild-composer-test/
install -m 0755 -vp tools/libvirt_test.sh %{buildroot}%{_libexecdir}/osbuild-composer-test/
install -m 0755 -vp tools/set-env-variables.sh %{buildroot}%{_libexecdir}/osbuild-composer-test/
install -m 0755 -vd %{buildroot}%{_libexecdir}/tests/osbuild-composer
install -m 0755 -vp test/cases/* %{buildroot}%{_libexecdir}/tests/osbuild-composer/
@ -264,8 +284,9 @@ install -m 0644 -vp internal/jobqueue/dbjobqueue/schemas/* %{buildroot}%{_d
%endif
%check
export GOFLAGS="-buildmode=pie"
%if 0%{?rhel}
export GOFLAGS=-mod=vendor
export GOFLAGS+=" -mod=vendor"
export GOPATH=$PWD/_build:%{gopath}
# cd inside GOPATH, otherwise go with GO111MODULE=off ignores vendor directory
cd $PWD/_build/src/%{goipath}
@ -296,21 +317,22 @@ cd $PWD/_build/src/%{goipath}
%package core
Summary: The core osbuild-composer binary
Requires: %{name}-dnf-json = %{version}-%{release}
%description core
The core osbuild-composer binary. This is suitable both for spawning in containers and by systemd.
%files core
%{_libexecdir}/osbuild-composer/osbuild-composer
%{_libexecdir}/osbuild-composer/dnf-json
%{_datadir}/osbuild-composer/
%package worker
Summary: The worker for osbuild-composer
Requires: systemd
Requires: qemu-img
Requires: osbuild >= 30
Requires: osbuild-ostree >= 30
Requires: osbuild >= 41
Requires: osbuild-ostree >= 41
Requires: %{name}-dnf-json = %{version}-%{release}
# remove in F34
Obsoletes: golang-github-osbuild-composer-worker < %{version}-%{release}
@ -331,15 +353,29 @@ The worker for osbuild-composer
# systemd_preun uses systemctl disable --now which doesn't work well with template services.
# See https://github.com/systemd/systemd/issues/15620
# The following lines mimicks its behaviour by running two commands:
# disable and stop all the worker services
systemctl --no-reload disable osbuild-worker@.service osbuild-remote-worker@.service
systemctl stop "osbuild-worker@*.service" "osbuild-remote-worker@*.service"
if [ -d /run/systemd/system ]; then
# disable and stop all the worker services
systemctl --no-reload disable osbuild-worker@.service osbuild-remote-worker@.service
systemctl stop "osbuild-worker@*.service" "osbuild-remote-worker@*.service"
fi
%postun worker
# restart all the worker services
%systemd_postun_with_restart "osbuild-worker@*.service" "osbuild-remote-worker@*.service"
%package dnf-json
Summary: The dnf-json binary used by osbuild-composer and the workers
# Conflicts with older versions of composer that provide the same files
# this can be removed when RHEL 8 and Fedora 35 reach EOL
Conflicts: osbuild-composer <= 35
%description dnf-json
The dnf-json binary used by osbuild-composer and the workers.
%files dnf-json
%{_libexecdir}/osbuild-composer/dnf-json
%if %{with tests} || 0%{?rhel}
%package tests
@ -407,13 +443,19 @@ Integration tests to be run on a pristine-dedicated system to test the osbuild-c
%endif
%changelog
* Sat Oct 02 2021 Ondřej Budai <ondrej@budai.cz> - 33.3-1
* Thu Dec 09 2021 Ondřej Budai <ondrej@budai.cz> - 40-1
- New upstream release
* Tue Sep 28 2021 Ondřej Budai <ondrej@budai.cz> - 33.2-1
* Wed Nov 24 2021 Chloe Kaubisch <chloe.kaubisch@gmail.com> - 39-1
- New upstream release
* Wed Sep 15 2021 Ondřej Budai <ondrej@budai.cz> - 33.1-1
* Fri Nov 12 2021 'Diaa Sami' <'<disami@redhat.com>'> - 38-1
- New upstream release
* Tue Nov 02 2021 lavocatt - 37-1
- New upstream release
* Thu Oct 14 2021 Achilleas Koutsou <achilleas@redhat.com> - 36-1
- New upstream release
* Mon Aug 30 2021 Tom Gundersen <teg@jklm.no> - 33-1