File python-pcapy-ng.spec of Package python-pcapy-ng

#
# spec file for package python-pcapy-ng
#
# Copyright (c) 2011 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
#
# Please submit bugfixes or comments via http://bugs.opensuse.org/
#

Name:           python-pcapy-ng
Version:        1.0.9
Release:        0
Summary:        Python Pcap Extension
URL:            https://pypi.org/project/pcapy-ng
License:        Apache-1.1
Group:          Development/Libraries/Python
Source:         https://github.com/stamparm/pcapy-ng/archive/refs/tags/%{version}.tar.gz#/%{name}-%{version}.tar.gz
BuildRoot:      %{_tmppath}/%{name}-buildroot
BuildRequires:  pkgconfig(python3)
BuildRequires:  python3-setuptools
BuildRequires:  gcc-c++
BuildRequires:  libpcap-devel
%if 0%{?suse_version} < 1510
PreReq:         python >= 3.6
%endif
Provides:       python-pcapy = %{version}
Obsoletes:      python-pcapy < %{version}

%{!?python3_sitelib: %global python3_sitelib %(%{__python3} -c "from distutils.sysconfig import get_python3_lib; print get_python3_lib()")}
%{!?python3_sitearch: %global python3_sitearch %(%{__python3} -c "from distutils.sysconfig import get_python3_lib; print get_python3_lib(1)")}

%description
Pcapy is a Python extension module that enables software written in
Python to access the routines from the pcap packet capture library.

From libpcap's documentation: "Libpcap is a system-independent
interface for user-level packet capture. Libpcap provides a portable
framework for low-level network monitoring. Applications include
network statistics collection, security monitoring, network debugging,
etc."

%prep
%setup -q -n pcapy-ng-%{version}
%autopatch -p1

%build
export CFLAGS="%{optflags}"
python3 setup.py build

%install
sed -i 's|\r||'  ChangeLog LICENSE README # Fix wrong EOL encoding
python3 setup.py install --prefix=%{_prefix} --root=%{buildroot}
rm -rf %{buildroot}%{_datadir}/doc

%files
%defattr(-,root,root)
%doc ChangeLog README pcapy.html
%license LICENSE
%{python3_sitearch}/*

%changelog

- Tue Apr 19 2022 mikhail.kasimov@gmail.com 1.0.9
  * New release of python-pcapy-ng: version 1.0.9
  * Fix for Windows compilation
  * Fix for incorrect unrecognizable arguments
openSUSE Build Service is sponsored by