177 lines
4.1 KiB
RPMSpec
177 lines
4.1 KiB
RPMSpec
%global header_dir %{ruby_vendorarchdir}
|
|
%global gem_name gtk3
|
|
%global glib_min_ver 2.0.0
|
|
|
|
# Planned for F-20+ only
|
|
Summary: Ruby/GTK3 is a Ruby binding of GTK+-3.x
|
|
Name: rubygem-%{gem_name}
|
|
Version: 2.0.2
|
|
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)
|
|
Requires: rubygem(atk)
|
|
Requires: rubygem(gdk_pixbuf2)
|
|
Requires: rubygem(gdk3)
|
|
Requires: rubygem(gio2)
|
|
Requires: rubygem(glib2) >= %{glib_min_ver}
|
|
Requires: rubygem(pango)
|
|
BuildRequires: ruby-devel
|
|
BuildRequires: rubygems-devel
|
|
BuildRequires: rubygem-cairo-devel
|
|
BuildRequires: rubygem-gdk_pixbuf2-devel
|
|
BuildRequires: rubygem-gdk3-devel
|
|
BuildRequires: rubygem-gio2-devel
|
|
BuildRequires: rubygem-glib2-devel >= %{glib_min_ver}
|
|
BuildRequires: rubygem-pango-devel
|
|
BuildRequires: gtk3-devel
|
|
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
|
|
|
|
# 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
|
|
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/
|
|
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
|
|
# Requires X
|
|
exit 0
|
|
# under X:
|
|
pushd .%{gem_instdir}
|
|
cd test
|
|
ruby -I../lib:. run-test.rb || echo "needs investigating"
|
|
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
|
|
|
|
%dir %{gem_extdir_mri}/
|
|
%dir %{gem_extdir_mri}/lib/
|
|
%{gem_extdir_mri}/lib/%{gem_name}.so
|
|
|
|
%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
|
|
* 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
|