Compare commits
No commits in common. "c618a40e3d43b046c08fb8ae0e41c31e2e0f4e57" and "a532b10c84d6a47623fef3a4fe450c6dffa4e339" have entirely different histories.
c618a40e3d
...
a532b10c84
30
0001-macros-Do-not-use-awk-s-inplace-feature.patch
Normal file
30
0001-macros-Do-not-use-awk-s-inplace-feature.patch
Normal file
@ -0,0 +1,30 @@
|
|||||||
|
From fac21ad662a14a4f901b3365a25749b516918554 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Igor Gnatenko <ignatenkobrain@fedoraproject.org>
|
||||||
|
Date: Mon, 24 Jun 2019 20:27:20 +0200
|
||||||
|
Subject: [PATCH] macros: Do not use awk's inplace feature
|
||||||
|
|
||||||
|
gawk 5.x changed variable name to `inplace::suffix` but gawk 4.x does
|
||||||
|
not like that name so we can't set both.
|
||||||
|
|
||||||
|
Signed-off-by: Igor Gnatenko <ignatenkobrain@fedoraproject.org>
|
||||||
|
---
|
||||||
|
data/macros.cargo | 3 ++-
|
||||||
|
1 file changed, 2 insertions(+), 1 deletion(-)
|
||||||
|
|
||||||
|
diff --git a/data/macros.cargo b/data/macros.cargo
|
||||||
|
index 1182850..5066587 100644
|
||||||
|
--- a/data/macros.cargo
|
||||||
|
+++ b/data/macros.cargo
|
||||||
|
@@ -89,7 +89,8 @@ if %__cargo_is_lib; then \
|
||||||
|
# Drop all dependency/features information \
|
||||||
|
# so that cargo doesn't fail resolving dependencies: \
|
||||||
|
# https://github.com/rust-lang/cargo/pull/6729 \
|
||||||
|
- %{__awk} -i inplace -v INPLACE_SUFFIX=.deps '/^\\\[((.+\\\.)?((dev|build)-)?dependencies|features)/{f=1;next} /^\\\[/{f=0}; !f' Cargo.toml \
|
||||||
|
+ mv Cargo.toml{,.deps} \
|
||||||
|
+ awk '/^\\\[((.+\\\.)?((dev|build)-)?dependencies|features)/{f=1;next} /^\\\[/{f=0}; !f' Cargo.toml.deps > Cargo.toml \
|
||||||
|
%{__cargo} package -l | xargs -d '\\\n' %{__cp} --parents -a -t $REG_DIR \
|
||||||
|
%{__mv} Cargo.toml{.deps,} \
|
||||||
|
%{__cp} -a Cargo.toml $REG_DIR/Cargo.toml \
|
||||||
|
--
|
||||||
|
2.22.0
|
||||||
|
|
||||||
@ -1,25 +0,0 @@
|
|||||||
From 01a5884b86f26a13b181d26d9082c674b2646b04 Mon Sep 17 00:00:00 2001
|
|
||||||
From: desert-sailor <dxwangk@isoftstone.com>
|
|
||||||
Date: Tue, 18 Jul 2023 10:18:30 +0800
|
|
||||||
Subject: [PATCH] remove test spec with opensuse tomlfile
|
|
||||||
|
|
||||||
---
|
|
||||||
rust2rpm/tests/test_generator.py | 2 +-
|
|
||||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
|
||||||
|
|
||||||
diff --git a/rust2rpm/tests/test_generator.py b/rust2rpm/tests/test_generator.py
|
|
||||||
index acf93ce..00eb9a8 100644
|
|
||||||
--- a/rust2rpm/tests/test_generator.py
|
|
||||||
+++ b/rust2rpm/tests/test_generator.py
|
|
||||||
@@ -65,7 +65,7 @@ def mock_spec_file_render(crate, tomlfile, target, tmpdir):
|
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.parametrize("tomlfile", tomlfiles)
|
|
||||||
-@pytest.mark.parametrize("target", ["plain", "fedora", "mageia", "opensuse"])
|
|
||||||
+@pytest.mark.parametrize("target", ["plain", "fedora", "mageia"])
|
|
||||||
def test_spec(tomlfile, target, tmpdir):
|
|
||||||
crate = tomlfile.with_suffix("").name
|
|
||||||
|
|
||||||
--
|
|
||||||
2.33.0
|
|
||||||
|
|
||||||
@ -3,26 +3,22 @@
|
|||||||
%global debug_package %{nil}
|
%global debug_package %{nil}
|
||||||
|
|
||||||
Name: rust-packaging
|
Name: rust-packaging
|
||||||
Version: 23
|
Version: 10
|
||||||
Release: 1
|
Release: 1
|
||||||
Summary: RPM macros for building Rust packages on various architectures
|
Summary: RPM macros for building Rust packages on various architectures
|
||||||
License: MIT
|
License: MIT
|
||||||
URL: https://pagure.io/fedora-rust/rust2rpm
|
URL: https://pagure.io/fedora-rust/rust2rpm
|
||||||
Source: https://pagure.io/fedora-rust/rust2rpm/archive/v%{version}/rust2rpm-v%{version}.tar.gz
|
Source: https://releases.pagure.org/fedora-rust/rust2rpm/rust2rpm-%{version}.tar.xz
|
||||||
Patch1: 0001-remove-test-spec-with-opensuse-tomlfile.patch
|
|
||||||
|
Patch0001: 0001-macros-Do-not-use-awk-s-inplace-feature.patch
|
||||||
|
|
||||||
BuildRequires: python3-devel python3-setuptools
|
BuildRequires: python3-devel python3-setuptools
|
||||||
BuildRequires: python3-pbr python3-pip python3-wheel
|
|
||||||
BuildRequires: python3-hatchling python3-virtualenv
|
|
||||||
# use for check
|
# use for check
|
||||||
BuildRequires: python3-pytest cargo python3-semantic_version
|
BuildRequires: python3-pytest cargo python3-semantic_version
|
||||||
BuildRequires: python3-tox-current-env
|
|
||||||
BuildRequires: python3-termcolor python3-jinja2
|
|
||||||
BuildRequires: python3-pyparsing python3-tqdm python3-requests
|
|
||||||
|
|
||||||
# gawk is needed for stripping dev-deps in macro
|
# gawk is needed for stripping dev-deps in macro
|
||||||
Requires: gawk python3-rust2rpm = %{version}-%{release}
|
Requires: gawk python3-rust2rpm = %{version}-%{release}
|
||||||
Requires: rust-srpm-macros rust cargo
|
Requires: rust-srpm-macros = %{version} rust cargo
|
||||||
|
|
||||||
%description
|
%description
|
||||||
The package provides macros for building projects in Rust
|
The package provides macros for building projects in Rust
|
||||||
@ -40,25 +36,18 @@ Provides: rust2rpm = %{version}-%{release}
|
|||||||
Convert Rust packages to RPM.
|
Convert Rust packages to RPM.
|
||||||
|
|
||||||
%prep
|
%prep
|
||||||
%autosetup -n rust2rpm-v%{version} -p1
|
%autosetup -n rust2rpm-%{version} -p1
|
||||||
|
|
||||||
%build
|
%build
|
||||||
%pyproject_build
|
%py3_build
|
||||||
|
|
||||||
%install
|
%install
|
||||||
%pyproject_install
|
%py3_install
|
||||||
install -D -p -m 0644 -t %{buildroot}%{_rpmmacrodir} data/macros.rust data/macros.cargo
|
install -D -p -m 0644 -t %{buildroot}%{_rpmmacrodir} data/macros.rust data/macros.cargo
|
||||||
install -D -p -m 0644 -t %{buildroot}%{_fileattrsdir} data/cargo.attr
|
install -D -p -m 0644 -t %{buildroot}%{_fileattrsdir} data/cargo.attr
|
||||||
|
|
||||||
%check
|
%check
|
||||||
TOX_TESTENV_PASSENV="${TOX_TESTENV_PASSENV:-*}" \
|
py.test-%{python3_version} -vv test.py
|
||||||
CFLAGS="${CFLAGS:-${RPM_OPT_FLAGS}}" LDFLAGS="${LDFLAGS:-${RPM_LD_FLAGS}}" \
|
|
||||||
PATH="%{buildroot}%{_bindir}:$PATH" \
|
|
||||||
PYTHONPATH="${PYTHONPATH:-%{buildroot}%{python3_sitearch}:%{buildroot}%{python3_sitelib}}" \
|
|
||||||
PYTHONDONTWRITEBYTECODE=1 \
|
|
||||||
%{?__pytest_addopts:PYTEST_ADDOPTS="${PYTEST_ADDOPTS:-} %{__pytest_addopts}"} \
|
|
||||||
PYTEST_XDIST_AUTO_NUM_WORKERS=%{_smp_build_ncpus} \
|
|
||||||
%{__python3} -m tox -e py%{python3_version_nodots} --current-env
|
|
||||||
|
|
||||||
%files
|
%files
|
||||||
%defattr(-,root,root)
|
%defattr(-,root,root)
|
||||||
@ -73,23 +62,8 @@ PYTEST_XDIST_AUTO_NUM_WORKERS=%{_smp_build_ncpus} \
|
|||||||
%{_bindir}/rust2rpm
|
%{_bindir}/rust2rpm
|
||||||
%{_bindir}/cargo-inspector
|
%{_bindir}/cargo-inspector
|
||||||
%{python3_sitelib}/rust2rpm/
|
%{python3_sitelib}/rust2rpm/
|
||||||
%{python3_sitelib}/rust2rpm-*.dist-info/
|
%{python3_sitelib}/rust2rpm-*.egg-info/
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
* Tue Jul 18 2023 Dongxing Wang <dxwangk@isoftstone.com> - 23-1
|
|
||||||
- update to 23
|
|
||||||
|
|
||||||
* Sat Aug 06 2022 tianlijing <tianlijing@kylinos.cn> - 21-1
|
|
||||||
- update to 21
|
|
||||||
|
|
||||||
* Tue Jan 18 2022 SimpleUpdate Robot <tc@openeuler.org> - 20-1
|
|
||||||
- Upgrade to version 20
|
|
||||||
|
|
||||||
* Thu Mar 18 2021 shixuantong <shixuantong@huawei.com> - 15-2
|
|
||||||
- fix install fail issue because nothing provides rust-srpm-macros = 15
|
|
||||||
|
|
||||||
* Tue Feb 02 2021 shixuantong <shixuantong@huawei.com> - 15-1
|
|
||||||
- Upgrade to version 15
|
|
||||||
|
|
||||||
* Wed Mar 4 2020 hexiujun <hexiujun1@huawei.com> - 10-1
|
* Wed Mar 4 2020 hexiujun <hexiujun1@huawei.com> - 10-1
|
||||||
- Package init
|
- Package init
|
||||||
|
|||||||
BIN
rust2rpm-10.tar.xz
Normal file
BIN
rust2rpm-10.tar.xz
Normal file
Binary file not shown.
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user