97d77c
%global multilib_arches %{ix86} ppc ppc64 s390 s390x x86_64
882da0
882da0
Name:		libffi
882da0
Version:	3.0.13
475d55
Release:	19%{?dist}
882da0
Summary:	A portable foreign function interface library
882da0
882da0
Group:		System Environment/Libraries
882da0
License:	MIT and Public Domain
882da0
URL:		http://sourceware.org/libffi
882da0
Source0:	ftp://sourceware.org/pub/libffi/libffi-%{version}.tar.gz
882da0
# part of upstream commit 5feacad4
882da0
Source1:	ffi-multilib.h
882da0
Source2:	ffitarget-multilib.h
882da0
Patch0:		libffi-3.0.13-fix-include-path.patch
7b8d55
Patch1:		libffi-fix-ppc-tests.patch
882da0
# part of upstream commit 5feacad4
97d77c
Patch10:	libffi-3.0.13-ppc64le-0.patch
97d77c
Patch11:	libffi-3.0.13-ppc64le-1.patch
97d77c
Patch12:	libffi-3.0.13-ppc64le-2.patch
97d77c
Patch13:	libffi-3.0.13-ppc64le-3.patch
9ba22b
# rhbz 1287815:
9ba22b
Patch20:	libffi-aarch64-rhbz1174037.patch
9ba22b
9ba22b
Patch21:        libffi-3.0.13-closures-Create-temporary-file-with-O_TMPFILE-and-O_.patch
97d77c
%ifarch ppc64le
97d77c
BuildRequires:  autoconf automake libtool texinfo
97d77c
%endif
882da0
BuildRoot:	%{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
882da0
882da0
%description
882da0
Compilers for high level languages generate code that follow certain
882da0
conventions.  These conventions are necessary, in part, for separate
882da0
compilation to work.  One such convention is the "calling convention".
882da0
The calling convention is a set of assumptions made by the compiler
882da0
about where function arguments will be found on entry to a function.  A
882da0
calling convention also specifies where the return value for a function
882da0
is found.  
882da0
882da0
Some programs may not know at the time of compilation what arguments
882da0
are to be passed to a function.  For instance, an interpreter may be
882da0
told at run-time about the number and types of arguments used to call a
882da0
given function.  `Libffi' can be used in such programs to provide a
882da0
bridge from the interpreter program to compiled code.
882da0
882da0
The `libffi' library provides a portable, high level programming
882da0
interface to various calling conventions.  This allows a programmer to
882da0
call any function specified by a call interface description at run time.
882da0
882da0
FFI stands for Foreign Function Interface.  A foreign function
882da0
interface is the popular name for the interface that allows code
882da0
written in one language to call code written in another language.  The
882da0
`libffi' library really only provides the lowest, machine dependent
882da0
layer of a fully featured foreign function interface.  A layer must
882da0
exist above `libffi' that handles type conversions for values passed
882da0
between the two languages.  
882da0
882da0
882da0
%package	devel
882da0
Summary:	Development files for %{name}
882da0
Group:		Development/Libraries
882da0
Requires:	%{name} = %{version}-%{release}
882da0
Requires:       pkgconfig
882da0
Requires(post): /sbin/install-info
882da0
Requires(preun): /sbin/install-info
882da0
882da0
%description	devel
882da0
The %{name}-devel package contains libraries and header files for
882da0
developing applications that use %{name}.
882da0
882da0
882da0
%prep
882da0
%setup -q
882da0
%patch0 -p1 -b .fixpath
7b8d55
%patch1 -p1 -b .fixpath
97d77c
%ifarch ppc64le
97d77c
%patch10 -p1 -b .ppc64le-0
97d77c
%patch11 -p1 -b .ppc64le-1
97d77c
%patch12 -p1 -b .ppc64le-2
97d77c
%patch13 -p1 -b .ppc64le-3
97d77c
97d77c
autoreconf -vif
97d77c
%endif
882da0
9ba22b
%patch20 -p1 -b .aarch64
9ba22b
%patch21 -p1 -b .tmpfile
882da0
%build
7b8d55
CFLAGS="$RPM_OPT_FLAGS -fno-strict-aliasing" %configure --disable-static
882da0
make %{?_smp_mflags}
882da0
882da0
882da0
%install
882da0
rm -rf $RPM_BUILD_ROOT
882da0
make install DESTDIR=$RPM_BUILD_ROOT
882da0
find $RPM_BUILD_ROOT -name '*.la' -exec rm -f {} ';'
882da0
rm -f $RPM_BUILD_ROOT%{_infodir}/dir
882da0
882da0
# Determine generic arch target name for multilib wrapper
882da0
basearch=%{_arch}
882da0
%ifarch %{ix86}
882da0
basearch=i386
882da0
%endif
882da0
882da0
%ifarch %{multilib_arches}
882da0
# Do header file switcheroo to avoid file conflicts on systems where you
882da0
# can have both a 32- and 64-bit version of the library, and they each need
882da0
# their own correct-but-different versions of the headers to be usable.
882da0
for i in ffi ffitarget; do
882da0
  mv $RPM_BUILD_ROOT%{_includedir}/$i.h $RPM_BUILD_ROOT%{_includedir}/$i-${basearch}.h
882da0
done
882da0
install -m644 %{SOURCE1} $RPM_BUILD_ROOT%{_includedir}/ffi.h
882da0
install -m644 %{SOURCE2} $RPM_BUILD_ROOT%{_includedir}/ffitarget.h
882da0
%endif
882da0
882da0
882da0
%clean
882da0
rm -rf $RPM_BUILD_ROOT
882da0
882da0
882da0
%post -p /sbin/ldconfig
882da0
882da0
%post devel
475d55
/sbin/install-info --info-dir=%{_infodir} %{_infodir}/libffi.info.gz || :
882da0
882da0
%preun devel
882da0
if [ $1 = 0 ] ;then
475d55
  /sbin/install-info --delete --info-dir=%{_infodir} %{_infodir}/libffi.info.gz || :
882da0
fi
882da0
882da0
%postun -p /sbin/ldconfig
882da0
882da0
882da0
%files
882da0
%defattr(-,root,root,-)
882da0
%doc LICENSE README
882da0
%{_libdir}/*.so.*
882da0
882da0
%files devel
882da0
%defattr(-,root,root,-)
882da0
%{_libdir}/pkgconfig/*.pc
882da0
%{_includedir}/ffi*.h
882da0
%{_libdir}/*.so
882da0
%{_mandir}/man3/*.gz
882da0
%{_infodir}/libffi.info.gz
882da0
882da0
%changelog
475d55
* Tue Jul 23 2019 DJ Delorie <dj@redhat.com> - 3.0.13-19
475d55
- Allow libffi-devel uninstall even when docs are not installed (#1609331)
475d55
9ba22b
* Tue Apr  5 2016 Andrew Haley <aph@redhat.com> - 3.0.13-18
9ba22b
- closures: Create temporary file with O_TMPFILE and O_CLOEXEC
9ba22b
- Resolves: RHBZ1151568
9ba22b
9ba22b
* Tue Apr  5 2016 Andrew Haley <aph@redhat.com> - 3.0.13-17
9ba22b
- libffi needs fix for structures not passed in registers
9ba22b
- Resolves: RHBZ1287815
9ba22b
97d77c
* Tue Sep 02 2014 Dan HorĂ¡k <dhorak@redhat.com> - 3.0.13-16
97d77c
- Drop ppc64le from the multilib list
97d77c
- Use additional BR: only in ppc64le build
97d77c
- Resolves: RHBZ1116945
97d77c
97d77c
* Tue Aug 26 2014 Andrew Haley <aph@redhat.com> - 3.0.13-15
97d77c
- Add requires for libtool and texinfo
97d77c
- Resolves: RHBZ1116945
97d77c
97d77c
* Tue Aug 26 2014 Andrew Haley <aph@redhat.com> - 3.0.13-14
97d77c
- Add requires for automake
97d77c
- Resolves: RHBZ1116945
97d77c
97d77c
* Tue Aug 26 2014 Andrew Haley <aph@redhat.com> - 3.0.13-13
97d77c
- Add requires for autoconf
97d77c
- Resolves: RHBZ1116945
97d77c
97d77c
* Tue Aug 26 2014 Andrew Haley <aph@redhat.com> - 3.0.13-12
97d77c
- Merge from private-rhel-7.0-ppc64le branch
97d77c
- Resolves: RHBZ1116945
97d77c
7b8d55
* Fri Jan 24 2014 Daniel Mach <dmach@redhat.com> - 3.0.13-11
7b8d55
- Mass rebuild 2014-01-24
7b8d55
7b8d55
* Fri Dec 27 2013 Daniel Mach <dmach@redhat.com> - 3.0.13-10
7b8d55
- Mass rebuild 2013-12-27
7b8d55
7b8d55
* Wed Dec 18 2013 Deepak Bhole <dbhole@redhat.com> - 3.0.13-9
7b8d55
- Added -fno-strict-aliasing (pointed out by rpmdiff)
7b8d55
- Fixes RHBZ 1006261
7b8d55
7b8d55
* Fri Nov 15 2013 Jon VanAlten <jon.vanalten@redhat.com> - 3.0.13-8
7b8d55
- Patch test suite to fix errors on ppc64
7b8d55
- Fixes RHBZ 1006261
7b8d55
882da0
* Thu Aug 22 2013 Deepak Bhole <dbhole@redhat.com> - 3.0.13-7
882da0
- Removed temporarily introduced compat package for OpenJDk6 bootstrap
882da0
882da0
* Wed Aug 21 2013 Deepak Bhole <dbhole@redhat.com> - 3.0.13-6
882da0
- Temporarily build with a .so.5 compat package to allow OpenJDK6 bootstrap
882da0
882da0
* Mon Jul 15 2013 Jon VanAlten <jon.vanalten@redhat.com> - 3.0.13-5
882da0
- Correct spec license
882da0
882da0
* Tue May 28 2013 Tom Callaway <spot@fedoraproject.org> - 3.0.13-4
882da0
- fix typos in wrapper headers
882da0
882da0
* Mon May 27 2013 Tom Callaway <spot@fedoraproject.org> - 3.0.13-3
882da0
- make header files multilib safe
882da0
882da0
* Sat May 25 2013 Tom Callaway <spot@fedoraproject.org> - 3.0.13-2
882da0
- fix incorrect header pathing (and .pc file)
882da0
882da0
* Wed Mar 20 2013 Anthony Green <green@redhat.com> - 3.0.13-1
882da0
- update to 3.0.13
882da0
882da0
* Thu Feb 14 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 3.0.11-2
882da0
- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild
882da0
882da0
* Mon Jan 14 2013 Dennis Gilmore <dennis@ausil.us> - 3.0.11-1
882da0
- update to 3.0.11
882da0
882da0
* Fri Nov 02 2012 Deepak Bhole <dbhole@redhat.com> - 3.0.10-4
882da0
- Fixed source location
882da0
882da0
* Fri Aug 10 2012 Dennis Gilmore <dennis@ausil.us> - 3.0.10-3
882da0
- drop back to 3.0.10, 3.0.11 was never pushed anywhere as the soname bump broke buildroots
882da0
- as 3.0.11 never went out no epoch needed.
882da0
882da0
* Thu Jul 19 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 3.0.11-2
882da0
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild
882da0
882da0
* Fri Apr 13 2012 Anthony Green <green@redhat.com> - 3.0.11-1
882da0
- Upgrade to 3.0.11.
882da0
882da0
* Fri Jan 13 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 3.0.10-2
882da0
- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild
882da0
882da0
* Tue Aug 23 2011 Anthony Green <green@redhat.com> - 3.0.10-1
882da0
- Upgrade to 3.0.10. 
882da0
882da0
* Fri Mar 18 2011 Dan HorĂ¡k <dan[at]danny.cz> - 3.0.9-3
882da0
- added patch for being careful when defining relatively generic symbols
882da0
882da0
* Mon Feb 07 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 3.0.9-2
882da0
- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild
882da0
882da0
* Tue Dec 29 2009 Anthony Green <green@redhat.com> - 3.0.9-1
882da0
- Upgrade
882da0
882da0
* Fri Jul 24 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 3.0.5-3
882da0
- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild
882da0
882da0
* Wed Feb 25 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 3.0.5-2
882da0
- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild
882da0
882da0
* Tue Jul 08 2008 Anthony Green <green@redhat.com> 3.0.5-1
882da0
- Upgrade to 3.0.5
882da0
882da0
* Fri Feb 15 2008 Anthony Green <green@redhat.com> 3.0.1-1
882da0
- Upgrade to 3.0.1
882da0
882da0
* Fri Feb 15 2008 Anthony Green <green@redhat.com> 2.99.9-1
882da0
- Upgrade to 2.99.9
882da0
- Require pkgconfig for the devel package.
882da0
- Update summary.
882da0
882da0
* Fri Feb 15 2008 Anthony Green <green@redhat.com> 2.99.8-1
882da0
- Upgrade to 2.99.8
882da0
882da0
* Thu Feb 14 2008 Anthony Green <green@redhat.com> 2.99.7-1
882da0
- Upgrade to 2.99.7
882da0
882da0
* Thu Feb 14 2008 Anthony Green <green@redhat.com> 2.99.6-1
882da0
- Upgrade to 2.99.6
882da0
882da0
* Thu Feb 14 2008 Anthony Green <green@redhat.com> 2.99.4-1
882da0
- Upgrade to 2.99.4
882da0
882da0
* Thu Feb 14 2008 Anthony Green <green@redhat.com> 2.99.3-1
882da0
- Upgrade to 2.99.3
882da0
882da0
* Thu Feb 14 2008 Anthony Green <green@redhat.com> 2.99.2-1
882da0
- Created.