]> git.pld-linux.org Git - packages/python-docopt.git/blob - python-docopt.spec
rebuild with tests and docs
[packages/python-docopt.git] / python-docopt.spec
1 #
2 # Conditional build:
3 %bcond_without  tests   # do not perform "make test"
4 %bcond_without  python2 # CPython 2.x module
5 %bcond_without  python3 # CPython 3.x module
6
7 %define         module  docopt
8 Summary:        Pythonic argument parser, that will make you smile
9 Summary(pl.UTF-8):      Przyjemny pythonowy parser argumentów
10 Name:           python-%{module}
11 Version:        0.6.2
12 Release:        13
13 License:        MIT
14 Group:          Libraries/Python
15 #Source0Download: https://pypi.org/simple/docopt/
16 Source0:        https://files.pythonhosted.org/packages/source/d/docopt/%{module}-%{version}.tar.gz
17 # Source0-md5:  4bc74561b37fad5d3e7d037f82a4c3b1
18 URL:            http://docopt.org/
19 %if %{with python2}
20 BuildRequires:  python-modules >= 1:2.5
21 BuildRequires:  python-setuptools
22 %endif
23 %if %{with python3}
24 BuildRequires:  python3-modules >= 1:3.2
25 BuildRequires:  python3-setuptools
26 %endif
27 BuildRequires:  rpm-pythonprov
28 BuildRequires:  rpmbuild(macros) >= 1.714
29 BuildRequires:  sed >= 4.0
30 Requires:       python-modules >= 1:2.5
31 BuildArch:      noarch
32 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
33
34 %description
35 docopt creates beautiful command-line interfaces.
36
37 %description -l pl.UTF-8
38 docopt tworzy ładne interfejsy linii poleceń.
39
40 %package -n python3-%{module}
41 Summary:        Pythonic argument parser, that will make you smile
42 Summary(pl.UTF-8):      Przyjemny pythonowy parser argumentów
43 Group:          Libraries/Python
44 Requires:       python3-modules >= 1:3.2
45
46 %description -n python3-%{module}
47 docopt creates beautiful command-line interfaces.
48
49 %description -n python3-%{module} -l pl.UTF-8
50 docopt tworzy ładne interfejsy linii poleceń.
51
52 %prep
53 %setup -q -n %{module}-%{version}
54
55 %build
56 %if %{with python2}
57 %py_build
58 %endif
59
60 %if %{with python3}
61 %py3_build
62 %endif
63
64 %install
65 rm -rf $RPM_BUILD_ROOT
66
67 %if %{with python2}
68 %py_install
69
70 %py_postclean
71 %endif
72
73 %if %{with python3}
74 %py3_install
75 %endif
76
77 %if %{with python2}
78 install -d $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
79 cp -a examples/* $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
80 %{__sed} -i -e '1s,/usr/bin/env python,%{__python},' $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}/git/git.py
81 %endif
82 %if %{with python3}
83 install -d $RPM_BUILD_ROOT%{_examplesdir}/python3-%{module}-%{version}
84 cp -a examples/* $RPM_BUILD_ROOT%{_examplesdir}/python3-%{module}-%{version}
85 %{__sed} -i -e '1s,/usr/bin/env python,%{__python},' $RPM_BUILD_ROOT%{_examplesdir}/python3-%{module}-%{version}/git/git.py
86 %endif
87
88 %clean
89 rm -rf $RPM_BUILD_ROOT
90
91 %if %{with python2}
92 %files
93 %defattr(644,root,root,755)
94 %doc LICENSE-MIT README.rst
95 %{py_sitescriptdir}/docopt.py[co]
96 %{py_sitescriptdir}/docopt-%{version}-py*.egg-info
97 %{_examplesdir}/%{name}-%{version}
98 %endif
99
100 %if %{with python3}
101 %files -n python3-%{module}
102 %defattr(644,root,root,755)
103 %doc LICENSE-MIT README.rst
104 %{py3_sitescriptdir}/__pycache__/docopt.cpython-*.py[co]
105 %{py3_sitescriptdir}/docopt.py
106 %{py3_sitescriptdir}/docopt-%{version}-py*.egg-info
107 %{_examplesdir}/python3-%{module}-%{version}
108 %endif
This page took 0.081735 seconds and 3 git commands to generate.