diff --git a/.gitignore b/.gitignore index d776cd4..71b4969 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ /pleaser-0.4.1.crate /pleaser-0.5.0.crate +/pleaser-0.5.0-vendor.tar.gz diff --git a/rust-pleaser.spec b/rust-pleaser.spec index 7c605a5..9a181bb 100644 --- a/rust-pleaser.spec +++ b/rust-pleaser.spec @@ -1,8 +1,18 @@ # Generated by rust2rpm 16 %bcond_without check +%global __cargo_skip_build 0 %global crate pleaser +%if 0%{?el8} +# disabling this as it chokes on the vendored dependencies +%undefine __brp_mangle_shebangs +# el8 doesn't have these macros +%global __crates_url https://crates.io/api/v1/crates/ +%global crates_source %{__crates_url}%{crate}/%{version}/download#/%{crate}-%{version}.crate +%global version_no_tilde %{version} +%endif + Name: rust-%{crate} Version: 0.5.0 Release: 1%{?dist} @@ -11,17 +21,27 @@ Summary: Please, a polite regex-first sudo alternative # Upstream license specification: GPL-3.0-or-later License: GPLv3+ URL: https://crates.io/crates/pleaser -Source: %{crates_source} + +Source0: %{crates_source} +Source1: %{crate}-%{version}-vendor.tar.gz + +%if ! 0%{?el8} +# Patch nix dependency to >= 0.19 as upstream bumped +Patch0: pleaser-fix-metadata.diff +%endif ExclusiveArch: %{rust_arches} %if %{__cargo_skip_build} BuildArch: noarch %endif -# Patch nix dep to >= 0.19 -Patch0: pleaser-fix-metadata.diff - +%if 0%{?el8} +BuildRequires: rust-toolset +BuildRequires: sed +BuildRequires: pam-devel +%else BuildRequires: rust-packaging +%endif %global _description %{expand: Please, a polite regex-first sudo alternative.} @@ -57,7 +77,10 @@ which use "%{crate}" crate. %files devel %doc README.md %license LICENSE + +%if ! 0%{?el8} %{cargo_registry}/%{crate}-%{version_no_tilde}/ +%endif %package -n %{name}+default-devel Summary: %{summary} @@ -69,14 +92,26 @@ This package contains library source intended for building other packages which use "default" feature of "%{crate}" crate. %files -n %{name}+default-devel +%if ! 0%{?el8} %ghost %{cargo_registry}/%{crate}-%{version_no_tilde}/Cargo.toml +%endif %prep %autosetup -n %{crate}-%{version_no_tilde} -p1 +%if 0%{?el8} +%cargo_prep -V 1 +%ifarch s390x +# drop opt-level generation to fix s390x OOM problems +sed -i 's/opt-level=3/opt-level=1/' .cargo/config +%endif +%else %cargo_prep +%endif +%if 0%{?fedora} %generate_buildrequires %cargo_generate_buildrequires +%endif %build %cargo_build @@ -116,6 +151,9 @@ EOF %endif %changelog +* Mon Nov 23 2021 ed neville - 0.5.0-1 +- EPEL8 sections + * Fri Jul 23 2021 Fedora Release Engineering - 0.4.1-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild diff --git a/sources b/sources index d83129a..78b8d78 100644 --- a/sources +++ b/sources @@ -1 +1,2 @@ +SHA512 (pleaser-0.5.0-vendor.tar.gz) = f4641379d55abfe4509e8b42d7a59c9893a19603228fad473d4b02085ab4763197b8a8514fa1200dbec34f43f6371feff27bd9c2e3d6663aa50b7e4677d5d665 SHA512 (pleaser-0.5.0.crate) = b85faeb8cad2258edf9e2b5470aa0b16cf505bc5eb91c43ab47e8c3e6cc3100e1921b99fd64ab1ec726f92ddc6ccfcb4c6b8c9915688b03753967b44ac4bee2f