diff --git a/README.en.md b/README.en.md deleted file mode 100644 index 487d6f3..0000000 --- a/README.en.md +++ /dev/null @@ -1,36 +0,0 @@ -# rubygem-gem2rpm - -#### Description -Generate rpm specfiles from gems - -#### 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 e1ba13c..0000000 --- a/README.md +++ /dev/null @@ -1,37 +0,0 @@ -# rubygem-gem2rpm - -#### 介绍 -Generate rpm specfiles from gems - -#### 软件架构 -软件架构说明 - - -#### 安装教程 - -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/gem2rpm-1.0.1-tests.tgz b/gem2rpm-1.0.1-tests.tgz new file mode 100644 index 0000000..ada096c Binary files /dev/null and b/gem2rpm-1.0.1-tests.tgz differ diff --git a/gem2rpm-1.0.1.gem b/gem2rpm-1.0.1.gem new file mode 100644 index 0000000..a800c76 Binary files /dev/null and b/gem2rpm-1.0.1.gem differ diff --git a/rubygem-gem2rpm.spec b/rubygem-gem2rpm.spec new file mode 100644 index 0000000..c438a35 --- /dev/null +++ b/rubygem-gem2rpm.spec @@ -0,0 +1,80 @@ +%global gem_name gem2rpm +%global debug_package %{nil} + +Name: rubygem-gem2rpm +Version: 1.0.1 +Release: 1 +Summary: Generate rpm specfiles from gems +License: GPLv2+ +URL: https://github.com/fedora-ruby/gem2rpm +Source0: https://rubygems.org/gems/gem2rpm-%{version}.gem +Source1: gem2rpm-%{version}-tests.tgz + +# Fix Ruby 2.6 test failure. +# https://github.com/rubygems/rubygems/issues/2627 +# https://github.com/fedora-ruby/gem2rpm/pull/99/commits/4b40d342761a3fdc402fbddccccaa99f38c50ddd +Patch0: sort-dependencies-in-the-test-case.patch + +BuildRequires: ruby rubygems-devel rubygem-minitest rpmdevtools +Requires: rpmdevtools + +%description +Generate source rpms and rpm spec files from a Ruby Gem. The spec file +tries to follow the gem as closely as possible, and be compliant with the +Fedora rubygem packaging guidelines. + +%package doc +Summary: Documentation for %{name} +BuildArch: noarch +Requires: %{name} = %{version}-%{release} + +%description doc +Documentation for %{name}. + +%prep +%setup -q -n gem2rpm-%{version} + +%build +# Create the gem as gem install only works on a gem file +gem build ../gem2rpm-%{version}.gemspec + +# %%gem_install compiles any C extensions and installs the gem into ./%%gem_dir +# by default, so that we can move it into the buildroot in %%install +%gem_install + +%install +mkdir -p %{buildroot}%{gem_dir} +cp -a .%{gem_dir}/* %{buildroot}%{gem_dir}/ + +mkdir -p %{buildroot}%{_bindir} +cp -a .%{_bindir}/* %{buildroot}%{_bindir}/ + +find %{buildroot}%{gem_instdir}/bin -type f | xargs chmod a+x + +%check +pushd .%{gem_instdir} +tar xzvf %{SOURCE1} + +cat %{PATCH0} | patch -p1 + +TEST_GEM2RPM_LOCAL=1 ruby -Itest -e 'Dir.glob "./test/**/test_*.rb", &method(:require)' +popd + +%files +%dir %{gem_instdir} +%doc %{gem_instdir}/README.md +%doc %{gem_instdir}/AUTHORS +%license %{gem_instdir}/LICENSE +%{_bindir}/gem2rpm +%{gem_instdir}/bin +%{gem_libdir} +%{gem_instdir}/templates +%{gem_spec} +%exclude %{gem_cache} + +%files doc +%doc %{gem_docdir} + +%changelog +* Fri Mar 6 2020 hexiujun - 1.0.1-1 +- Package init diff --git a/sort-dependencies-in-the-test-case.patch b/sort-dependencies-in-the-test-case.patch new file mode 100644 index 0000000..08ed165 --- /dev/null +++ b/sort-dependencies-in-the-test-case.patch @@ -0,0 +1,38 @@ +From 4b40d342761a3fdc402fbddccccaa99f38c50ddd Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?V=C3=ADt=20Ondruch?= +Date: Wed, 6 Feb 2019 14:56:13 +0100 +Subject: [PATCH 1/2] Sort dependencies in the test case. + +Some versions of RubyGems might or might not sort the requirements. The +order should not be important for this test case, so sort the entries. +But otherwise keep the RubyGems upstream sort order. + +https://github.com/rubygems/rubygems/issues/2627 +--- + test/test_gem2rpm.rb | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/test/test_gem2rpm.rb b/test/test_gem2rpm.rb +index 4f3ce9f..325922a 100644 +--- a/test/test_gem2rpm.rb ++++ b/test/test_gem2rpm.rb +@@ -57,7 +57,7 @@ foo + end + + def test_print_dependencies +- dependencies = <<-END.gsub(/^ */, '') ++ dependencies = <<-END.gsub(/^ */, '').lines.sort + rubygem(test_runtime) >= 1.0 + rubygem(test_runtime) < 2 + rubygem(test_runtime) >= 1.0.0 +@@ -71,6 +71,6 @@ foo + @out + ) + +- assert_equal dependencies, @out.string ++ assert_equal dependencies, @out.string.lines.sort + end + end +-- +2.20.1 +