From 34b2c454d14954eac598fb05c75ac69d762d164e Mon Sep 17 00:00:00 2001 From: Fabio Valentini Date: Fri, 13 Oct 2023 00:37:13 +0200 Subject: [PATCH 1/2] Temporarily accept cargo_prep -V flag for spec compatibiltiy with RHEL --- ...pt-cargo_prep-V-flag-for-spec-compat.patch | 27 +++++++++++++++++++ rust-packaging.spec | 6 +++++ 2 files changed, 33 insertions(+) create mode 100644 0001-Temporarily-accept-cargo_prep-V-flag-for-spec-compat.patch diff --git a/0001-Temporarily-accept-cargo_prep-V-flag-for-spec-compat.patch b/0001-Temporarily-accept-cargo_prep-V-flag-for-spec-compat.patch new file mode 100644 index 0000000..2195780 --- /dev/null +++ b/0001-Temporarily-accept-cargo_prep-V-flag-for-spec-compat.patch @@ -0,0 +1,27 @@ +From c1cb014722147a3373a7d7ebbf99781cbb335cbf Mon Sep 17 00:00:00 2001 +From: Fabio Valentini +Date: Fri, 13 Oct 2023 00:31:15 +0200 +Subject: [PATCH] Temporarily accept cargo_prep -V flag for spec compatibiltiy + with RHEL + +--- + macros.d/macros.cargo | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/macros.d/macros.cargo b/macros.d/macros.cargo +index e99f5a6..05159d8 100644 +--- a/macros.d/macros.cargo ++++ b/macros.d/macros.cargo +@@ -54,7 +54,8 @@ + # -v - use vendored sources from instead of + # %%cargo_registry + # -N - Don't set up any registry. Only set up the build configuration. +-%cargo_prep(v:N)\ ++%cargo_prep(V:v:N)\ ++%{-V:%{?fedora:%{error:The -V flag for cargo_prep is not supported in Fedora}}}\ + %{-v:%{-N:%{error:-v and -N are mutually exclusive!}}}\ + (\ + set -euo pipefail\ +-- +2.41.0 + diff --git a/rust-packaging.spec b/rust-packaging.spec index c239e72..b4a4869 100644 --- a/rust-packaging.spec +++ b/rust-packaging.spec @@ -9,6 +9,12 @@ License: MIT URL: https://pagure.io/fedora-rust/rust-packaging Source: %{url}/archive/%{version}/rust-packaging-%{version}.tar.gz +# temporary patch for compatibility with RHEL / ELN: +# The %%cargo_prep macro in RHEL / ELN accepts a -V flag. Using the same spec +# file for both Fedora and ELN would cause spec file parsing errors because +# the -V flag is not known in Fedora. +Patch: 0001-Temporarily-accept-cargo_prep-V-flag-for-spec-compat.patch + BuildArch: noarch %if %{with check} From d31787eb6576de0349f641c7e021c58bd56318cd Mon Sep 17 00:00:00 2001 From: MSVSphere Packaging Team Date: Thu, 16 Nov 2023 19:56:37 +0300 Subject: [PATCH 2/2] Remove unnecessary files and fix spec-file --- changelog => SPECS/rust-packaging.spec | 161 +++++++++++++++++++++++++ rust-packaging.spec | 91 -------------- sources | 1 - 3 files changed, 161 insertions(+), 92 deletions(-) rename changelog => SPECS/rust-packaging.spec (59%) delete mode 100644 rust-packaging.spec delete mode 100644 sources diff --git a/changelog b/SPECS/rust-packaging.spec similarity index 59% rename from changelog rename to SPECS/rust-packaging.spec index 779a325..b6d700d 100644 --- a/changelog +++ b/SPECS/rust-packaging.spec @@ -1,3 +1,163 @@ +## START: Set by rpmautospec +## (rpmautospec version 0.3.5) +## RPMAUTOSPEC: autorelease, autochangelog +%define autorelease(e:s:pb:n) %{?-p:0.}%{lua: + release_number = 2; + base_release_number = tonumber(rpm.expand("%{?-b*}%{!?-b:1}")); + print(release_number + base_release_number - 1); +}%{?-e:.%{-e*}}%{?-s:.%{-s*}}%{!?-n:%{?dist}} +## END: Set by rpmautospec + +%bcond_without check + +Name: rust-packaging +Version: 25.2 +Release: %autorelease +Summary: RPM macros and generators for building Rust packages +License: MIT + +URL: https://pagure.io/fedora-rust/rust-packaging +Source: %{url}/archive/%{version}/rust-packaging-%{version}.tar.gz + +# temporary patch for compatibility with RHEL / ELN: +# The %%cargo_prep macro in RHEL / ELN accepts a -V flag. Using the same spec +# file for both Fedora and ELN would cause spec file parsing errors because +# the -V flag is not known in Fedora. +Patch: 0001-Temporarily-accept-cargo_prep-V-flag-for-spec-compat.patch + +BuildArch: noarch + +%if %{with check} +BuildRequires: python3.11-pytest +%endif + +%description +%{summary}. + +%package -n rust-srpm-macros-epel +Summary: RPM macros for building Rust projects +# Require rust-srpm-macros from RHEL +Requires: rust-srpm-macros + +%description -n rust-srpm-macros-epel +RPM macros for building source packages for Rust projects. + +%package -n cargo-rpm-macros +Summary: RPM macros for building projects with cargo + +# obsolete + provide rust-packaging (removed in Fedora 38) +Obsoletes: rust-packaging < 24 +Provides: rust-packaging = %{version}-%{release} + +Requires: cargo2rpm >= 0.1.8 + +Requires: cargo +Requires: gawk +Requires: grep + +Requires: rust-srpm-macros-epel = %{version}-%{release} + +%description -n cargo-rpm-macros +RPM macros for building projects with cargo. + +%prep +%autosetup -p1 + +%build +# nothing to do + +%install +install -D -p -m 0644 -t %{buildroot}/%{_rpmmacrodir} macros.d/macros.cargo +install -D -p -m 0644 -t %{buildroot}/%{_rpmmacrodir} macros.d/macros.rust + +# We don't install these on RHEL 9, as they conflict with the regular +# rust-srpm-macros. +# If we need to override these, they can be installed as +# macros.zzz-rust-srpm-epel. +%dnl install -D -p -m 0644 -t %{buildroot}/%{_rpmmacrodir} macros.d/macros.rust-srpm + +install -D -p -m 0644 -t %{buildroot}/%{_fileattrsdir} fileattrs/cargo.attr +install -D -p -m 0644 -t %{buildroot}/%{_fileattrsdir} fileattrs/cargo_vendor.attr + +%if %{with check} +%check +export MACRO_DIR=%{buildroot}%{_rpmmacrodir} +# skip tests that fail due to whitespace differences in expected strings +pytest-3.11 -vv -k "not test_cargo_prep" +%endif + +%files -n rust-srpm-macros-epel +%license LICENSE +%{_rpmmacrodir}/macros.rust +%dnl %{_rpmmacrodir}/macros.rust-srpm + +%files -n cargo-rpm-macros +%license LICENSE +%{_rpmmacrodir}/macros.cargo +%{_fileattrsdir}/cargo.attr +%{_fileattrsdir}/cargo_vendor.attr + +%changelog +* Tue Nov 07 2023 Fabio Valentini - 25.2-2 +- Temporarily accept cargo_prep -V flag for spec compatibiltiy with RHEL + +* Sat Sep 30 2023 Fabio Valentini - 25.2-1 +- Update to version 25.2 + +* Sat Sep 30 2023 Fabio Valentini - 25.1-1 +- Update to version 25.1; Fixes RHBZ#2241437 + +* Sat Sep 30 2023 Fabio Valentini - 25.0-1 +- Update to version 25.0 + +* Thu Aug 17 2023 Yaakov Selkowitz - 24-6 +- Correct cargo_registry path + +* Thu Aug 17 2023 Yaakov Selkowitz - 24-5 +- Correct cargo and cargo2rpm paths + +* Sun May 21 2023 Fabio Valentini - 24-4 +- Include upstream patches with minor bug fixes and improvements + +* Sun Feb 26 2023 Maxwell G - 24-3 +- Fix rust-srpm-macros-epel's Requires + +* Thu Feb 23 2023 Maxwell G - 24-2 +- rust-srpm-macros -> rust-srpm-macros-epel on epel9 + +* Wed Feb 22 2023 Fabio Valentini - 24-1 +- Update to version 24 + +* Sat Sep 10 2022 Fabio Valentini - 21-4 +- Adapt %%cargo_prep macro to fix builds with Rust 1.62+ + +* Sat Sep 10 2022 Zbigniew Jędrzejewski-Szmek - 21-3 +- Backport patch to fix rpmautospec detection + +* Sat Sep 10 2022 Zbigniew Jędrzejewski-Szmek - 21-2 +- Add patches to allow debuginfo level to be set easily again + +* Sat Sep 10 2022 Zbigniew Jędrzejewski-Szmek - 21-1 +- Version 21 + +* Sat Sep 10 2022 Zbigniew Jędrzejewski-Szmek - 20-2 +- Include linker flags for package note in %%build_rustflags + +* Sat Sep 10 2022 Zbigniew Jędrzejewski-Szmek - 20-1 +- Version 20 + +* Tue Dec 28 2021 Igor Raits - 19-4 +- Rebuild + +* Sat Nov 27 2021 Igor Raits - 19-3 +- EPEL9 hack: Allow older rust-srpm-macros + +* Mon Nov 22 2021 Zbigniew Jędrzejewski-Szmek - 19-2 +- Rebuild in a side tag + +* Mon Nov 22 2021 Zbigniew Jędrzejewski-Szmek - 19-1 +- Version 19 + * Fri Jul 23 2021 Fedora Release Engineering - 18-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild @@ -204,3 +364,4 @@ * Tue Jun 13 2017 Igor Gnatenko - 3-1 - Initial package + diff --git a/rust-packaging.spec b/rust-packaging.spec deleted file mode 100644 index b4a4869..0000000 --- a/rust-packaging.spec +++ /dev/null @@ -1,91 +0,0 @@ -%bcond_without check - -Name: rust-packaging -Version: 25.2 -Release: %autorelease -Summary: RPM macros and generators for building Rust packages -License: MIT - -URL: https://pagure.io/fedora-rust/rust-packaging -Source: %{url}/archive/%{version}/rust-packaging-%{version}.tar.gz - -# temporary patch for compatibility with RHEL / ELN: -# The %%cargo_prep macro in RHEL / ELN accepts a -V flag. Using the same spec -# file for both Fedora and ELN would cause spec file parsing errors because -# the -V flag is not known in Fedora. -Patch: 0001-Temporarily-accept-cargo_prep-V-flag-for-spec-compat.patch - -BuildArch: noarch - -%if %{with check} -BuildRequires: python3.11-pytest -%endif - -%description -%{summary}. - -%package -n rust-srpm-macros-epel -Summary: RPM macros for building Rust projects -# Require rust-srpm-macros from RHEL -Requires: rust-srpm-macros - -%description -n rust-srpm-macros-epel -RPM macros for building source packages for Rust projects. - -%package -n cargo-rpm-macros -Summary: RPM macros for building projects with cargo - -# obsolete + provide rust-packaging (removed in Fedora 38) -Obsoletes: rust-packaging < 24 -Provides: rust-packaging = %{version}-%{release} - -Requires: cargo2rpm >= 0.1.8 - -Requires: cargo -Requires: gawk -Requires: grep - -Requires: rust-srpm-macros-epel = %{version}-%{release} - -%description -n cargo-rpm-macros -RPM macros for building projects with cargo. - -%prep -%autosetup -p1 - -%build -# nothing to do - -%install -install -D -p -m 0644 -t %{buildroot}/%{_rpmmacrodir} macros.d/macros.cargo -install -D -p -m 0644 -t %{buildroot}/%{_rpmmacrodir} macros.d/macros.rust - -# We don't install these on RHEL 9, as they conflict with the regular -# rust-srpm-macros. -# If we need to override these, they can be installed as -# macros.zzz-rust-srpm-epel. -%dnl install -D -p -m 0644 -t %{buildroot}/%{_rpmmacrodir} macros.d/macros.rust-srpm - -install -D -p -m 0644 -t %{buildroot}/%{_fileattrsdir} fileattrs/cargo.attr -install -D -p -m 0644 -t %{buildroot}/%{_fileattrsdir} fileattrs/cargo_vendor.attr - -%if %{with check} -%check -export MACRO_DIR=%{buildroot}%{_rpmmacrodir} -# skip tests that fail due to whitespace differences in expected strings -pytest-3.11 -vv -k "not test_cargo_prep" -%endif - -%files -n rust-srpm-macros-epel -%license LICENSE -%{_rpmmacrodir}/macros.rust -%dnl %{_rpmmacrodir}/macros.rust-srpm - -%files -n cargo-rpm-macros -%license LICENSE -%{_rpmmacrodir}/macros.cargo -%{_fileattrsdir}/cargo.attr -%{_fileattrsdir}/cargo_vendor.attr - -%changelog -%autochangelog diff --git a/sources b/sources deleted file mode 100644 index 88ac844..0000000 --- a/sources +++ /dev/null @@ -1 +0,0 @@ -SHA512 (rust-packaging-25.2.tar.gz) = a57908f0d0dc4294fd7bd693d97519a2ac6a6a98a0c37f0317635bfb20bf55fb70a5d850bc57d869e8f5dad88386840112f345bd40a599a9a4b53553832199ea