summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMamoru Tasaka <mtasaka@fedoraproject.org>2009-01-20 04:10:53 +0000
committerMamoru Tasaka <mtasaka@fedoraproject.org>2009-01-20 04:10:53 +0000
commit4113b89565ca1cf3296a1cf8fc4e128939f39bef (patch)
tree7292fd687a8eee9802f7498aae87a5be9567a0a8
parent01908244dfce5c312ea8d34641b31e187091033e (diff)
downloadrubygem-nokogiri-4113b89565ca1cf3296a1cf8fc4e128939f39bef.tar.gz
rubygem-nokogiri-4113b89565ca1cf3296a1cf8fc4e128939f39bef.tar.xz
rubygem-nokogiri-4113b89565ca1cf3296a1cf8fc4e128939f39bef.zip
It seems that I did a big mistake...
-rw-r--r--jd.spec387
-rw-r--r--rubygem-nokogiri.spec190
2 files changed, 190 insertions, 387 deletions
diff --git a/jd.spec b/jd.spec
deleted file mode 100644
index 171e49f..0000000
--- a/jd.spec
+++ /dev/null
@@ -1,387 +0,0 @@
-##########################################
-# For using svn: do
-# export SVNROOT="http://svn.sourceforge.jp/svnroot/jd4linux/jd"
-# svn checkout $SVNROOT/trunk
-# mv trunk jd-%%{main_ver}-%%{strtag}
-# tar czf jd-%%{main_ver}-%%{strtag}.tgz jd-%%{main_ver}-%%{strtag}
-##########################################
-
-##########################################
-# Defined by upsteam
-#
-%define main_ver 2.2.0
-%define strtag svn2631_trunk
-%define repoid 36802
-# Define this if this is pre-version
-%define pre_release 1
-##########################################
-
-##########################################
-# Defined by vendor
-#
-%define vendor_rel 1
-%define extra_rel %{nil}
-# Tag name changed from vendor to vendorname so as not to
-# overwrite Vendor entry in Summary
-%define vendorname fedora
-%define gtkmmdevel gtkmm24-devel
-%define fontpackage mona-fonts-VLGothic
-%define icondir %{_datadir}/icons/hicolor/96x96/apps/
-##########################################
-
-##########################################
-%if %{pre_release}
-%define rel 0.%{vendor_rel}.%{strtag}%{?extra_rel}%{?dist}
-%else
-%define rel %{vendor_rel}%{?dist}
-%endif
-
-# By default, Migemo support is disabled.
-%if 0%{?fedora} >= 5
-%define _with_migemo 1
-%endif
-%define migemo_dict %{_datadir}/cmigemo/utf-8/migemo-dict
-##########################################
-
-Name: jd
-Version: %{main_ver}
-Release: %{rel}
-Summary: A 2ch browser
-
-Group: Applications/Internet
-License: GPLv2
-URL: http://jd4linux.sourceforge.jp/
-Source0: http://downloads.sourceforge.jp/jd4linux/%{repoid}/%{name}-%{main_ver}-%{strtag}.tgz
-#Source0: %{name}-%{main_ver}-%{strtag}.tgz
-BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
-
-BuildRequires: %{gtkmmdevel}
-BuildRequires: libtool automake
-BuildRequires: gnutls-devel
-BuildRequires: desktop-file-utils
-BuildRequires: libSM-devel
-%if 0%{?_with_migemo} >= 1
-BuildRequires: cmigemo-devel
-%endif
-BuildRequires: alsa-lib-devel
-%if 0%{?fedora} > 8
-BuildRequires: oniguruma-devel
-%endif
-%if %{pre_release}
-BuildRequires: subversion
-%endif
-Requires: %{fontpackage}
-
-
-%description
-JD is a 2ch browser based on gtkmm2.
-
-%prep
-%setup -q -n %{name}-%{main_ver}-%{strtag}
-#find . -name .svn | sort -r | xargs %{__rm} -rf
-
-sh autogen.sh
-
-%build
-# set TZ for __TIME__
-export TZ='Asia/Tokyo'
-
-%configure \
- --with-alsa \
-%if 0%{?fedora} > 8
- --with-oniguruma \
-%endif
- --with-xdgopen \
-%if 0%{?_with_migemo} >= 1
- --with-migemo \
- --with-migemodict=%{migemo_dict}
-%endif
-
-%{__make} %{?_smp_mflags}
-
-
-%install
-%{__rm} -rf $RPM_BUILD_ROOT
-%{__make} install DESTDIR=$RPM_BUILD_ROOT
-
-%{__mkdir_p} $RPM_BUILD_ROOT%{icondir}
-%{__install} -p -m 644 %{name}.png $RPM_BUILD_ROOT%{icondir}
-
-desktop-file-install \
- --vendor %{vendorname} \
- --dir $RPM_BUILD_ROOT%{_datadir}/applications \
- --delete-original \
- $RPM_BUILD_ROOT%{_datadir}/applications/%{name}.desktop
-
-%clean
-%{__rm} -rf $RPM_BUILD_ROOT
-
-%post
-touch --no-create %{_datadir}/icons/hicolor || :
-%{_bindir}/gtk-update-icon-cache --quiet %{_datadir}/icons/hicolor || :
-
-%postun
-touch --no-create %{_datadir}/icons/hicolor || :
-%{_bindir}/gtk-update-icon-cache --quiet %{_datadir}/icons/hicolor || :
-
-%files
-%defattr(-,root,root,-)
-%doc COPYING ChangeLog README
-%{_bindir}/%{name}
-%{_datadir}/applications/%{vendorname}-%{name}.desktop
-%{_datadir}/pixmaps/%{name}.png
-%{icondir}/%{name}.png
-
-%changelog
-* Tue Jan 20 2009 Mamoru Tasaka <mtasaka@ioa.s.u-tokyo.ac.jp>
-- rev 2631
-
-* Tue Dec 30 2008 Mamoru Tasaka <mtasaka@ioa.s.u-tokyo.ac.jp> - 2.1.0-2
-- Workaround for the issue on res 868 in JD 6 thread (segv when
- bookmarking when bookmark is empty)
-
-* Mon Dec 29 2008 Mamoru Tasaka <mtasaka@ioa.s.u-tokyo.ac.jp> - 2.1.0-1
-- 2.1.0
-
-* Sun Dec 28 2008 Mamoru Tasaka <mtasaka@ioa.s.u-tokyo.ac.jp>
-- rev 2608 (patched against previous rc)
-
-* Tue Dec 23 2008 Mamoru Tasaka <mtasaka@ioa.s.u-tokyo.ac.jp> - 2.1.0-0.5.rc081223
-- 2.1.0 rc 081223
-
-* Sat Dec 20 2008 Mamoru Tasaka <mtasaka@ioa.s.u-tokyo.ac.jp>
-- rev 2579
-- Use oniguruma on F-9+ for regex
-
-* Tue Dec 16 2008 Mamoru Tasaka <mtasaka@ioa.s.u-tokyo.ac.jp> - 2.1.0-0.2.beta081216
-- 2.1.0 beta 081216
-
-* Mon Nov 24 2008 Mamoru Tasaka <mtasaka@ioa.s.u-tokyo.ac.jp> - 2.0.3-1
-- 2.0.3
-
-* Tue Nov 18 2008 Mamoru Tasaka <mtasaka@ioa.s.u-tokyo.ac.jp> - 2.0.3-0.3.rc081117
-- 2.0.3 rc 081117
-
-* Mon Nov 10 2008 Mamoru Tasaka <mtasaka@ioa.s.u-tokyo.ac.jp> - 2.0.3-0.2.beta081110
-- 2.0.3 beta 081110
-
-* Sat Sep 20 2008 Mamoru Tasaka <mtasaka@ioa.s.u-tokyo.ac.jp> - 2.0.2-1
-- 2.0.2
-
-* Tue Sep 16 2008 Mamoru Tasaka <mtasaka@ioa.s.u-tokyo.ac.jp> - 2.0.1-2
-- Patch to cope with occasional cookie change
-
-* Sun Sep 14 2008 Mamoru Tasaka <mtasaka@ioa.s.u-tokyo.ac.jp> - 2.0.1-1
-- 2.0.1
-
-* Wed Sep 10 2008 Mamoru Tasaka <mtasaka@ioa.s.u-tokyo.ac.jp> - 2.0.1-0.3.rc080909
-- 2.0.1 rc 080909
-
-* Tue Sep 9 2008 Mamoru Tasaka <mtasaka@ioa.s.u-tokyo.ac.jp>
-- rev 2322
-- Set xdg-open as default browser now by configure option
-
-* Mon Sep 8 2008 Mamoru Tasaka <mtasaka@ioa.s.u-tokyo.ac.jp>
-- rev 2319
-- revert default browser setting
-
-* Tue Sep 2 2008 Mamoru Tasaka <mtasaka@ioa.s.u-tokyo.ac.jp> - 2.0.1-0.2.beta080901
-- 2.0.1 beta 080901
-- Change default config in Fedora
- fonts: use Mona-VLGothic
- browser: use xdg-open
-
-* Tue Aug 5 2008 Mamoru Tasaka <mtasaka@ioa.s.u-tokyo.ac.jp>
-- Switch the default fonts to VLGothic-based Mona
-
-* Mon Jul 28 2008 Mamoru Tasaka <mtasaka@ioa.s.u-tokyo.ac.jp> - 2.0.0-2
-- Change Japanese fonts Requires (F-10+)
-
-* Wed Jul 23 2008 Mamoru Tasaka <mtasaka@ioa.s.u-tokyo.ac.jp> - 2.0.0-1
-- 2.0.0
-
-* Mon Jul 14 2008 Mamoru Tasaka <mtasaka@ioa.s.u-tokyo.ac.jp> - 2.0.0-0.8.rc080714
-- 2.0.0 rc 080714
-
-* Thu Jul 3 2008 Mamoru Tasaka <mtasaka@ioa.s.u-tokyo.ac.jp> - 2.0.0-0.7.beta20080702
-- 2.0.0 beta 20080702
-
-* Tue Jun 24 2008 Mamoru Tasaka <mtasaka@ioa.s.u-tokyo.ac.jp>
-- F-10: rebuild against new gnutls
-- F-10: kill subversion tagging until dependency is solved.
-
-* Mon Jun 2 2008 Mamoru Tasaka <mtasaka@ioa.s.u-tokyo.ac.jp> - 2.0.0-0.6.beta20080601
-- 2.0.0 beta 20080601
-
-* Mon Jun 2 2008 Mamoru Tasaka <mtasaka@ioa.s.u-tokyo.ac.jp> - 2.0.0-0.5.svn2081_trunk
-- Workarround for bug 449225
-
-* Sun May 25 2008 Mamoru Tasaka <mtasaka@ioa.s.u-tokyo.ac.jp> - 2.0.0-0.5.svn2066_trunk
-- Enable alsa
-
-* Fri Apr 18 2008 Mamoru Tasaka <mtasaka@ioa.s.u-tokyo.ac.jp> - 2.0.0-0.4.beta080418
-- 2.0.0 beta 080418
-
-* Tue Apr 15 2008 Mamoru Tasaka <mtasaka@ioa.s.u-tokyo.ac.jp> - 1.9.9-1
-- 1.9.9
-
-* Wed Apr 9 2008 Mamoru Tasaka <mtasaka@ioa.s.u-tokyo.ac.jp> - 1.9.9-0.3.rc080408
-- 1.9.9 rc 080408
-
-* Sun Mar 23 2008 Mamoru Tasaka <mtasaka@ioa.s.u-tokyo.ac.jp>
-- Workaround for bug 438600
-
-* Mon Feb 25 2008 Mamoru Tasaka <mtasaka@ioa.s.u-tokyo.ac.jp> - 1.9.9-0.3.beta080225
-- 1.9.9 beta 080225
-
-* Sat Feb 9 2008 Mamoru Tasaka <mtasaka@ioa.s.u-tokyo.ac.jp>
-- Remove patch for gcc43 (applied by upstream)
-- Remove workarround for libsigc++ side bug
-
-* Fri Feb 8 2008 Mamoru Tasaka <mtasaka@ioa.s.u-tokyo.ac.jp> - 2.0.0-0.2.svn1774
-- Patch to make jd happy with gcc43
-- Workarround for libsigc++ side bug (bug 431017)
-
-* Fri Dec 28 2007 Mamoru Tasaka <mtasaka@ioa.s.u-tokyo.ac.jp> - 1.9.8-1
-- 1.9.8
-
-* Sun Dec 23 2007 Mamoru Tasaka <mtasaka@ioa.s.u-tokyo.ac.jp> - 1.9.8-0.5.rc071223
-- 1.9.8 rc 071223
-
-* Tue Dec 18 2007 Mamoru Tasaka <mtasaka@ioa.s.u-tokyo.ac.jp> - 1.9.8-0.4,beta071218
-- 1.9.8 beta 071218
-
-* Mon Dec 10 2007 Mamoru Tasaka <mtasaka@ioa.s.u-tokyo.ac.jp> - 1.9.8-0.3.beta071210
-- 1.9.8 beta 071210
-
-* Sun Dec 9 2007 Mamoru Tasaka <mtasaka@ioa.s.u-tokyo.ac.jp>
-- Switch from openssl to gnutls
-
-* Thu Nov 22 2007 Mamoru Tasaka <mtasaka@ioa.s.u-tokyo.ac.jp> - 1.9.7-1
-- 1.9.7
-
-* Thu Nov 15 2007 Mamoru Tasaka <mtasaka@ioa.s.u-tokyo.ac.jp> - 1.9.7-0.4.rc071105
-- 1.9.7 rc 071115
-
-* Fri Nov 9 2007 Mamoru Tasaka <mtasaka@ioa.s.u-tokyo.ac.jp> - 1.9.7-0.3.beta071109
-- 1.9.7 beta 071109
-
-* Fri Nov 2 2007 Mamoru Tasaka <mtasaka@ioa.s.u-tokyoa.c.jp> - 1.9.7-0.2.beta071101
-- 1.9.7 beta 071101
-
-* Fri Oct 5 2007 Mamoru Tasaka <mtasaka@ioa.s.u-tokyo.ac.jp> - 1.9.6-1
-- 1.9.6
-
-* Sun Sep 30 2007 Mamoru Tasaka <mtasaka@ioa.s.u-tokyo.ac.jp> - 1.9.6-0.6.rc070930
-- 1.9.6 rc 070930
-
-* Tue Sep 18 2007 Mamoru Tasaka <mtasaka@ioa.s.u-tokyo.ac.jp> - 1.9.6-0.5.beta070918
-- 1.9.6 beta 070918
-
-* Sun Aug 5 2007 Mamoru Tasaka <mtasaka@ioa.s.u-tokyo.ac.jp> - 1.9.6-0.2.beta070804
-- 1.9.6 beta 070804 release 2
-
-* Sat Aug 4 2007 Mamoru Tasaka <mtasaka@ioa.s.u-tokyo.ac.jp> - 1.9.6-0.1.beta070804
-- 1.9.6 beta 070804
-
-* Sat Jun 30 2007 Mamoru Tasaka <mtasaka@ioa.s.u-tokyo.ac.jp> - 1.9.5-1
-- 1.9.5
-
-* Mon Jun 25 2007 Mamoru Tasaka <mtasaka@ioa.s.u-tokyo.ac.jp> - 1.9.5-0.6.rc070625
-- 1.9.5 rc 070625
-
-* Sat Jun 16 2007 Mamoru Tasaka <mtasaka@ioa.s.u-tokyo.ac.jp> - 1.9.5-0.5.beta070616
-- 1.9.5 beta 070616
-
-* Mon Jun 11 2007 Mamoru Tasaka <mtasaka@ioa.s.u-tokyo.ac.jp> - 1.9.5-0.4.beta070611
-- 1.9.5 beta 070611
-
-* Mon May 28 2007 Mamoru Tasaka <mtasaka@ioa.s.u-tokyo.ac.jp> - 1.9.5-0.3.beta070528
-- 1.9.5 beta 070528
-
-* Tue May 22 2007 Mamoru Tasaka <mtasaka@ioa.s.u-tokyo.ac.jp> - 1.9.5-0.2.beta070516
-- Support C/Migemo search
-
-* Tue May 15 2007 Mamoru Tasaka <mtasaka@ioa.s.u-tokyo.ac.jp> - 1.9.5-0.1.beta070516
-- 1.9.5 beta 070516
-
-* Tue Apr 3 2007 Mamoru Tasaka <mtasaka@ioa.s.u-tokyo.ac.jp> - 1.8.8-1
-- 1.8.8
-
-* Fri Mar 30 2007 Mamoru Tasaka <mtasaka@ioa.s.u-tokyo.ac.jp> - 1.8.8-0.3.rc070330
-- 1.8.8 rc 070330
-
-* Fri Mar 23 2007 Mamoru Tasaka <mtasaka@ioa.s.u-tokyo.ac.jp> - 1.8.8-0.3.beta070324
-- 1.8.8 beta 070324
-
-* Sat Mar 17 2007 Mamoru Tasaka <mtasaka@ioa.s.u-tokyo.ac.jp> - 1.8.8-0.2.beta070317
-- 1.8.8 beta 070317
-
-* Sun Feb 18 2007 Mamoru Tasaka <mtasaka@ioa.s.u-tokyo.ac.jp> - 1.8.8-0.1.beta070218
-- 1.8.8 beta 070218
-
-* Fri Feb 2 2007 Mamoru Tasaka <mtasaka@ioa.s.u-tokyo.ac.jp> - 1.8.5-1
-- 1.8.5
-
-* Sun Jan 21 2007 Mamoru Tasaka <mtasaka@ioa.s.u-tokyo.ac.jp> - 1.8.5-0.3.rc071121
-- 1.8.5 rc 071121
-
-* Sun Jan 14 2007 Mamoru Tasaka <mtasaka@ioa.s.u-tokyo.ac.jp> - 1.8.5-0.3.beta071114
-- 1.8.5 beta 070114
-
-* Sun Jan 7 2007 Mamoru Tasaka <mtasaka@ioa.s.u-tokyo.ac.jp> - 1.8.5-0.2.beta061227
-- Add fix for zero-inserted dat problem
-
-* Tue Dec 26 2006 Mamoru Tasaka <mtasaka@ioa.s.u-tokyo.ac.jp> - 1.8.5-0.1.beta061227
-- 1.8.5 beta 061227
-
-* Sun Dec 17 2006 Mamoru Tasaka <mtasaka@ioa.s.u-tokyo.ac.jp> - 1.8.1-1
-- 1.8.1
-
-* Tue Dec 12 2006 Mamoru Tasaka <mtasaka@ioa.s.u-tokyo.ac.jp> - 1.8.1-0.2.rc061213
-- 1.8.1 rc 061213
-
-* Sat Dec 2 2006 Mamoru Tasaka <mtasaka@ioa.s.u-tokyo.ac.jp> - 1.8.1-0.2.beta061202
-- 1.8.1 beta 061202
-
-* Tue Nov 14 2006 Mamoru Tasaka <mtasaka@ioa.s.u-tokyo.ac.jp> - 1.8.0-1
-- 1.8.0
-
-* Wed Nov 8 2006 Mamoru Tasaka <mtasaka@ioa.s.u-tokyo.ac.jp> - 1.8.0-0.5.rc061108
-- 1.8.0 rc 061108
-
-* Fri Nov 3 2006 Mamoru Tasaka <mtasaka@ioa.s.u-tokyo.ac.jp> - 1.8.0-0.5.beta061103
-- 1.8.0 beta 061103
-
-* Sat Oct 28 2006 Mamoru Tasaka <mtasaka@ioa.s.u-tokyo.ac.jp> - 1.8.0-0.4.cvs061028
-- Detect libSM and libICE for x86_64.
-- cvs 061028 (23:59 JST)
-
-* Wed Oct 25 2006 Mamoru Tasaka <mtasaka@ioa.s.u-tokyo.ac.jp> - 1.8.0-0.3.beta061023
-- Remove some category from desktop files due to
- desktop-file-utils change.
-
-* Tue Oct 24 2006 Mamoru Tasaka <mtasaka@ioa.s.u-tokyo.ac.jp> - 1.8.0-0.2.beta061023
-- 1.8.0 beta 061023
-
-* Sun Oct 22 2006 Mamoru Tasaka <mtasaka@ioa.s.u-tokyo.ac.jp> - 1.8.0-0.1.cvs061022
-- cvs 061022 (23:59 JST)
-
-* Mon Oct 9 2006 Mamoru Tasaka <mtasaka@ioa.s.u-tokyo.ac.jp> - 1.8.0-0.1.beta061009
-- 1.8.0 beta 061009
-
-* Sat Oct 7 2006 Mamoru Tasaka <mtasaka@ioa.s.u-tokyo.ac.jp> - 1.7.0-2
-- Add libSM-devel to BuildRequires.
-
-* Wed Sep 27 2006 Mamoru Tasaka <mtasaka@ioa.s.u-tokyo.ac.jp> - 1.7.0-1
-- 1.7.0
-
-* Mon Sep 25 2006 Mamoru Tasaka <mtasaka@ioa.s.u-tokyo.ac.jp> - 1.7.0-0.1.rc060921
-- Import to Fedora Extras.
-
-* Sun Mar 9 2006 Houritsuchu <houritsuchu@hotmail.com>
-- Version up.
-- add icon
-
-* Sat Feb 25 2006 Houritsuchu <houritsuchu@hotmail.com>
-- first
diff --git a/rubygem-nokogiri.spec b/rubygem-nokogiri.spec
new file mode 100644
index 0000000..80c843f
--- /dev/null
+++ b/rubygem-nokogiri.spec
@@ -0,0 +1,190 @@
+%define ruby_sitelib %(ruby -rrbconfig -e "puts Config::CONFIG['sitelibdir']")
+%define ruby_sitearch %(ruby -rrbconfig -e "puts Config::CONFIG['sitearchdir']")
+%define rubyabi 1.8
+
+%define gemdir %(ruby -rubygems -e 'puts Gem::dir' 2>/dev/null)
+%define gemname nokogiri
+%define geminstdir %{gemdir}/gems/%{gemname}-%{version}
+
+Summary: An HTML, XML, SAX, and Reader parser
+Name: rubygem-%{gemname}
+Version: 1.1.1
+Release: 1%{?dist}
+Group: Development/Languages
+License: MIT
+URL: http://nokogiri.rubyforge.org/nokogiri/
+Source0: http://gems.rubyforge.org/gems/%{gemname}-%{version}.gem
+
+BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
+BuildRequires: ruby(abi) = %{rubyabi}
+BuildRequires: ruby(rubygems)
+BuildRequires: rubygem(rake)
+BuildRequires: libxml2-devel
+BuildRequires: libxslt-devel
+BuildRequires: ruby-devel
+Requires: ruby(abi) = %{rubyabi}
+Requires: ruby(rubygems)
+Provides: rubygem(%{gemname}) = %{version}-%{release}
+
+%description
+Nokogiri parses and searches XML/HTML very quickly, and also has
+correctly implemented CSS3 selector support as well as XPath support.
+
+Nokogiri also features an Hpricot compatibility layer to help ease the change
+to using correct CSS and XPath.
+
+%package doc
+Summary: Documentation for %{name}
+Group: Documentation
+# Directory ownership issue
+Requires: %{name} = %{version}-%{release}
+Requires: ruby(rubygems)
+
+%description doc
+This package contains documentation for %{name}.
+
+%package -n ruby-%{gemname}
+Summary: Non-Gem support package for %{gemname}
+Group: Development/Languages
+Requires: %{name} = %{version}-%{release}
+Provides: ruby(%{gemname}) = %{version}-%{release}
+
+%description -n ruby-%{gemname}
+This package provides non-Gem support for %{gemname}.
+
+%prep
+%setup -q -T -c
+
+%build
+mkdir -p ./%{gemdir}
+export CONFIGURE_ARGS="--with-cflags='%{optflags}'"
+gem install \
+ --local \
+ --install-dir ./%{gemdir} \
+ -V --force \
+ %{SOURCE0}
+
+# cflags wrong (-O3 passed), recompiling
+pushd ./%{geminstdir}
+sed -i.flags -e 's|-O3||' ext/nokogiri/extconf.rb
+find . -name \*.so -or -name \*.o -exec rm -f {} \;
+rake -v ext/nokogiri/native.so
+
+%install
+rm -rf %{buildroot}
+mkdir -p %{buildroot}%{gemdir}
+cp -a ./%{gemdir}/* %{buildroot}%{gemdir}
+
+# move arch dependent files to %%ruby_sitearch
+mkdir -p %{buildroot}%{ruby_sitearch}/%{gemname}
+mv %{buildroot}%{geminstdir}/lib/%{gemname}/*.so \
+ %{buildroot}%{ruby_sitearch}/%{gemname}/
+
+# remove all shebang
+for f in $(find %{buildroot}%{geminstdir} -name \*.rb)
+do
+ sed -i -e '/^#!/d' $f
+ chmod 0644 $f
+done
+
+# cleanups
+rm -rf %{buildroot}%{geminstdir}/ext
+rm -f %{buildroot}%{geminstdir}/{.require_paths,Rakefile}
+
+# only needed by Rakefile, removing
+## First remove only files, then check if the directory
+## is empty
+rm -f %{buildroot}/%{geminstdir}/vendor/hoe.rb
+rmdir %{buildroot}/%{geminstdir}/vendor/
+
+# The following method is completely copied from rubygem-gettext
+# spec file
+#
+# Create symlinks
+##
+## Note that before switching to gem %%{ruby_sitelib}/%%{gemname}
+## 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
+
+}
+
+create_symlink_rec %{geminstdir}/lib %{ruby_sitelib}
+
+
+%clean
+rm -rf %{buildroot}
+
+%files
+%defattr(-,root, root,-)
+%{ruby_sitearch}/%{gemname}/
+%dir %{geminstdir}/
+%doc %{geminstdir}/[A-Z]*
+%{geminstdir}/[a-l]*/
+%{gemdir}/cache/%{gemname}-%{version}.gem
+%{gemdir}/specifications/%{gemname}-%{version}.gemspec
+
+%files doc
+%defattr(-,root,root,-)
+%{geminstdir}/test/
+%{gemdir}/doc/%{gemname}-%{version}/
+
+%files -n ruby-%{gemname}
+%defattr(-,root,root,-)
+%{ruby_sitelib}/*%{gemname}.rb
+%{ruby_sitelib}/%{gemname}/
+
+%changelog
+* Thu Jan 15 2009 Mamoru Tasaka <mtasaka@ioa.s.u-tokyo.ac.jp> - 1.1.1-1
+- 1.1.1
+
+* Thu Dec 25 2008 Mamoru Tasaka <mtasaka@ioa.s.u-tokyo.ac.jp> - 1.1.0-1
+- Initial packaging
+