Skip to content

Instantly share code, notes, and snippets.

@yut148
Created February 1, 2013 09:16
Show Gist options
  • Save yut148/4690276 to your computer and use it in GitHub Desktop.
Save yut148/4690276 to your computer and use it in GitHub Desktop.
RequiresとBuildRequiresを削除。ImageMagickのバージョンを問わず使えるruby-RMagick。動作は未確認です。
%{!?ruby_sitelib: %global ruby_sitelib %(ruby -rrbconfig -e "puts Config::CONFIG['sitelibdir']")}
%{!?ruby_sitearch: %global ruby_sitearch %(ruby -rrbconfig -e "puts Config::CONFIG['sitearchdir']")}
%{!?ruby_abiver: %global ruby_abiver %((echo "1.8"; ruby -rrbconfig -e "puts Config::CONFIG['ruby_version']" 2>/dev/null) | tail -1)}
%define modname RMagick
%define repoid 47971
Name: ruby-%{modname}
Version: 1.15.17
Release: 2%{?dist}
Summary: Graphics Processing for Ruby and Ruby on Rails
Group: Development/Languages
License: MIT
URL: http://rmagick.rubyforge.org/
Source0: http://rubyforge.org/frs/download.php/%{repoid}/%{modname}-%{version}.tar.bz2
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
#Requires: ruby(abi) = %{ruby_abiver}, ImageMagick = 6.2.8.0
#BuildRequires: ruby, ruby-devel, ImageMagick-devel >= 6.0.0
Requires: ruby(abi) = %{ruby_abiver}
BuildRequires: ruby, ruby-devel
Provides: ruby(%{modname}) = %{version}-%{release}
%description
RMagick is an interface between the Ruby programming language and the
ImageMagick and GraphicsMagick image processing libraries.
%package doc
Summary: Documentation for %{name}
Group: Documentation
%description doc
This package contains documentaton files for %{name}.
%prep
%setup -q -n %{modname}-%{version}
%build
%configure --with-so-dir=%{ruby_sitearch} --with-site-ruby=%{ruby_sitelib} --disable-htmldoc
make %{?_smp_mflags}
%install
rm -rf $RPM_BUILD_ROOT
ruby setup.rb install --prefix=$RPM_BUILD_ROOT
# Correct wrong permissions
chmod 755 $RPM_BUILD_ROOT%{ruby_sitearch}/%{modname}.so
# Switch from non-UTF-8 to UTF-8
sed -e 's@ISO-8859-1@UTF-8@' README.html | iconv -f iso-8859-1 -t utf-8 > README.html.iso
touch -r README.html README.html.iso
mv -f README.html.iso README.html
# At the correct shebank to the example files
for file in doc/ex/*.rb; do
sed -e 's@/\(usr/local\|home/software/ruby-1.6.8\)/bin/ruby@%{_bindir}/ruby@g' $file > $file.new
touch -r $file $file.new
mv -f $file.new $file
done
%clean
rm -rf $RPM_BUILD_ROOT
%files
%defattr(-,root,root,-)
%doc ChangeLog README.html
%{ruby_sitelib}/%{modname}.rb
%{ruby_sitelib}/rvg/
%{ruby_sitearch}/%{modname}.so
%files doc
%defattr(-,root,root,-)
%doc doc/*
%changelog
* Sun Aug 02 2009 Robert Scheck <robert@fedoraproject.org> 1.15.17-2
- Added missing requirement to ruby(abi) = version (#514931 #c4)
- Added a fixed dependency for the ImageMagick version (#500565)
* Fri Jul 31 2009 Robert Scheck <robert@fedoraproject.org> 1.15.17-1
- Upgrade to 1.15.17
- Initial spec file for Fedora and Red Hat Enterprise Linux
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment