]> git.pld-linux.org Git - packages/python-configshell-fb.git/blob - python-configshell-fb.spec
156cc8d233255a6cc510e4db43f601f518eae781
[packages/python-configshell-fb.git] / python-configshell-fb.spec
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
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
10 Version:        1.1.fb25
11 Release:        4
12 License:        Apache v2.0
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
21 %if %{with python2}
22 BuildRequires:  python-modules >= 1:2.4
23 BuildRequires:  python-setuptools
24 %endif
25 %if %{with python3}
26 BuildRequires:  python3-modules >= 1:3.2
27 BuildRequires:  python3-setuptools
28 %endif
29 Requires:       python-modules >= 1:2.4
30 Requires:       python-pyparsing
31 Requires:       python-urwid
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
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
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
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
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
59 %prep
60 %setup -q -n configshell-fb-%{version}
61
62 %build
63 %if %{with python2}
64 %py_build %{?with_tests:test}
65 %endif
66
67 %if %{with python3}
68 %py3_build %{?with_tests:test}
69 %endif
70
71 %install
72 rm -rf $RPM_BUILD_ROOT
73
74 %if %{with python2}
75 %py_install
76
77 %py_postclean
78 %endif
79
80 %if %{with python3}
81 %py3_install
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}
87 %{__sed} -i -e '1s,/usr/bin/env python,%{__python},' $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}/myshell
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}
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}/*
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
103 %{py_sitescriptdir}/configshell
104 %{py_sitescriptdir}/configshell_fb
105 %if "%{py_ver}" > "2.4"
106 %{py_sitescriptdir}/configshell_fb-*-py*.egg-info
107 %endif
108 %dir %{_examplesdir}/%{name}-%{version}
109 %attr(755,root,root) %{_examplesdir}/%{name}-%{version}/myshell
110 %endif
111
112 %if %{with python3}
113 %files -n python3-configshell-fb
114 %defattr(644,root,root,755)
115 %doc README.md
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
121 %endif
This page took 0.06361 seconds and 2 git commands to generate.