Ruby SIG:Draft Package Guidelines/Example Ruby Lib Spec

A  could look like:

%global ruby_libname packagingtest %global ruby_versions 1.8.6 1.8.7 1.9.1 Name:          ruby-%{ruby_libname} Version:       0.1 Release:       1%{?dist} Summary:       Packaging test for Ruby Group:         Development/Tools License:       GPLv2+ URL:           http://www.example.org BuildRoot:     %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX) Source0:       packagingtest.txt.tar.gz %(for ruby_version in 1.8.6 1.8.7 1.9.1; do echo " %package -n ruby-${ruby_version}-%{ruby_libname} BuildRequires:  ruby-${ruby_version} # or, BuildRequires:  ruby(abi) = ${ruby_version} Requires:       ruby(abi) = ${ruby_version} Summary:        Ruby ${ruby_version} version of this package %description -n ruby-${ruby_version}-%{ruby_libname} Some description for the Ruby ${ruby_version} version of this package "; done) # or, use a system wide macro: %ruby_multiver_package
 * 1) In case you choose some of the system wide macros
 * 1) Either execute some custom sequence similar to the following:

%description Some description for the Ruby library %prep %(for ruby_version in 1.8.6 1.8.7 1.9.1; do echo " %setup -q -c -n ruby-${ruby_version}-%{ruby_libname} "; done) %ruby_multiver_setup %build cd %{_builddir} function buildit { %configure --with-ruby=ruby-$1 } %(for ruby_version in 1.8.6 1.8.7 1.9.1; do echo " pushd ruby-${ruby_version}-%{ruby_libname} buildit ${ruby_version} make %{?_smp_mflags} popd "; done) %ruby_multiver_build %install rm -rf %{buildroot} %(for ruby_version in 1.8.6 1.8.7 1.9.1; do echo " pushd ./${ruby_version} make install DESTDIR=%{buildroot} "; done) %clean rm -rf $RPM_BUILD_ROOT %files %defattr(-,root,root,-) %doc %changelog * Sun Jul 27 2010 Jeroen van Meeuwen  - 0.1-1 - Do some foo
 * 1) Again, either execute some custom sequence similar to the following:
 * 1) or use a system wide macro:
 * 1) This function needs to be in the .spec as expansion results in
 * 2) things going FUBAR.
 * 1) Again either use something customizable
 * 1) or use a system wide macro: