From Fedora Project Wiki

< PackagingDrafts

Revision as of 15:53, 18 June 2009 by Mtasaka (talk | contribs) (Once save)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Propoposal to change the stage to expand RubyGem file

Current guidelines

Current guidelines for packaging RubyGem files here says:

  • The %prep and %build sections of the specfile should be empty.
  • The install should be performed with the command
gem install --local --install-dir %{buildroot}%{gemdir} --force %{SOURCE0}

This means that

  • usually RubyGem files should be expanded under %{buildroot} directly without using %prep or %build stage.

Issues with current guidelines

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

  • When we want to apply some needed patches after expanding Gem files, with current guidelines %patchXXX macro canot be used because %patchXXX macro can be used only at %prep
  • When we want to execute some check program to verify if the Gems to be installed really works, we usually create %check stage and execute them at the stage. With current guidelines we must execute these check programs under %{buildroot}.
    • This is troublesome if executing such programs create additional files (under %{buildroot})
  • Note that when Gem file creates C extension libraries, we have already moved the stage to expand Gem file from %install to %build (not %prep, however) to create debuginfo rpm correctly.

Proposal

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

  • RubyGem files should be expanded under %{_builddir}/%{name}-%{version}%{gemdir} at prep first. This can usually be performed by the folloing lines:
%prep
%setup -q -c T
mkdir -p .%{gemdir}

( if Gem file creates C extension modules, add the following line:
export CONFIGURE_ARGS="--with-cflags='%{optflags}'"
)

gem install -V --local \
	--install-dir $(pwd)/%{gemdir} \
	--force --rdoc \
	%{SOURCE0}