Use vendored dependencies for RHEL builds
RHEL does not ship Rust dependencies as separate packages.
This commit is contained in:
parent
33d745b335
commit
1c9ef259bb
1
.gitignore
vendored
1
.gitignore
vendored
@ -13,3 +13,4 @@
|
|||||||
/nispor-1.2.9.tar.gz
|
/nispor-1.2.9.tar.gz
|
||||||
/nispor-1.2.10.tar.gz
|
/nispor-1.2.10.tar.gz
|
||||||
/nispor-1.2.11.tar.gz
|
/nispor-1.2.11.tar.gz
|
||||||
|
/nispor-vendor-1.2.11.tar.xz
|
||||||
|
17
nispor.spec
17
nispor.spec
@ -8,14 +8,18 @@ Summary: Unified interface for Linux network state querying
|
|||||||
License: ASL 2.0
|
License: ASL 2.0
|
||||||
URL: https://github.com/nispor/nispor
|
URL: https://github.com/nispor/nispor
|
||||||
Source: https://github.com/nispor/nispor/archive/v%{version}.tar.gz#/%{name}-%{version}.tar.gz
|
Source: https://github.com/nispor/nispor/archive/v%{version}.tar.gz#/%{name}-%{version}.tar.gz
|
||||||
|
Source1: https://github.com/nispor/nispor/releases/download/v%{version}/nispor-vendor-%{version}.tar.xz
|
||||||
BuildRequires: make
|
BuildRequires: make
|
||||||
BuildRequires: pkg-config
|
BuildRequires: pkg-config
|
||||||
BuildRequires: python3-devel
|
BuildRequires: python3-devel
|
||||||
BuildRequires: python-setuptools
|
BuildRequires: python-setuptools
|
||||||
BuildRequires: rust-packaging
|
|
||||||
BuildRequires: systemd-devel
|
BuildRequires: systemd-devel
|
||||||
BuildRequires: systemd-rpm-macros
|
BuildRequires: systemd-rpm-macros
|
||||||
BuildRequires: patchelf
|
BuildRequires: patchelf
|
||||||
|
%if 0%{?rhel}
|
||||||
|
BuildRequires: rust-toolset
|
||||||
|
%else
|
||||||
|
BuildRequires: rust-packaging
|
||||||
BuildRequires: (crate(clap/cargo) >= 4.2.0 with crate(clap/cargo) < 5.0)
|
BuildRequires: (crate(clap/cargo) >= 4.2.0 with crate(clap/cargo) < 5.0)
|
||||||
BuildRequires: (crate(clap/default) >= 4.2.0 with crate(clap/default) < 5.0)
|
BuildRequires: (crate(clap/default) >= 4.2.0 with crate(clap/default) < 5.0)
|
||||||
BuildRequires: (crate(env_logger/default) >= 0.10 with crate(env_logger/default) < 0.11)
|
BuildRequires: (crate(env_logger/default) >= 0.10 with crate(env_logger/default) < 0.11)
|
||||||
@ -34,10 +38,12 @@ BuildRequires: (crate(serde_json/default) >= 1.0 with crate(serde_json/default)
|
|||||||
BuildRequires: (crate(serde_yaml/default) >= 0.9 with crate(serde_yaml/default) < 0.10)
|
BuildRequires: (crate(serde_yaml/default) >= 0.9 with crate(serde_yaml/default) < 0.10)
|
||||||
BuildRequires: (crate(tokio/macros) >= 1.18 with crate(tokio/macros) < 2.0)
|
BuildRequires: (crate(tokio/macros) >= 1.18 with crate(tokio/macros) < 2.0)
|
||||||
BuildRequires: (crate(tokio/rt) >= 1.18 with crate(tokio/rt) < 2.0)
|
BuildRequires: (crate(tokio/rt) >= 1.18 with crate(tokio/rt) < 2.0)
|
||||||
|
%endif
|
||||||
|
|
||||||
%description
|
%description
|
||||||
Unified interface for Linux network state querying.
|
Unified interface for Linux network state querying.
|
||||||
|
|
||||||
|
%if ! 0%{?rhel}
|
||||||
%package -n rust-%{name}-devel
|
%package -n rust-%{name}-devel
|
||||||
Summary: %{summary}
|
Summary: %{summary}
|
||||||
BuildArch: noarch
|
BuildArch: noarch
|
||||||
@ -55,6 +61,7 @@ BuildArch: noarch
|
|||||||
|
|
||||||
This package contains library source intended for building other packages
|
This package contains library source intended for building other packages
|
||||||
which use "%{name}" crate with default feature.
|
which use "%{name}" crate with default feature.
|
||||||
|
%endif
|
||||||
|
|
||||||
%package -n python3-%{name}
|
%package -n python3-%{name}
|
||||||
Summary: %{summary}
|
Summary: %{summary}
|
||||||
@ -79,7 +86,11 @@ This package contains C binding of %{name}.
|
|||||||
# we use patchelf to set the SONAME.
|
# we use patchelf to set the SONAME.
|
||||||
rm .cargo/config.toml
|
rm .cargo/config.toml
|
||||||
|
|
||||||
|
%if 0%{?rhel}
|
||||||
|
%cargo_prep -V 1
|
||||||
|
%else
|
||||||
%cargo_prep
|
%cargo_prep
|
||||||
|
%endif
|
||||||
|
|
||||||
%build
|
%build
|
||||||
%cargo_build
|
%cargo_build
|
||||||
@ -89,6 +100,7 @@ pushd src/python
|
|||||||
popd
|
popd
|
||||||
|
|
||||||
%install
|
%install
|
||||||
|
%if ! 0%{?rhel}
|
||||||
# cargo_install has problem on detecting library when running in workspace
|
# cargo_install has problem on detecting library when running in workspace
|
||||||
# due to bug https://pagure.io/fedora-rust/cargo2rpm/issue/5
|
# due to bug https://pagure.io/fedora-rust/cargo2rpm/issue/5
|
||||||
# Removing the workspace Cargo.toml will workaround this problem.
|
# Removing the workspace Cargo.toml will workaround this problem.
|
||||||
@ -96,6 +108,7 @@ rm Cargo.toml
|
|||||||
pushd src/lib
|
pushd src/lib
|
||||||
%cargo_install
|
%cargo_install
|
||||||
popd
|
popd
|
||||||
|
%endif
|
||||||
|
|
||||||
env SKIP_PYTHON_INSTALL=1 PREFIX=%{_prefix} LIBDIR=%{_libdir} %make_install
|
env SKIP_PYTHON_INSTALL=1 PREFIX=%{_prefix} LIBDIR=%{_libdir} %make_install
|
||||||
|
|
||||||
@ -127,12 +140,14 @@ patchelf --set-soname libnispor.so.1 \
|
|||||||
%{_includedir}/nispor.h
|
%{_includedir}/nispor.h
|
||||||
%{_libdir}/pkgconfig/nispor.pc
|
%{_libdir}/pkgconfig/nispor.pc
|
||||||
|
|
||||||
|
%if ! 0%{?rhel}
|
||||||
%files -n rust-%{name}-devel
|
%files -n rust-%{name}-devel
|
||||||
%license LICENSE
|
%license LICENSE
|
||||||
%{cargo_registry}/%{name}-%{version_no_tilde}/
|
%{cargo_registry}/%{name}-%{version_no_tilde}/
|
||||||
|
|
||||||
%files -n rust-%{name}+default-devel
|
%files -n rust-%{name}+default-devel
|
||||||
%ghost %{cargo_registry}/%{name}-%{version_no_tilde}/Cargo.toml
|
%ghost %{cargo_registry}/%{name}-%{version_no_tilde}/Cargo.toml
|
||||||
|
%endif
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
%autochangelog
|
%autochangelog
|
||||||
|
1
sources
1
sources
@ -1 +1,2 @@
|
|||||||
SHA512 (nispor-1.2.11.tar.gz) = b0b652eac1456daacb3bf7cb639e9f06f395f23082a6c235c9a0b6e5f16c9b2f5c5b554eda921a83f855571fc4049ced35caf21a186ed2e970966d8d3817ad85
|
SHA512 (nispor-1.2.11.tar.gz) = b0b652eac1456daacb3bf7cb639e9f06f395f23082a6c235c9a0b6e5f16c9b2f5c5b554eda921a83f855571fc4049ced35caf21a186ed2e970966d8d3817ad85
|
||||||
|
SHA512 (nispor-vendor-1.2.11.tar.xz) = 20ee83b9930cfafe5b50903f53a11b65d8b0e01f2d64022b271bcade4952785c217b562300c3e036a76fb3c04af8f621a813ffbcf93c0e9e890e07814b9f4d34
|
||||||
|
Loading…
Reference in New Issue
Block a user