3 %bcond_without python2 # CPython 2.x module
4 %bcond_without python3 # CPython 3.x module
6 %define module configshell
7 Summary: A Python library for building configuration shells
8 Name: python-configshell-fb
12 Group: Libraries/Python
13 Source0: https://codeload.github.com/agrover/configshell-fb/tar.gz/v%{version}
14 # Source0-md5: 72e152e33785bd975cc3848653d1f0bd
15 URL: https://github.com/agrover/configshell-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
25 Requires: python-pyparsing
27 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
30 configshell-fb is a Python library that provides a framework for
31 building simple but nice CLI-based applications.
33 %package -n python3-configshell-fb
34 Summary: A Python library for building configuration shells
35 Group: Libraries/Python
36 Requires: python3-pyparsing
38 %description -n python3-configshell-fb
39 configshell-fb is a Python library that provides a framework for
40 building simple but nice CLI-based applications.
43 %setup -q -n configshell-fb-%{version}
47 %{__python} setup.py build --build-base build-2 %{?with_tests:test}
51 %{__python3} setup.py build --build-base build-3 %{?with_tests:test}
55 rm -rf $RPM_BUILD_ROOT
58 %{__python} setup.py \
59 build --build-base build-2 \
60 install --skip-build \
61 --root=$RPM_BUILD_ROOT \
68 %{__python3} setup.py \
69 build --build-base build-3 \
70 install --skip-build \
71 --root=$RPM_BUILD_ROOT \
76 install -d $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
77 cp -a examples/* $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
80 install -d $RPM_BUILD_ROOT%{_examplesdir}/python3-configshell-fb-%{version}
81 cp -a examples/* $RPM_BUILD_ROOT%{_examplesdir}/python3-configshell-fb-%{version}
82 sed -i '1s|^#!.*python\b|#!%{__python3}|' $RPM_BUILD_ROOT%{_examplesdir}/python3-configshell-fb-%{version}/*
86 rm -rf $RPM_BUILD_ROOT
90 %defattr(644,root,root,755)
92 %dir %{py_sitescriptdir}/%{module}
93 %{py_sitescriptdir}/%{module}/*.py[co]
94 %if "%{py_ver}" > "2.4"
95 %{py_sitescriptdir}/configshell_fb-*.egg-info
98 %dir %{_examplesdir}/%{name}-%{version}
99 %attr(755,root,root) %{_examplesdir}/%{name}-%{version}/myshell
102 %files -n python3-configshell-fb
103 %defattr(644,root,root,755)
105 %{py3_sitescriptdir}/%{module}
106 %{py3_sitescriptdir}/configshell_fb-*-py*.egg-info
108 %dir %{_examplesdir}/python3-configshell-fb-%{version}
109 %attr(755,root,root) %{_examplesdir}/python3-configshell-fb-%{version}/myshell