]> git.pld-linux.org Git - packages/python-zeroconf.git/blame - python-zeroconf.spec
- disable python3 here
[packages/python-zeroconf.git] / python-zeroconf.spec
CommitLineData
99aed9db
JR
1#
2# Conditional build:
3%bcond_with integration # Integration tests work in mock but fail in Koji with PermissionError
401c9fd8
JB
4%bcond_with tests # unit tests
5%bcond_without python2 # CPython 2.x module
9006ed26 6%bcond_with python3 # CPython 3.x module (built from python3-zeroconf.spec)
99aed9db 7
401c9fd8 8%define module zeroconf
99aed9db 9Summary: Pure Python Multicast DNS Service Discovery Library
401c9fd8
JB
10Summary(pl.UTF-8): Czysto pythonowa biblioteka Multicast DNS Service Discovery
11Name: python-%{module}
12# keep 0.19.x here for python2 support
13Version: 0.19.1
14Release: 1
15License: LGPL v2
99aed9db 16Group: Libraries/Python
401c9fd8
JB
17#Source0Download: https://github.com/jstasiak/python-zeroconf/releases
18Source0: https://github.com/jstasiak/python-zeroconf/archive/%{version}/%{module}-%{version}.tar.gz
19# Source0-md5: bda83913df1669610ba3c09f8133614e
20Patch0: %{name}-mock.patch
21URL: https://github.com/jstasiak/python-zeroconf
99aed9db 22%if %{with python2}
401c9fd8
JB
23BuildRequires: python-devel >= 1:2.6
24BuildRequires: python-setuptools
25%if %{with tests}
99aed9db
JR
26BuildRequires: python-enum34
27BuildRequires: python-mock
401c9fd8 28BuildRequires: python-netifaces >= 0.10.6
99aed9db 29BuildRequires: python-pytest
99aed9db
JR
30BuildRequires: python-six
31%endif
401c9fd8 32%endif
99aed9db 33%if %{with python3}
401c9fd8 34BuildRequires: python3-devel >= 1:3.4
99aed9db 35BuildRequires: python3-setuptools
401c9fd8
JB
36%if %{with tests}
37BuildRequires: python3-netifaces >= 0.10.6
38BuildRequires: python3-pytest
99aed9db
JR
39BuildRequires: python3-six
40%endif
401c9fd8
JB
41%endif
42BuildRequires: rpm-pythonprov
43BuildRequires: rpmbuild(macros) >= 1.714
9006ed26 44BuildRequires: sed >= 4.0
99aed9db
JR
45BuildArch: noarch
46BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
47
48%description
49A pure Python implementation of multicast DNS service discovery
50supporting Bonjour/Avahi.
51
401c9fd8
JB
52%description -l pl.UTF-8
53Czysto pythonowa implementacja wykrywania usług multicastowych DNS
54przy użyciu Bonjour/Avahi.
55
56%package -n python3-%{module}
57Summary: Pure Python Multicast DNS Service Discovery Library
58Summary(pl.UTF-8): Czysto pythonowa biblioteka Multicast DNS Service Discovery
99aed9db 59Group: Libraries/Python
99aed9db 60
401c9fd8
JB
61%description -n python3-%{module}
62A pure Python implementation of multicast DNS service discovery
99aed9db
JR
63supporting Bonjour/Avahi.
64
401c9fd8
JB
65%description -n python3-%{module} -l pl.UTF-8
66Czysto pythonowa implementacja wykrywania usług multicastowych DNS
67przy użyciu Bonjour/Avahi.
68
99aed9db
JR
69%prep
70%setup -q
401c9fd8 71%patch0 -p1
99aed9db
JR
72
73# Remove enum-compat from install_requires
74# See https://bugzilla.redhat.com/show_bug.cgi?id=1432165
9006ed26 75%{__sed} -i '/enum-compat/d' setup.py
99aed9db
JR
76
77%build
78%if %{with python2}
79%py_build
401c9fd8 80
99aed9db 81%if %{with tests}
401c9fd8 82PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 \
99aed9db 83%{__python} -m pytest \
401c9fd8 84 %{!?with_integration:-k "not integration"}
99aed9db
JR
85%endif
86%endif
87
88%if %{with python3}
401c9fd8 89%py3_build
99aed9db
JR
90
91%if %{with tests}
401c9fd8 92PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 \
99aed9db 93%{__python3} -m pytest \
401c9fd8 94 %{!?with_integration:-k "not integration"}
99aed9db
JR
95%endif
96%endif
97
98%install
99rm -rf $RPM_BUILD_ROOT
100
101%if %{with python2}
102%py_install
103
99aed9db
JR
104%py_postclean
105%endif
106
107%if %{with python3}
108%py3_install
109%endif
110
111%clean
112rm -rf $RPM_BUILD_ROOT
113
114%if %{with python2}
115%files
116%defattr(644,root,root,755)
117%doc README.rst
401c9fd8
JB
118%{py_sitescriptdir}/zeroconf.py[co]
119%{py_sitescriptdir}/zeroconf-%{version}-py*.egg-info
99aed9db
JR
120%endif
121
122%if %{with python3}
401c9fd8 123%files -n python3-%{module}
99aed9db
JR
124%defattr(644,root,root,755)
125%doc README.rst
401c9fd8
JB
126%{py3_sitescriptdir}/__pycache__/zeroconf.cpython-*.py[co]
127%{py3_sitescriptdir}/zeroconf.py
128%{py3_sitescriptdir}/zeroconf-%{version}-py*.egg-info
99aed9db 129%endif
This page took 0.14403 seconds and 4 git commands to generate.