Merged update from upstream sources

This is an automated DistroBaker update from upstream sources.
If you do not know what this is about or would like to opt out,
contact the OSCI team.

Source: https://src.fedoraproject.org/rpms/osbuild-composer.git#d9e66c859525d0396e1db1bc27c2a6c014dc9f5b
This commit is contained in:
DistroBaker 2020-10-27 21:40:50 +01:00 committed by Petr Šabata
parent 2ecada9614
commit 719c031c0b
3 changed files with 170 additions and 32 deletions

1
.gitignore vendored
View File

@ -11,3 +11,4 @@
/osbuild-composer-18.tar.gz /osbuild-composer-18.tar.gz
/osbuild-composer-19.tar.gz /osbuild-composer-19.tar.gz
/osbuild-composer-20.tar.gz /osbuild-composer-20.tar.gz
/osbuild-composer-22.tar.gz

View File

@ -4,7 +4,7 @@
%global goipath github.com/osbuild/osbuild-composer %global goipath github.com/osbuild/osbuild-composer
Version: 20 Version: 22
%gometa %gometa
@ -15,7 +15,7 @@ As such, it is a drop-in replacement.
} }
Name: osbuild-composer Name: osbuild-composer
Release: 2%{?dist} Release: 1%{?dist}
Summary: An image building service based on osbuild Summary: An image building service based on osbuild
# osbuild-composer doesn't have support for building i686 images # osbuild-composer doesn't have support for building i686 images
@ -30,6 +30,7 @@ Source0: %{gosource}
BuildRequires: %{?go_compiler:compiler(go-compiler)}%{!?go_compiler:golang} BuildRequires: %{?go_compiler:compiler(go-compiler)}%{!?go_compiler:golang}
BuildRequires: systemd BuildRequires: systemd
BuildRequires: krb5-devel
%if 0%{?fedora} %if 0%{?fedora}
BuildRequires: systemd-rpm-macros BuildRequires: systemd-rpm-macros
BuildRequires: git BuildRequires: git
@ -39,12 +40,17 @@ BuildRequires: golang(github.com/Azure/azure-storage-blob-go/azblob)
BuildRequires: golang(github.com/BurntSushi/toml) BuildRequires: golang(github.com/BurntSushi/toml)
BuildRequires: golang(github.com/coreos/go-semver/semver) BuildRequires: golang(github.com/coreos/go-semver/semver)
BuildRequires: golang(github.com/coreos/go-systemd/activation) 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/google/uuid) BuildRequires: golang(github.com/google/uuid)
BuildRequires: golang(github.com/julienschmidt/httprouter) BuildRequires: golang(github.com/julienschmidt/httprouter)
BuildRequires: golang(github.com/kolo/xmlrpc)
BuildRequires: golang(github.com/labstack/echo/v4)
BuildRequires: golang(github.com/gobwas/glob) BuildRequires: golang(github.com/gobwas/glob)
BuildRequires: golang(github.com/google/go-cmp/cmp) BuildRequires: golang(github.com/google/go-cmp/cmp)
BuildRequires: golang(github.com/gophercloud/gophercloud) BuildRequires: golang(github.com/gophercloud/gophercloud)
BuildRequires: golang(github.com/stretchr/testify/assert) BuildRequires: golang(github.com/stretchr/testify/assert)
BuildRequires: golang(github.com/ubccr/kerby)
BuildRequires: golang(github.com/vmware/govmomi) BuildRequires: golang(github.com/vmware/govmomi)
%endif %endif
@ -61,6 +67,12 @@ Obsoletes: lorax-composer <= 29
Conflicts: lorax-composer Conflicts: lorax-composer
%endif %endif
# Remove when we stop releasing into Fedora 35
%if 0%{?fedora} >= 34
# lorax 34.3 is the first one without the composer subpackage
Obsoletes: lorax-composer < 34.3
%endif
# remove in F34 # remove in F34
Obsoletes: golang-github-osbuild-composer < %{version}-%{release} Obsoletes: golang-github-osbuild-composer < %{version}-%{release}
Provides: golang-github-osbuild-composer = %{version}-%{release} Provides: golang-github-osbuild-composer = %{version}-%{release}
@ -75,6 +87,20 @@ Provides: golang-github-osbuild-composer = %{version}-%{release}
%goprep %goprep
%endif %endif
%if 0%{?fedora} && 0%{?fedora} <= 32
# Fedora 32 and older ships a different kolo/xmlrpc API. We cannot specify
# build tags in gobuild macro because the macro itself specifies build tags.
# and -tags argument cannot be used more than once.
# Therefore, this ugly hack with build tags switcharoo is required.
# Remove when F32 is EOL.
# Remove the build constraint from the wrapper of the old API
sed -i "s$// +build kolo_xmlrpc_oldapi$// +build !kolo_xmlrpc_oldapi$" internal/upload/koji/xmlrpc-response-oldapi.go
# Add a build constraint to the wrapper of the new API
sed -i "s$// +build !kolo_xmlrpc_oldapi$// +build kolo_xmlrpc_oldapi$" internal/upload/koji/xmlrpc-response.go
%endif
%build %build
%if 0%{?rhel} %if 0%{?rhel}
GO_BUILD_PATH=$PWD/_build GO_BUILD_PATH=$PWD/_build
@ -106,49 +132,94 @@ export GOPATH=%{gobuilddir}:%{gopath}
TEST_LDFLAGS="${LDFLAGS:-} -B 0x$(od -N 20 -An -tx1 -w100 /dev/urandom | tr -d ' ')" TEST_LDFLAGS="${LDFLAGS:-} -B 0x$(od -N 20 -An -tx1 -w100 /dev/urandom | tr -d ' ')"
go test -c -tags=integration -ldflags="${TEST_LDFLAGS}" -o _bin/osbuild-tests %{goipath}/cmd/osbuild-tests go test -c -tags=integration -ldflags="${TEST_LDFLAGS}" -o _bin/osbuild-composer-cli-tests %{goipath}/cmd/osbuild-composer-cli-tests
go test -c -tags=integration -ldflags="${TEST_LDFLAGS}" -o _bin/osbuild-dnf-json-tests %{goipath}/cmd/osbuild-dnf-json-tests go test -c -tags=integration -ldflags="${TEST_LDFLAGS}" -o _bin/osbuild-dnf-json-tests %{goipath}/cmd/osbuild-dnf-json-tests
go test -c -tags=integration -ldflags="${TEST_LDFLAGS}" -o _bin/osbuild-weldr-tests %{goipath}/internal/client/ go test -c -tags=integration -ldflags="${TEST_LDFLAGS}" -o _bin/osbuild-weldr-tests %{goipath}/internal/client/
go test -c -tags=integration -ldflags="${TEST_LDFLAGS}" -o _bin/osbuild-image-tests %{goipath}/cmd/osbuild-image-tests go test -c -tags=integration -ldflags="${TEST_LDFLAGS}" -o _bin/osbuild-image-tests %{goipath}/cmd/osbuild-image-tests
go test -c -tags=integration -ldflags="${TEST_LDFLAGS}" -o _bin/osbuild-auth-tests %{goipath}/cmd/osbuild-auth-tests
go build -tags=integration -ldflags="${TEST_LDFLAGS}" -o _bin/cloud-cleaner %{goipath}/cmd/cloud-cleaner
%endif %endif
%install %install
install -m 0755 -vd %{buildroot}%{_libexecdir}/osbuild-composer install -m 0755 -vd %{buildroot}%{_libexecdir}/osbuild-composer
install -m 0755 -vp _bin/osbuild-composer %{buildroot}%{_libexecdir}/osbuild-composer/ install -m 0755 -vp _bin/osbuild-composer %{buildroot}%{_libexecdir}/osbuild-composer/
install -m 0755 -vp _bin/osbuild-worker %{buildroot}%{_libexecdir}/osbuild-composer/ install -m 0755 -vp _bin/osbuild-worker %{buildroot}%{_libexecdir}/osbuild-composer/
install -m 0755 -vp dnf-json %{buildroot}%{_libexecdir}/osbuild-composer/ install -m 0755 -vp dnf-json %{buildroot}%{_libexecdir}/osbuild-composer/
install -m 0755 -vd %{buildroot}%{_datadir}/osbuild-composer/repositories install -m 0755 -vd %{buildroot}%{_datadir}/osbuild-composer/repositories
install -m 0644 -vp repositories/* %{buildroot}%{_datadir}/osbuild-composer/repositories/ install -m 0644 -vp repositories/* %{buildroot}%{_datadir}/osbuild-composer/repositories/
install -m 0755 -vd %{buildroot}%{_unitdir} install -m 0755 -vd %{buildroot}%{_unitdir}
install -m 0644 -vp distribution/*.{service,socket} %{buildroot}%{_unitdir}/ install -m 0644 -vp distribution/osbuild-composer.service %{buildroot}%{_unitdir}/
install -m 0644 -vp distribution/osbuild-composer.socket %{buildroot}%{_unitdir}/
install -m 0644 -vp distribution/osbuild-remote-worker.socket %{buildroot}%{_unitdir}/
install -m 0644 -vp distribution/osbuild-remote-worker@.service %{buildroot}%{_unitdir}/
install -m 0644 -vp distribution/osbuild-worker@.service %{buildroot}%{_unitdir}/
install -m 0644 -vp distribution/osbuild-composer-api.socket %{buildroot}%{_unitdir}/
install -m 0644 -vp distribution/osbuild-composer-koji.socket %{buildroot}%{_unitdir}/
install -m 0755 -vd %{buildroot}%{_unitdir}
install -m 0644 -vp distribution/osbuild-composer.{service,socket} %{buildroot}%{_unitdir}/
install -m 0644 -vp distribution/osbuild-*worker*.{service,socket} %{buildroot}%{_unitdir}/
install -m 0755 -vd %{buildroot}%{_sysusersdir} install -m 0755 -vd %{buildroot}%{_sysusersdir}
install -m 0644 -vp distribution/osbuild-composer.conf %{buildroot}%{_sysusersdir}/ install -m 0644 -vp distribution/osbuild-composer.conf %{buildroot}%{_sysusersdir}/
install -m 0755 -vd %{buildroot}%{_localstatedir}/cache/osbuild-composer/dnf-cache install -m 0755 -vd %{buildroot}%{_localstatedir}/cache/osbuild-composer/dnf-cache
%if %{with tests} || 0%{?rhel} %if %{with tests} || 0%{?rhel}
install -m 0755 -vd %{buildroot}%{_libexecdir}/tests/osbuild-composer install -m 0755 -vd %{buildroot}%{_libexecdir}/tests/osbuild-composer
install -m 0755 -vp _bin/osbuild-tests %{buildroot}%{_libexecdir}/tests/osbuild-composer/ install -m 0755 -vp _bin/osbuild-composer-cli-tests %{buildroot}%{_libexecdir}/tests/osbuild-composer/
install -m 0755 -vp _bin/osbuild-weldr-tests %{buildroot}%{_libexecdir}/tests/osbuild-composer/ install -m 0755 -vp _bin/osbuild-weldr-tests %{buildroot}%{_libexecdir}/tests/osbuild-composer/
install -m 0755 -vp _bin/osbuild-dnf-json-tests %{buildroot}%{_libexecdir}/tests/osbuild-composer/ install -m 0755 -vp _bin/osbuild-dnf-json-tests %{buildroot}%{_libexecdir}/tests/osbuild-composer/
install -m 0755 -vp _bin/osbuild-image-tests %{buildroot}%{_libexecdir}/tests/osbuild-composer/ install -m 0755 -vp _bin/osbuild-image-tests %{buildroot}%{_libexecdir}/tests/osbuild-composer/
install -m 0755 -vp tools/image-info %{buildroot}%{_libexecdir}/osbuild-composer/ install -m 0755 -vp _bin/osbuild-auth-tests %{buildroot}%{_libexecdir}/tests/osbuild-composer/
install -m 0755 -vp test/cmd/* %{buildroot}%{_libexecdir}/tests/osbuild-composer/
install -m 0755 -vp _bin/cloud-cleaner %{buildroot}%{_libexecdir}/osbuild-composer/
install -m 0755 -vp tools/image-info %{buildroot}%{_libexecdir}/osbuild-composer/
install -m 0755 -vp tools/run-koji-container.sh %{buildroot}%{_libexecdir}/osbuild-composer/
install -m 0755 -vp tools/koji-compose.py %{buildroot}%{_libexecdir}/osbuild-composer/
install -m 0755 -vd %{buildroot}%{_datadir}/tests/osbuild-composer install -m 0755 -vd %{buildroot}%{_datadir}/tests/osbuild-composer/ansible
install -m 0644 -vp test/azure-deployment-template.json %{buildroot}%{_datadir}/tests/osbuild-composer/ install -m 0644 -vp test/data/ansible/* %{buildroot}%{_datadir}/tests/osbuild-composer/ansible/
install -m 0755 -vd %{buildroot}%{_datadir}/tests/osbuild-composer/cases install -m 0755 -vd %{buildroot}%{_datadir}/tests/osbuild-composer/azure
install -m 0644 -vp test/cases/* %{buildroot}%{_datadir}/tests/osbuild-composer/cases/ install -m 0644 -vp test/data/azure/* %{buildroot}%{_datadir}/tests/osbuild-composer/azure/
install -m 0755 -vd %{buildroot}%{_datadir}/tests/osbuild-composer/keyring
install -m 0600 -vp test/keyring/* %{buildroot}%{_datadir}/tests/osbuild-composer/keyring/
install -m 0755 -vd %{buildroot}%{_datadir}/tests/osbuild-composer/cloud-init install -m 0755 -vd %{buildroot}%{_datadir}/tests/osbuild-composer/ca
install -m 0644 -vp test/cloud-init/* %{buildroot}%{_datadir}/tests/osbuild-composer/cloud-init/ install -m 0755 -vp test/data/ca/ca-crt.pem %{buildroot}%{_datadir}/tests/osbuild-composer/ca/
install -m 0600 -vp test/data/ca/ca-key.pem %{buildroot}%{_datadir}/tests/osbuild-composer/ca/
install -m 0755 -vp test/data/ca/composer-crt.pem %{buildroot}%{_datadir}/tests/osbuild-composer/ca/
install -m 0600 -vp test/data/ca/composer-key.pem %{buildroot}%{_datadir}/tests/osbuild-composer/ca/
install -m 0755 -vp test/data/ca/worker-crt.pem %{buildroot}%{_datadir}/tests/osbuild-composer/ca/
install -m 0600 -vp test/data/ca/worker-key.pem %{buildroot}%{_datadir}/tests/osbuild-composer/ca/
# Client keys are used by tests to access the composer APIs. Allow all users access.
install -m 0755 -vp test/data/ca/client-crt.pem %{buildroot}%{_datadir}/tests/osbuild-composer/ca/
install -m 0755 -vp test/data/ca/client-key.pem %{buildroot}%{_datadir}/tests/osbuild-composer/ca/
install -m 0755 -vd %{buildroot}%{_datadir}/tests/osbuild-composer/cases
install -m 0644 -vp test/data/cases/* %{buildroot}%{_datadir}/tests/osbuild-composer/cases/
install -m 0755 -vd %{buildroot}%{_datadir}/tests/osbuild-composer/cloud-init
install -m 0644 -vp test/data/cloud-init/* %{buildroot}%{_datadir}/tests/osbuild-composer/cloud-init/
install -m 0755 -vd %{buildroot}%{_datadir}/tests/osbuild-composer/composer
install -m 0644 -vp test/data/composer/* %{buildroot}%{_datadir}/tests/osbuild-composer/composer/
install -m 0755 -vd %{buildroot}%{_datadir}/tests/osbuild-composer/kerberos
install -m 0644 -vp test/data/kerberos/* %{buildroot}%{_datadir}/tests/osbuild-composer/kerberos/
install -m 0755 -vd %{buildroot}%{_datadir}/tests/osbuild-composer/keyring
install -m 0644 -vp test/data/keyring/id_rsa.pub %{buildroot}%{_datadir}/tests/osbuild-composer/keyring/
install -m 0600 -vp test/data/keyring/id_rsa %{buildroot}%{_datadir}/tests/osbuild-composer/keyring/
%if 0%{?rhel}
install -m 0755 -vd %{buildroot}%{_datadir}/tests/osbuild-composer/vendor
install -m 0644 -vp test/data/vendor/87-podman-bridge.conflist %{buildroot}%{_datadir}/tests/osbuild-composer/vendor/
install -m 0755 -vp test/data/vendor/dnsname %{buildroot}%{_datadir}/tests/osbuild-composer/vendor/
%endif
%endif %endif
@ -164,13 +235,13 @@ cd $PWD/_build/src/%{goipath}
%endif %endif
%post %post
%systemd_post osbuild-composer.service osbuild-composer.socket osbuild-remote-worker.socket %systemd_post osbuild-composer.service osbuild-composer.socket osbuild-composer-api.socket osbuild-remote-worker.socket
%preun %preun
%systemd_preun osbuild-composer.service osbuild-composer.socket osbuild-remote-worker.socket %systemd_preun osbuild-composer.service osbuild-composer.socket osbuild-composer-api.socket osbuild-remote-worker.socket
%postun %postun
%systemd_postun_with_restart osbuild-composer.service osbuild-composer.socket osbuild-remote-worker.socket %systemd_postun_with_restart osbuild-composer.service osbuild-composer.socket osbuild-composer-api.socket osbuild-remote-worker.socket
%files %files
%license LICENSE %license LICENSE
@ -180,6 +251,7 @@ cd $PWD/_build/src/%{goipath}
%{_datadir}/osbuild-composer/ %{_datadir}/osbuild-composer/
%{_unitdir}/osbuild-composer.service %{_unitdir}/osbuild-composer.service
%{_unitdir}/osbuild-composer.socket %{_unitdir}/osbuild-composer.socket
%{_unitdir}/osbuild-composer-api.socket
%{_unitdir}/osbuild-remote-worker.socket %{_unitdir}/osbuild-remote-worker.socket
%{_sysusersdir}/osbuild-composer.conf %{_sysusersdir}/osbuild-composer.conf
@ -221,11 +293,43 @@ systemctl stop "osbuild-worker@*.service" "osbuild-remote-worker@*.service"
%package tests %package tests
Summary: Integration tests Summary: Integration tests
Requires: %{name} = %{version}-%{release} Requires: %{name} = %{version}-%{release}
Requires: %{name}-koji = %{version}-%{release}
Requires: composer-cli Requires: composer-cli
Requires: createrepo_c Requires: createrepo_c
Requires: genisoimage Requires: genisoimage
Requires: qemu-kvm-core Requires: qemu-kvm-core
Requires: systemd-container Requires: systemd-container
Requires: jq
Requires: unzip
Requires: container-selinux
Requires: dnsmasq
Requires: krb5-workstation
Requires: koji
Requires: podman
Requires: python3
Requires: sssd-krb5
Requires: libvirt-client libvirt-daemon
Requires: libvirt-daemon-config-network
Requires: libvirt-daemon-config-nwfilter
Requires: libvirt-daemon-driver-interface
Requires: libvirt-daemon-driver-network
Requires: libvirt-daemon-driver-nodedev
Requires: libvirt-daemon-driver-nwfilter
Requires: libvirt-daemon-driver-qemu
Requires: libvirt-daemon-driver-secret
Requires: libvirt-daemon-driver-storage
Requires: libvirt-daemon-driver-storage-disk
Requires: libvirt-daemon-kvm
Requires: qemu-img
Requires: qemu-kvm
Requires: virt-install
Requires: expect
Requires: python3-lxml
Requires: ansible
Requires: httpd
%if 0%{?fedora}
Requires: podman-plugins
%endif
%ifarch %{arm} %ifarch %{arm}
Requires: edk2-aarch64 Requires: edk2-aarch64
%endif %endif
@ -236,11 +340,44 @@ Integration tests to be run on a pristine-dedicated system to test the osbuild-c
%files tests %files tests
%{_libexecdir}/tests/osbuild-composer/ %{_libexecdir}/tests/osbuild-composer/
%{_datadir}/tests/osbuild-composer/ %{_datadir}/tests/osbuild-composer/
%{_libexecdir}/osbuild-composer/cloud-cleaner
%{_libexecdir}/osbuild-composer/image-info %{_libexecdir}/osbuild-composer/image-info
%{_libexecdir}/osbuild-composer/run-koji-container.sh
%{_libexecdir}/osbuild-composer/koji-compose.py
%endif %endif
%package koji
Summary: osbuild-composer for pushing images to Koji
Requires: %{name} = %{version}-%{release}
# remove in F34
Obsoletes: golang-github-osbuild-composer-rcm < %{version}-%{release}
Provides: golang-github-osbuild-composer-rcm = %{version}-%{release}
# remove in the future
Obsoletes: osbuild-composer-rcm < %{version}-%{release}
Provides: osbuild-composer-rcm = %{version}-%{release}
%description koji
osbuild-composer specifically for pushing images to Koji. This package is only
needed for backwards compatibility and will be removed in the future.
%files koji
%{_unitdir}/osbuild-composer-koji.socket
%post koji
%systemd_post osbuild-composer-koji.socket
%preun koji
%systemd_preun osbuild-composer-koji.socket
%postun koji
%systemd_postun_with_restart osbuild-composer-koji.socket
%changelog %changelog
* Fri Oct 16 2020 Ondrej Budai <obudai@redhat.com> - 22-1
- New upstream release
* Sun Aug 23 2020 Tom Gundersen <teg@jklm.no> - 20-1 * Sun Aug 23 2020 Tom Gundersen <teg@jklm.no> - 20-1
- New upstream release - New upstream release

View File

@ -1 +1 @@
SHA512 (osbuild-composer-20.tar.gz) = 08af438be4adcd9911800beac8f457296db1eb37000d14b7c14944eb93c7486379658d55e716683f36d5cc69260339552452118d1a41f0dbb82fac49d8d4e360 SHA512 (osbuild-composer-22.tar.gz) = 23b13d8f36126726fb3dafdbfdddb752adae90f88046698ef900cd45abc7c249643628baacc297eac6287814fce65e2c97a9a6aa86a475bff2e98b054325f66a