]>
Commit | Line | Data |
---|---|---|
4ac58333 AM |
1 | # Conditional build: |
2 | %bcond_without 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 pygtail | |
7 | %define egg_name pygtail | |
8 | %define pypi_name pygtail | |
9 | Summary: Reads log file lines that have not been read | |
10 | Name: python-%{pypi_name} | |
11 | Version: 0.8.0 | |
f69509be | 12 | Release: 6 |
4ac58333 AM |
13 | License: GPL v2 |
14 | Group: Libraries/Python | |
15 | Source0: https://github.com/bgreenlee/pygtail/archive/%{version}.tar.gz | |
16 | # Source0-md5: 504ffc804e83a4dd09e20546990b1d43 | |
2892fc57 | 17 | Patch0: python-pygtail-bug-38.patch |
4ac58333 AM |
18 | URL: https://github.com/bgreenlee/pygtail |
19 | BuildRequires: rpm-pythonprov | |
20 | BuildRequires: rpmbuild(macros) >= 1.714 | |
21 | %if %{with python2} | |
22 | BuildRequires: python-modules | |
23 | BuildRequires: python-setuptools | |
24 | %endif | |
25 | %if %{with python3} | |
26 | BuildRequires: python3-modules | |
27 | BuildRequires: python3-setuptools | |
28 | %endif | |
29 | Requires: python-modules | |
30 | BuildArch: noarch | |
31 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
32 | ||
33 | %description | |
34 | Pygtail reads log file lines that have not been read. It will even | |
35 | handle log files that have been rotated. | |
36 | ||
37 | %package -n python3-%{pypi_name} | |
38 | Summary: - | |
39 | Summary(pl.UTF-8): - | |
40 | Group: Libraries/Python | |
41 | Requires: python3-modules | |
42 | ||
43 | %description -n python3-%{pypi_name} | |
44 | Pygtail reads log file lines that have not been read. It will even | |
45 | handle log files that have been rotated. | |
46 | ||
47 | %prep | |
48 | %setup -q -n %{pypi_name}-%{version} | |
2892fc57 AM |
49 | %patch0 -p1 |
50 | ||
4ac58333 AM |
51 | sed -i -e 's#0\.7\.0#0\.8\.0#g' pygtail/core.py |
52 | ||
53 | %build | |
54 | %if %{with python2} | |
55 | %py_build %{?with_tests:test} | |
56 | %endif | |
57 | ||
58 | %if %{with python3} | |
59 | %py3_build %{?with_tests:test} | |
60 | %endif | |
61 | ||
62 | %install | |
63 | rm -rf $RPM_BUILD_ROOT | |
64 | ||
65 | %if %{with python2} | |
66 | %py_install | |
67 | %endif | |
68 | ||
69 | %if %{with python3} | |
70 | %py3_install | |
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.md | |
80 | %{py_sitescriptdir}/%{module} | |
81 | %{py_sitescriptdir}/%{egg_name}-%{version}-py*.egg-info | |
82 | %endif | |
83 | ||
84 | %if %{with python3} | |
85 | %files -n python3-%{pypi_name} | |
86 | %defattr(644,root,root,755) | |
87 | %doc README.md | |
88 | %attr(755,root,root) %{_bindir}/pygtail | |
89 | %{py3_sitescriptdir}/%{module} | |
90 | %{py3_sitescriptdir}/%{egg_name}-%{version}-py*.egg-info | |
91 | %endif |