3 %bcond_without python2 # CPython 2.x module
4 %bcond_without python3 # CPython 3.x module
7 Summary: Python library for configuring the Linux kernel-based multiprotocol SCSI target (LIO)
12 Group: Libraries/Python
13 Source0: https://codeload.github.com/agrover/rtslib-fb/tar.gz/v%{version}
14 # Source0-md5: aa709051e1de17fa1cff41432e05bcca
15 URL: https://github.com/agrover/rtslib-fb
16 BuildRequires: python-distribute
17 BuildRequires: rpm-pythonprov
18 BuildRequires: rpmbuild(macros) >= 1.219
19 BuildRequires: sed >= 4.0
21 BuildRequires: python3-distribute
22 BuildRequires: python3-modules
24 Requires: python-modules
26 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
29 rtslib-fb is an object-based Python library for configuring the LIO
30 generic SCSI target, present in 3.x Linux kernel versions.
32 %package -n python3-rtslib-fb
33 Summary: Python library for configuring the Linux kernel-based multiprotocol SCSI target (LIO)
34 Group: Libraries/Python
36 %description -n python3-rtslib-fb
37 rtslib-fb is an object-based Python library for configuring the LIO
38 generic SCSI target, present in 3.x Linux kernel versions.
41 %setup -q -n rtslib-fb-%{version}
45 %{__python} setup.py build --build-base build-2 %{?with_tests:test}
49 %{__python3} setup.py build --build-base build-3 %{?with_tests:test}
53 rm -rf $RPM_BUILD_ROOT
54 install -d $RPM_BUILD_ROOT%{_mandir}/man{5,8}
57 %{__python} setup.py \
58 build --build-base build-2 \
59 install --skip-build \
60 --root=$RPM_BUILD_ROOT \
67 %{__python3} setup.py \
68 build --build-base build-3 \
69 install --skip-build \
70 --root=$RPM_BUILD_ROOT \
74 cp doc/*.5 $RPM_BUILD_ROOT%{_mandir}/man5/
75 cp doc/*.8 $RPM_BUILD_ROOT%{_mandir}/man8/
78 rm -rf $RPM_BUILD_ROOT
82 %defattr(644,root,root,755)
83 %attr(755,root,root) %{_bindir}/targetctl
85 %dir %{py_sitescriptdir}/%{module}
86 %{py_sitescriptdir}/%{module}/*.py[co]
87 %if "%{py_ver}" > "2.4"
88 %{py_sitescriptdir}/rtslib_fb-*.egg-info
91 %{_mandir}/man5/saveconfig.json.5*
92 %{_mandir}/man8/targetctl.8*
95 %files -n python3-rtslib-fb
96 %defattr(644,root,root,755)
98 %{py3_sitescriptdir}/%{module}
99 %{py3_sitescriptdir}/rtslib_fb-*-py*.egg-info