Compare commits
5 commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d46e32683e | ||
|
|
64a0695a84 | ||
|
|
47ccada6db | ||
|
|
ff02005848 | ||
|
|
6862a55be2 |
3 changed files with 287 additions and 0 deletions
4
.gitignore
vendored
4
.gitignore
vendored
|
|
@ -0,0 +1,4 @@
|
|||
/pango-0.90.2.gem
|
||||
/pango-0.90.3.gem
|
||||
/pango-0.90.4.gem
|
||||
/pango-0.90.5.gem
|
||||
282
rubygem-pango.spec
Normal file
282
rubygem-pango.spec
Normal file
|
|
@ -0,0 +1,282 @@
|
|||
%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 pango
|
||||
%global geminstdir %{gemdir}/gems/%{gemname}-%{version}
|
||||
|
||||
%global glibminver 0.90.5
|
||||
%global obsoleteevr 0.90.5-1.999
|
||||
|
||||
%global rubyabi 1.8
|
||||
|
||||
Summary: Ruby binding of pango-1.x
|
||||
Name: rubygem-%{gemname}
|
||||
Version: 0.90.5
|
||||
Release: 2%{?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-cairo-devel
|
||||
BuildRequires: rubygem-glib2-devel >= %{glibminver}
|
||||
BuildRequires: ruby-devel
|
||||
BuildRequires: pango-devel
|
||||
BuildRequires(check): rubygem(test-unit)
|
||||
Requires: ruby(abi) = %{rubyabi}
|
||||
Requires: rubygems
|
||||
Requires: rubygem(cairo)
|
||||
Requires: rubygem(glib2) >= %{glibminver}
|
||||
Provides: rubygem(%{gemname}) = %{version}
|
||||
|
||||
%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-%{gemname}
|
||||
Summary: Non-Gem support package for %{gemname}
|
||||
Group: Development/Languages
|
||||
Requires: %{name} = %{version}-%{release}
|
||||
# Requires for corresponsing non-gem rpms
|
||||
Requires: ruby(cairo)
|
||||
Requires: ruby(glib2) >= %{glibminver}
|
||||
Provides: ruby(%{gemname}) = %{version}-%{release}
|
||||
|
||||
%description -n ruby-%{gemname}
|
||||
This package provides non-Gem support for %{gemname}.
|
||||
|
||||
%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(%%{gemname}-devel) Provides is for compatibility
|
||||
Obsoletes: ruby-%{gemname}-devel < %{obsoleteevr}
|
||||
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 CONFIGURE_ARGS="--with-cflags='%{optflags}'"
|
||||
export CONFIGURE_ARGS="$CONFIGURE_ARGS --with-pkg-config-dir=$(pwd)%{_libdir}/pkgconfig"
|
||||
gem install \
|
||||
-V \
|
||||
--local \
|
||||
--install-dir .%{gemdir} \
|
||||
--force \
|
||||
--rdoc \
|
||||
%{SOURCE0}
|
||||
|
||||
find . -name \*.gem | xargs chmod 0644
|
||||
|
||||
pushd .%{geminstdir}
|
||||
# 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 .%{geminstdir}
|
||||
mkdir lib/ruby-gnome2
|
||||
mv lib/%{gemname}.so lib/ruby-gnome2/
|
||||
grep -rl '%{gemname}.so' . | \
|
||||
xargs sed -i \
|
||||
-e "\@require@s|'%{gemname}.so'|'ruby-gnome2/%{gemname}.so'|" \
|
||||
-e '\@require@s|"%{gemname}.so"|"ruby-gnome2/%{gemname}.so"|'
|
||||
|
||||
%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}/ruby-gnome2/
|
||||
mv .%{geminstdir}/lib/*.h .%{ruby_sitearch}/
|
||||
mv .%{geminstdir}/lib/ruby-gnome2/%{gemname}.so .%{ruby_sitearch}/ruby-gnome2/
|
||||
popd
|
||||
|
||||
# move pkgconfig file
|
||||
mkdir %{buildroot}%{_libdir}/pkgconfig
|
||||
install -cpm 644 ./%{_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
|
||||
rm -rf ./TMPBINDIR
|
||||
mkdir ./TMPBINDIR
|
||||
pushd ./TMPBINDIR
|
||||
ln -sf /bin/true make
|
||||
export PATH=$(pwd):$PATH
|
||||
popd
|
||||
|
||||
cat > glib-test-init.rb <<EOF
|
||||
\$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), "lib"))
|
||||
\$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), "test"))
|
||||
|
||||
begin
|
||||
require 'rubygems'
|
||||
gem 'test-unit'
|
||||
require 'test/unit'
|
||||
rescue LoadError
|
||||
end
|
||||
EOF
|
||||
|
||||
# test_default(TestLanguage) [./test/test-language.rb] needs LANG=ja_JP.UTF-8, for example
|
||||
LANG=en_US.UTF-8
|
||||
ruby ./test/run-test.rb
|
||||
|
||||
%clean
|
||||
rm -rf %{buildroot}
|
||||
|
||||
%files
|
||||
%defattr(-,root,root,-)
|
||||
%dir %{geminstdir}
|
||||
%dir %{geminstdir}/lib/
|
||||
|
||||
%doc %{geminstdir}/[A-Z]*
|
||||
%exclude %{geminstdir}/Rakefile
|
||||
|
||||
%{geminstdir}/lib/%{gemname}.rb
|
||||
# %%ruby_sitearch/ruby-gnome2 is owned by rubygem-glib2
|
||||
%{ruby_sitearch}/ruby-gnome2/%{gemname}.so
|
||||
|
||||
%{gemdir}/cache/%{gemname}-%{version}.gem
|
||||
%{gemdir}/specifications/%{gemname}-%{version}.gemspec
|
||||
|
||||
%files -n ruby-%{gemname}
|
||||
%defattr(-,root,root,-)
|
||||
%{ruby_sitelib}/*.rb
|
||||
|
||||
%files devel
|
||||
%defattr(-,root,root,-)
|
||||
%{_libdir}/pkgconfig/ruby-%{gemname}.pc
|
||||
%{ruby_sitearch}/rbpango.h
|
||||
%{ruby_sitearch}/rbpangoversion.h
|
||||
|
||||
%files doc
|
||||
%defattr(-,root,root,-)
|
||||
%{gemdir}/doc/%{gemname}-%{version}
|
||||
%{geminstdir}/Rakefile
|
||||
%{geminstdir}/sample/
|
||||
%{geminstdir}/test/
|
||||
|
||||
%changelog
|
||||
* 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 %%gemname" 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
|
||||
1
sources
1
sources
|
|
@ -0,0 +1 @@
|
|||
5e39411da2ced845bb12a309c8908645 pango-0.90.5.gem
|
||||
Loading…
Add table
Add a link
Reference in a new issue