F-17: rebuild against ruby 1.9
This commit is contained in:
parent
367f525459
commit
4937b90815
|
@ -1,25 +1,31 @@
|
||||||
|
%if 0%{?fedora} <= 16
|
||||||
%global ruby_sitelib %(ruby -rrbconfig -e "puts Config::CONFIG['sitelibdir']")
|
%global ruby_sitelib %(ruby -rrbconfig -e "puts Config::CONFIG['sitelibdir']")
|
||||||
%global ruby_sitearch %(ruby -rrbconfig -e "puts Config::CONFIG['sitearchdir']")
|
%global ruby_sitearch %(ruby -rrbconfig -e "puts Config::CONFIG['sitearchdir']")
|
||||||
%global rubyabi 1.8
|
%endif
|
||||||
|
|
||||||
%global gemdir %(ruby -rubygems -e 'puts Gem::dir' 2>/dev/null)
|
%if 0%{?fedora} >= 17
|
||||||
%global gemname cairo
|
%global rubyabi 1.9.1
|
||||||
%global geminstdir %{gemdir}/gems/%{gemname}-%{version}
|
%global header_dir %{ruby_vendorarchdir}
|
||||||
|
%else
|
||||||
|
%global rubyabi 1.8
|
||||||
|
%global header_dir %{ruby_sitearch}
|
||||||
|
%endif
|
||||||
|
|
||||||
|
%global gem_name cairo
|
||||||
|
|
||||||
# Upstream GIT http://github.com/rcairo/
|
# Upstream GIT http://github.com/rcairo/
|
||||||
|
|
||||||
Summary: Ruby bindings for cairo
|
Summary: Ruby bindings for cairo
|
||||||
Name: rubygem-%{gemname}
|
Name: rubygem-%{gem_name}
|
||||||
Version: 1.10.2
|
Version: 1.10.2
|
||||||
Release: 2%{?dist}
|
Release: 3%{?dist}
|
||||||
Group: Development/Languages
|
Group: Development/Languages
|
||||||
License: GPLv2 or Ruby
|
License: GPLv2 or Ruby
|
||||||
URL: http://cairographics.org/rcairo/
|
URL: http://cairographics.org/rcairo/
|
||||||
Source0: http://rubygems.org/downloads/%{gemname}-%{version}.gem
|
Source0: http://rubygems.org/downloads/%{gem_name}-%{version}.gem
|
||||||
|
|
||||||
BuildRequires: ruby(abi) = %{rubyabi}
|
BuildRequires: ruby(abi) = %{rubyabi}
|
||||||
BuildRequires: rubygems
|
BuildRequires: rubygems-devel
|
||||||
BuildRequires: cairo-devel
|
BuildRequires: cairo-devel
|
||||||
BuildRequires: ruby-devel
|
BuildRequires: ruby-devel
|
||||||
# For %%check
|
# For %%check
|
||||||
|
@ -30,7 +36,12 @@ BuildRequires: rubygem(pkg-config)
|
||||||
BuildRequires: dejavu-serif-fonts
|
BuildRequires: dejavu-serif-fonts
|
||||||
Requires: ruby(abi) = %{rubyabi}
|
Requires: ruby(abi) = %{rubyabi}
|
||||||
Requires: rubygems
|
Requires: rubygems
|
||||||
Provides: rubygem(%{gemname}) = %{version}-%{release}
|
Provides: rubygem(%{gem_name}) = %{version}-%{release}
|
||||||
|
|
||||||
|
%if 0%{?fedora} >= 17
|
||||||
|
Obsoletes: ruby-%{gem_name} = %{version}-%{release}
|
||||||
|
Provides: ruby-%{gem_name} = %{version}-%{release}
|
||||||
|
%endif
|
||||||
|
|
||||||
%description
|
%description
|
||||||
Ruby bindings for cairo. Cairo is a 2D graphics library with support for
|
Ruby bindings for cairo. Cairo is a 2D graphics library with support for
|
||||||
|
@ -45,16 +56,16 @@ Requires: %{name} = %{version}-%{release}
|
||||||
%description doc
|
%description doc
|
||||||
This package contains documentation for %{name}.
|
This package contains documentation for %{name}.
|
||||||
|
|
||||||
%package -n ruby-%{gemname}
|
%package -n ruby-%{gem_name}
|
||||||
# TODO: remove ruby-%%{gemname} compat package for F-17
|
# TODO: remove ruby-%%{gem_name} compat package for F-17
|
||||||
# TODO: needs dependency check
|
# TODO: needs dependency check
|
||||||
Summary: Non-Gem support package for %{gemname}
|
Summary: Non-Gem support package for %{gem_name}
|
||||||
Group: Development/Languages
|
Group: Development/Languages
|
||||||
Requires: %{name} = %{version}-%{release}
|
Requires: %{name} = %{version}-%{release}
|
||||||
Provides: ruby(%{gemname}) = %{version}-%{release}
|
Provides: ruby(%{gem_name}) = %{version}-%{release}
|
||||||
|
|
||||||
%description -n ruby-%{gemname}
|
%description -n ruby-%{gem_name}
|
||||||
This package provides non-Gem support for %{gemname}.
|
This package provides non-Gem support for %{gem_name}.
|
||||||
|
|
||||||
%package devel
|
%package devel
|
||||||
Summary: Ruby-cairo development environment
|
Summary: Ruby-cairo development environment
|
||||||
|
@ -80,11 +91,11 @@ ruby-cairo
|
||||||
%prep
|
%prep
|
||||||
%setup -q -T -c
|
%setup -q -T -c
|
||||||
|
|
||||||
mkdir -p ./%{gemdir}
|
mkdir -p ./%{gem_dir}
|
||||||
export CONFIGURE_ARGS="--with-cflags='%{optflags}'"
|
export CONFIGURE_ARGS="--with-cflags='%{optflags}'"
|
||||||
gem install \
|
gem install \
|
||||||
--local \
|
--local \
|
||||||
--install-dir ./%{gemdir} \
|
--install-dir ./%{gem_dir} \
|
||||||
-V --force \
|
-V --force \
|
||||||
%{SOURCE0}
|
%{SOURCE0}
|
||||||
|
|
||||||
|
@ -97,40 +108,48 @@ find . -name \*.gemspec | \
|
||||||
|
|
||||||
# Once install to TMPINSTDIR for %%check
|
# Once install to TMPINSTDIR for %%check
|
||||||
rm -rf ./TMPINSTDIR
|
rm -rf ./TMPINSTDIR
|
||||||
mkdir -p ./TMPINSTDIR/%{gemdir}
|
mkdir -p ./TMPINSTDIR/%{gem_dir}
|
||||||
cp -a ./%{gemdir}/* ./TMPINSTDIR/%{gemdir}
|
cp -a ./%{gem_dir}/* ./TMPINSTDIR/%{gem_dir}
|
||||||
|
|
||||||
TOPDIR=$(pwd)
|
TOPDIR=$(pwd)
|
||||||
|
|
||||||
## remove all shebang, set permission to 0644
|
## remove all shebang, set permission to 0644
|
||||||
for f in $(find ./TMPINSTDIR/%{geminstdir} -name \*.rb)
|
for f in $(find ./TMPINSTDIR/%{gem_instdir} -name \*.rb)
|
||||||
do
|
do
|
||||||
sed -i -e '/^#!/d' $f
|
sed -i -e '/^#!/d' $f
|
||||||
chmod 0644 $f
|
chmod 0644 $f
|
||||||
done
|
done
|
||||||
|
|
||||||
# Move C extension library to some private directory
|
# Move C extension library to some private directory
|
||||||
pushd ./TMPINSTDIR/%{geminstdir}
|
pushd ./TMPINSTDIR/%{gem_instdir}
|
||||||
grep -rl '%{gemname}.so' . | \
|
%if 0%{?fedora} < 17
|
||||||
|
grep -rl '%{gem_name}.so' . | \
|
||||||
xargs sed -i \
|
xargs sed -i \
|
||||||
-e "\@require@s|'%{gemname}.so'|'%{gemname}/%{gemname}.so'|" \
|
-e "\@require@s|'%{gem_name}.so'|'%{gem_name}/%{gem_name}.so'|" \
|
||||||
-e '\@require@s|"%{gemname}.so"|"%{gemname}/%{gemname}.so"|'
|
-e '\@require@s|"%{gem_name}.so"|"%{gem_name}/%{gem_name}.so"|'
|
||||||
popd
|
popd
|
||||||
mkdir -p ./TMPINSTDIR/%{ruby_sitearch}/%{gemname}
|
mkdir -p ./TMPINSTDIR/%{ruby_sitearch}/%{gem_name}
|
||||||
pushd ./TMPINSTDIR
|
pushd ./TMPINSTDIR
|
||||||
mv .%{geminstdir}/lib/%{gemname}.so \
|
mv .%{gem_instdir}/lib/%{gem_name}.so \
|
||||||
./%{ruby_sitearch}/%{gemname}/
|
./%{ruby_sitearch}/%{gem_name}/
|
||||||
|
%else
|
||||||
|
popd
|
||||||
|
pushd ./TMPINSTDIR
|
||||||
|
mkdir -p .%{gem_extdir}/lib
|
||||||
|
mv .%{gem_instdir}/lib/%{gem_name}.so \
|
||||||
|
./%{gem_extdir}/lib
|
||||||
|
%endif
|
||||||
|
|
||||||
# Move header
|
# Move header
|
||||||
mv ./%{geminstdir}/lib/*.h \
|
mkdir -p ./%{header_dir}
|
||||||
./%{ruby_sitearch}/
|
mv ./%{gem_instdir}/lib/*.h \
|
||||||
|
./%{header_dir}/
|
||||||
popd
|
popd
|
||||||
|
|
||||||
|
|
||||||
# cleanups
|
# cleanups
|
||||||
rm -rf ./TMPINSTDIR/%{geminstdir}/ext/
|
rm -rf ./TMPINSTDIR/%{gem_instdir}/ext/
|
||||||
rm -f ./TMPINSTDIR/%{geminstdir}/{Makefile*,extconf.rb}
|
rm -f ./TMPINSTDIR/%{gem_instdir}/{Makefile*,extconf.rb}
|
||||||
|
|
||||||
%install
|
%install
|
||||||
cp -a ./TMPINSTDIR/* %{buildroot}/
|
cp -a ./TMPINSTDIR/* %{buildroot}/
|
||||||
|
@ -140,7 +159,7 @@ cp -a ./TMPINSTDIR/* %{buildroot}/
|
||||||
#
|
#
|
||||||
# Create symlinks
|
# Create symlinks
|
||||||
##
|
##
|
||||||
## Note that before switching to gem %%{ruby_sitelib}/%%{gemname}
|
## Note that before switching to gem %%{ruby_sitelib}/%%{gem_name}
|
||||||
## already existed as a directory, so this cannot be replaced
|
## already existed as a directory, so this cannot be replaced
|
||||||
## by symlink (cpio fails)
|
## by symlink (cpio fails)
|
||||||
## Similarly, all directories under %%{ruby_sitelib} cannot be
|
## Similarly, all directories under %%{ruby_sitelib} cannot be
|
||||||
|
@ -194,12 +213,18 @@ popd
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
create_symlink_rec %{geminstdir}/lib %{ruby_sitelib}
|
%if 0%{?fedora} < 17
|
||||||
|
create_symlink_rec %{gem_instdir}/lib %{ruby_sitelib}
|
||||||
|
%endif
|
||||||
|
|
||||||
%check
|
%check
|
||||||
|
%if 0%{?fedora} >= 17
|
||||||
|
export RUBYLIB=$(pwd)/TMPINSTDIR/%{gem_instdir}:$(pwd)/TMPINSTDIR/%{gem_extdir}/lib
|
||||||
|
%else
|
||||||
export RUBYLIB=$(pwd)/TMPINSTDIR/%{ruby_sitearch}
|
export RUBYLIB=$(pwd)/TMPINSTDIR/%{ruby_sitearch}
|
||||||
|
%endif
|
||||||
|
|
||||||
pushd ./TMPINSTDIR/%{geminstdir}
|
pushd ./TMPINSTDIR/%{gem_instdir}
|
||||||
# kill unneeded make process
|
# kill unneeded make process
|
||||||
rm -rf ./TMPBINDIR
|
rm -rf ./TMPBINDIR
|
||||||
mkdir ./TMPBINDIR
|
mkdir ./TMPBINDIR
|
||||||
|
@ -215,31 +240,42 @@ ruby ./test/run-test.rb
|
||||||
popd
|
popd
|
||||||
|
|
||||||
%files
|
%files
|
||||||
%dir %{ruby_sitearch}/%{gemname}/
|
%if 0%{fedora} < 17
|
||||||
%{ruby_sitearch}/%{gemname}/%{gemname}.so
|
%dir %{ruby_sitearch}/%{gem_name}/
|
||||||
%dir %{geminstdir}/
|
%{ruby_sitearch}/%{gem_name}/%{gem_name}.so
|
||||||
%doc %{geminstdir}/[A-Z]*
|
%else
|
||||||
%exclude %{geminstdir}/Gemfile
|
%dir %{gem_extdir}
|
||||||
%exclude %{geminstdir}/Rakefile
|
%dir %{gem_extdir}/lib
|
||||||
%{geminstdir}/lib/
|
%{gem_extdir}/lib/%{gem_name}.so
|
||||||
%{gemdir}/cache/%{gemname}-%{version}.gem
|
%endif
|
||||||
%{gemdir}/specifications/%{gemname}-%{version}.gemspec
|
%dir %{gem_instdir}/
|
||||||
|
%doc %{gem_instdir}/[A-Z]*
|
||||||
|
%exclude %{gem_instdir}/Gemfile
|
||||||
|
%exclude %{gem_instdir}/Rakefile
|
||||||
|
%{gem_instdir}/lib/
|
||||||
|
%{gem_cache}
|
||||||
|
%{gem_spec}
|
||||||
|
|
||||||
%files doc
|
%files doc
|
||||||
%{geminstdir}/Gemfile
|
%{gem_instdir}/Gemfile
|
||||||
%{geminstdir}/Rakefile
|
%{gem_instdir}/Rakefile
|
||||||
%{geminstdir}/samples/
|
%{gem_instdir}/samples/
|
||||||
%{geminstdir}/test/
|
%{gem_instdir}/test/
|
||||||
%{gemdir}/doc/%{gemname}-%{version}/
|
%{gem_docdir}/
|
||||||
|
|
||||||
%files -n ruby-%{gemname}
|
%if 0%{?fedora} < 17
|
||||||
%{ruby_sitelib}/%{gemname}.rb
|
%files -n ruby-%{gem_name}
|
||||||
%{ruby_sitelib}/%{gemname}/
|
%{ruby_sitelib}/%{gem_name}.rb
|
||||||
|
%{ruby_sitelib}/%{gem_name}/
|
||||||
|
%endif
|
||||||
|
|
||||||
%files devel
|
%files devel
|
||||||
%{ruby_sitearch}/rb_cairo.h
|
%{header_dir}/rb_cairo.h
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Sun Jan 29 2012 Mamoru Tasaka <mtasaka@fedoraproject.org> - 1.10.2-3
|
||||||
|
- F-17: rebuild against ruby 1.9
|
||||||
|
|
||||||
* Sat Jan 14 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.10.2-2
|
* Sat Jan 14 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.10.2-2
|
||||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild
|
- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild
|
||||||
|
|
||||||
|
@ -257,7 +293,7 @@ popd
|
||||||
- Ignore test failure for now
|
- Ignore test failure for now
|
||||||
|
|
||||||
* Sun Oct 31 2010 Mamoru Tasaka <mtasaka@ioa.s.u-tokyo.ac.jp> 1.10.0-3
|
* Sun Oct 31 2010 Mamoru Tasaka <mtasaka@ioa.s.u-tokyo.ac.jp> 1.10.0-3
|
||||||
- Move C extension so that "require %%gemname" works correctly
|
- Move C extension so that "require %%gem_name" works correctly
|
||||||
|
|
||||||
* Tue Oct 5 2010 Mamoru Tasaka <mtasaka@ioa.s.u-tokyo.ac.jp> 1.10.0-2
|
* Tue Oct 5 2010 Mamoru Tasaka <mtasaka@ioa.s.u-tokyo.ac.jp> 1.10.0-2
|
||||||
- Install one font at BuildRequires for test
|
- Install one font at BuildRequires for test
|
||||||
|
|
Loading…
Reference in New Issue