]>
Commit | Line | Data |
---|---|---|
6d4aae2a AM |
1 | # Conditional build: |
2 | %bcond_with tests # do not perform "make test" | |
3 | %bcond_without python2 # CPython 2.x module | |
4 | %bcond_without python3 # CPython 3.x module | |
5 | ||
6 | %define module phpserialize | |
7 | %define egg_name phpserialize | |
8 | %define pypi_name phpserialize | |
9 | Summary: A port of the serialize and unserialize functions of php to python | |
10 | Name: python-%{pypi_name} | |
11 | Version: 1.3 | |
c7a18517 | 12 | Release: 7 |
6d4aae2a AM |
13 | License: BSD |
14 | Group: Libraries/Python | |
15 | Source0: https://pypi.debian.net/%{pypi_name}/%{pypi_name}-%{version}.tar.gz | |
16 | # Source0-md5: cbf88a62e04135e3be3c7fe412525b8b | |
17 | URL: https://pypi.python.org/pypi/phpserialize | |
18 | BuildRequires: rpm-pythonprov | |
19 | BuildRequires: rpmbuild(macros) >= 1.714 | |
20 | %if %{with python2} | |
21 | BuildRequires: python-modules | |
22 | BuildRequires: python-setuptools | |
23 | %endif | |
24 | %if %{with python3} | |
25 | BuildRequires: python3-modules | |
26 | BuildRequires: python3-setuptools | |
27 | %endif | |
28 | Requires: python-modules | |
29 | BuildArch: noarch | |
30 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
31 | ||
32 | %description | |
33 | A port of the serialize and unserialize functions of php to python. | |
34 | ||
35 | %package -n python3-%{pypi_name} | |
36 | Summary: A port of the serialize and unserialize functions of php to python | |
37 | Group: Libraries/Python | |
38 | Requires: python3-modules | |
39 | ||
40 | %description -n python3-%{pypi_name} | |
41 | A port of the serialize and unserialize functions of php to python. | |
42 | ||
43 | %prep | |
44 | %setup -q -n %{pypi_name}-%{version} | |
45 | ||
46 | %build | |
47 | %if %{with python2} | |
48 | %py_build %{?with_tests:test} | |
49 | %endif | |
50 | ||
51 | %if %{with python3} | |
52 | %py3_build %{?with_tests:test} | |
53 | %endif | |
54 | ||
55 | %install | |
56 | rm -rf $RPM_BUILD_ROOT | |
57 | ||
58 | %if %{with python2} | |
59 | %py_install | |
60 | %py_postclean | |
61 | %endif | |
62 | ||
63 | %if %{with python3} | |
64 | %py3_install | |
65 | %endif | |
66 | ||
67 | %clean | |
68 | rm -rf $RPM_BUILD_ROOT | |
69 | ||
70 | %if %{with python2} | |
71 | %files | |
72 | %defattr(644,root,root,755) | |
73 | %doc PKG-INFO | |
74 | %{py_sitescriptdir}/%{module}.py* | |
75 | %{py_sitescriptdir}/%{egg_name}-%{version}-py*.egg-info | |
76 | %endif | |
77 | ||
78 | %if %{with python3} | |
79 | %files -n python3-%{pypi_name} | |
80 | %defattr(644,root,root,755) | |
81 | %doc PKG-INFO | |
82 | %{py3_sitescriptdir}/%{module}.py* | |
83 | %{py3_sitescriptdir}/__pycache__/%{module}* | |
84 | %{py3_sitescriptdir}/%{egg_name}-%{version}-py*.egg-info | |
85 | %endif |