package init

This commit is contained in:
h00465007 2020-03-06 16:41:31 +08:00
parent 3af862debf
commit 31d5318d20
5 changed files with 99 additions and 73 deletions

View 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

View File

@ -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/)

View File

@ -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/)

69
rust-packaging.spec Normal file
View File

@ -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 <hexiujun1@huawei.com> - 10-1
- Package init

BIN
rust2rpm-10.tar.xz Normal file

Binary file not shown.