[rubygem-glib2] Initial import
Mamoru Tasaka
mtasaka at fedoraproject.org
Thu Oct 7 06:47:04 UTC 2010
commit 65e789613d79dfe5cd2373b2d7aa023c85ec3f60
Author: Mamoru Tasaka <tasaka1 at localhost.localdomain>
Date: Thu Oct 7 15:47:09 2010 +0900
Initial import
.gitignore | 1 +
rubygem-glib2.spec | 269 ++++++++++++++++++++++++++++++++++++++++++++++++++++
sources | 1 +
3 files changed, 271 insertions(+), 0 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index e69de29..f95aae0 100644
--- a/.gitignore
+++ b/.gitignore
@@ -0,0 +1 @@
+/glib2-0.90.2.gem
diff --git a/rubygem-glib2.spec b/rubygem-glib2.spec
new file mode 100644
index 0000000..8330a26
--- /dev/null
+++ b/rubygem-glib2.spec
@@ -0,0 +1,269 @@
+%global ruby_sitelib %(ruby -rrbconfig -e "puts Config::CONFIG['sitelibdir']")
+%global ruby_sitearch %(ruby -rrbconfig -e "puts Config::CONFIG['sitearchdir']")
+
+%global gemdir %(ruby -rubygems -e 'puts Gem::dir' 2>/dev/null)
+%global gemname glib2
+%global geminstdir %{gemdir}/gems/%{gemname}-%{version}
+
+%global rubyabi 1.8
+
+Summary: Ruby binding of GLib-2.x
+Name: rubygem-%{gemname}
+Version: 0.90.2
+Release: 6%{?dist}
+Group: Development/Languages
+# from README
+License: LGPLv2
+URL: http://ruby-gnome2.sourceforge.jp/
+Source0: http://rubygems.org/gems/%{gemname}-%{version}.gem
+
+BuildRequires: ruby(abi) = %{rubyabi}
+BuildRequires: rubygems
+BuildRequires: rubygem(pkg-config)
+BuildRequires: ruby-devel
+BuildRequires: glib2-devel
+BuildRequires(check): rubygem(test-unit)
+Requires: ruby(abi) = %{rubyabi}
+Requires: rubygems
+# Ruby-GetText-Package support in glib2.rb
+Requires: rubygem(gettext)
+# If someone uses gnome2-win32-binary-downloader.rb, please explicitly
+# require the following by yourself
+#Requires: rubygem(mechanize)
+Provides: rubygem(%{gemname}) = %{version}
+
+%description
+Ruby/GLib2 is a Ruby binding of GLib-2.x.
+
+%package doc
+Summary: Documentation for %{name}
+Group: Documentation
+Requires: %{name} = %{version}-%{release}
+
+%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}
+# Requires for corresponsing non-gem rpms
+Requires: ruby(gettext-package)
+Provides: ruby(%{gemname}) = %{version}-%{release}
+
+%description -n ruby-%{gemname}
+This package provides non-Gem support for %{gemname}.
+
+%package devel
+Summary: Ruby/GLib development environment
+Group: Development/Languages
+Requires: %{name} = %{version}-%{release}
+Requires: glib2-devel
+Requires: ruby-devel
+# mkmf-gnome2.rb
+Requires: rubygem(pkg-config)
+# Not needed
+#Requires: rubygem(cairo)
+# Obsoletes / Provides
+# ruby(%%{gemname}-devel) Provides is for compatibility
+Obsoletes: ruby-%{gemname}-devel < 0.90.2-3.999
+Provides: ruby-%{gemname}-devel = %{version}-%{release}
+Provides: ruby(%{gemname}-devel) = %{version}-%{release}
+
+%description devel
+Header files and libraries for building a extension library for the
+rubygem-%{gemname}
+
+%prep
+%setup -q -c -T
+mkdir -p .%{gemdir}
+
+export DESTDIR=$(pwd)/TMPINSTDIR
+export CONFIGURE_ARGS="--with-cflags='%{optflags}'"
+gem install \
+ -V \
+ --local \
+ --install-dir .%{gemdir} \
+ --force \
+ --rdoc \
+ %{SOURCE0}
+
+find . -name \*.gem | xargs chmod 0644
+
+# Remove completely unneeded files
+pushd .%{geminstdir}
+# Remove vendorlized one (already packaged)
+rm -rf test-unit/
+sed -i \
+ -e '2a require "rubygems"\ngem "test-unit"\n' \
+ test/run-test.rb
+
+# shebang issue
+find sample/ test/ -name \*.rb | xargs chmod 0644
+grep -rl '#![ ]*/usr' sample/ test/ | \
+ xargs chmod 0755
+
+%build
+
+%install
+rm -rf %{buildroot}
+
+# Once copy all
+mkdir -p %{buildroot}%{gemdir}
+cp -a .%{gemdir}/* \
+ %{buildroot}%{gemdir}/
+
+pushd %{buildroot}
+# move header files, C extension files to the correct directory
+mkdir -p .%{ruby_sitearch}
+mv .%{geminstdir}/lib/*.h .%{ruby_sitearch}/
+mv .%{geminstdir}/lib/%{gemname}.so .%{ruby_sitearch}/
+popd
+
+# move pkgconfig file
+mkdir %{buildroot}%{_libdir}/pkgconfig
+install -cpm 644 TMPINSTDIR/%{_libdir}/pkgconfig/*.pc \
+ %{buildroot}%{_libdir}/pkgconfig/
+
+
+# Cleanups
+pushd %{buildroot}
+rm -rf .%{geminstdir}/ext/
+rm -f .%{geminstdir}/extconf.rb
+popd
+
+# 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}
+
+%check
+pushd .%{geminstdir}
+
+# Kill unneeded make process
+mkdir -p TMPBINDIR
+pushd TMPBINDIR
+ln -sf /bin/true make
+export PATH=$(pwd):$PATH
+popd
+
+ruby ./test/run-test.rb
+popd
+
+%clean
+rm -rf %{buildroot}
+
+%files
+%defattr(-,root,root,-)
+%dir %{geminstdir}
+%dir %{geminstdir}/lib/
+
+%doc %{geminstdir}/[A-Z]*
+%exclude %{geminstdir}/Rakefile
+
+%{geminstdir}/lib/glib2.rb
+%{geminstdir}/lib/glib-mkenums.rb
+%{geminstdir}/lib/gnome2-win32-binary-downloader.rb
+%{ruby_sitearch}/%{gemname}.so
+
+%{gemdir}/cache/%{gemname}-%{version}.gem
+%{gemdir}/specifications/%{gemname}-%{version}.gemspec
+
+%files -n ruby-%{gemname}
+%defattr(-,root,root,-)
+%{ruby_sitelib}/*.rb
+%exclude %{ruby_sitelib}/mkmf-gnome2.rb
+
+%files devel
+%defattr(-,root,root,-)
+# Using pkg-config and mkmf, let's move mkmf-gnome2.rb into -devel
+%{geminstdir}/lib/mkmf-gnome2.rb
+%{ruby_sitelib}/mkmf-gnome2.rb
+
+%{ruby_sitearch}/rbgcompat.h
+%{ruby_sitearch}/rbglib.h
+%{ruby_sitearch}/rbgobject.h
+%{ruby_sitearch}/rbgutil.h
+%{ruby_sitearch}/glib-enum-types.h
+%{_libdir}/pkgconfig/ruby-%{gemname}.pc
+
+%files doc
+%defattr(-,root,root,-)
+%{gemdir}/doc/%{gemname}-%{version}
+%{geminstdir}/Rakefile
+%{geminstdir}/sample/
+%{geminstdir}/test/
+
+
+%changelog
+* Fri Oct 1 2010 Mamoru Tasaka <mtasaka at ioa.s.u-tokyo.ac.jp> - 0.90.2-6
+- Fix up summary
+
+* Fri Oct 1 2010 Mamoru Tasaka <mtasaka at ioa.s.u-tokyo.ac.jp> - 0.90.2-5
+- Use formally released gem file
+
+* Tue Sep 28 2010 Mamoru Tasaka <mtasaka at ioa.s.u-tokyo.ac.jp> - 0.90.2-4
+- Modify Obsoletes
+- Fix %%description
+
+* Mon Sep 27 2010 Mamoru Tasaka <mtasaka at ioa.s.u-tokyo.ac.jp> - 0.90.2-2
+- 0.90.2 released, release bump
+
+* Sun Sep 26 2010 Mamoru Tasaka <mtasaka at ioa.s.u-tokyo.ac.jp> - 0.90.2-0.1
+- Initial package
diff --git a/sources b/sources
index e69de29..9fdccf3 100644
--- a/sources
+++ b/sources
@@ -0,0 +1 @@
+d64fb6f1635265777e10e7314911a06e glib2-0.90.2.gem
More information about the scm-commits
mailing list