3 %bcond_without python2 # CPython 2.x module
4 %bcond_without python3 # CPython 3.x module
6 %define module configshell
7 Summary: ConfigShell - Python 2 library for building configuration shells
8 Summary(pl.UTF-8): ConfigShell - biblioteka Pythona 2 do tworzenia powłok konfiguracyjnych
9 Name: python-configshell-fb
13 Group: Libraries/Python
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
16 # Source0-md5: e4d5394815712f661c04917a429f3e06
17 URL: https://github.com/open-iscsi/configshell-fb
18 BuildRequires: rpm-pythonprov
19 BuildRequires: rpmbuild(macros) >= 1.714
20 BuildRequires: sed >= 4.0
22 BuildRequires: python-modules >= 1:2.4
23 BuildRequires: python-setuptools
26 BuildRequires: python3-modules >= 1:3.2
27 BuildRequires: python3-setuptools
29 Requires: python-modules >= 1:2.4
30 Requires: python-pyparsing
31 Requires: python-urwid
33 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
36 configshell-fb is a Python library that provides a framework for
37 building simple but nice CLI-based applications.
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ń.
43 %package -n python3-configshell-fb
44 Summary: ConfigShell - Python 3 library for building configuration shells
45 Summary(pl.UTF-8): ConfigShell - biblioteka Pythona 3 do tworzenia powłok konfiguracyjnych
46 Group: Libraries/Python
47 Requires: python3-modules
48 Requires: python3-pyparsing
49 Requires: python3-urwid
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.
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ń.
60 %setup -q -n configshell-fb-%{version}
64 %py_build %{?with_tests:test}
68 %py3_build %{?with_tests:test}
72 rm -rf $RPM_BUILD_ROOT
85 install -d $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
86 cp -a examples/* $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
87 %{__sed} -i -e '1s,/usr/bin/env python,%{__python},' $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}/myshell
90 install -d $RPM_BUILD_ROOT%{_examplesdir}/python3-configshell-fb-%{version}
91 cp -a examples/* $RPM_BUILD_ROOT%{_examplesdir}/python3-configshell-fb-%{version}
92 %{__sed} -i -e '1s,/usr/bin/env python,%{__python3},' $RPM_BUILD_ROOT%{_examplesdir}/python3-configshell-fb-%{version}/myshell
93 sed -i '1s|^#!.*python\b|#!%{__python3}|' $RPM_BUILD_ROOT%{_examplesdir}/python3-configshell-fb-%{version}/*
97 rm -rf $RPM_BUILD_ROOT
101 %defattr(644,root,root,755)
103 %{py_sitescriptdir}/configshell
104 %{py_sitescriptdir}/configshell_fb
105 %if "%{py_ver}" > "2.4"
106 %{py_sitescriptdir}/configshell_fb-*-py*.egg-info
108 %dir %{_examplesdir}/%{name}-%{version}
109 %attr(755,root,root) %{_examplesdir}/%{name}-%{version}/myshell
113 %files -n python3-configshell-fb
114 %defattr(644,root,root,755)
116 %{py3_sitescriptdir}/configshell
117 %{py3_sitescriptdir}/configshell_fb
118 %{py3_sitescriptdir}/configshell_fb-*-py*.egg-info
119 %dir %{_examplesdir}/python3-configshell-fb-%{version}
120 %attr(755,root,root) %{_examplesdir}/python3-configshell-fb-%{version}/myshell