From 86a1e00c38f1b3fd06c4e8ea5fbeb9f271bf3eb9 Mon Sep 17 00:00:00 2001 From: Zbigniew Jędrzejewski-Szmek Date: Feb 20 2022 15:12:31 +0000 Subject: Version 21 Let's adjust the package descriptions a bit too. --- diff --git a/.gitignore b/.gitignore index 7256461..875f8ef 100644 --- a/.gitignore +++ b/.gitignore @@ -15,3 +15,4 @@ /rust2rpm-v18.tar.gz /rust2rpm-v19.tar.gz /rust2rpm-v20.tar.gz +/rust2rpm-v21.tar.gz diff --git a/168.patch b/168.patch deleted file mode 100644 index acef049..0000000 --- a/168.patch +++ /dev/null @@ -1,34 +0,0 @@ -From f1be3a0d4d2df6497d46f627cc54ce8450da8699 Mon Sep 17 00:00:00 2001 -From: Aleksei Bavshin -Date: Dec 06 2021 06:20:52 +0000 -Subject: macros: pass CFLAGS/CXXFLAGS to the processes started by cargo - - -This is mainly targeted to the crates using `rust-cc`, where we want to -apply system-wide compiler flags when invoking the compiler. `cc` -supports CFLAGS and CXXFLAGS, but we never set those. -Defining that per project is not possible, as we have no way to inherit -any build context from a dependency package. - -Possibly also affects: `bindgen`, `cxx`, any other crate that invokes -the C/C++ compiler and passes the CFLAGSS - ---- - -diff --git a/data/macros.cargo b/data/macros.cargo -index 0a68998..07fcb56 100644 ---- a/data/macros.cargo -+++ b/data/macros.cargo -@@ -22,6 +22,11 @@ rustc = "%{__rustc}"\ - rustdoc = "%{__rustdoc}"\ - rustflags = %{__global_rustflags_toml}\ - \ -+[env]\ -+CFLAGS = "%{build_cflags}"\ -+CXXFLAGS = "%{build_cxxflags}"\ -+LDFLAGS = "%{build_ldflags}"\ -+\ - [install]\ - root = "%{buildroot}%{_prefix}"\ - \ - diff --git a/179.patch b/179.patch deleted file mode 100644 index 25c3b80..0000000 --- a/179.patch +++ /dev/null @@ -1,61 +0,0 @@ -From 0131b4e28aca1e036d1d089a17553d6378657e07 Mon Sep 17 00:00:00 2001 -From: Zbigniew Jędrzejewski-Szmek -Date: Feb 15 2022 09:59:42 +0000 -Subject: Include linker flags for package note in %build_rustflags - - -%build_rustflags was used in %cargo_prep, which is executed in %prep, -when %buildsubdir is not set yet. To avoid this, insertion of flags is -moved to an environment variable that is set for %cargo_build and -%cargo_test. - -The linker flag gets passed to rustc, and resulting binaries seem to have -note as expected. - ---- - -diff --git a/data/macros.cargo b/data/macros.cargo -index 07fcb56..05f5eb2 100644 ---- a/data/macros.cargo -+++ b/data/macros.cargo -@@ -4,7 +4,7 @@ - # it never writes to ~/.cargo during rpmbuild. - # We also need RUSTC_BOOTSTRAP since we use -Z avoid-dev-deps - # until it gets stabilized: https://github.com/rust-lang/cargo/issues/5133 --%__cargo %{_bindir}/env CARGO_HOME=.cargo RUSTC_BOOTSTRAP=1 %{_bindir}/cargo -+%__cargo %{_bindir}/env CARGO_HOME=.cargo RUSTC_BOOTSTRAP=1 RUSTFLAGS='%{build_rustflags}' %{_bindir}/cargo - %__cargo_common_opts %{?_smp_mflags} -Z avoid-dev-deps - %__cargo_inspector %{_bindir}/cargo-inspector - -@@ -20,7 +20,6 @@ cat > .cargo/config << EOF \ - [build]\ - rustc = "%{__rustc}"\ - rustdoc = "%{__rustdoc}"\ --rustflags = %{__global_rustflags_toml}\ - \ - [env]\ - CFLAGS = "%{build_cflags}"\ -@@ -61,6 +60,7 @@ EOF\ - - %cargo_build(naf:) \ - %{shrink:\ -+ RUSTFLAGS='%{build_rustflags}' \ - %{__cargo} build \ - %{__cargo_common_opts} \ - --release \ -diff --git a/data/macros.rust b/data/macros.rust -index 7377f92..0940d06 100644 ---- a/data/macros.rust -+++ b/data/macros.rust -@@ -5,7 +5,9 @@ - %build_rustflags %{shrink: - -Copt-level=3 - -Cdebuginfo=2 -- -Clink-arg=-Wl,-z,relro,-z,now -+ -Clink-arg=-Wl,-z,relro -+ -Clink-arg=-Wl,-z,now -+ %{?_package_note_file:-Clink-arg=-Wl,-dT,%{_package_note_file}} - -Ccodegen-units=1 - --cap-lints=warn - } - diff --git a/rust-packaging.spec b/rust-packaging.spec index 92f0011..b22c300 100644 --- a/rust-packaging.spec +++ b/rust-packaging.spec @@ -3,15 +3,13 @@ %global debug_package %{nil} Name: rust-packaging -Version: 20 +Version: 21 Release: %autorelease -Summary: RPM macros for building Rust packages on various architectures +Summary: RPM macros for building Rust packages License: MIT URL: https://pagure.io/fedora-rust/rust2rpm Source: https://pagure.io/fedora-rust/rust2rpm/archive/v%{version}/rust2rpm-v%{version}.tar.gz -Patch: https://pagure.io/fedora-rust/rust2rpm/pull-request/168.patch -Patch: https://pagure.io/fedora-rust/rust2rpm/pull-request/179.patch ExclusiveArch: %{rust_arches} @@ -23,11 +21,13 @@ Requires: rust Requires: cargo >= 1.41 %description -The package provides macros for building projects in Rust -on various architectures. +The package provides RPM macros for building Rust projects. + +Note that rust-srpm-macros is a seperate arch-independent package that +is also required to build Rust packages. %package -n python3-rust2rpm -Summary: Convert Rust packages to RPM +Summary: Generate RPM spec files for Rust packages BuildRequires: python3-devel BuildRequires: python3-setuptools %if %{with check} diff --git a/sources b/sources index 3c96919..a2f5243 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (rust2rpm-v20.tar.gz) = f29a443b61690c71b023ce9d9536ca05099fdd9c51ccca921dd75fc578d6213b095b5becdeb85040fb073f9a59610553091345c34ce2bde4514689b303c951b1 +SHA512 (rust2rpm-v21.tar.gz) = 50864eea0025d1c6d681e5e618f7e7dfe3aab576ec722134e07089459d73cb954e5886409578de7dd7d1a05dfbe7cc034af5f2b4d4e27db3310b0e0a2170869e