|
 |
1368395 |
# The check need root privilege hence disabled by default
|
|
Gris Ge |
8bc856b |
%bcond_with check
|
|
Gris Ge |
8bc856b |
|
|
Gris Ge |
8bc856b |
Name: nispor
|
|
 |
e150bb6 |
Version: 1.2.12
|
|
 |
d5daa5a |
Release: %autorelease
|
|
Gris Ge |
8bc856b |
Summary: Unified interface for Linux network state querying
|
|
 |
ed45198 |
License: Apache-2.0
|
|
Gris Ge |
8bc856b |
URL: https://github.com/nispor/nispor
|
|
Gris Ge |
8bc856b |
Source: https://github.com/nispor/nispor/archive/v%{version}.tar.gz#/%{name}-%{version}.tar.gz
|
|
 |
1c9ef25 |
Source1: https://github.com/nispor/nispor/releases/download/v%{version}/nispor-vendor-%{version}.tar.xz
|
|
 |
bee51a6 |
Patch1: 0001-Makefile-Fix-version-1.2.12.patch
|
|
Fernando Fernandez Mancera |
29b9915 |
BuildRequires: make
|
|
Gris Ge |
8bc856b |
BuildRequires: pkg-config
|
|
Gris Ge |
8bc856b |
BuildRequires: python3-devel
|
|
Fernando Fernandez Mancera |
29b9915 |
BuildRequires: python-setuptools
|
|
Gris Ge |
8bc856b |
BuildRequires: systemd-devel
|
|
Gris Ge |
8bc856b |
BuildRequires: systemd-rpm-macros
|
|
 |
03ac155 |
BuildRequires: patchelf
|
|
 |
1c9ef25 |
%if 0%{?rhel}
|
|
 |
1c9ef25 |
BuildRequires: rust-toolset
|
|
 |
1c9ef25 |
%else
|
|
 |
1c9ef25 |
BuildRequires: rust-packaging
|
|
 |
33d745b |
BuildRequires: (crate(clap/cargo) >= 4.2.0 with crate(clap/cargo) < 5.0)
|
|
 |
33d745b |
BuildRequires: (crate(clap/default) >= 4.2.0 with crate(clap/default) < 5.0)
|
|
 |
33d745b |
BuildRequires: (crate(env_logger/default) >= 0.10 with crate(env_logger/default) < 0.11)
|
|
 |
e150bb6 |
BuildRequires: (crate(ethtool/default) >= 0.2.5 with crate(ethtool/default) < 0.3)
|
|
 |
67eee78 |
BuildRequires: (crate(futures/default) >= 0.3 with crate(futures/default) < 0.4)
|
|
 |
67eee78 |
BuildRequires: (crate(libc/default) >= 0.2.126 with crate(libc/default) < 0.3)
|
|
 |
67eee78 |
BuildRequires: (crate(log/default) >= 0.4 with crate(log/default) < 0.5)
|
|
 |
e150bb6 |
BuildRequires: (crate(mptcp-pm/default) >= 0.1.3 with crate(mptcp-pm/default) < 0.2)
|
|
 |
e150bb6 |
BuildRequires: (crate(netlink-packet-route/default) >= 0.17.0 with crate(netlink-packet-route/default) < 0.18)
|
|
 |
1368395 |
BuildRequires: (crate(netlink-packet-utils/default) >= 0.5.2 with crate(netlink-packet-utils/default) < 0.6)
|
|
 |
1368395 |
BuildRequires: (crate(netlink-sys/default) >= 0.8.4 with crate(netlink-sys/default) < 0.9)
|
|
 |
e150bb6 |
BuildRequires: (crate(rtnetlink/default) >= 0.13.1 with crate(rtnetlink/default) < 0.14)
|
|
Gris Ge |
8bc856b |
BuildRequires: (crate(serde/default) >= 1.0 with crate(serde/default) < 2.0)
|
|
 |
03ac155 |
BuildRequires: (crate(serde/derive) >= 1.0 with crate(serde/derive) < 2.0)
|
|
Gris Ge |
8bc856b |
BuildRequires: (crate(serde_json/default) >= 1.0 with crate(serde_json/default) < 2.0)
|
|
 |
67eee78 |
BuildRequires: (crate(serde_yaml/default) >= 0.9 with crate(serde_yaml/default) < 0.10)
|
|
 |
c5379f9 |
BuildRequires: (crate(tokio/macros) >= 1.18 with crate(tokio/macros) < 2.0)
|
|
 |
c5379f9 |
BuildRequires: (crate(tokio/rt) >= 1.18 with crate(tokio/rt) < 2.0)
|
|
 |
1c9ef25 |
%endif
|
|
Gris Ge |
8bc856b |
|
|
Gris Ge |
8bc856b |
%description
|
|
Gris Ge |
8bc856b |
Unified interface for Linux network state querying.
|
|
Gris Ge |
8bc856b |
|
|
 |
1c9ef25 |
%if ! 0%{?rhel}
|
|
Gris Ge |
8bc856b |
%package -n rust-%{name}-devel
|
|
Gris Ge |
8bc856b |
Summary: %{summary}
|
|
Gris Ge |
8bc856b |
BuildArch: noarch
|
|
Gris Ge |
8bc856b |
|
|
Gris Ge |
8bc856b |
%description -n rust-%{name}-devel
|
|
Gris Ge |
8bc856b |
|
|
Gris Ge |
8bc856b |
This package contains library source intended for building other packages
|
|
Gris Ge |
8bc856b |
which use "%{name}" crate.
|
|
Gris Ge |
8bc856b |
|
|
Gris Ge |
8bc856b |
%package -n rust-%{name}+default-devel
|
|
Gris Ge |
8bc856b |
Summary: %{summary}
|
|
Gris Ge |
8bc856b |
BuildArch: noarch
|
|
Gris Ge |
8bc856b |
|
|
Gris Ge |
8bc856b |
%description -n rust-%{name}+default-devel
|
|
Gris Ge |
8bc856b |
|
|
Gris Ge |
8bc856b |
This package contains library source intended for building other packages
|
|
Gris Ge |
8bc856b |
which use "%{name}" crate with default feature.
|
|
 |
1c9ef25 |
%endif
|
|
Gris Ge |
8bc856b |
|
|
Gris Ge |
8bc856b |
%package -n python3-%{name}
|
|
Gris Ge |
8bc856b |
Summary: %{summary}
|
|
Gris Ge |
381ad62 |
Requires: nispor = %{?epoch:%{epoch}:}%{version}-%{release}
|
|
Gris Ge |
8bc856b |
BuildArch: noarch
|
|
Gris Ge |
8bc856b |
|
|
Gris Ge |
8bc856b |
%description -n python3-%{name}
|
|
Gris Ge |
8bc856b |
|
|
Gris Ge |
8bc856b |
This package contains python3 binding of %{name}.
|
|
Gris Ge |
8bc856b |
|
|
Gris Ge |
8bc856b |
%package devel
|
|
Gris Ge |
8bc856b |
Summary: %{summary}
|
|
Gris Ge |
8bc856b |
Requires: nispor%{?_isa} = %{?epoch:%{epoch}:}%{version}-%{release}
|
|
Gris Ge |
8bc856b |
|
|
Gris Ge |
8bc856b |
%description devel
|
|
Gris Ge |
8bc856b |
|
|
Gris Ge |
8bc856b |
This package contains C binding of %{name}.
|
|
Gris Ge |
8bc856b |
|
|
Gris Ge |
8bc856b |
%prep
|
|
Gris Ge |
8bc856b |
%autosetup -n %{name}-%{version_no_tilde} -p1
|
|
 |
03ac155 |
# Drop the upstream fix on SONAME as fedora %cargo_xxx marcos override it,
|
|
 |
03ac155 |
# we use patchelf to set the SONAME.
|
|
 |
03ac155 |
rm .cargo/config.toml
|
|
Gris Ge |
8bc856b |
|
|
 |
1c9ef25 |
%if 0%{?rhel}
|
|
 |
1c9ef25 |
%cargo_prep -V 1
|
|
 |
1c9ef25 |
%else
|
|
Gris Ge |
8bc856b |
%cargo_prep
|
|
 |
1c9ef25 |
%endif
|
|
Gris Ge |
8bc856b |
|
|
Gris Ge |
8bc856b |
%build
|
|
 |
03ac155 |
%cargo_build
|
|
Gris Ge |
8bc856b |
|
|
Gris Ge |
8bc856b |
pushd src/python
|
|
Gris Ge |
8bc856b |
%py3_build
|
|
Gris Ge |
8bc856b |
popd
|
|
Gris Ge |
8bc856b |
|
|
Gris Ge |
8bc856b |
%install
|
|
 |
1c9ef25 |
%if ! 0%{?rhel}
|
|
 |
8def2e1 |
# cargo_install has problem on detecting library when running in workspace
|
|
 |
8def2e1 |
# due to bug https://pagure.io/fedora-rust/cargo2rpm/issue/5
|
|
 |
8def2e1 |
# Removing the workspace Cargo.toml will workaround this problem.
|
|
 |
8def2e1 |
rm Cargo.toml
|
|
Gris Ge |
8bc856b |
pushd src/lib
|
|
Gris Ge |
8bc856b |
%cargo_install
|
|
Gris Ge |
8bc856b |
popd
|
|
 |
1c9ef25 |
%endif
|
|
Gris Ge |
8bc856b |
|
|
Gris Ge |
8bc856b |
env SKIP_PYTHON_INSTALL=1 PREFIX=%{_prefix} LIBDIR=%{_libdir} %make_install
|
|
Gris Ge |
8bc856b |
|
|
Gris Ge |
8bc856b |
pushd src/python
|
|
Gris Ge |
8bc856b |
%py3_install
|
|
Gris Ge |
8bc856b |
popd
|
|
Gris Ge |
8bc856b |
|
|
 |
03ac155 |
patchelf --set-soname libnispor.so.1 \
|
|
 |
03ac155 |
%{buildroot}/%{_libdir}/libnispor.so.%{version}
|
|
Gris Ge |
8bc856b |
|
|
Gris Ge |
8bc856b |
%if %{with check}
|
|
Gris Ge |
8bc856b |
%check
|
|
Gris Ge |
8bc856b |
%cargo_test
|
|
Gris Ge |
8bc856b |
%endif
|
|
Gris Ge |
8bc856b |
|
|
Gris Ge |
8bc856b |
%files
|
|
Gris Ge |
8bc856b |
%doc AUTHORS CHANGELOG DEVEL.md README.md
|
|
Gris Ge |
8bc856b |
%license LICENSE
|
|
Gris Ge |
8bc856b |
%{_bindir}/npc
|
|
Gris Ge |
8bc856b |
%{_libdir}/libnispor.so.*
|
|
Gris Ge |
8bc856b |
|
|
Gris Ge |
8bc856b |
%files -n python3-%{name}
|
|
Gris Ge |
8bc856b |
%license LICENSE
|
|
Gris Ge |
8bc856b |
%{python3_sitelib}/nispor*
|
|
Gris Ge |
8bc856b |
|
|
Gris Ge |
8bc856b |
%files devel
|
|
Gris Ge |
8bc856b |
%license LICENSE
|
|
Gris Ge |
8bc856b |
%{_libdir}/libnispor.so
|
|
Gris Ge |
8bc856b |
%{_includedir}/nispor.h
|
|
Gris Ge |
b0e7bf2 |
%{_libdir}/pkgconfig/nispor.pc
|
|
Gris Ge |
8bc856b |
|
|
 |
1c9ef25 |
%if ! 0%{?rhel}
|
|
Gris Ge |
8bc856b |
%files -n rust-%{name}-devel
|
|
Gris Ge |
8bc856b |
%license LICENSE
|
|
Gris Ge |
8bc856b |
%{cargo_registry}/%{name}-%{version_no_tilde}/
|
|
Gris Ge |
8bc856b |
|
|
Gris Ge |
8bc856b |
%files -n rust-%{name}+default-devel
|
|
Gris Ge |
8bc856b |
%ghost %{cargo_registry}/%{name}-%{version_no_tilde}/Cargo.toml
|
|
 |
1c9ef25 |
%endif
|
|
Gris Ge |
8bc856b |
|
|
Gris Ge |
8bc856b |
%changelog
|
|
 |
03ac155 |
%autochangelog
|