[rubygem-xmlparser/f17] new version following new rubygem packaging guidelines

Ulrich Schwickerath schwicke at fedoraproject.org
Thu Apr 26 10:48:01 UTC 2012


commit 2fa3f7767239222b51cdba597594e8cc83bfa2ad
Author: Ulrich Schwickerath <Ulrich.Schwickerath at cern.ch>
Date:   Thu Apr 26 12:47:25 2012 +0200

    new version following new rubygem packaging guidelines

 .gitignore             |    1 +
 rubygem-xmlparser.spec |   64 +++++++++++++++++++++++++----------------------
 sources                |    2 +-
 3 files changed, 36 insertions(+), 31 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index f39540e..1f72df0 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1 +1,2 @@
 /xmlparser-0.7.2.gem
+/xmlparser-0.7.2.1.gem
diff --git a/rubygem-xmlparser.spec b/rubygem-xmlparser.spec
index d0b6f79..52fd3b3 100644
--- a/rubygem-xmlparser.spec
+++ b/rubygem-xmlparser.spec
@@ -1,7 +1,4 @@
-%{!?ruby_sitelib: %global ruby_sitearch %(ruby -rrbconfig -e "puts Config::CONFIG['sitearchdir']")}
-%global gemdir %(ruby -rubygems -e 'puts Gem::dir' 2>/dev/null)
-%global gemname xmlparser
-%global geminstdir %{gemdir}/gems/%{gemname}-%{version}
+%global gem_name xmlparser
 
 %if 0%{?fedora} >= 17
 %global rubyabi 1.9.1
@@ -10,18 +7,17 @@
 %endif
 
 Summary: Ruby bindings to the Expat XML parsing library
-Name: rubygem-%{gemname}
-Version: 0.7.2
-Release: 1%{?dist}
+Name: rubygem-%{gem_name}
+Version: 0.7.2.1
+Release: 3%{?dist}
 Group: Development/Languages
 # src/lib/xml/xpath.rb is GPLv2+
 # src/ext/encoding.h and the functions of encoding map are GPLv2+ or Artistic
 # All other files are Ruby or GPLv2+ or MIT
 # For a breakdown of the licensing, see also README
 License: GPLv2+ and ( Ruby or GPLv2+ or MIT ) and ( GPLv2+ or Artistic ) 
-URL: http://www.yoshidam.net/Ruby.html#xmlparser
-#Source0: http://gems.rubyforge.org/gems/%{gemname}-%{version}.gem
-Source0: https://uschwick.web.cern.ch/uschwick/software/%{gemname}-%{version}.gem
+URL: http://rubygems.org/gems/xmlparser
+Source0: http://gems.rubyforge.org/gems/%{gem_name}-%{version}.gem
 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 Requires: ruby
 Requires: ruby(rubygems)
@@ -30,35 +26,35 @@ BuildRequires: ruby
 BuildRequires: ruby(rubygems)
 BuildRequires: ruby(abi) = %{rubyabi}
 BuildRequires: ruby-devel
+BuildRequires: rubygems-devel
 BuildRequires: rubygem(rake)
 BuildRequires: rubygem(mkrf)
 BuildRequires: expat-devel
-Provides: rubygem(%{gemname}) = %{version}
+Provides: rubygem(%{gem_name}) = %{version}
 
 %description
 Ruby bindings to the Expat XML parsing library. 
 
 %prep
 %setup -q -c -T 
-cp %{SOURCE0} %{gemname}-%{version}.gem
+cp %{SOURCE0} %{gem_name}-%{version}.gem
 
 %build
-mkdir -p .%{gemdir}
+mkdir -p .%{gem_dir}
 export CONFIGURE_ARGS="--with-cflags='%{optflags}'"
-gem install -V --local --install-dir $(pwd)/%{gemdir} --no-rdoc --no-ri --force %{gemname}-%{version}.gem
+gem install -V --local --install-dir ./%{gem_dir} --bindir ./%{_bindir} --no-rdoc --no-ri --force %{gem_name}-%{version}.gem
 
 %install
 rm -rf %{buildroot}
-mkdir -p %{buildroot}%{gemdir}
-cp -rp .%{gemdir}/* %{buildroot}%{gemdir}
+mkdir -p %{buildroot}%{gem_dir}
+cp -rp .%{gem_dir}/* %{buildroot}%{gem_dir}/
 
-# Arch dependent files go here
-mkdir -p %{buildroot}%{ruby_sitearch}
+# remove development stuff
+rm -rf %{buildroot}%{gem_instdir}/ext
 
-# for this package the .so file need to be in the ruby_sitearch directory (rather than %{ruby_sitearch}/lib) else the library is not found
-mv %{buildroot}%{geminstdir}/xmlparser.so %{buildroot}%{ruby_sitearch}
-
-rm -f %{buildroot}%{geminstdir}/mkmf.log
+# install externals
+mkdir -p %{buildroot}%{gem_extdir}/lib
+mv %{buildroot}%{gem_instdir}/lib/*.so %{buildroot}%{gem_extdir}/lib
 
 %clean
 rm -rf %{buildroot}
@@ -66,14 +62,22 @@ rm -rf %{buildroot}
 
 %files
 %defattr(-, root, root, -)
-%{ruby_sitearch}/xmlparser.so
-%dir %{gemdir}/gems/%{gemname}-%{version}/
-%doc %{gemdir}/gems/%{gemname}-%{version}/[A-Z]*
-%{gemdir}/gems/%{gemname}-%{version}/[a-z]*
-%{gemdir}/cache/%{gemname}-%{version}.gem
-%{gemdir}/specifications/%{gemname}-%{version}.gemspec
+%{gem_extdir}/lib/xmlparser.so
+%dir %{gem_instdir}/
+%doc %{gem_instdir}/[A-Z]*
+%{gem_instdir}/[a-z]*
+%exclude %{gem_cache}
+%{gem_spec}
 
 %changelog
+* Thu Apr 26 2012 Ulrich Schwickerath <ulrich.schwickerath at web.de> - 0.7.2.1-3
+- sync with updated gem version from rubyforge instead of private copy
+- use macros for files section
+- cleanup macros in changelog section to make rpmlint happy
+
+* Wed Apr 25 2012 Ulrich Schwickerath <ulrich.schwickerath at web.de> - 0.7.2-2
+- use macros following the new gem packaging guidelines for fed17+
+
 * Tue Mar 20 2012 Ulrich Schwickerath <ulrich.schwickerath at web.de> - 0.7.2-1
 - spec file patch to support fedora 17+
 - update to 0.7.2 from Yoshidam
@@ -82,12 +86,12 @@ rm -rf %{buildroot}
 - replace build requirement for ruby-libs by ruby 
 
 * Wed Dec 07 2011 Ulrich Schwickerath <ulrich.schwickerath at web.de> - 0.6.81-8
-- remove the link to xmlparser.so and move it to  %{ruby_sitearch}
+- remove the link to xmlparser.so and move it to ruby_sitearch
 
 * Wed Dec 07 2011 Ulrich Schwickerath <ulrich.schwickerath at web.de> - 0.6.81-7
 - fix for /usr/lib/ruby/gems/1.8/gems/xmlparser-0.6.81 should be owned by the package
 - fix installation path for .so files
-- add dependency on ruby-libs which owns the %{ruby_sitearch} directory
+- add dependency on ruby-libs which owns the ruby_sitearch directory
 
 * Wed Jul 12 2011 Ulrich Schwickerath <ulrich.schwickerath at web.de> - 0.6.81-6
 - add more details about licensing
diff --git a/sources b/sources
index c34d1ab..94b83af 100644
--- a/sources
+++ b/sources
@@ -1 +1 @@
-612952fa33d5670d7073807715b01610  xmlparser-0.7.2.gem
+c5634cace66cb2542463ce698cc041e5  xmlparser-0.7.2.1.gem


More information about the scm-commits mailing list