ovirt-imageio: import ovirt-imageio-2.5.0

This commit is contained in:
Jeff Mahoney 2024-05-17 15:42:34 -04:00
parent e4e989e5bb
commit c794366e45
7 changed files with 179 additions and 0 deletions

20
_service Normal file
View File

@ -0,0 +1,20 @@
<services>
<service mode="manual" name="obs_scm">
<param name="url">https://github.com/oVirt/ovirt-imageio</param>
<param name="filename">ovirt-imageio</param>
<param name="versionformat">@PARENT_TAG@~git@TAG_OFFSET@.%h</param>
<param name="revision">v2.5.0</param>
<param name="scm">git</param>
<param name="parent-tag">v2.5.0</param>
<param name="versionrewrite-pattern">v(.*)</param>
<param name="versionrewrite-replacement">\1</param>
<param name="changesgenerate">enable</param>
</service>
<service name="set_version" mode="manual" />
<service mode="buildtime" name="tar"/>
<service mode="buildtime" name="recompress">
<param name="file">ovirt-imageio-[0-9]*.tar</param>
<param name="compression">gz</param>
</service>
</services>

4
_servicedata Normal file
View File

@ -0,0 +1,4 @@
<servicedata>
<service name="tar_scm">
<param name="url">https://github.com/oVirt/ovirt-imageio</param>
<param name="changesrevision">83401ef882215d8cc39bd016aa3e63afa02aebd5</param></service></servicedata>

Binary file not shown.

4
ovirt-imageio.changes Normal file
View File

@ -0,0 +1,4 @@
-------------------------------------------------------------------
Fri May 17 19:35:48 UTC 2024 - Jeff Mahoney <jeffm@suse.com>
- Initial packaging.

4
ovirt-imageio.obsinfo Normal file
View File

@ -0,0 +1,4 @@
name: ovirt-imageio
version: 2.5.0~git0.83401ef
mtime: 1680158633
commit: 83401ef882215d8cc39bd016aa3e63afa02aebd5

1
ovirt-imageio.rpmlintrc Normal file
View File

@ -0,0 +1 @@
addFilter("ovirt-imageio.* summary-not-capitalized")

146
ovirt-imageio.spec Normal file
View File

@ -0,0 +1,146 @@
# SPDX-FileCopyrightText: Red Hat, Inc.
# SPDX-License-Identifier: GPL-2.0-or-later
Name: ovirt-imageio
Version: 2.5.0~git0.83401ef
Release: 0
Summary: oVirt imageio
License: GPL-2.0-or-later
Url: https://github.com/oVirt/%{name}
Source0: https://github.com/oVirt/%{name}/releases/download/v%{version}/%{name}-%{version}.tar.gz
BuildRequires: fdupes
%global ovirtimg_user ovirtimg
%global srcname ovirt_imageio
%global logdir %{_localstatedir}/log/%{name}
%global admin_confdir %{_sysconfdir}/%{name}
%global vendor_confdir %{_prefix}/lib/%{name}
%description
Transfer disk images on oVirt system.
%prep
%setup -q
%build
%py3_build
%install
%py3_install
install -D -m 0755 --directory %{buildroot}%{logdir}
# Create a dummy log file to make rpm happy during build
touch %{buildroot}%{logdir}/daemon.log
install -D -m 0755 --directory %{buildroot}%{vendor_confdir}/conf.d
install -D -m 0755 --directory %{buildroot}%{admin_confdir}/conf.d
install -D -m 0644 data/%{name}.service %{buildroot}%{_unitdir}/%{name}.service
%fdupes %buildroot%{python3_sitearch}
%package common
Summary: oVirt imageio common resources
# NOTE: keep in sync with docs/development.md
BuildRequires: gcc
BuildRequires: python3-devel
BuildRequires: python3-setuptools
Requires: python3
%description common
Common resources used by oVirt imageio server and client
%files common
%license LICENSES/GPL-2.0-or-later.txt
%{python3_sitearch}/%{srcname}
%{python3_sitearch}/%{srcname}-*.egg-info
%exclude %{python3_sitearch}/%{srcname}/client
%exclude %{python3_sitearch}/%{srcname}/admin
%package client
Summary: oVirt imageio client library
Requires: %{name}-common = %{version}-%{release}
%if 0%{?rhel}
# RHEL 8.4 version. Some features require qemu-nbd 5.2.0 and are disabled when
# using older qemu-nbd.
Requires: qemu-img >= 15:4.2.0
Requires: python3-ovirt-engine-sdk4
%else
# Fedora.
Requires: qemu-img
%endif
%description client
Python client library for accessing imageio server on oVirt hosts.
%files client
%{python3_sitearch}/%{srcname}/client
%{_bindir}/ovirt-img
%package daemon
Summary: oVirt imageio daemon
# NOTE: keep in sync with docs/development.md
BuildRequires: systemd
Requires: python3-systemd
Requires: %{name}-common = %{version}-%{release}
Requires(pre): user(ovirtimg)
%description daemon
Daemon providing image transfer service on oVirt hosts.
%files daemon
%doc data/README
%{python3_sitearch}/%{srcname}/admin
%{_bindir}/%{name}
%{_bindir}/%{name}ctl
%{_unitdir}/%{name}.service
%dir %{admin_confdir}
%dir %{admin_confdir}/conf.d
%dir %{vendor_confdir}
%dir %{vendor_confdir}/conf.d
# The log directory should belong to the daemon so it can create log files.
# http://rpm.org/max-rpm-snapshot/s1-rpm-inside-files-list-directives.html#S3-RPM-INSIDE-FLIST-ATTR-DIRECTIVE
%dir %attr(755, %{ovirtimg_user}, %{ovirtimg_user}) %{logdir}
# The log files belongs to the package, so they will be removed with the package.
# http://rpm.org/max-rpm-snapshot/s1-rpm-inside-files-list-directives.html#S3-RPM-INSIDE-FLIST-GHOST-DIRECTIVE
%ghost %attr(644, %{ovirtimg_user}, %{ovirtimg_user}) %{logdir}/daemon.log*
# For more information about the systemd macros, see:
# https://fedoraproject.org/wiki/Packaging:Scriptlets#New_Packages
# For info on ordering of the scriplets, see:
# https://docs.fedoraproject.org/en-US/packaging-guidelines/Scriptlets/#ordering
%pre daemon
%systemd_pre %{name}.service
%post daemon
# After installation, synchronize service state with preset files.
%systemd_post %{name}.service
%preun daemon
# Before uninstalling, stop and disable the service.
%systemd_preun %{name}.service
%postun daemon
# After upgrading, restart the service.
%systemd_postun_with_restart %{name}.service
%posttrans daemon
# At the end of the transaction, stop stale ovirt-imageio-daemon service.
# Needed only when upgrading from ovirt-imageio-daemon < 2.
if systemctl is-active ovirt-imageio-daemon.service >/dev/null; then
echo "Stopping ovirt-imageio-daemon.service";
systemctl stop ovirt-imageio-daemon.service
fi
%changelog