6.7.3.3. RubyGems spec 文件示例
用于构建 gems 的 spec 文件示例,以及其特定部分的说明。
RubyGems spec 文件示例
%prep
%setup -q -n %{gem_name}-%{version}
# Modify the gemspec if necessary
# Also apply patches to code if necessary
%patch0 -p1
%build
# Create the gem as gem install only works on a gem file
gem build ../%{gem_name}-%{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}/
# If there were programs installed:
mkdir -p %{buildroot}%{_bindir}
cp -a ./%{_bindir}/* %{buildroot}%{_bindir}
# If there are C extensions, copy them to the extdir.
mkdir -p %{buildroot}%{gem_extdir_mri}
cp -a .%{gem_extdir_mri}/{gem.build_complete,*.so} %{buildroot}%{gem_extdir_mri}/
下表解释了 RubyGems spec 文件中特定项的具体信息:
| 指令 | RubyGems 具体信息 |
|---|---|
| %prep |
RPM 可以直接解包 gem 归档,以便您可以运行 |
| %build |
此指令包括将软件构建到机器代码的命令或一系列命令。
|
| %install |
安装将在 |