[rubygem-hpricot] F-21: rebuild for ruby 2.1 / rubygems 2.2
Mamoru TASAKA
mtasaka at fedoraproject.org
Sat May 3 07:18:50 UTC 2014
commit 02481f6cecd347a9f62be772ce5a5ac1afcb7c42
Author: Mamoru TASAKA <mtasaka at fedoraproject.org>
Date: Sat May 3 16:19:05 2014 +0900
F-21: rebuild for ruby 2.1 / rubygems 2.2
- End up with using test-unit for testsuite
rubygem-hpricot.spec | 118 ++++++++-----------------------------------------
1 files changed, 20 insertions(+), 98 deletions(-)
---
diff --git a/rubygem-hpricot.spec b/rubygem-hpricot.spec
index 2359789..99356b2 100644
--- a/rubygem-hpricot.spec
+++ b/rubygem-hpricot.spec
@@ -1,20 +1,10 @@
# Initially generated from hpricot-0.6.164.gem by gem2rpm -*- rpm-spec -*-
-%if 0%{?fedora} >= 17
-%if 0%{?fedora} < 19
-%define rubyabi 1.9.1
-%endif
-%else
-%define rubyabi 1.8
-%define ruby_sitelib %(ruby -rrbconfig -e "puts Config::CONFIG['sitelibdir']")
-%define ruby_sitearch %(ruby -rrbconfig -e "puts Config::CONFIG['sitearchdir']")
-%endif
-
%define gem_name hpricot
Summary: A Fast, Enjoyable HTML Parser for Ruby
Name: rubygem-%{gem_name}
Version: 0.8.6
-Release: 5%{?dist}
+Release: 6%{?dist}
Group: Development/Languages
# ext/fast_xs/FastXsService.java is licensed under ASL 2.0
License: MIT and ASL 2.0
@@ -24,15 +14,8 @@ URL: http://github.com/hpricot/hpricot
Source0: %{gem_name}-%{version}-modified.gem
Source10: rubygem-hpricot-create-free-gem.sh
-%if 0%{?fedora} >= 19
Requires: ruby(release)
BuildRequires: ruby(release)
-%else
-Requires: ruby(abi) = %{rubyabi}
-Requires: ruby
-BuildRequires: ruby(abi) = %{rubyabi}
-BuildRequires: ruby
-%endif
BuildRequires: rubygems-devel
# Recompile
@@ -42,7 +25,7 @@ BuildRequires: rubygem(rake-compiler)
BuildRequires: rubygem(rdoc)
BuildRequires: ruby-devel
BuildRequires: ragel
-BuildRequires: rubygem(minitest)
+BuildRequires: rubygem(test-unit)
BuildRequires: rubygem(rake)
Requires: ruby(rubygems)
Provides: rubygem(%{gem_name}) = %{version}-%{release}
@@ -94,12 +77,18 @@ find . -type f | xargs chmod ugo+r
mkdir -p %{buildroot}%{gem_dir}
cp -a ./%{gem_dir}/* %{buildroot}%{gem_dir}
-%if 0%{?fedora} >= 17
+%if 0%{?fedora} >= 21
+mkdir -p %{buildroot}%{gem_extdir_mri}
+cp -a ./%{gem_extdir_mri}/* %{buildroot}%{gem_extdir_mri}/
+
+pushd %{buildroot}
+rm -f .%{gem_extdir_mri}/{gem_make.out,mkmf.log}
+popd
+
+%else
mkdir -p %{buildroot}%{gem_extdir_mri}/lib
mv %{buildroot}%{gem_libdir}/*.so %{buildroot}%{gem_extdir_mri}/lib
-%else
-mkdir -p %{buildroot}%{ruby_sitearch}
-mv %{buildroot}%{gem_libdir}/*.so %{buildroot}%{ruby_sitearch}/
+
%endif
# Shebang
@@ -122,68 +111,6 @@ rm -f %{buildroot}%{gem_instdir}/.require_paths
DIR=%{buildroot}%{gem_libdir}/universal-java*
[ -d $DIR ] && rmdir $DIR
-# The following method is completely copied from rubygem-gettext
-# spec file
-#
-# Create symlinks
-##
-## Note that before switching to gem %%{ruby_sitelib}/%%{gem_name}
-## already existed as a directory, so this cannot be replaced
-## by symlink (cpio fails)
-## Similarly, all directories under %%{ruby_sitelib} cannot be
-## replaced by symlink
-#
-
-create_symlink_rec(){
-
-ORIGBASEDIR=$1
-TARGETBASEDIR=$2
-
-## First calculate relative path of ORIGBASEDIR
-## from TARGETBASEDIR
-TMPDIR=$TARGETBASEDIR
-BACKDIR=
-DOWNDIR=
-num=0
-nnum=0
-while true
-do
- num=$((num+1))
- TMPDIR=$(echo $TMPDIR | sed -e 's|/[^/][^/]*$||')
- DOWNDIR=$(echo $ORIGBASEDIR | sed -e "s|^$TMPDIR||")
- if [ x$DOWNDIR != x$ORIGBASEDIR ]
- then
- nnum=0
- while [ $nnum -lt $num ]
- do
- BACKDIR="../$BACKDIR"
- nnum=$((nnum+1))
- done
- break
- fi
-done
-
-RELBASEDIR=$( echo $BACKDIR/$DOWNDIR | sed -e 's|//*|/|g' )
-
-## Next actually create symlink
-pushd %{buildroot}/$ORIGBASEDIR
-find . -type f | while read f
-do
- DIRNAME=$(dirname $f)
- BACK2DIR=$(echo $DIRNAME | sed -e 's|/[^/][^/]*|/..|g')
- mkdir -p %{buildroot}${TARGETBASEDIR}/$DIRNAME
- LNNAME=$(echo $BACK2DIR/$RELBASEDIR/$f | \
- sed -e 's|^\./||' | sed -e 's|//|/|g' | \
- sed -e 's|/\./|/|' )
- ln -s -f $LNNAME %{buildroot}${TARGETBASEDIR}/$f
-done
-popd
-
-}
-
-%if 0%{?fedora} < 17
-create_symlink_rec %{gem_libdir} %{ruby_sitelib}
-%endif
# Fix permission (bug 487654)
pushd %{buildroot}
@@ -192,21 +119,19 @@ find . -type f '(' -name '[A-Z]*' -or -name '*.java' -or -name '*.rb' -or -name
popd
%check
-export GEM_PATH=$(pwd)%{gem_dir}:%{gem_dir}
pushd .%{gem_instdir}
# problem reported here: https://github.com/hpricot/hpricot/issues/52
LANG=en_US.utf8
-testrb -Ilib test
+ruby \
+ -Ilib:.:ext/hpricot_scan:ext/fast_xs:test \
+ -e "gem 'test-unit' ; Dir.glob('test/test_*.rb').each { |f| require f }"
+
popd
%files
%defattr(-,root, root,-)
-%if 0%{?fedora} >= 17
%{gem_extdir_mri}
-%else
-%{ruby_sitearch}/*.so
-%endif
%dir %{gem_instdir}/
%doc %{gem_instdir}/[A-Z]*
%exclude %{gem_instdir}/Rakefile
@@ -221,14 +146,11 @@ popd
%{gem_instdir}/test/
%{gem_docdir}/
-%if 0%{?fedora} < 17
-%files -n ruby-%{gem_name}
-%defattr(-,root,root,-)
-%{ruby_sitelib}/%{gem_name}.rb
-%{ruby_sitelib}/%{gem_name}/
-%endif
-
%changelog
+* Sat May 3 2014 Mamoru TASAKA <mtasaka at fedoraproject.org> - 0.8.6-6
+- F-21: rebuild for ruby 2.1 / rubygems 2.2
+- End up with using test-unit for testsuite
+
* Sun Aug 04 2013 Fedora Release Engineering <rel-eng at lists.fedoraproject.org> - 0.8.6-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild
More information about the scm-commits
mailing list