]> git.pld-linux.org Git - packages/python-zeroconf.git/blob - python-zeroconf.spec
531b2efa6a93014e865b0b49638a6ab238788ef2
[packages/python-zeroconf.git] / python-zeroconf.spec
1 #
2 # Conditional build:
3 %bcond_with     integration     # Integration tests work in mock but fail in Koji with PermissionError
4 %bcond_with     tests   # do not perform "make test"
5 %bcond_without  python2 # CPython 2.x module
6 %bcond_without  python3 # CPython 3.x module
7
8 %define pypi_name zeroconf
9 Summary:        Pure Python Multicast DNS Service Discovery Library
10 Name:           python-%{pypi_name}
11 Version:        0.18.0
12 Release:        8
13 License:        LGPLv2
14 Group:          Libraries/Python
15 Source0:        https://github.com/jstasiak/%{name}/archive/%{version}/%{pypi_name}-%{version}.tar.gz
16 # Source0-md5:  f40e133a2cec3087761e5230cdf8637c
17 URL:            https://github.com/jstasiak/python-%{pypi_name}
18 %if %{with python2}
19 BuildRequires:  python-devel
20 BuildRequires:  python-enum34
21 BuildRequires:  python-mock
22 BuildRequires:  python-netifaces
23 BuildRequires:  python-pytest
24 BuildRequires:  python-setuptools
25 BuildRequires:  python-six
26 %endif
27 %if %{with python3}
28 BuildRequires:  python3-devel
29 BuildRequires:  python3-mock
30 BuildRequires:  python3-netifaces
31 BuildRequires:  python3-pytest
32 BuildRequires:  python3-setuptools
33 BuildRequires:  python3-six
34 %endif
35 BuildArch:      noarch
36 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
37
38 %description
39 A pure Python implementation of multicast DNS service discovery
40 supporting Bonjour/Avahi.
41
42 %package -n     python3-%{pypi_name}
43 Summary:        Pure Python 3 Multicast DNS Service Discovery Library
44 Group:          Libraries/Python
45 Requires:       python3-netifaces
46 Requires:       python3-six
47
48 %description -n python3-%{pypi_name}
49 A pure Python 3 implementation of multicast DNS service discovery
50 supporting Bonjour/Avahi.
51
52 %prep
53 %setup -q
54
55 # Remove enum-compat from install_requires
56 # See https://bugzilla.redhat.com/show_bug.cgi?id=1432165
57 sed -i '/enum-compat/d' setup.py
58
59 %build
60 %if %{with python2}
61 %py_build
62 %if %{with tests}
63 %{__python} -m pytest \
64         %{!?with_integartion:-k "not integration"}
65 %endif
66 %endif
67
68 %if %{with python3}
69 %py3_build %{?with_tests:test}
70
71 %if %{with tests}
72 %{__python3} -m pytest \
73         %{!?with_integartion:-k "not integration"}
74 %endif
75 %endif
76
77 %install
78 rm -rf $RPM_BUILD_ROOT
79
80 %if %{with python2}
81 %py_install
82
83 # when files are installed in other way that standard 'setup.py
84 # they need to be (re-)compiled
85 # change %{py_sitedir} to %{py_sitescriptdir} for 'noarch' packages!
86 %py_ocomp $RPM_BUILD_ROOT%{py_sitedir}
87 %py_comp $RPM_BUILD_ROOT%{py_sitedir}
88
89 %py_postclean
90 %endif
91
92 %if %{with python3}
93 %py3_install
94 %endif
95
96 %clean
97 rm -rf $RPM_BUILD_ROOT
98
99 %if %{with python2}
100 %files
101 %defattr(644,root,root,755)
102 %doc README.rst
103 %{py_sitescriptdir}/%{pypi_name}.py[co]
104 %{py_sitescriptdir}/%{pypi_name}-%{version}-py*.egg-info
105 %endif
106
107 %if %{with python3}
108 %files -n python3-%{pypi_name}
109 %defattr(644,root,root,755)
110 %doc README.rst
111 %{py3_sitescriptdir}/__pycache__/*
112 %{py3_sitescriptdir}/%{pypi_name}.py
113 %{py3_sitescriptdir}/%{pypi_name}-%{version}-py*.egg-info
114 %endif
This page took 0.046646 seconds and 2 git commands to generate.