]>
Commit | Line | Data |
---|---|---|
dedb394b JK |
1 | # |
2 | # Conditional build: | |
3 | %bcond_without python2 # CPython 2.x module | |
4 | %bcond_without python3 # CPython 3.x module | |
5 | ||
6 | %define module rtslib | |
7 | Summary: Python library for configuring the Linux kernel-based multiprotocol SCSI target (LIO) | |
8 | Name: python-rtslib-fb | |
bf74d903 | 9 | Version: 2.1.fb50 |
dedb394b JK |
10 | Release: 1 |
11 | License: Apache v2.0 | |
12 | Group: Libraries/Python | |
13 | Source0: https://codeload.github.com/agrover/rtslib-fb/tar.gz/v%{version} | |
bf74d903 | 14 | # Source0-md5: 2eccddc0c6061590250f2d358fafdad7 |
dedb394b JK |
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 | |
20 | %if %{with python3} | |
21 | BuildRequires: python3-distribute | |
22 | BuildRequires: python3-modules | |
23 | %endif | |
24 | Requires: python-modules | |
25 | BuildArch: noarch | |
26 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
27 | ||
28 | %description | |
29 | rtslib-fb is an object-based Python library for configuring the LIO | |
30 | generic SCSI target, present in 3.x Linux kernel versions. | |
31 | ||
32 | %package -n python3-rtslib-fb | |
33 | Summary: Python library for configuring the Linux kernel-based multiprotocol SCSI target (LIO) | |
34 | Group: Libraries/Python | |
35 | ||
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. | |
39 | ||
40 | %prep | |
41 | %setup -q -n rtslib-fb-%{version} | |
42 | ||
43 | %build | |
44 | %if %{with python2} | |
45 | %{__python} setup.py build --build-base build-2 %{?with_tests:test} | |
46 | %endif | |
47 | ||
48 | %if %{with python3} | |
49 | %{__python3} setup.py build --build-base build-3 %{?with_tests:test} | |
50 | %endif | |
51 | ||
52 | %install | |
53 | rm -rf $RPM_BUILD_ROOT | |
54 | install -d $RPM_BUILD_ROOT%{_mandir}/man{5,8} | |
55 | ||
56 | %if %{with python2} | |
57 | %{__python} setup.py \ | |
58 | build --build-base build-2 \ | |
59 | install --skip-build \ | |
60 | --root=$RPM_BUILD_ROOT \ | |
61 | --optimize=2 | |
62 | ||
63 | %py_postclean | |
64 | %endif | |
65 | ||
66 | %if %{with python3} | |
67 | %{__python3} setup.py \ | |
68 | build --build-base build-3 \ | |
69 | install --skip-build \ | |
70 | --root=$RPM_BUILD_ROOT \ | |
71 | --optimize=2 | |
72 | %endif | |
73 | ||
74 | cp doc/*.5 $RPM_BUILD_ROOT%{_mandir}/man5/ | |
75 | cp doc/*.8 $RPM_BUILD_ROOT%{_mandir}/man8/ | |
76 | ||
77 | %clean | |
78 | rm -rf $RPM_BUILD_ROOT | |
79 | ||
80 | %if %{with python2} | |
81 | %files | |
82 | %defattr(644,root,root,755) | |
83 | %attr(755,root,root) %{_bindir}/targetctl | |
84 | %doc README.md | |
85 | %dir %{py_sitescriptdir}/%{module} | |
86 | %{py_sitescriptdir}/%{module}/*.py[co] | |
87 | %if "%{py_ver}" > "2.4" | |
88 | %{py_sitescriptdir}/rtslib_fb-*.egg-info | |
89 | %endif | |
90 | %endif | |
91 | %{_mandir}/man5/saveconfig.json.5* | |
92 | %{_mandir}/man8/targetctl.8* | |
93 | ||
94 | %if %{with python3} | |
95 | %files -n python3-rtslib-fb | |
96 | %defattr(644,root,root,755) | |
97 | %doc README.md | |
98 | %{py3_sitescriptdir}/%{module} | |
99 | %{py3_sitescriptdir}/rtslib_fb-*-py*.egg-info | |
100 | %endif |