192 lines
4.6 KiB
RPMSpec
192 lines
4.6 KiB
RPMSpec
%global header_dir %{ruby_vendorarchdir}
|
|
%global gem_name gtk3
|
|
%global glib_min_ver 2.2.0
|
|
|
|
# Planned for F-20+ only
|
|
Summary: Ruby/GTK3 is a Ruby binding of GTK+-3.x
|
|
Name: rubygem-%{gem_name}
|
|
Version: 2.2.0
|
|
Release: 2%{?dist}
|
|
|
|
Group: Development/Languages
|
|
# Various files in gem
|
|
License: LGPLv2+
|
|
URL: http://ruby-gnome2.sourceforge.jp/
|
|
Source0: https://rubygems.org/gems/%{gem_name}-%{version}.gem
|
|
# https://raw.github.com/ruby-gnome2/ruby-gnome2/master/gtk3/COPYING.LIB
|
|
# Renamed to avoid overwrite on SOURCE dir
|
|
Source1: COPYING.LIB.gtk3
|
|
# MRI only
|
|
Requires: ruby
|
|
BuildRequires: ruby
|
|
|
|
Requires: ruby(rubygems)
|
|
BuildRequires: ruby-devel
|
|
BuildRequires: rubygems-devel
|
|
BuildRequires: rubygem-cairo-devel
|
|
BuildRequires: rubygem-gdk_pixbuf2-devel
|
|
BuildRequires: rubygem-gdk3-devel
|
|
BuildRequires: rubygem-gio2
|
|
BuildRequires: rubygem-glib2-devel >= %{glib_min_ver}
|
|
BuildRequires: rubygem-pango-devel
|
|
BuildRequires: gtk3-devel
|
|
# %%check
|
|
BuildRequires: rubygem(atk)
|
|
BuildRequires: rubygem(test-unit)
|
|
BuildRequires: rubygem(test-unit-notify)
|
|
# Needs X
|
|
BuildRequires: xorg-x11-server-Xvfb
|
|
# Icon for face-cool
|
|
BuildRequires: gnome-icon-theme
|
|
# gtkrc
|
|
BuildRequires: adwaita-gtk2-theme
|
|
# "actions/find"
|
|
BuildRequires: gnome-icon-theme-legacy
|
|
Provides: rubygem(%{gem_name}) = %{version}-%{release}
|
|
|
|
%description
|
|
Ruby/GTK3 is a Ruby binding of GTK+-3.x.
|
|
|
|
%package devel
|
|
Summary: Ruby/GTK3 development environment
|
|
Group: Development/Languages
|
|
Requires: %{name}%{?_isa} = %{version}-%{release}
|
|
Requires: gtk3-devel%{?_isa}
|
|
Requires: rubygem-glib2-devel%{?_isa}
|
|
|
|
%description devel
|
|
Header files and libraries for building a extension library for the
|
|
rubygem-%{gem_name}
|
|
|
|
%package doc
|
|
Summary: Documentation for %{name}
|
|
Group: Documentation
|
|
Requires: %{name} = %{version}-%{release}
|
|
BuildArch: noarch
|
|
|
|
%description doc
|
|
Documentation for %{name}
|
|
|
|
%prep
|
|
%setup -q -c -T
|
|
|
|
TOPDIR=$(pwd)
|
|
mkdir tmpunpackdir
|
|
pushd tmpunpackdir
|
|
|
|
gem unpack %{SOURCE0}
|
|
cd %{gem_name}-%{version}
|
|
|
|
# Permission
|
|
find . -name \*.rb -print0 | xargs --null chmod 0644
|
|
|
|
gem specification -l --ruby %{SOURCE0} > %{gem_name}.gemspec
|
|
|
|
# Allow ruby-gnome2 no less than ones
|
|
sed -i -e 's|= 2\.2\.0|>= 2.2.0|' %{gem_name}.gemspec
|
|
|
|
# shebang
|
|
grep -rIl --null '/usr/bin/env' lib/ | \
|
|
xargs --null sed -i -e '\@/usr/bin/env@d'
|
|
|
|
# Add license text
|
|
install -cpm 644 %{SOURCE1} ./COPYING.LIB
|
|
sed -i -e '/files =/s|\("Rakefile",\)|\1 "COPYING.LIB", |' \
|
|
%{gem_name}.gemspec
|
|
|
|
gem build %{gem_name}.gemspec
|
|
mv %{gem_name}-%{version}.gem $TOPDIR
|
|
|
|
popd
|
|
rm -rf tmpunpackdir
|
|
|
|
%build
|
|
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"
|
|
%gem_install
|
|
|
|
%install
|
|
mkdir -p %{buildroot}%{gem_dir}
|
|
cp -a .%{gem_dir}/* \
|
|
%{buildroot}%{gem_dir}/
|
|
|
|
# move header files, C extension files to the correct directory
|
|
mkdir -p %{buildroot}%{gem_extdir_mri}
|
|
cp -a ./%{gem_extdir_mri}/* %{buildroot}%{gem_extdir_mri}/
|
|
|
|
pushd %{buildroot}
|
|
mkdir -p .%{header_dir}
|
|
mv .%{gem_extdir_mri}/*.h .%{header_dir}/
|
|
rm -f .%{gem_extdir_mri}/{gem_make.out,mkmf.log}
|
|
popd
|
|
|
|
|
|
# move pkgconfig file
|
|
mkdir %{buildroot}%{_libdir}/pkgconfig
|
|
install -cpm 644 ./%{_libdir}/pkgconfig/*.pc \
|
|
%{buildroot}%{_libdir}/pkgconfig/
|
|
|
|
# Cleanups
|
|
pushd %{buildroot}
|
|
rm -rf .%{gem_instdir}/ext/
|
|
rm -f .%{gem_instdir}/extconf.rb
|
|
popd
|
|
|
|
%check
|
|
pushd .%{gem_instdir}
|
|
cd test
|
|
xvfb-run \
|
|
ruby -I../lib:.:../ext/%{gem_name} run-test.rb
|
|
cd ..
|
|
popd
|
|
|
|
%files
|
|
%doc %{gem_instdir}/[A-Z]*
|
|
%exclude %{gem_instdir}/Rakefile
|
|
%dir %{gem_instdir}/
|
|
%dir %{gem_instdir}/lib/
|
|
%{gem_instdir}/lib/%{gem_name}.rb
|
|
%dir %{gem_instdir}/lib/%{gem_name}/
|
|
%{gem_instdir}/lib/%{gem_name}/*.rb
|
|
|
|
%{gem_extdir_mri}/
|
|
|
|
%exclude %{gem_cache}
|
|
%{gem_spec}
|
|
|
|
%files devel
|
|
%{_libdir}/pkgconfig/ruby-%{gem_name}.pc
|
|
%{header_dir}/rbgtk3.h
|
|
%{header_dir}/rbgtk3conversions.h
|
|
|
|
%files doc
|
|
%doc %{gem_docdir}/
|
|
%{gem_instdir}/sample/
|
|
%exclude %{gem_instdir}/test/
|
|
|
|
%changelog
|
|
* Fri Apr 18 2014 Mamoru TASAKA <mtasaka@fedoraproject.org> - 2.2.0-2
|
|
- F-21: rebuild for ruby 2.1 / rubygems 2.2
|
|
|
|
* Mon Apr 14 2014 Mamoru TASAKA <mtasaka@fedoraproject.org> - 2.2.0-1
|
|
- 2.2.0
|
|
|
|
* Thu Jan 16 2014 Mamoru TASAKA <mtasaka@fedoraproject.org> - 2.1.0-1
|
|
- 2.1.0
|
|
|
|
* Mon Oct 21 2013 Mamoru TASAKA <mtasaka@fedoraproject.org> - 2.0.2-2
|
|
- Update license file and misc fix
|
|
|
|
* Sun Aug 25 2013 Mamoru TASAKA <mtasaka@fedoraproject.org> - 2.0.2-1
|
|
- 2.0.2
|
|
|
|
* Mon Apr 29 2013 Mamoru TASAKA <mtasaka@fedoraproject.org> - 1.2.6-1
|
|
- 1.2.6
|
|
|
|
* Fri Mar 22 2013 Mamoru TASAKA <mtasaka@fedoraproject.org> - 1.2.3-1
|
|
- 1.2.3
|
|
|
|
* Tue Feb 19 2013 Mamoru TASAKA <mtasaka@fedoraproject.org> - 1.2.1-1
|
|
- Initial package
|