]>
Commit | Line | Data |
---|---|---|
1607ef5a 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 configshell | |
fa9c33db JB |
7 | Summary: ConfigShell - Python 2 library for building configuration shells |
8 | Summary(pl.UTF-8): ConfigShell - biblioteka Pythona 2 do tworzenia powłok konfiguracyjnych | |
1607ef5a | 9 | Name: python-configshell-fb |
ca8180a0 | 10 | Version: 1.1.fb25 |
acc6e9c6 | 11 | Release: 5 |
1607ef5a JK |
12 | License: Apache v2.0 |
13 | Group: Libraries/Python | |
c247c50f JB |
14 | #Source0Download: https://github.com/open-iscsi/configshell-fb/releases |
15 | Source0: https://github.com/open-iscsi/configshell-fb/archive/v%{version}/configshell-fb-%{version}.tar.gz | |
ca8180a0 | 16 | # Source0-md5: e4d5394815712f661c04917a429f3e06 |
c247c50f | 17 | URL: https://github.com/open-iscsi/configshell-fb |
1607ef5a | 18 | BuildRequires: rpm-pythonprov |
fa9c33db | 19 | BuildRequires: rpmbuild(macros) >= 1.714 |
1607ef5a | 20 | BuildRequires: sed >= 4.0 |
fa9c33db | 21 | %if %{with python2} |
c247c50f | 22 | BuildRequires: python-modules >= 1:2.4 |
fa9c33db JB |
23 | BuildRequires: python-setuptools |
24 | %endif | |
1607ef5a | 25 | %if %{with python3} |
c247c50f | 26 | BuildRequires: python3-modules >= 1:3.2 |
fa9c33db | 27 | BuildRequires: python3-setuptools |
1607ef5a | 28 | %endif |
c247c50f | 29 | Requires: python-modules >= 1:2.4 |
1607ef5a | 30 | Requires: python-pyparsing |
c247c50f | 31 | Requires: python-urwid |
1607ef5a JK |
32 | BuildArch: noarch |
33 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
34 | ||
35 | %description | |
36 | configshell-fb is a Python library that provides a framework for | |
37 | building simple but nice CLI-based applications. | |
38 | ||
fa9c33db JB |
39 | %description -l pl.UTF-8 |
40 | configshell-fb to biblioteka Pythona udostępniająca szkielet do | |
41 | tworzenia prostych, ale ładnych aplikacji opartych na linii poleceń. | |
42 | ||
1607ef5a | 43 | %package -n python3-configshell-fb |
fa9c33db JB |
44 | Summary: ConfigShell - Python 3 library for building configuration shells |
45 | Summary(pl.UTF-8): ConfigShell - biblioteka Pythona 3 do tworzenia powłok konfiguracyjnych | |
1607ef5a | 46 | Group: Libraries/Python |
fa9c33db | 47 | Requires: python3-modules |
1607ef5a | 48 | Requires: python3-pyparsing |
c247c50f | 49 | Requires: python3-urwid |
1607ef5a JK |
50 | |
51 | %description -n python3-configshell-fb | |
52 | configshell-fb is a Python library that provides a framework for | |
53 | building simple but nice CLI-based applications. | |
54 | ||
fa9c33db JB |
55 | %description -n python3-configshell-fb -l pl.UTF-8 |
56 | configshell-fb to biblioteka Pythona udostępniająca szkielet do | |
57 | tworzenia prostych, ale ładnych aplikacji opartych na linii poleceń. | |
58 | ||
1607ef5a JK |
59 | %prep |
60 | %setup -q -n configshell-fb-%{version} | |
61 | ||
62 | %build | |
63 | %if %{with python2} | |
76d2cac1 | 64 | %py_build %{?with_tests:test} |
1607ef5a JK |
65 | %endif |
66 | ||
67 | %if %{with python3} | |
76d2cac1 | 68 | %py3_build %{?with_tests:test} |
1607ef5a JK |
69 | %endif |
70 | ||
71 | %install | |
72 | rm -rf $RPM_BUILD_ROOT | |
73 | ||
74 | %if %{with python2} | |
76d2cac1 | 75 | %py_install |
1607ef5a JK |
76 | |
77 | %py_postclean | |
78 | %endif | |
79 | ||
80 | %if %{with python3} | |
76d2cac1 | 81 | %py3_install |
1607ef5a JK |
82 | %endif |
83 | ||
84 | %if %{with python2} | |
85 | install -d $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version} | |
86 | cp -a examples/* $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version} | |
b44e7e0e | 87 | %{__sed} -i -e '1s,/usr/bin/env python,%{__python},' $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}/myshell |
1607ef5a JK |
88 | %endif |
89 | %if %{with python3} | |
90 | install -d $RPM_BUILD_ROOT%{_examplesdir}/python3-configshell-fb-%{version} | |
91 | cp -a examples/* $RPM_BUILD_ROOT%{_examplesdir}/python3-configshell-fb-%{version} | |
b44e7e0e | 92 | %{__sed} -i -e '1s,/usr/bin/env python,%{__python3},' $RPM_BUILD_ROOT%{_examplesdir}/python3-configshell-fb-%{version}/myshell |
1607ef5a JK |
93 | sed -i '1s|^#!.*python\b|#!%{__python3}|' $RPM_BUILD_ROOT%{_examplesdir}/python3-configshell-fb-%{version}/* |
94 | %endif | |
95 | ||
96 | %clean | |
97 | rm -rf $RPM_BUILD_ROOT | |
98 | ||
99 | %if %{with python2} | |
100 | %files | |
101 | %defattr(644,root,root,755) | |
102 | %doc README.md | |
c247c50f JB |
103 | %{py_sitescriptdir}/configshell |
104 | %{py_sitescriptdir}/configshell_fb | |
1607ef5a | 105 | %if "%{py_ver}" > "2.4" |
c247c50f | 106 | %{py_sitescriptdir}/configshell_fb-*-py*.egg-info |
1607ef5a | 107 | %endif |
1607ef5a JK |
108 | %dir %{_examplesdir}/%{name}-%{version} |
109 | %attr(755,root,root) %{_examplesdir}/%{name}-%{version}/myshell | |
fa9c33db | 110 | %endif |
1607ef5a JK |
111 | |
112 | %if %{with python3} | |
113 | %files -n python3-configshell-fb | |
114 | %defattr(644,root,root,755) | |
115 | %doc README.md | |
c247c50f JB |
116 | %{py3_sitescriptdir}/configshell |
117 | %{py3_sitescriptdir}/configshell_fb | |
1607ef5a | 118 | %{py3_sitescriptdir}/configshell_fb-*-py*.egg-info |
1607ef5a JK |
119 | %dir %{_examplesdir}/python3-configshell-fb-%{version} |
120 | %attr(755,root,root) %{_examplesdir}/python3-configshell-fb-%{version}/myshell | |
fa9c33db | 121 | %endif |