PackagingDrafts/Gem expand stage change

From FedoraProject

Jump to: navigation, search

Contents

Propoposal to change the stage to expand RubyGem file

Current guidelines

Current guidelines for packaging RubyGem files here says:

gem install --local --install-dir %{buildroot}%{gemdir} --force %{SOURCE0}

This means that

Issues with current guidelines

Some of the issues with current guidelines are already discussed on the thread beginning at here and continues to this.

Proposal

All RubyGem files should be expanded at %prep first. i.e.

%prep
%setup -q -c -T

mkdir -p .%{gemdir}
(If RubyGem creates C extension modules, adding the following line
 is recommend:
export CONFIGURE_ARGS="--with-cflags='%{optflags}'"
)
gem install -V --local \
	--install-dir $(pwd)/%{gemdir} \
	--force --rdoc \
	%{SOURCE0}
%install
rm -rf %{buildroot}

mkdir -p %{buildroot}%{gemdir}
cp -a .%{gemdir}/* %{buildroot}%{gemdir}/
%global geminstdir %{gemdir}/gems/%{gemname}-%{version}
BuildRequires: rubygem(rake)

%check
export GEM_PATH=.%{gemdir}
pushd .%{geminstdir}
rake test
popd

Some notes