]>
Commit | Line | Data |
---|---|---|
471dcd6d AM |
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 pyClamd | |
8 | Summary: A python interface to Clamd (Clamav daemon) | |
9 | # Name must match the python module/package name (as in 'import' statement) | |
10 | Name: python-%{module} | |
11 | Version: 0.3.10 | |
d5ddb1a6 | 12 | Release: 2 |
471dcd6d AM |
13 | License: - (enter GPL/GPL v2/GPL v3/LGPL/BSD/BSD-like/other license name here) |
14 | Group: Libraries/Python | |
15 | Source0: https://pypi.python.org/packages/source/p/pyClamd/%{module}-%{version}.tar.gz | |
16 | # Source0-md5: 370d7c12da34376eca730aea193a8712 | |
17 | URL: http://xael.org/norman/python/pyclamd/ | |
18 | BuildRequires: rpmbuild(macros) >= 1.219 | |
19 | %if %{with python2} | |
20 | BuildRequires: python-devel | |
21 | BuildRequires: python-distribute | |
22 | %endif | |
23 | %if %{with python3} | |
24 | BuildRequires: python3-devel | |
25 | BuildRequires: python3-distribute | |
26 | BuildRequires: python3-modules | |
27 | %endif | |
28 | Requires: python-modules | |
29 | BuildArch: noarch | |
30 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
31 | ||
32 | %description | |
33 | pyClamd is a python interface to Clamd (Clamav daemon). By using | |
34 | pyClamd, you can add virus detection capabilities to your python | |
35 | software in an efficient and easy way. | |
36 | ||
37 | %package -n python3-%{module} | |
38 | Summary: - | |
39 | Summary(pl.UTF-8): - | |
40 | Group: Libraries/Python | |
41 | Requires: python3-modules | |
42 | ||
43 | %description -n python3-%{module} | |
44 | pyClamd is a python interface to Clamd (Clamav daemon). By using | |
45 | pyClamd, you can add virus detection capabilities to your python | |
46 | software in an efficient and easy way. | |
47 | ||
48 | %prep | |
49 | %setup -q -n %{module}-%{version} | |
50 | ||
e8609a2c AM |
51 | sed -i -e 's#/etc/clamav/clamd.conf#/etc/clamd.conf#g' README.txt pyclamd/pyclamd.py |
52 | ||
471dcd6d AM |
53 | %build |
54 | %if %{with python2} | |
55 | %{__python} setup.py build --build-base build-2 %{?with_tests:test} | |
56 | %endif | |
57 | ||
58 | %if %{with python3} | |
59 | %{__python3} setup.py build --build-base build-3 %{?with_tests:test} | |
60 | %endif | |
61 | ||
62 | %install | |
63 | rm -rf $RPM_BUILD_ROOT | |
64 | ||
65 | %if %{with python2} | |
66 | %{__python} setup.py \ | |
67 | build --build-base build-2 \ | |
68 | install --skip-build \ | |
69 | --optimize=2 \ | |
70 | --root=$RPM_BUILD_ROOT | |
71 | ||
72 | %py_postclean | |
73 | %endif | |
74 | ||
75 | %if %{with python3} | |
76 | %{__python3} setup.py \ | |
77 | build --build-base build-3 \ | |
78 | install --skip-build \ | |
79 | --optimize=2 \ | |
80 | --root=$RPM_BUILD_ROOT | |
81 | %endif | |
82 | ||
83 | %clean | |
84 | rm -rf $RPM_BUILD_ROOT | |
85 | ||
86 | %if %{with python2} | |
87 | %files | |
88 | %defattr(644,root,root,755) | |
89 | %doc README.txt | |
90 | %dir %{py_sitescriptdir}/pyclamd | |
91 | %{py_sitescriptdir}/pyclamd/*.py[co] | |
92 | %if "%{py_ver}" > "2.4" | |
93 | %{py_sitescriptdir}/%{module}-%{version}-py*.egg-info | |
94 | %endif | |
95 | %endif | |
96 | ||
97 | %if %{with python3} | |
98 | %files -n python3-%{module} | |
99 | %defattr(644,root,root,755) | |
100 | %doc README.txt | |
101 | %{py3_sitescriptdir}/pyclamd | |
102 | %{py3_sitescriptdir}/%{module}-%{version}-py*.egg-info | |
103 | %endif |