gem2rpm工具工作,但我找不到rpm包

时间:2014-01-10 14:21:31

标签: ruby rubygems rpm rpmbuild

我一直在尝试使用gem2rpm将gem(chef)转换为rpm包。现在,我已经抓住了#39;宝石,做了一个' spec'文件和使用过的' rpmbuild'。我收到以下错误:

error: Installed (but unpackaged) file(s) found:
   /usr/share/gems/gems/chef-11.8.2/Rakefile
   /usr/share/gems/gems/chef-11.8.2/bin/chef-apply
   /usr/share/gems/gems/chef-11.8.2/bin/chef-client
   /usr/share/gems/gems/chef-11.8.2/bin/chef-service-manager
   /usr/share/gems/gems/chef-11.8.2/bin/chef-shell
   /usr/share/gems/gems/chef-11.8.2/bin/chef-solo
   /usr/share/gems/gems/chef-11.8.2/bin/knife
   /usr/share/gems/gems/chef-11.8.2/bin/shef
   /usr/share/gems/gems/chef-11.8.2/distro/README
   /usr/share/gems/gems/chef-11.8.2/distro/arch/etc/conf.d/chef-client.conf
   /usr/share/gems/gems/chef-11.8.2/distro/arch/etc/conf.d/chef-expander.conf
   /usr/share/gems/gems/chef-11.8.2/distro/arch/etc/conf.d/chef-server-webui.conf
   /usr/share/gems/gems/chef-11.8.2/distro/arch/etc/conf.d/chef-server.conf
   /usr/share/gems/gems/chef-11.8.2/distro/arch/etc/conf.d/chef-solr.conf
   /usr/share/gems/gems/chef-11.8.2/distro/arch/etc/rc.d/chef-client
   /usr/share/gems/gems/chef-11.8.2/distro/arch/etc/rc.d/chef-expander
   /usr/share/gems/gems/chef-11.8.2/distro/arch/etc/rc.d/chef-server
   /usr/share/gems/gems/chef-11.8.2/distro/arch/etc/rc.d/chef-server-webui
   /usr/share/gems/gems/chef-11.8.2/distro/arch/etc/rc.d/chef-solr
   /usr/share/gems/gems/chef-11.8.2/distro/common/html/chef-client.8.html
   /usr/share/gems/gems/chef-11.8.2/distro/common/html/chef-expander.8.html
   /usr/share/gems/gems/chef-11.8.2/distro/common/html/chef-expanderctl.8.html
   /usr/share/gems/gems/chef-11.8.2/distro/common/html/chef-server-webui.8.html
   /usr/share/gems/gems/chef-11.8.2/distro/common/html/chef-server.8.html

这是我的宝石规范文件:

# Generated from chef-11.8.2.gem by gem2rpm -*- rpm-spec -*-
%global gem_name chef
%global rubyabi 1.9.1

Name: rubygem-%{gem_name}
Version: 11.8.2
Release: 1%{?dist}
Summary: A systems integration framework, built to bring the benefits of configuration management to your entire infrastructure
Group: Development/Languages
License: GPL
URL: http://wiki.opscode.com/display/chef
Source0: http://rubygems.org/gems/%{gem_name}-%{version}.gem
Requires: ruby(abi) = %{rubyabi}
Requires: ruby(rubygems) 
Requires: rubygem(mixlib-config) => 2.0
Requires: rubygem(mixlib-config) < 3
Requires: rubygem(mixlib-cli) => 1.3
Requires: rubygem(mixlib-cli) < 2
Requires: rubygem(mixlib-log) => 1.3
Requires: rubygem(mixlib-log) < 2
Requires: rubygem(mixlib-authentication) => 1.3
Requires: rubygem(mixlib-authentication) < 2
Requires: rubygem(mixlib-shellout) => 1.2
Requires: rubygem(mixlib-shellout) < 2
Requires: rubygem(ohai) => 6.0
Requires: rubygem(ohai) < 7
Requires: rubygem(rest-client) >= 1.0.4
Requires: rubygem(rest-client) < 1.7.0
Requires: rubygem(mime-types) => 1.16
Requires: rubygem(mime-types) < 2
Requires: rubygem(json) >= 1.4.4
Requires: rubygem(json) <= 1.7.7
Requires: rubygem(yajl-ruby) => 1.1
Requires: rubygem(yajl-ruby) < 2
Requires: rubygem(net-ssh) => 2.6
Requires: rubygem(net-ssh) < 3
Requires: rubygem(net-ssh-multi) => 1.1.0
Requires: rubygem(net-ssh-multi) < 1.2
Requires: rubygem(highline) => 1.6
Requires: rubygem(highline) < 2
Requires: rubygem(highline) >= 1.6.9
Requires: rubygem(erubis) => 2.7
Requires: rubygem(erubis) < 3
Requires: rubygem(diff-lcs) => 1.2
Requires: rubygem(diff-lcs) < 2
Requires: rubygem(diff-lcs) >= 1.2.4
Requires: rubygem(chef-zero) => 1.6
Requires: rubygem(chef-zero) < 2
Requires: rubygem(chef-zero) >= 1.6.2
Requires: rubygem(puma) => 1.6
Requires: rubygem(puma) < 2
Requires: rubygem(pry) => 0.9
Requires: rubygem(pry) < 1
BuildRequires: ruby(abi) = %{rubyabi}
BuildRequires: rubygems-devel 
BuildRequires: ruby 
BuildArch: noarch
Provides: rubygem(%{gem_name}) = %{version}

%description
A systems integration framework, built to bring the benefits of configuration
management to your entire infrastructure.


%package doc
Summary: Documentation for %{name}
Group: Documentation
Requires: %{name} = %{version}-%{release}
BuildArch: noarch

%description doc
Documentation for %{name}

%prep
gem unpack %{SOURCE0}

%setup -q -D -T -n  %{gem_name}-%{version}

gem spec %{SOURCE0} -l --ruby > %{gem_name}.gemspec

%build
mkdir -p .%{gem_dir}

# Create the gem as gem install only works on a gem file
gem build %{gem_name}.gemspec


# gem install installs into a directory.  We set that to be a local
# directory so that we can move it into the buildroot in %%install
gem install --local --install-dir ./%{gem_dir} \
            --bindir ./%{_bindir} \
            --force --rdoc %{gem_name}-%{version}.gem

%install
mkdir -p %{buildroot}%{gem_dir}
cp -pa .%{gem_dir}/* \
        %{buildroot}%{gem_dir}/


mkdir -p %{buildroot}%{_bindir}
cp -pa .%{_bindir}/* \
        %{buildroot}%{_bindir}/

find %{buildroot}%{gem_instdir}/bin -type f | xargs chmod a+x

%files
%{gem_instdir}
%{_bindir}/chef-client
%{_bindir}/chef-solo
%{_bindir}/knife
%{_bindir}/chef-shell
%{_bindir}/shef
%{_bindir}/chef-apply
%{_bindir}/chef-service-manager
%{gem_instdir}/bin
%{gem_libdir}
%exclude %{gem_cache}
%{gem_spec}

%files doc
%doc %{gem_docdir}
%doc %{gem_instdir}/README.md
%doc %{gem_instdir}/CONTRIBUTING.md
%doc %{gem_instdir}/LICENSE

%changelog
* Fri Jan 10 2014 Peeyush <peeyush@localhost.localdomain> - 11.8.2-1
- Initial package

我知道我需要更改%files%部分中的内容。但我无法弄清楚是什么!任何指针都将受到赞赏。

1 个答案:

答案 0 :(得分:0)

好的,没关系!我只需要排除%{gem_instdir}。