]>
Commit | Line | Data |
---|---|---|
dedb394b | 1 | # |
f03abd3c AG |
2 | # TODO: |
3 | # - when updating, check if we can get rid of -no-save-flag patch in targetcli | |
4 | # | |
dedb394b JK |
5 | # Conditional build: |
6 | %bcond_without python2 # CPython 2.x module | |
7 | %bcond_without python3 # CPython 3.x module | |
8 | ||
d53b44d6 | 9 | %define module rtslib_fb |
dedb394b JK |
10 | Summary: Python library for configuring the Linux kernel-based multiprotocol SCSI target (LIO) |
11 | Name: python-rtslib-fb | |
70580191 | 12 | Version: 2.1.70 |
00aa45c4 | 13 | Release: 4 |
dedb394b JK |
14 | License: Apache v2.0 |
15 | Group: Libraries/Python | |
70580191 JR |
16 | Source0: https://github.com/open-iscsi/rtslib-fb/archive/v%{version}/%{module}-%{version}.tar.gz |
17 | # Source0-md5: 9ebdd1dc80537ffd5a92178621e8cc47 | |
c56cf611 | 18 | URL: https://github.com/open-iscsi/rtslib-fb |
dedb394b JK |
19 | BuildRequires: python-distribute |
20 | BuildRequires: rpm-pythonprov | |
a65c9ac5 | 21 | BuildRequires: rpmbuild(macros) >= 1.710 |
dedb394b JK |
22 | BuildRequires: sed >= 4.0 |
23 | %if %{with python3} | |
dedb394b JK |
24 | BuildRequires: python3-modules |
25 | %endif | |
26 | Requires: python-modules | |
d53b44d6 | 27 | Requires: python-pyudev >= 0.16.1 |
dedb394b JK |
28 | BuildArch: noarch |
29 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
30 | ||
31 | %description | |
32 | rtslib-fb is an object-based Python library for configuring the LIO | |
33 | generic SCSI target, present in 3.x Linux kernel versions. | |
34 | ||
35 | %package -n python3-rtslib-fb | |
36 | Summary: Python library for configuring the Linux kernel-based multiprotocol SCSI target (LIO) | |
37 | Group: Libraries/Python | |
d53b44d6 | 38 | Requires: python3-pyudev >= 0.16.1 |
dedb394b JK |
39 | |
40 | %description -n python3-rtslib-fb | |
41 | rtslib-fb is an object-based Python library for configuring the LIO | |
42 | generic SCSI target, present in 3.x Linux kernel versions. | |
43 | ||
44 | %prep | |
45 | %setup -q -n rtslib-fb-%{version} | |
46 | ||
47 | %build | |
48 | %if %{with python2} | |
32d3e8a0 | 49 | %py_build %{?with_tests:test} |
dedb394b JK |
50 | %endif |
51 | ||
52 | %if %{with python3} | |
32d3e8a0 | 53 | %py3_build %{?with_tests:test} |
dedb394b JK |
54 | %endif |
55 | ||
56 | %install | |
70580191 | 57 | %{__rm} -rf $RPM_BUILD_ROOT |
dedb394b JK |
58 | install -d $RPM_BUILD_ROOT%{_mandir}/man{5,8} |
59 | ||
60 | %if %{with python2} | |
32d3e8a0 | 61 | %py_install |
dedb394b | 62 | |
d53b44d6 | 63 | # symlink for old module name |
70580191 | 64 | %{__rm} -r $RPM_BUILD_ROOT%{py_sitescriptdir}/rtslib |
d53b44d6 AG |
65 | ln -sf %{py_sitescriptdir}/%{module} $RPM_BUILD_ROOT%{py_sitescriptdir}/rtslib |
66 | ||
dedb394b | 67 | %py_postclean |
70580191 JR |
68 | |
69 | %{__mv} $RPM_BUILD_ROOT%{_bindir}/targetctl{,2} | |
70 | cp doc/targetctl.8 $RPM_BUILD_ROOT%{_mandir}/man8/targetctl2.8 | |
dedb394b JK |
71 | %endif |
72 | ||
73 | %if %{with python3} | |
32d3e8a0 | 74 | %py3_install |
d53b44d6 AG |
75 | |
76 | # symlink for old module name | |
70580191 | 77 | %{__rm} -r $RPM_BUILD_ROOT%{py3_sitescriptdir}/rtslib |
d53b44d6 | 78 | ln -sf %{py3_sitescriptdir}/%{module} $RPM_BUILD_ROOT%{py3_sitescriptdir}/rtslib |
70580191 | 79 | cp doc/targetctl.8 $RPM_BUILD_ROOT%{_mandir}/man8/ |
dedb394b JK |
80 | %endif |
81 | ||
70580191 | 82 | cp -p doc/*.5 $RPM_BUILD_ROOT%{_mandir}/man5/ |
dedb394b JK |
83 | |
84 | %clean | |
70580191 | 85 | %{__rm} -rf $RPM_BUILD_ROOT |
dedb394b JK |
86 | |
87 | %if %{with python2} | |
88 | %files | |
89 | %defattr(644,root,root,755) | |
dedb394b | 90 | %doc README.md |
70580191 | 91 | %attr(755,root,root) %{_bindir}/targetctl2 |
dedb394b | 92 | %dir %{py_sitescriptdir}/%{module} |
d53b44d6 | 93 | %ghost %{py_sitescriptdir}/rtslib |
dedb394b | 94 | %{py_sitescriptdir}/%{module}/*.py[co] |
dedb394b | 95 | %{py_sitescriptdir}/rtslib_fb-*.egg-info |
70580191 | 96 | %{_mandir}/man8/targetctl2.8* |
dedb394b | 97 | %endif |
dedb394b JK |
98 | |
99 | %if %{with python3} | |
100 | %files -n python3-rtslib-fb | |
101 | %defattr(644,root,root,755) | |
102 | %doc README.md | |
70580191 | 103 | %attr(755,root,root) %{_bindir}/targetctl |
dedb394b | 104 | %{py3_sitescriptdir}/%{module} |
d53b44d6 | 105 | %{py3_sitescriptdir}/rtslib |
dedb394b | 106 | %{py3_sitescriptdir}/rtslib_fb-*-py*.egg-info |
70580191 JR |
107 | %{_mandir}/man5/saveconfig.json.5* |
108 | %{_mandir}/man8/targetctl.8* | |
dedb394b | 109 | %endif |