[packages/ruby-ffi] - pl - added platform patch (move platform .conf files to arch-dependent dir); package only file f

qboosh qboosh at pld-linux.org
Sun Aug 24 09:42:59 CEST 2014


commit 4ae334f66b4cbf65ea63a996dc1f8e899cf977bd
Author: Jakub Bogusz <qboosh at pld-linux.org>
Date:   Sun Aug 24 09:43:10 2014 +0200

    - pl
    - added platform patch (move platform .conf files to arch-dependent dir);
      package only file for target architecture (needs testing)

 ruby-ffi-platform.patch | 11 +++++++++
 ruby-ffi.spec           | 64 +++++++++++++++++++++++++++++++++++++++----------
 2 files changed, 62 insertions(+), 13 deletions(-)
---
diff --git a/ruby-ffi.spec b/ruby-ffi.spec
index d20aac8..4796b0c 100644
--- a/ruby-ffi.spec
+++ b/ruby-ffi.spec
@@ -1,10 +1,10 @@
-# TODO:
-# - rm files in platform dir (and make not noarch?)
+#
 # Conditional build:
 %bcond_without	tests		# build without tests
 
 %define	pkgname ffi
 Summary:	FFI Extensions for Ruby
+Summary(pl.UTF-8):	Rozszerzenia FFI dla języka Ruby
 Name:		ruby-%{pkgname}
 Version:	1.9.3
 Release:	1
@@ -12,6 +12,7 @@ License:	BSD
 Group:		Development/Languages
 Source0:	http://rubygems.org/gems/%{pkgname}-%{version}.gem
 # Source0-md5:	1b5ab133fb1b861eeb7c7a8dbaa0acf4
+Patch0:		%{name}-platform.patch
 URL:		http://wiki.github.com/ffi/ffi
 BuildRequires:	libffi-devel
 BuildRequires:	rpm-rubyprov
@@ -21,30 +22,64 @@ BuildRequires:	setup.rb
 BuildRequires:	ruby-rspec
 BuildRequires:	ruby-rspec-mocks
 %endif
+ExclusiveArch:	%{ix86} %{x8664} arm ia64 mips mipsel ppc s390 s390x sparc sparcv9
 BuildRoot:	%{tmpdir}/%{name}-%{version}-root-%(id -u -n)
 
 %description
-Ruby-FFI is a ruby extension for programmatically loading dynamic
+Ruby-FFI is a Ruby extension for programmatically loading dynamic
 libraries, binding functions within them, and calling those functions
 from Ruby code. Moreover, a Ruby-FFI extension works without changes
 on Ruby and JRuby. Discover why should you write your next extension
 using Ruby-FFI here: <http://wiki.github.com/ffi/ffi/why-use-ffi>.
 
+%description -l pl.UTF-8
+Ruby-FFI to rozszerzenie języka Ruby do programowego ładowania
+bibliotek dynamicznych, wiązania obecnych w nich funkcji oraz
+wywoływania tych funkcji z kodu w języku Ruby. Co więcej, rozszerzenie
+Ruby-FFI działa bez zmian w implementacji Ruby oraz JRuby. Informacje,
+dlaczego nowe rozszerzenia powinny używać Ruby-FFI, można znaleźć na
+stronie <http://wiki.github.com/ffi/ffi/why-use-ffi>.
+
 %prep
 %setup -q -n %{pkgname}-%{version}
+%patch0 -p1
 
 # be sure to use system ffi
-rm -r ext/ffi_c/libffi
+%{__rm} -r ext/ffi_c/libffi
 
 # drop not our targets
-rm -rv lib/ffi/platform/*-{cygwin,darwin,gnu,*bsd,solaris,windows}
-# not in pld th, so drop
-rm -rv lib/ffi/platform/arm-*
-rm -rv lib/ffi/platform/ia64-*
-rm -rv lib/ffi/platform/mips*
-rm -rv lib/ffi/platform/powerpc-*
-rm -rv lib/ffi/platform/s390*
-rm -rv lib/ffi/platform/sparc*
+%{__rm} -r lib/ffi/platform/*-{aix,cygwin,darwin,gnu,*bsd,solaris,windows}
+# provide only definitions for package architecture
+%ifnarch arm
+%{__rm} -r lib/ffi/platform/arm-*
+%endif
+%ifnarch %{ix86}
+%{__rm} -r lib/ffi/platform/i386-*
+%endif
+%ifnarch ia64
+%{__rm} -r lib/ffi/platform/ia64-*
+%endif
+%ifnarch mips
+%{__rm} -r lib/ffi/platform/mips-*
+%endif
+%ifnarch mipsel
+%{__rm} -r lib/ffi/platform/mipsel-*
+%endif
+%ifnarch powerpc
+%{__rm} -r lib/ffi/platform/powerpc-*
+%endif
+%ifnarch s390
+%{__rm} -r lib/ffi/platform/s390-*
+%endif
+%ifnarch s390x
+%{__rm} -r lib/ffi/platform/s390x-*
+%endif
+%ifnarch sparc
+%{__rm} -r lib/ffi/platform/sparc-*
+%endif
+%ifnarch %{x8664}
+%{__rm} -r lib/ffi/platform/x86_64-*
+%endif
 
 # ext build
 cp -p %{_datadir}/setup.rb .
@@ -72,9 +107,10 @@ ruby -Ilib:ext/ffi_c -S \
 
 %install
 rm -rf $RPM_BUILD_ROOT
-install -d $RPM_BUILD_ROOT{%{ruby_vendorlibdir},%{ruby_vendorarchdir},%{ruby_specdir}}
+install -d $RPM_BUILD_ROOT{%{ruby_vendorlibdir},%{ruby_vendorarchdir}/ffi,%{ruby_specdir}}
 cp -a lib/* $RPM_BUILD_ROOT%{ruby_vendorlibdir}
 install -p ext/ffi_c/ffi_c.so $RPM_BUILD_ROOT%{ruby_vendorarchdir}
+%{__mv} $RPM_BUILD_ROOT%{ruby_vendorlibdir}/ffi/platform $RPM_BUILD_ROOT%{ruby_vendorarchdir}/ffi
 cp -p %{pkgname}-%{version}.gemspec $RPM_BUILD_ROOT%{ruby_specdir}
 
 %clean
@@ -86,4 +122,6 @@ rm -rf $RPM_BUILD_ROOT
 %{ruby_vendorlibdir}/ffi.rb
 %{ruby_vendorlibdir}/ffi
 %attr(755,root,root) %{ruby_vendorarchdir}/ffi_c.so
+%dir %{ruby_vendorarchdir}/ffi
+%{ruby_vendorarchdir}/ffi/platform
 %{ruby_specdir}/%{pkgname}-%{version}.gemspec
diff --git a/ruby-ffi-platform.patch b/ruby-ffi-platform.patch
new file mode 100644
index 0000000..07179c3
--- /dev/null
+++ b/ruby-ffi-platform.patch
@@ -0,0 +1,11 @@
+--- ffi-1.9.3/lib/ffi/platform.rb.orig	2014-08-23 20:46:27.278379695 +0200
++++ ffi-1.9.3/lib/ffi/platform.rb	2014-08-24 08:34:55.736595784 +0200
+@@ -84,7 +84,7 @@
+     IS_OPENBSD = is_os("openbsd")
+     IS_WINDOWS = is_os("windows")
+     IS_BSD = IS_MAC || IS_FREEBSD || IS_OPENBSD
+-    CONF_DIR = File.join(File.dirname(__FILE__), 'platform', NAME)
++    CONF_DIR = File.join(RbConfig::CONFIG["vendorarchdir"], 'ffi', 'platform', NAME)
+     public
+ 
+     
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/ruby-ffi.git/commitdiff/4ae334f66b4cbf65ea63a996dc1f8e899cf977bd



More information about the pld-cvs-commit mailing list