diff --git a/0001-macros-Do-not-use-awk-s-inplace-feature.patch b/0001-macros-Do-not-use-awk-s-inplace-feature.patch new file mode 100644 index 0000000000000000000000000000000000000000..dd839866c54782420fbeb208f1c72e0a6a7f0e81 --- /dev/null +++ b/0001-macros-Do-not-use-awk-s-inplace-feature.patch @@ -0,0 +1,30 @@ +From fac21ad662a14a4f901b3365a25749b516918554 Mon Sep 17 00:00:00 2001 +From: Igor Gnatenko +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 +--- + 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 + diff --git a/README.en.md b/README.en.md deleted file mode 100644 index 88995ffa93ef3a977883e1b3101fc88445a0051f..0000000000000000000000000000000000000000 --- a/README.en.md +++ /dev/null @@ -1,36 +0,0 @@ -# rust-packaging - -#### Description -RPM macros for building Rust packages on various architectures - -#### Software Architecture -Software architecture description - -#### Installation - -1. xxxx -2. xxxx -3. xxxx - -#### Instructions - -1. xxxx -2. xxxx -3. xxxx - -#### Contribution - -1. Fork the repository -2. Create Feat_xxx branch -3. Commit your code -4. Create Pull Request - - -#### Gitee Feature - -1. You can use Readme\_XXX.md to support different languages, such as Readme\_en.md, Readme\_zh.md -2. Gitee blog [blog.gitee.com](https://blog.gitee.com) -3. Explore open source project [https://gitee.com/explore](https://gitee.com/explore) -4. The most valuable open source project [GVP](https://gitee.com/gvp) -5. The manual of Gitee [https://gitee.com/help](https://gitee.com/help) -6. The most popular members [https://gitee.com/gitee-stars/](https://gitee.com/gitee-stars/) diff --git a/README.md b/README.md deleted file mode 100644 index 82cec105a790c60f04b7b1e035913c67e5ee61b0..0000000000000000000000000000000000000000 --- a/README.md +++ /dev/null @@ -1,37 +0,0 @@ -# rust-packaging - -#### 介绍 -RPM macros for building Rust packages on various architectures - -#### 软件架构 -软件架构说明 - - -#### 安装教程 - -1. xxxx -2. xxxx -3. xxxx - -#### 使用说明 - -1. xxxx -2. xxxx -3. xxxx - -#### 参与贡献 - -1. Fork 本仓库 -2. 新建 Feat_xxx 分支 -3. 提交代码 -4. 新建 Pull Request - - -#### 码云特技 - -1. 使用 Readme\_XXX.md 来支持不同的语言,例如 Readme\_en.md, Readme\_zh.md -2. 码云官方博客 [blog.gitee.com](https://blog.gitee.com) -3. 你可以 [https://gitee.com/explore](https://gitee.com/explore) 这个地址来了解码云上的优秀开源项目 -4. [GVP](https://gitee.com/gvp) 全称是码云最有价值开源项目,是码云综合评定出的优秀开源项目 -5. 码云官方提供的使用手册 [https://gitee.com/help](https://gitee.com/help) -6. 码云封面人物是一档用来展示码云会员风采的栏目 [https://gitee.com/gitee-stars/](https://gitee.com/gitee-stars/) diff --git a/rust-packaging.spec b/rust-packaging.spec new file mode 100644 index 0000000000000000000000000000000000000000..41ce8fdafee2dd5f363e8165e5fabb3970d6f4e6 --- /dev/null +++ b/rust-packaging.spec @@ -0,0 +1,69 @@ +%{?python_enable_dependency_generator} +# https://pagure.io/koji/issue/659 +%global debug_package %{nil} + +Name: rust-packaging +Version: 10 +Release: 1 +Summary: RPM macros for building Rust packages on various architectures +License: MIT +URL: https://pagure.io/fedora-rust/rust2rpm +Source: https://releases.pagure.org/fedora-rust/rust2rpm/rust2rpm-%{version}.tar.xz + +Patch0001: 0001-macros-Do-not-use-awk-s-inplace-feature.patch + +BuildRequires: python3-devel python3-setuptools +# use for check +BuildRequires: python3-pytest cargo python3-semantic_version + +# gawk is needed for stripping dev-deps in macro +Requires: gawk python3-rust2rpm = %{version}-%{release} +Requires: rust-srpm-macros = %{version} rust cargo + +%description +The package provides macros for building projects in Rust +on various architectures. + +%package -n python3-rust2rpm +Summary: Convert Rust packages to RPM + +Requires: cargo + +Provides: rust2rpm = %{version}-%{release} +%{?python_provide:%python_provide python3-rust2rpm} + +%description -n python3-rust2rpm +Convert Rust packages to RPM. + +%prep +%autosetup -n rust2rpm-%{version} -p1 + +%build +%py3_build + +%install +%py3_install +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 + +%check +py.test-%{python3_version} -vv test.py + +%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 +%{python3_sitelib}/rust2rpm/ +%{python3_sitelib}/rust2rpm-*.egg-info/ + +%changelog +* Wed Mar 4 2020 hexiujun - 10-1 +- Package init diff --git a/rust2rpm-10.tar.xz b/rust2rpm-10.tar.xz new file mode 100644 index 0000000000000000000000000000000000000000..99cf975364a58f0ebac1afb92d7e8f11afac151e Binary files /dev/null and b/rust2rpm-10.tar.xz differ