Blob Blame History Raw
%global	header_dir	%{ruby_vendorarchdir}
%global	gem_name	gdk3
%global	glib_min_ver	2.0.0

# Planned for F-20+ only
Summary:	Ruby binding of GDK-3.x
Name:		rubygem-%{gem_name}
Version:	2.0.2
Release:	2%{?dist}

Group:		Development/Languages
# Various files in gem
License:	LGPLv2+
# Renamed to avoid overwrite on SOURCE dir
Source1:	COPYING.LIB.gdk3
Patch0:	rubygem-gdk3-2.0.2-rgba-rounding.patch

# MRI only
Requires:	ruby
BuildRequires:	ruby

Requires:	ruby(rubygems) 
Requires:	rubygem(glib2) >= %{glib_min_ver}
Requires:	rubygem(atk)
Requires:	rubygem(pango)
Requires:	rubygem(gdk_pixbuf2)
BuildRequires:	ruby-devel
BuildRequires:	rubygems-devel
BuildRequires:	rubygem-glib2-devel >= %{glib_min_ver}
BuildRequires:	rubygem-pango-devel
BuildRequires:	gtk3-devel
# %%check
BuildRequires:	rubygem(gdk_pixbuf2)
BuildRequires:	rubygem(test-unit)
BuildRequires:	rubygem(test-unit-notify)
Provides:	rubygem(%{gem_name}) = %{version}-%{release}

Ruby/GDK3 is a Ruby binding of GDK-3.x.

%package	devel
Summary:	Ruby/GLib development environment
Group:		Development/Languages
Requires:	%{name}%{?isa} = %{version}-%{release}
Requires:	gtk3-devel%{?isa}
Requires:	ruby-devel%{?isa}

%description devel
Header files and libraries for building a extension library for the

%package	doc
Summary:	Documentation for %{name}
Group:		Documentation
Requires:	%{name} = %{version}-%{release}
BuildArch:	noarch

%description doc
Documentation for %{name}

%setup -q -c -T

mkdir tmpunpackdir
pushd tmpunpackdir

gem unpack %{SOURCE0}
cd %{gem_name}-%{version}

# Patches
%patch0 -p2

# Permission
find . -name \*.rb -print0 | xargs --null chmod 0644

gem specification -l --ruby %{SOURCE0} > %{gem_name}.gemspec

# Add license text
install -cpm 644 %{SOURCE1} ./COPYING.LIB
sed -i -e '/files =/s|\("Rakefile",\)|\1 "COPYING.LIB", |' \

gem build %{gem_name}.gemspec
mv %{gem_name}-%{version}.gem $TOPDIR

rm -rf tmpunpackdir

mkdir -p .%{gem_dir}

export CONFIGURE_ARGS="--with-cflags='%{optflags} -Werror-implicit-function-declaration'"
export CONFIGURE_ARGS="$CONFIGURE_ARGS --with-pkg-config-dir=$(pwd)%{_libdir}/pkgconfig"

mkdir -p %{buildroot}%{gem_dir}
cp -a .%{gem_dir}/* \

# move header files, C extension files to the correct directory
pushd %{buildroot}

mkdir -p .%{header_dir}
mv .%{gem_instdir}/lib/*.h .%{header_dir}/

mkdir -p .%{gem_extdir_mri}/lib
mv .%{gem_instdir}/lib/%{gem_name}.so .%{gem_extdir_mri}/lib/

# move pkgconfig file
mkdir %{buildroot}%{_libdir}/pkgconfig
install -cpm 644 ./%{_libdir}/pkgconfig/*.pc \

# Cleanups
pushd %{buildroot}
rm -rf .%{gem_instdir}/ext/
rm -f .%{gem_instdir}/extconf.rb

pushd .%{gem_instdir}

# kill unneeded make process
rm -rf ./TMPBINDIR
ln -sf /bin/true make
export PATH=$(pwd):$PATH

ruby -Ilib:test ./test/run-test.rb


%doc	%{gem_instdir}/[A-Z]*
%exclude	%{gem_instdir}/Rakefile
%dir	%{gem_instdir}/
%dir	%{gem_instdir}/lib/
%dir	%{gem_instdir}/lib/%{gem_name}/

%dir	%{gem_extdir_mri}/
%dir	%{gem_extdir_mri}/lib/

%exclude %{gem_cache}

%files	devel

%files	doc
%doc	%{gem_docdir}/
%exclude	%{gem_instdir}/test/

* Thu Sep 19 2013 Mamoru TASAKA <> - 2.0.2-2
- Patch from upstream to fix TestGdkRGBA

* Sun Aug 25 2013 Mamoru TASAKA <> - 2.0.2-1
- 2.0.2

* Mon Apr 29 2013 Mamoru TASAKA <> - 1.2.6-1
- 1.2.6

* Fri Mar 22 2013 Mamoru TASAKA <> - 1.2.3-1
- 1.2.3

* Mon Feb 18 2013 Mamoru TASAKA <> - 1.2.1-1
- Initial package