]> git.pld-linux.org Git - packages/python-configshell-fb.git/blob - python-configshell-fb.spec
removing template spec leftover
[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:        A Python library for building configuration shells
8 Name:           python-configshell-fb
9 Version:        1.1.fb10
10 Release:        1
11 License:        Apache v2.0
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
20 %if %{with python3}
21 BuildRequires:  python3-distribute
22 BuildRequires:  python3-modules
23 %endif
24 Requires:       python-modules
25 Requires:       python-pyparsing
26 BuildArch:      noarch
27 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
28
29 %description
30 configshell-fb is a Python library that provides a framework for
31 building simple but nice CLI-based applications.
32
33 %package -n python3-configshell-fb
34 Summary:        A Python library for building configuration shells
35 Group:          Libraries/Python
36 Requires:       python3-pyparsing
37
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.
41
42 %prep
43 %setup -q -n configshell-fb-%{version}
44
45 %build
46 %if %{with python2}
47 %{__python} setup.py build --build-base build-2 %{?with_tests:test}
48 %endif
49
50 %if %{with python3}
51 %{__python3} setup.py build --build-base build-3 %{?with_tests:test}
52 %endif
53
54 %install
55 rm -rf $RPM_BUILD_ROOT
56
57 %if %{with python2}
58 %{__python} setup.py \
59         build --build-base build-2 \
60         install --skip-build \
61         --root=$RPM_BUILD_ROOT \
62         --optimize=2
63
64 %py_postclean
65 %endif
66
67 %if %{with python3}
68 %{__python3} setup.py \
69         build --build-base build-3 \
70         install --skip-build \
71         --root=$RPM_BUILD_ROOT \
72         --optimize=2
73 %endif
74
75 %if %{with python2}
76 install -d $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
77 cp -a examples/* $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
78 %endif
79 %if %{with python3}
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}/*
83 %endif
84
85 %clean
86 rm -rf $RPM_BUILD_ROOT
87
88 %if %{with python2}
89 %files
90 %defattr(644,root,root,755)
91 %doc README.md
92 %dir %{py_sitescriptdir}/%{module}
93 %{py_sitescriptdir}/%{module}/*.py[co]
94 %if "%{py_ver}" > "2.4"
95 %{py_sitescriptdir}/configshell_fb-*.egg-info
96 %endif
97 %endif
98 %dir %{_examplesdir}/%{name}-%{version}
99 %attr(755,root,root) %{_examplesdir}/%{name}-%{version}/myshell
100
101 %if %{with python3}
102 %files -n python3-configshell-fb
103 %defattr(644,root,root,755)
104 %doc README.md
105 %{py3_sitescriptdir}/%{module}
106 %{py3_sitescriptdir}/configshell_fb-*-py*.egg-info
107 %endif
108 %dir %{_examplesdir}/python3-configshell-fb-%{version}
109 %attr(755,root,root) %{_examplesdir}/python3-configshell-fb-%{version}/myshell
This page took 0.064115 seconds and 3 git commands to generate.