]> git.pld-linux.org Git - packages/python-PyMySQL.git/blob - python-PyMySQL.spec
rebuild with tests and docs
[packages/python-PyMySQL.git] / python-PyMySQL.spec
1 #
2 # Conditional build:
3 %bcond_with     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  PyMySQL
8 Summary:        Pure Python MySQL Client
9 Name:           python-%{module}
10 Version:        0.7.4
11 Release:        8
12 License:        MIT
13 Group:          Libraries/Python
14 Source0:        https://github.com/PyMySQL/PyMySQL/archive/%{version}/%{module}-%{version}.tar.gz
15 # Source0-md5:  e5d21154a71e5f6e73bcb3fd7659c642
16 URL:            https://github.com/PyMySQL/PyMySQL
17 BuildRequires:  rpm-pythonprov
18 BuildRequires:  rpmbuild(macros) >= 1.714
19 %if %{with python2}
20 BuildRequires:  python-modules
21 BuildRequires:  python-setuptools
22 %endif
23 %if %{with python3}
24 BuildRequires:  python3-modules
25 BuildRequires:  python3-setuptools
26 %endif
27 Requires:       python-modules
28 BuildArch:      noarch
29 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
30
31 %description
32 This package contains a pure-Python MySQL client library.
33
34 The goal of PyMySQL is to be a drop-in replacement for MySQLdb and
35 work on CPython, PyPy and IronPython.
36
37 %package -n python3-%{module}
38 Summary:        Pure Python MySQL Client
39 Group:          Libraries/Python
40 Requires:       python3-modules
41
42 %description -n python3-%{module}
43 This package contains a pure-Python MySQL client library.
44
45 The goal of PyMySQL is to be a drop-in replacement for MySQLdb and
46 work on CPython, PyPy and IronPython.
47
48 %prep
49 %setup  -q -n PyMySQL-%{version}
50
51 %build
52 %if %{with python2}
53 %py_build %{?with_tests:test}
54 %endif
55
56 %if %{with python3}
57 %py3_build %{?with_tests:test}
58 %endif
59
60 %install
61 rm -rf $RPM_BUILD_ROOT
62 %if %{with python2}
63 %py_install
64 %py_postclean
65 %{__rm} -r $RPM_BUILD_ROOT%{py_sitescriptdir}/pymysql/tests
66 %endif
67
68 %if %{with python3}
69 %py3_install
70 %{__rm} -r $RPM_BUILD_ROOT%{py3_sitescriptdir}/pymysql/tests
71 %endif
72
73 %clean
74 rm -rf $RPM_BUILD_ROOT
75
76 %if %{with python2}
77 %files
78 %defattr(644,root,root,755)
79 %doc README.rst CHANGELOG LICENSE
80 %{py_sitescriptdir}/pymysql
81 %{py_sitescriptdir}/PyMySQL-%{version}-py*.egg-info
82 %endif
83
84 %if %{with python3}
85 %files -n python3-%{module}
86 %defattr(644,root,root,755)
87 %doc README.rst CHANGELOG LICENSE
88 %{py3_sitescriptdir}/pymysql
89 %{py3_sitescriptdir}/PyMySQL-%{version}-py*.egg-info
90 %endif
This page took 0.057647 seconds and 3 git commands to generate.