334 lines
8.3 KiB
RPMSpec
334 lines
8.3 KiB
RPMSpec
%if 0%{?fedora} >= 17
|
|
%global rubyabi 1.9.1
|
|
%global header_dir %{ruby_vendorarchdir}
|
|
%global ruby19 1
|
|
%else
|
|
%global ruby_sitelib %(ruby -rrbconfig -e "puts Config::CONFIG['sitelibdir']")
|
|
%global ruby_sitearch %(ruby -rrbconfig -e "puts Config::CONFIG['sitearchdir']")
|
|
|
|
%global rubyabi 1.8
|
|
%global header_dir %{ruby_sitearch}
|
|
%global ruby19 0
|
|
%endif
|
|
|
|
|
|
%global gem_name pango
|
|
|
|
%global glibminver 1.0.3
|
|
%global obsoleteevr 0.90.7-1.999
|
|
|
|
Summary: Ruby binding of pango-1.x
|
|
Name: rubygem-%{gem_name}
|
|
Version: 1.1.2
|
|
Release: 4%{?dist}
|
|
Group: Development/Languages
|
|
# from README
|
|
License: LGPLv2
|
|
URL: http://ruby-gnome2.sourceforge.jp/
|
|
Source0: http://rubygems.org/gems/%{gem_name}-%{version}.gem
|
|
|
|
BuildRequires: ruby(abi) = %{rubyabi}
|
|
BuildRequires: rubygems-devel
|
|
BuildRequires: rubygem-cairo-devel
|
|
BuildRequires: rubygem-glib2-devel >= %{glibminver}
|
|
BuildRequires: ruby-devel
|
|
BuildRequires: pango-devel
|
|
# %%check
|
|
BuildRequires: rubygem(test-unit)
|
|
Requires: ruby(abi) = %{rubyabi}
|
|
Requires: rubygems
|
|
Requires: rubygem(cairo)
|
|
Requires: rubygem(glib2) >= %{glibminver}
|
|
Provides: rubygem(%{gem_name}) = %{version}
|
|
%if %{ruby19}
|
|
Obsoletes: ruby-%{gem_name} = %{version}-%{release}
|
|
Provides: ruby-%{gem_name} = %{version}-%{release}
|
|
Provides: ruby(%{gem_name}) = %{version}-%{release}
|
|
%endif
|
|
|
|
%description
|
|
Ruby/Pango is a Ruby binding of pango-1.x.
|
|
|
|
%package doc
|
|
Summary: Documentation for %{name}
|
|
Group: Documentation
|
|
Requires: %{name} = %{version}-%{release}
|
|
|
|
%description doc
|
|
This package contains documentation for %{name}.
|
|
|
|
%package -n ruby-%{gem_name}
|
|
Summary: Non-Gem support package for %{gem_name}
|
|
Group: Development/Languages
|
|
Requires: %{name} = %{version}-%{release}
|
|
# Requires for corresponsing non-gem rpms
|
|
Requires: ruby(cairo)
|
|
Requires: ruby(glib2) >= %{glibminver}
|
|
Provides: ruby(%{gem_name}) = %{version}-%{release}
|
|
|
|
%description -n ruby-%{gem_name}
|
|
This package provides non-Gem support for %{gem_name}.
|
|
|
|
%package devel
|
|
Summary: Ruby/pango development environment
|
|
Group: Development/Languages
|
|
Requires: %{name} = %{version}-%{release}
|
|
Requires: ruby-devel
|
|
Requires: pango-devel
|
|
Requires: rubygem-cairo-devel
|
|
# Obsoletes / Provides
|
|
# ruby(%%{gem_name}-devel) Provides is for compatibility
|
|
Obsoletes: ruby-%{gem_name}-devel < %{obsoleteevr}
|
|
Provides: ruby-%{gem_name}-devel = %{version}-%{release}
|
|
%if ! 0%{ruby19}
|
|
Provides: ruby(%{gem_name}-devel) = %{version}-%{release}
|
|
%endif
|
|
|
|
%description devel
|
|
Header files and libraries for building a extension library for the
|
|
rubygem-%{gem_name}
|
|
|
|
%prep
|
|
%setup -q -c -T
|
|
mkdir -p .%{gem_dir}
|
|
|
|
export CONFIGURE_ARGS="--with-cflags='%{optflags}'"
|
|
export CONFIGURE_ARGS="$CONFIGURE_ARGS --with-pkg-config-dir=$(pwd)%{_libdir}/pkgconfig"
|
|
gem install \
|
|
-V \
|
|
--local \
|
|
--install-dir .%{gem_dir} \
|
|
--force \
|
|
--rdoc \
|
|
%{SOURCE0}
|
|
|
|
find . -name \*.gem | xargs chmod 0644
|
|
|
|
pushd .%{gem_instdir}
|
|
# Fix wrong shebang
|
|
grep -rl /usr/local/bin sample | \
|
|
xargs sed -i -e 's|/usr/local/bin|/usr/bin|'
|
|
|
|
# Kill shebang
|
|
grep -rl '#!.*/usr/bin' sample | \
|
|
xargs sed -i -e '\@#![ ]*/usr/bin@d'
|
|
find sample/ -name \*.rb | xargs chmod 0644
|
|
popd
|
|
|
|
%build
|
|
# Move C extension library to some private directory
|
|
pushd .%{gem_instdir}
|
|
%if ! %{ruby19}
|
|
mkdir lib/ruby-gnome2
|
|
mv lib/%{gem_name}.so lib/ruby-gnome2/
|
|
grep -rl '%{gem_name}.so' . | \
|
|
xargs sed -i \
|
|
-e "\@require@s|'%{gem_name}.so'|'ruby-gnome2/%{gem_name}.so'|" \
|
|
-e '\@require@s|"%{gem_name}.so"|"ruby-gnome2/%{gem_name}.so"|'
|
|
%endif
|
|
|
|
# Fix up Rakefile for "gnome2-raketask" requirement
|
|
sed -i -e "/require.*gnome2-raketask/s|^\(.*\)|begin\n \1\nrescue LoadError\n require 'rubygems'\n require 'gnome2-raketask'\nend\n|" \
|
|
Rakefile
|
|
|
|
%install
|
|
# Once copy all
|
|
mkdir -p %{buildroot}%{gem_dir}
|
|
cp -a .%{gem_dir}/* \
|
|
%{buildroot}%{gem_dir}/
|
|
|
|
pushd %{buildroot}
|
|
# move header files, C extension files to the correct directory
|
|
mkdir -p .%{header_dir}
|
|
mv .%{gem_instdir}/lib/*.h .%{header_dir}/
|
|
|
|
%if ! %{ruby19}
|
|
mkdir -p .%{ruby_sitearch}/ruby-gnome2
|
|
mv .%{gem_instdir}/lib/ruby-gnome2/%{gem_name}.so .%{ruby_sitearch}/ruby-gnome2/
|
|
%else
|
|
mkdir -p .%{gem_extdir}/lib
|
|
mv .%{gem_instdir}/lib/%{gem_name}.so .%{gem_extdir}/lib
|
|
%endif
|
|
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
|
|
|
|
# The following method is completely copied from rubygem-gettext
|
|
# spec file
|
|
#
|
|
# Create symlinks
|
|
##
|
|
## Note that before switching to gem %%{ruby_sitelib}/%%{gem_name}
|
|
## 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
|
|
|
|
}
|
|
|
|
%if ! %{ruby19}
|
|
create_symlink_rec %{gem_instdir}/lib %{ruby_sitelib}
|
|
%endif
|
|
|
|
%check
|
|
pushd .%{gem_instdir}
|
|
|
|
# kill unneeded make process
|
|
rm -rf ./TMPBINDIR
|
|
mkdir ./TMPBINDIR
|
|
pushd ./TMPBINDIR
|
|
ln -sf /bin/true make
|
|
export PATH=$(pwd):$PATH
|
|
popd
|
|
|
|
# test_default(TestLanguage) [./test/test-language.rb] needs LANG=ja_JP.UTF-8, for example
|
|
LANG=en_US.UTF-8
|
|
ruby -Ilib:test ./test/run-test.rb
|
|
|
|
%files
|
|
%defattr(-,root,root,-)
|
|
%dir %{gem_instdir}
|
|
%dir %{gem_instdir}/lib/
|
|
|
|
%doc %{gem_instdir}/[A-Z]*
|
|
%exclude %{gem_instdir}/Rakefile
|
|
|
|
%{gem_instdir}/lib/%{gem_name}.rb
|
|
%if %{ruby19}
|
|
%dir %{gem_extdir}
|
|
%dir %{gem_extdir}/lib
|
|
%{gem_extdir}/lib/%{gem_name}.so
|
|
%else
|
|
# %%ruby_sitearch/ruby-gnome2 is owned by rubygem-glib2
|
|
%{ruby_sitearch}/ruby-gnome2/%{gem_name}.so
|
|
%endif
|
|
|
|
%{gem_cache}
|
|
%{gem_spec}
|
|
|
|
%if ! %{ruby19}
|
|
%files -n ruby-%{gem_name}
|
|
%defattr(-,root,root,-)
|
|
%{ruby_sitelib}/*.rb
|
|
%endif
|
|
|
|
%files devel
|
|
%defattr(-,root,root,-)
|
|
%{_libdir}/pkgconfig/ruby-%{gem_name}.pc
|
|
%{header_dir}/rbpango.h
|
|
%{header_dir}/rbpangoversion.h
|
|
%{header_dir}/rbpangoconversions.h
|
|
|
|
%files doc
|
|
%defattr(-,root,root,-)
|
|
%{gem_dir}/doc/%{gem_name}-%{version}
|
|
%{gem_instdir}/Rakefile
|
|
%{gem_instdir}/sample/
|
|
%{gem_instdir}/test/
|
|
|
|
%changelog
|
|
* Wed Feb 1 2012 Mamoru Tasaka <mtasaka@fedoraproject.org> - 1.1.2-4
|
|
- Add proper Obsoletes/Provides
|
|
|
|
* Tue Jan 31 2012 Mamoru Tasaka <mtasaka@fedoraproject.org> - 1.1.2-3
|
|
- 1.1.2
|
|
|
|
* Sun Jan 15 2012 Mamoru Tasaka <mtasaka@fedoraproject.org> - 1.1.1-1
|
|
- 1.1.1
|
|
|
|
* Sat Jan 14 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.0.3-2
|
|
- F-17: Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild
|
|
|
|
* Mon Sep 19 2011 Mamoru Tasaka <mtasaka@fedoraproject.org> - 1.0.3-1
|
|
- 1.0.3
|
|
|
|
* Fri Jul 15 2011 Mamoru Tasaka <mtasaka@fedoraproject.org> - 1.0.0-1
|
|
- 1.0.0
|
|
|
|
* Sun Jun 12 2011 Mamoru Tasaka <mtasaka@fedoraproject.org> - 0.90.9-1
|
|
- 0.90.9
|
|
|
|
* Sat Mar 5 2011 Mamoru Tasaka <mtasaka@fedoraproject.org> - 0.90.8-1
|
|
- 0.90.8
|
|
|
|
* Wed Feb 09 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.90.7-3
|
|
- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild
|
|
|
|
* Wed Feb 9 2011 Mamoru Tasaka <mtasaka@ioa.s.u-tokyo.ac.jp> - 0.90.7-2
|
|
- 0.90.7
|
|
|
|
* Sun Oct 31 2010 Mamoru Taska <mtasaka@ioa.s.u-tokyo.ac.jp> - 0.90.5-2
|
|
- 0.90.5
|
|
- Move C extension so that "require %%gem_name" works correctly
|
|
|
|
* Sun Oct 24 2010 Mamoru Taska <mtasaka@ioa.s.u-tokyo.ac.jp> - 0.90.4-2
|
|
- 0.90.4
|
|
|
|
* Sun Oct 24 2010 Mamoru Taska <mtasaka@ioa.s.u-tokyo.ac.jp> - 0.90.3-2
|
|
- 0.90.3
|
|
|
|
* Fri Oct 1 2010 Mamoru Tasaka <mtasaka@ioa.s.u-tokyo.ac.jp> - 0.90.2-5
|
|
- Fix up summary
|
|
- Fix Requires for -devel subpackage
|
|
|
|
* Fri Oct 1 2010 Mamoru Tasaka <mtasaka@ioa.s.u-tokyo.ac.jp> - 0.90.2-4
|
|
- Use formally released gem file
|
|
|
|
* Tue Sep 28 2010 Mamoru Tasaka <mtasaka@ioa.s.u-tokyo.ac.jp> - 0.90.2-2
|
|
- Initial package
|