From 92c74ad7296d2564c78edd9f478fedeb2b774f1d Mon Sep 17 00:00:00 2001 From: Funda Wang Date: Mon, 4 Aug 2025 23:48:04 +0800 Subject: [PATCH 1/5] do not strip binaries, as it is required for debugsource generating --- 0002-rust-macros-do-not-strip.patch | 16 ++++++++++++++++ rust-packaging.spec | 8 +++++--- 2 files changed, 21 insertions(+), 3 deletions(-) create mode 100644 0002-rust-macros-do-not-strip.patch diff --git a/0002-rust-macros-do-not-strip.patch b/0002-rust-macros-do-not-strip.patch new file mode 100644 index 0000000..202431b --- /dev/null +++ b/0002-rust-macros-do-not-strip.patch @@ -0,0 +1,16 @@ +diff --git a/data/macros.rust b/data/macros.rust +index efa46a3..2702a24 100644 +--- a/data/macros.rust ++++ b/data/macros.rust +@@ -10,9 +10,8 @@ + -Copt-level=%rustflags_opt_level + -Cdebuginfo=%rustflags_debuginfo + -Ccodegen-units=%rustflags_codegen_units +- -Clink-arg=-Wl,-z,relro +- -Clink-arg=-Wl,-z,now +- %{?_package_note_file:-Clink-arg=-Wl,-dT,%{_package_note_file}} ++ -Cstrip=none ++ %[0%{?_package_note_status} ? "-Clink-arg=%_package_note_flags" : ""] + --cap-lints=warn + } + diff --git a/rust-packaging.spec b/rust-packaging.spec index cf7a178..163d0a5 100644 --- a/rust-packaging.spec +++ b/rust-packaging.spec @@ -4,12 +4,13 @@ Name: rust-packaging Version: 23 -Release: 1 +Release: 2 Summary: RPM macros for building Rust packages on various architectures License: MIT URL: https://pagure.io/fedora-rust/rust2rpm Source: https://pagure.io/fedora-rust/rust2rpm/archive/v%{version}/rust2rpm-v%{version}.tar.gz Patch1: 0001-remove-test-spec-with-opensuse-tomlfile.patch +Patch2: 0002-rust-macros-do-not-strip.patch BuildRequires: python3-devel python3-setuptools BuildRequires: python3-pbr python3-pip python3-wheel @@ -61,14 +62,12 @@ PYTEST_XDIST_AUTO_NUM_WORKERS=%{_smp_build_ncpus} \ %{__python3} -m tox -e py%{python3_version_nodots} --current-env %files -%defattr(-,root,root) %license LICENSE %{_rpmmacrodir}/macros.rust %{_rpmmacrodir}/macros.cargo %{_fileattrsdir}/cargo.attr %files -n python3-rust2rpm -%defattr(-,root,root) %license LICENSE %{_bindir}/rust2rpm %{_bindir}/cargo-inspector @@ -76,6 +75,9 @@ PYTEST_XDIST_AUTO_NUM_WORKERS=%{_smp_build_ncpus} \ %{python3_sitelib}/rust2rpm-*.dist-info/ %changelog +* Mon Aug 04 2025 Funda Wang - 23-2 +- do not strip binaries, as it is required for debugsource generating + * Tue Jul 18 2023 Dongxing Wang - 23-1 - update to 23 -- Gitee From ba4b740eecac5de24ef8540871b3b878fb83b56a Mon Sep 17 00:00:00 2001 From: Funda Wang Date: Sun, 17 Aug 2025 12:36:03 +0800 Subject: [PATCH 2/5] use config.toml rather than config for projects --- 0003-use-config.toml-as-config.patch | 13 +++++++++++++ rust-packaging.spec | 6 +++++- 2 files changed, 18 insertions(+), 1 deletion(-) create mode 100644 0003-use-config.toml-as-config.patch diff --git a/0003-use-config.toml-as-config.patch b/0003-use-config.toml-as-config.patch new file mode 100644 index 0000000..79764ac --- /dev/null +++ b/0003-use-config.toml-as-config.patch @@ -0,0 +1,13 @@ +diff --git a/data/macros.cargo b/data/macros.cargo +index e54705a..eff8bae 100644 +--- a/data/macros.cargo ++++ b/data/macros.cargo +@@ -18,7 +18,7 @@ + %cargo_prep (\ + set -eu \ + %{__mkdir} -p .cargo \ +-cat > .cargo/config << EOF \ ++cat > .cargo/config.toml << EOF \ + [build]\ + rustc = "%{__rustc}"\ + rustdoc = "%{__rustdoc}"\ diff --git a/rust-packaging.spec b/rust-packaging.spec index 163d0a5..6a3389b 100644 --- a/rust-packaging.spec +++ b/rust-packaging.spec @@ -4,13 +4,14 @@ Name: rust-packaging Version: 23 -Release: 2 +Release: 3 Summary: RPM macros for building Rust packages on various architectures License: MIT URL: https://pagure.io/fedora-rust/rust2rpm Source: https://pagure.io/fedora-rust/rust2rpm/archive/v%{version}/rust2rpm-v%{version}.tar.gz Patch1: 0001-remove-test-spec-with-opensuse-tomlfile.patch Patch2: 0002-rust-macros-do-not-strip.patch +Patch3: 0003-use-config.toml-as-config.patch BuildRequires: python3-devel python3-setuptools BuildRequires: python3-pbr python3-pip python3-wheel @@ -75,6 +76,9 @@ PYTEST_XDIST_AUTO_NUM_WORKERS=%{_smp_build_ncpus} \ %{python3_sitelib}/rust2rpm-*.dist-info/ %changelog +* Sun Aug 17 2025 Funda Wang - 23-3 +- use config.toml rather than config for projects + * Mon Aug 04 2025 Funda Wang - 23-2 - do not strip binaries, as it is required for debugsource generating -- Gitee From c91920993479a71f3e38e67e64adb5d20c940241 Mon Sep 17 00:00:00 2001 From: Funda Wang Date: Tue, 19 Aug 2025 05:30:59 +0800 Subject: [PATCH 3/5] revert config.toml change as there are too many downstream packages affected --- 0003-use-config.toml-as-config.patch | 13 ------------- rust-packaging.spec | 6 ++++-- 2 files changed, 4 insertions(+), 15 deletions(-) delete mode 100644 0003-use-config.toml-as-config.patch diff --git a/0003-use-config.toml-as-config.patch b/0003-use-config.toml-as-config.patch deleted file mode 100644 index 79764ac..0000000 --- a/0003-use-config.toml-as-config.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff --git a/data/macros.cargo b/data/macros.cargo -index e54705a..eff8bae 100644 ---- a/data/macros.cargo -+++ b/data/macros.cargo -@@ -18,7 +18,7 @@ - %cargo_prep (\ - set -eu \ - %{__mkdir} -p .cargo \ --cat > .cargo/config << EOF \ -+cat > .cargo/config.toml << EOF \ - [build]\ - rustc = "%{__rustc}"\ - rustdoc = "%{__rustdoc}"\ diff --git a/rust-packaging.spec b/rust-packaging.spec index 6a3389b..072004b 100644 --- a/rust-packaging.spec +++ b/rust-packaging.spec @@ -4,14 +4,13 @@ Name: rust-packaging Version: 23 -Release: 3 +Release: 4 Summary: RPM macros for building Rust packages on various architectures License: MIT URL: https://pagure.io/fedora-rust/rust2rpm Source: https://pagure.io/fedora-rust/rust2rpm/archive/v%{version}/rust2rpm-v%{version}.tar.gz Patch1: 0001-remove-test-spec-with-opensuse-tomlfile.patch Patch2: 0002-rust-macros-do-not-strip.patch -Patch3: 0003-use-config.toml-as-config.patch BuildRequires: python3-devel python3-setuptools BuildRequires: python3-pbr python3-pip python3-wheel @@ -76,6 +75,9 @@ PYTEST_XDIST_AUTO_NUM_WORKERS=%{_smp_build_ncpus} \ %{python3_sitelib}/rust2rpm-*.dist-info/ %changelog +* Tue Aug 19 2025 Funda Wang - 23-4 +- revert config.toml change as there are too many downstream packages affected + * Sun Aug 17 2025 Funda Wang - 23-3 - use config.toml rather than config for projects -- Gitee From 341598c7e338139c8966dc86a68d011eb53ecf9d Mon Sep 17 00:00:00 2001 From: Funda Wang Date: Thu, 23 Oct 2025 14:36:05 +0800 Subject: [PATCH 4/5] bump epoch so that it won't be obsoleted by wrongly imported packages --- rust-packaging.spec | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/rust-packaging.spec b/rust-packaging.spec index 072004b..acd0f77 100644 --- a/rust-packaging.spec +++ b/rust-packaging.spec @@ -3,8 +3,9 @@ %global debug_package %{nil} Name: rust-packaging +Epoch: 1 Version: 23 -Release: 4 +Release: 1 Summary: RPM macros for building Rust packages on various architectures License: MIT URL: https://pagure.io/fedora-rust/rust2rpm @@ -22,8 +23,10 @@ BuildRequires: python3-termcolor python3-jinja2 BuildRequires: python3-pyparsing python3-tqdm python3-requests # gawk is needed for stripping dev-deps in macro -Requires: gawk python3-rust2rpm = %{version}-%{release} +Requires: gawk python3-rust2rpm = %{epoch}:%{version}-%{release} Requires: rust-srpm-macros rust cargo +Obsoletes: rust-srpm-macros < 1:23 +Obsoletes: cargo-rpm-macros < 1:23 %description The package provides macros for building projects in Rust @@ -34,7 +37,7 @@ Summary: Convert Rust packages to RPM Requires: cargo -Provides: rust2rpm = %{version}-%{release} +Provides: rust2rpm = %{epoch}:%{version}-%{release} %{?python_provide:%python_provide python3-rust2rpm} %description -n python3-rust2rpm @@ -75,6 +78,9 @@ PYTEST_XDIST_AUTO_NUM_WORKERS=%{_smp_build_ncpus} \ %{python3_sitelib}/rust2rpm-*.dist-info/ %changelog +* Thu Oct 23 2025 Funda Wang - 1:23-1 +- bump epoch so that it won't be obsoleted by wrongly imported packages + * Tue Aug 19 2025 Funda Wang - 23-4 - revert config.toml change as there are too many downstream packages affected -- Gitee From cbc22b21eab02d5b3e17691508c7aec3f4b438e1 Mon Sep 17 00:00:00 2001 From: wk333 <13474090681@163.com> Date: Thu, 30 Oct 2025 14:59:21 +0800 Subject: [PATCH 5/5] Fix duplicate RPM names to update release 5 --- rust-packaging.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/rust-packaging.spec b/rust-packaging.spec index acd0f77..eab32d8 100644 --- a/rust-packaging.spec +++ b/rust-packaging.spec @@ -5,7 +5,7 @@ Name: rust-packaging Epoch: 1 Version: 23 -Release: 1 +Release: 5 Summary: RPM macros for building Rust packages on various architectures License: MIT URL: https://pagure.io/fedora-rust/rust2rpm @@ -78,6 +78,9 @@ PYTEST_XDIST_AUTO_NUM_WORKERS=%{_smp_build_ncpus} \ %{python3_sitelib}/rust2rpm-*.dist-info/ %changelog +* Thu Oct 30 2025 wangkai <13474090681@163.com> - 1:23-5 +- Fix duplicate rpm names to update release 5 + * Thu Oct 23 2025 Funda Wang - 1:23-1 - bump epoch so that it won't be obsoleted by wrongly imported packages -- Gitee