--- /dev/null
+--- libffi-1.20/configure.in.orig Sat Dec 28 22:34:54 2002
++++ libffi-1.20/configure.in Sat Dec 28 22:38:30 2002
+@@ -7,6 +7,7 @@
+ AM_INIT_AUTOMAKE(libffi,1.20)
+
+ AC_PROG_CC
++AM_PROG_AS
+ AM_PROG_LIBTOOL
+
+ TARGETDIR="unknown"
+--- libffi-1.20/src/Makefile.am.orig Mon Oct 5 11:23:27 1998
++++ libffi-1.20/src/Makefile.am Sat Dec 28 23:05:05 2002
+@@ -19,14 +19,14 @@
+ lib_LTLIBRARIES = libffi.la
+ noinst_PROGRAMS = ffitest
+
+-TARGET_SRC_MIPS_GCC = mips/ffi.c mips/o32.S mips/n32.S
+-TARGET_SRC_MIPS_SGI = mips/ffi.c mips/o32.s mips/n32.s
+-TARGET_SRC_X86 = x86/ffi.c x86/sysv.S
+-TARGET_SRC_SPARC = sparc/ffi.c sparc/v8.S
+-TARGET_SRC_ALPHA = alpha/ffi.c alpha/osf.S
+-TARGET_SRC_M68K = m68k/ffi.c m68k/sysv.S
+-TARGET_SRC_POWERPC = powerpc/ffi.c powerpc/sysv.S
+-TARGET_SRC_ARM = arm/sysv.S arm/ffi.c
++TARGET_SRC_MIPS_GCC = mips/mips_ffi.c mips/mips_gcc_o32.S mips/mips_gcc_n32.S
++TARGET_SRC_MIPS_SGI = mips/mips_ffi.c mips/mips_sgi_o32.s mips/mips_sgi_n32.s
++TARGET_SRC_X86 = x86/x86_ffi.c x86/x86_sysv.S
++TARGET_SRC_SPARC = sparc/sparc_ffi.c sparc/sparc_v8.S
++TARGET_SRC_ALPHA = alpha/alpha_ffi.c alpha/alpha_osf.S
++TARGET_SRC_M68K = m68k/m68k_ffi.c m68k/m68k_sysv.S
++TARGET_SRC_POWERPC = powerpc/powerpc_ffi.c powerpc/powerpc_sysv.S
++TARGET_SRC_ARM = arm/arm_sysv.S arm/arm_ffi.c
+
+ ##libffi_la_SOURCES = debug.c prep_cif.c types.c $(TARGET_SRC_@TARGET@)
+ ## Work around automake deficiency
+@@ -92,6 +92,7 @@
+ endif
+
+ INCLUDES = -I$(top_srcdir)/include -I../include
++AM_CCASFLAGS = $(INCLUDES)
+
+ test: ffitest
+ ./ffitest
--- /dev/null
+--- libffi-1.20/configure.in.orig Mon Oct 5 11:23:27 1998
++++ libffi-1.20/configure.in Sat Dec 28 22:32:36 2002
+@@ -12,7 +12,7 @@
+ TARGETDIR="unknown"
+ case "$host" in
+ mips-sgi-irix5.* | mips-sgi-irix6.*) TARGET=MIPS; TARGETDIR=mips;;
+-i*86-pc-linux*) TARGET=X86; TARGETDIR=x86;;
++i*86-*-linux*) TARGET=X86; TARGETDIR=x86;;
+ sparc-sun-4*) TARGET=SPARC; TARGETDIR=sparc;;
+ sparc-sun-*) TARGET=SPARC; TARGETDIR=sparc;;
+ alpha*-*-linux* | alpha*-*-osf*) TARGET=ALPHA; TARGETDIR=alpha;;
Summary(pl): Biblioteka Foreign Function Interface
Name: libffi
Version: 1.20
-Release: 3
+Release: 4
License: distributable
Group: Libraries
Vendor: Cygnus
-Source0: ftp://sourceware.cygnus.com/pub/libffi/%{name}-%{version}.tar.gz
+Source0: ftp://sources.redhat.com/pub/libffi/%{name}-%{version}.tar.gz
+Patch0: %{name}-pld.patch
+Patch1: %{name}-acam.patch
URL: http://sources.redhat.com/libffi/
-#Note: this package is platform independent though it is (currently) only
-# needed on ppc (to build kaffe)
-ExclusiveArch: ppc
+BuildRequires: autoconf
+BuildRequires: automake
+BuildRequires: libtool
BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
%description
%prep
%setup -q
+%patch0 -p1
+%patch1 -p1
+
+# automake hell: patch below hundred lines requires files renaming
+cd src/mips
+mv -f {,mips_}ffi.c
+mv -f {,mips_gcc_}o32.S
+mv -f {,mips_gcc_}n32.S
+mv -f {,mips_sgi_}o32.s
+mv -f {,mips_sgi_}n32.s
+for d in alpha arm m68k powerpc sparc x86 ; do
+ cd ../$d
+ for f in * ; do
+ mv -f $f ${d}_$f
+ done
+done
%build
-%configure2_13
+%{__libtoolize}
+%{__aclocal}
+%{__autoconf}
+%{__automake}
+%configure
+
%{__make}
%install
rm -rf $RPM_BUILD_ROOT
-install -d $RPM_BUILD_ROOT
%{__make} install DESTDIR=$RPM_BUILD_ROOT
%files
%defattr(644,root,root,755)
%doc README ChangeLog LICENSE
-%attr(755,root,root) %{_libdir}/libffi.so.*
+%attr(755,root,root) %{_libdir}/libffi.so.*.*
%files devel
%defattr(644,root,root,755)
%attr(755,root,root) %{_libdir}/libffi.so
%{_libdir}/*.la
-%{_includedir}
+%{_includedir}/*
%files static
%defattr(644,root,root,755)