[Fedora-packaging] New packaging guidelines for Ruby

Vít Ondruch vondruch at redhat.com
Tue Feb 28 16:56:54 UTC 2012


Dne 28.2.2012 17:43, Rex Dieter napsal(a):
> On 02/28/2012 10:36 AM, Vít Ondruch wrote:
>> May be you could elaborate a bit what do you want to achieve and what is
>> the reasoning. What do you mean by "not building from (preferred form)
>> source" anyway?
>
> So, perhaps I'm showing some ignorance here.  Do these guidelines 
> allow for packaging pre-built gems (similar to pre-built java .jar 
> files) or are they genuinely being built completely from source?
>
> Maybe I'm confusing that with gems being built and generated in one 
> step, rather than the rpm notion of extracting source/patching 
> (%prep), building stuff (%build), and installing into buildroot 
> (%install).
>
> -- rex
> -- 
> packaging mailing list
> packaging at lists.fedoraproject.org
> https://admin.fedoraproject.org/mailman/listinfo/packaging

Ok, I'll give you 3 examples:

= Old guidelines, used from the time RubyGems were packaged for Fedora =

%prep

%build

%install
mkdir -p %{buildroot}%{gem_dir}
gem install --local --install-dir %{buildroot}%{gem_dir} \
             --force %{SOURCE0}




= What we are proposing =

%prep
%setup -q -c -T
mkdir -p .%{gem_dir}
gem install --local --install-dir .%{gem_dir} \
             --force %{SOURCE0}

%build

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




= What FPC is proposing =

%prep
%setup -q -c -T
pushd ..
gem unpack %{SOURCE0}

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

gem build %{gem_name}.gemspec
popd
popd

%build
mkdir -p ./%{gem_dir}
gem install --local --install-dir ./%{gem_dir} \
     --force    ../%{gem_name}-%{version}/%{gem_name}-%{version}.gem

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


All three versions provide the same output, unless I did some mistake, 
since I did not tested it (actually the middle one was taken directly 
from rubygem-POpen4.spec). So which version you prefer? Please note that 
the "gem install" will always "unpack" the gem with some additional, for 
our case unimportant, steps. We do not distribute the .gem file anywhere.


Vit


More information about the ruby-sig mailing list