%gem_install macro

Vít Ondruch vondruch at redhat.com
Mon Mar 18 15:13:34 UTC 2013


> You can use the same approach we used previously for other macros, e.g.
>
> %{?!gem_install: %global %gem_install(d:n:) \
> mkdir -p %{-d*}%{!?-d:.%{gem_dir}} \
> \
> CONFIGURE_ARGS="--with-cflags='%{optflags}' $CONFIGURE_ARGS" \\\
> gem install \\\
>         -V \\\
>         --local \\\
>         --install-dir %{-d*}%{!?-d:.%{gem_dir}} \\\
>         --bindir .%{_bindir} \\\
>         --force \\\
>         --document=ri,rdoc \\\
>         %{-n*}%{!?-n:%{gem_name}-%{version}.gem} \
> %{nil}
> }
>
> Or some simplified version. Please note that I did not tested this 
> macro, so I am pretty sure it does not work out of the box ;) Of 
> course if you can express your voice in this ticket [3], that wold be 
> best :)

That is ugly I must say. This might be better:

%if 0%{?fedora} > 18
%gem_install
%else
mkdir -p .%{gem_dir}
gem install --local --install-dir .%{gem_dir} \
             --force --rdoc %{gem_name}-%{version}.gem
%endif


And the best is to not share the .spec file.


Vít


More information about the ruby-sig mailing list