diff --git a/python-rtslib.spec b/python-rtslib.spec index f9ab936133e7739eab999c123849c9a4a5ab244a..525431b0ad0db73edc607acba607fa49938e7f4e 100644 --- a/python-rtslib.spec +++ b/python-rtslib.spec @@ -1,126 +1,90 @@ -%bcond_without python3 +%global _empty_manifest_terminate_build 0 %global oname rtslib-fb Name: python-rtslib -Version: 2.1.76 -Release: 2 +Version: 2.2.1 +Release: 1 Summary: Python object API for Linux kernel LIO SCSI target License: ASL 2.0 URL: https://github.com/open-iscsi/%{oname} -Source0: %{url}/archive/v%{version}/%{oname}-%{version}.tar.gz +Source0: https://files.pythonhosted.org/packages/63/50/cde4737143f6bad01a5982e1eb2430438fc3824c3829bcd2e862039fec46/rtslib_fb-2.2.1.tar.gz BuildArch: noarch -BuildRequires: systemd-units -Requires(post): systemd -Requires(preun): systemd -Requires(postun): systemd - -Provides: python-rtslib-doc -Obsoletes: python-rtslib-doc +# Base build requires +BuildRequires: python3-devel +BuildRequires: python3-setuptools +BuildRequires: python3-pbr +BuildRequires: python3-pip +BuildRequires: python3-wheel +# General requires +BuildRequires: python3-hatchling %description %{name} is a python object API for generic Linux SCSI kernel target which includes the 'target' service and targetctl tool for restoring configuration. -%if %{with python3} %package -n python3-rtslib -Summary: Python3 object API for Linux kernel LIO SCSI target -BuildRequires: python3-devel, python3-setuptools -Requires: python3-kmod, python3-six, python3-pyudev -%{?python_provide:%python_provide python3-rtslib} -provides: python3-%{oname} - +Summary: API for Linux kernel SCSI target (aka LIO) +BuildRequires: python3-devel +BuildRequires: python3-setuptools +BuildRequires: python3-pip %description -n python3-rtslib -python3-rtslib is a python object API for generic Linux SCSI kernel -target which includes the 'target' service and targetctl tool for -restoring configuration. -%endif - -%package -n target-restore -Summary: Systemd service for targetcli/rtslib -%if %{with python3} -Requires: python3-rtslib = %{version}-%{release} -%endif - -%description -n target-restore -Systemd service to restore the LIO kernel target settings on system -restart. - -%package_help +%{name} is a python object API for generic Linux SCSI kernel target +which includes the 'target' service and targetctl tool for restoring +configuration. -%prep -%autosetup -n %{oname}-%{version} -p1 +%package help +Summary: Development documents and examples for rtslib-fb +%description help +%{name} is a python object API for generic Linux SCSI kernel target +which includes the 'target' service and targetctl tool for restoring +configuration. -%if %{with python3} -rm -rf %{py3dir} -cp -a . %{py3dir} -%endif +%prep +%autosetup -n rtslib_fb-%{version} %build -gzip --stdout doc/targetctl.8 > doc/targetctl.8.gz -gzip --stdout doc/saveconfig.json.5 > doc/saveconfig.json.5.gz - -%if 0%{?with_python3} -pushd %{py3dir} -%py3_build -popd -%endif +%pyproject_build %install -%if %{with python3} -pushd %{py3dir} -%py3_install +%pyproject_install +install -d -m755 %{buildroot}/%{_pkgdocdir} +if [ -d doc ]; then cp -arf doc %{buildroot}/%{_pkgdocdir}; fi +if [ -d docs ]; then cp -arf docs %{buildroot}/%{_pkgdocdir}; fi +if [ -d example ]; then cp -arf example %{buildroot}/%{_pkgdocdir}; fi +if [ -d examples ]; then cp -arf examples %{buildroot}/%{_pkgdocdir}; fi +pushd %{buildroot} +touch filelist.lst +if [ -d usr/lib64 ]; then + find usr/lib64 -type f -printf "\"/%h/%f\"\n" >> filelist.lst +fi +if [ -d usr/bin ]; then + find usr/bin -type f -printf "\"/%h/%f\"\n" >> filelist.lst +fi +if [ -d usr/sbin ]; then + find usr/sbin -type f -printf "\"/%h/%f\"\n" >> filelist.lst +fi +touch doclist.lst +if [ -d usr/share/man ]; then + find usr/share/man -type f -printf "\"/%h/%f.gz\"\n" >> doclist.lst +fi popd -%endif - -mkdir -p %{buildroot}%{_mandir}/man8/ -mkdir -p %{buildroot}%{_mandir}/man5/ -mkdir -p %{buildroot}%{_unitdir} -mkdir -p %{buildroot}%{_sysconfdir}/target/backup -mkdir -p %{buildroot}%{_localstatedir}/target/pr -mkdir -p %{buildroot}%{_localstatedir}/target/alua -mkdir -p %{buildroot}%{_bindir} -install -m 644 systemd/target.service %{buildroot}%{_unitdir}/target.service -install -m 644 doc/targetctl.8.gz %{buildroot}%{_mandir}/man8/ -install -m 644 doc/saveconfig.json.5.gz %{buildroot}%{_mandir}/man5/ -install -m 755 scripts/targetctl %{buildroot}%{_bindir}/ - -%post -n target-restore -%systemd_post target.service - -%preun -n target-restore -%systemd_preun target.service - -%postun -n target-restore -%systemd_postun_with_restart target.service - -%if %{with python3} -%files -n python3-rtslib -%defattr(-,root,root) -%license COPYING +mv %{buildroot}/filelist.lst . +mv %{buildroot}/doclist.lst . + +%files -n python3-rtslib -f filelist.lst %{python3_sitelib}/* -%endif - -%files -n target-restore -%defattr(-,root,root) -%{_bindir}/targetctl -%{_unitdir}/target.service -%dir %{_sysconfdir}/target -%dir %{_sysconfdir}/target/backup -%dir %{_localstatedir}/target -%dir %{_localstatedir}/target/pr -%dir %{_localstatedir}/target/alua - -%files help -%defattr(-,root,root) -%doc README.md doc/getting_started.md -%{_mandir}/man8/targetctl.8.gz -%{_mandir}/man5/saveconfig.json.5.gz + +%files help -f doclist.lst +%{_docdir}/* %changelog +* Wed Nov 12 2025 liutao - 2.2.1-1 +- Update package to version 2.2.1 + * Tue Apr 16 2024 Pengda Dou - 2.1.76-2 - Fix missing targetctl file error diff --git a/rtslib-fb-2.1.76.tar.gz b/rtslib-fb-2.1.76.tar.gz deleted file mode 100644 index 1fb4c331b3fd7943b6757efcfabdeb9e3b558bd6..0000000000000000000000000000000000000000 Binary files a/rtslib-fb-2.1.76.tar.gz and /dev/null differ diff --git a/rtslib_fb-2.2.1.tar.gz b/rtslib_fb-2.2.1.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..7611af6c8aded71ed1c19ee7acd67d0862c3d204 Binary files /dev/null and b/rtslib_fb-2.2.1.tar.gz differ