658c17
%bcond_with bootstrap
658c17
658c17
%global multilib_arches %{ix86} x86_64
658c17
658c17
Name:		libffi
658c17
Version:	3.4.2
658c17
Release:	7%{?dist}
658c17
Summary:	A portable foreign function interface library
658c17
License:	MIT
658c17
URL:		http://sourceware.org/libffi
658c17
658c17
Source0:	https://github.com/libffi/libffi/releases/download/v3.4.2/libffi-3.4.2.tar.gz
658c17
Source1:	ffi-multilib.h
658c17
Source2:	ffitarget-multilib.h
658c17
658c17
BuildRequires: make
658c17
BuildRequires: gcc
658c17
%if %{without bootstrap}
658c17
BuildRequires: gcc-c++
658c17
BuildRequires: dejagnu
658c17
%endif
658c17
658c17
%description
658c17
Compilers for high level languages generate code that follow certain
658c17
conventions.  These conventions are necessary, in part, for separate
658c17
compilation to work.  One such convention is the "calling convention".
658c17
The calling convention is a set of assumptions made by the compiler
658c17
about where function arguments will be found on entry to a function.  A
658c17
calling convention also specifies where the return value for a function
658c17
is found.  
658c17
658c17
Some programs may not know at the time of compilation what arguments
658c17
are to be passed to a function.  For instance, an interpreter may be
658c17
told at run-time about the number and types of arguments used to call a
658c17
given function.  `Libffi' can be used in such programs to provide a
658c17
bridge from the interpreter program to compiled code.
658c17
658c17
The `libffi' library provides a portable, high level programming
658c17
interface to various calling conventions.  This allows a programmer to
658c17
call any function specified by a call interface description at run time.
658c17
658c17
FFI stands for Foreign Function Interface.  A foreign function
658c17
interface is the popular name for the interface that allows code
658c17
written in one language to call code written in another language.  The
658c17
`libffi' library really only provides the lowest, machine dependent
658c17
layer of a fully featured foreign function interface.  A layer must
658c17
exist above `libffi' that handles type conversions for values passed
658c17
between the two languages.  
658c17
658c17
%package	devel
658c17
Summary:	Development files for %{name}
658c17
Requires:	%{name} = %{version}-%{release}
658c17
Requires:	pkgconfig
658c17
658c17
%description	devel
658c17
The %{name}-devel package contains libraries and header files for
658c17
developing applications that use %{name}.
658c17
658c17
%prep
658c17
%setup -q
658c17
658c17
%build
658c17
# For now we disable the static templates to avoid ghc and
658c17
# gobject-introspection failures:
658c17
# https://gitlab.haskell.org/ghc/ghc/-/issues/20051
658c17
# https://gitlab.gnome.org/GNOME/gobject-introspection/-/merge_requests/283
658c17
# We need to get these fixes into Fedora before we can reeanble them.
658c17
%configure --disable-static --disable-exec-static-tramp
658c17
%make_build
658c17
658c17
%check
658c17
%if %{without bootstrap}
658c17
%make_build check
658c17
%endif
658c17
658c17
%install
658c17
%make_install
658c17
658c17
find $RPM_BUILD_ROOT -name '*.la' -exec rm -f {} ';'
658c17
rm -f $RPM_BUILD_ROOT%{_infodir}/dir
658c17
658c17
# Determine generic arch target name for multilib wrapper
658c17
basearch=%{_arch}
658c17
%ifarch %{ix86}
658c17
basearch=i386
658c17
%endif
658c17
658c17
mkdir -p $RPM_BUILD_ROOT%{_includedir}
658c17
%ifarch %{multilib_arches}
658c17
# Do header file switcheroo to avoid file conflicts on systems where you
658c17
# can have both a 32- and 64-bit version of the library, and they each need
658c17
# their own correct-but-different versions of the headers to be usable.
658c17
for i in ffi ffitarget; do
658c17
  mv $RPM_BUILD_ROOT%{_includedir}/$i.h $RPM_BUILD_ROOT%{_includedir}/$i-${basearch}.h
658c17
done
658c17
install -m644 %{SOURCE1} $RPM_BUILD_ROOT%{_includedir}/ffi.h
658c17
install -m644 %{SOURCE2} $RPM_BUILD_ROOT%{_includedir}/ffitarget.h
658c17
%endif
658c17
658c17
%ldconfig_scriptlets
658c17
658c17
%files
658c17
%license LICENSE
658c17
%doc README.md
658c17
%{_libdir}/libffi.so.8
658c17
%{_libdir}/libffi.so.8.1.0
658c17
658c17
%files devel
658c17
%{_libdir}/pkgconfig/*.pc
658c17
%{_includedir}/ffi*.h
658c17
%{_libdir}/*.so
658c17
%{_mandir}/man3/*.gz
658c17
%{_infodir}/libffi.info.*
658c17
658c17
%changelog
658c17
* Thu Aug 26 2021 Carlos O'Donell <codonell@redhat.com> - 3.4.2-7
658c17
- Remove compat-libffi3.1 subpackage to complete SONAME transition.
658c17
  Related: rhbz#1891914
658c17
658c17
* Wed Aug 18 2021 Carlos O'Donell <carlos@redhat.com> - 3.4.2-6
658c17
- Rebuilt for libffi 3.4.2 SONAME transition. Related: rhbz#1891914
658c17
658c17
* Mon Aug 09 2021 Mohan Boddu <mboddu@redhat.com> - 3.4.2-5
658c17
- Rebuilt for IMA sigs, glibc 2.34, aarch64 flags
658c17
  Related: rhbz#1991688
658c17
658c17
* Thu Jul 29 2021 Carlos O'Donell <carlos@redhat.com> - 3.4.2-4
658c17
- Drop pkgconf support for compat-libffi3.1. 
658c17
658c17
* Tue Jul 27 2021 Carlos O'Donell <carlos@redhat.com> - 3.4.2-3
658c17
- Add temporary compat-libffi3.1 for library transition.
658c17
658c17
* Thu Jul 22 2021 Fedora Release Engineering <releng@fedoraproject.org> - 3.4.2-2
658c17
- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild
658c17
658c17
* Mon Jun 28 2021 Carlos O'Donell <carlos@redhat.com> - 3.4.2-1
658c17
- Rebase to libffi 3.4.2.
658c17
658c17
* Fri Apr 16 2021 Mohan Boddu <mboddu@redhat.com> - 3.1-29
658c17
- Rebuilt for RHEL 9 BETA on Apr 15th 2021. Related: rhbz#1947937
658c17
658c17
* Tue Jan 26 2021 Fedora Release Engineering <releng@fedoraproject.org> - 3.1-28
658c17
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
658c17
658c17
* Wed Dec 02 2020 Carlos O'Donell <carlos@redhat.com> - 3.1-27
658c17
- Use make macros
658c17
- https://fedoraproject.org/wiki/Changes/UseMakeBuildInstallMacro
658c17
658c17
* Tue Jul 28 2020 Fedora Release Engineering <releng@fedoraproject.org> - 3.1-26
658c17
- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
658c17
658c17
* Thu Apr 30 2020 DJ Delorie <idj@redhat.com> - 3.1-25
658c17
- Add $LIBFFI_TMPDIR environment variable support (#1667620)
658c17
658c17
* Wed Jan 29 2020 Fedora Release Engineering <releng@fedoraproject.org> - 3.1-24
658c17
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
658c17
658c17
* Thu Jul 25 2019 Fedora Release Engineering <releng@fedoraproject.org> - 3.1-23
658c17
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
658c17
658c17
* Tue Jul  9 2019 Florian Weimer <fweimer@redhat.com> - 3.1-22
658c17
- Run test suite during build (#1727088)
658c17
658c17
* Wed Jun 19 2019 Anthony Green <green@redhat.com> - 3.1-21
658c17
- Fix license tag
658c17
658c17
* Wed Apr 24 2019 Björn Esser <besser82@fedoraproject.org> - 3.1-20
658c17
- Remove hardcoded gzip suffix from GNU info pages
658c17
658c17
* Fri Feb 01 2019 Fedora Release Engineering <releng@fedoraproject.org> - 3.1-19
658c17
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
658c17
658c17
* Sun Jul 22 2018 Peter Robinson <pbrobinson@fedoraproject.org> 3.1-28
658c17
- Fix FTBFS
658c17
658c17
* Fri Jul 13 2018 Fedora Release Engineering <releng@fedoraproject.org> - 3.1-17
658c17
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
658c17
658c17
* Wed Feb 07 2018 Fedora Release Engineering <releng@fedoraproject.org> - 3.1-16
658c17
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
658c17
658c17
* Sat Feb 03 2018 Igor Gnatenko <ignatenkobrain@fedoraproject.org> - 3.1-15
658c17
- Switch to %%ldconfig_scriptlets
658c17
658c17
* Thu Aug 03 2017 Fedora Release Engineering <releng@fedoraproject.org> - 3.1-14
658c17
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild
658c17
658c17
* Wed Jul 26 2017 Fedora Release Engineering <releng@fedoraproject.org> - 3.1-13
658c17
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
658c17
658c17
* Wed Jul  5 2017 Jens Petersen <petersen@redhat.com> - 3.1-12
658c17
- protect install-info in the rpm scriptlets
658c17
  https://fedoraproject.org/wiki/Packaging:Scriptlets#Texinfo
658c17
658c17
* Tue Jun 20 2017 Anthony Green <green@redhat.com> - 3.1-11
658c17
- fix exec stack problem on aarch64 build
658c17
658c17
* Fri Feb 10 2017 Fedora Release Engineering <releng@fedoraproject.org> - 3.1-10
658c17
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild
658c17
658c17
* Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 3.1-9
658c17
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
658c17
658c17
* Wed Jun 17 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 3.1-8
658c17
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild
658c17
658c17
* Thu Jan 15 2015 Peter Robinson <pbrobinson@fedoraproject.org> 3.1-7
658c17
- Add patch to fix issues on aarch64 (rhbz 1174037)
658c17
658c17
* Sun Aug 17 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 3.1-6
658c17
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild
658c17
658c17
* Thu Jul 17 2014 Tom Callaway <spot@fedoraproject.org> - 3.1-5
658c17
- fix license handling
658c17
658c17
* Sun Jun 29 2014 Anthony Green <green@redhat.com> - 3.1-4
658c17
- fix exec stack problem on 32-bit build
658c17
658c17
* Thu Jun 12 2014 Dan Horák <dan[at]danny.cz> - 3.1-3
658c17
- fix header path in pkgconfig file
658c17
658c17
* Sat Jun 07 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 3.1-2
658c17
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild
658c17
658c17
* Mon May 19 2014 Anthony Green <green@redhat.com> - 3.1-1
658c17
- fix non-multiarch builds (arm).
658c17
658c17
* Mon May 19 2014 Anthony Green <green@redhat.com> - 3.1-0
658c17
- update to 3.1.
658c17
658c17
* Sat Aug 03 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 3.0.13-5
658c17
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild
658c17
658c17
* Tue May 28 2013 Tom Callaway <spot@fedoraproject.org> - 3.0.13-4
658c17
- fix typos in wrapper headers
658c17
658c17
* Mon May 27 2013 Tom Callaway <spot@fedoraproject.org> - 3.0.13-3
658c17
- make header files multilib safe
658c17
658c17
* Sat May 25 2013 Tom Callaway <spot@fedoraproject.org> - 3.0.13-2
658c17
- fix incorrect header pathing (and .pc file)
658c17
658c17
* Wed Mar 20 2013 Anthony Green <green@redhat.com> - 3.0.13-1
658c17
- update to 3.0.13
658c17
658c17
* Thu Feb 14 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 3.0.11-2
658c17
- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild
658c17
658c17
* Mon Jan 14 2013 Dennis Gilmore <dennis@ausil.us> - 3.0.11-1
658c17
- update to 3.0.11
658c17
658c17
* Fri Nov 02 2012 Deepak Bhole <dbhole@redhat.com> - 3.0.10-4
658c17
- Fixed source location
658c17
658c17
* Fri Aug 10 2012 Dennis Gilmore <dennis@ausil.us> - 3.0.10-3
658c17
- drop back to 3.0.10, 3.0.11 was never pushed anywhere as the soname bump broke buildroots
658c17
- as 3.0.11 never went out no epoch needed.
658c17
658c17
* Thu Jul 19 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 3.0.11-2
658c17
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild
658c17
658c17
* Fri Apr 13 2012 Anthony Green <green@redhat.com> - 3.0.11-1
658c17
- Upgrade to 3.0.11.
658c17
658c17
* Fri Jan 13 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 3.0.10-2
658c17
- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild
658c17
658c17
* Tue Aug 23 2011 Anthony Green <green@redhat.com> - 3.0.10-1
658c17
- Upgrade to 3.0.10. 
658c17
658c17
* Fri Mar 18 2011 Dan Horák <dan[at]danny.cz> - 3.0.9-3
658c17
- added patch for being careful when defining relatively generic symbols
658c17
658c17
* Mon Feb 07 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 3.0.9-2
658c17
- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild
658c17
658c17
* Tue Dec 29 2009 Anthony Green <green@redhat.com> - 3.0.9-1
658c17
- Upgrade
658c17
658c17
* Fri Jul 24 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 3.0.5-3
658c17
- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild
658c17
658c17
* Wed Feb 25 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 3.0.5-2
658c17
- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild
658c17
658c17
* Tue Jul 08 2008 Anthony Green <green@redhat.com> 3.0.5-1
658c17
- Upgrade to 3.0.5
658c17
658c17
* Fri Feb 15 2008 Anthony Green <green@redhat.com> 3.0.1-1
658c17
- Upgrade to 3.0.1
658c17
658c17
* Fri Feb 15 2008 Anthony Green <green@redhat.com> 2.99.9-1
658c17
- Upgrade to 2.99.9
658c17
- Require pkgconfig for the devel package.
658c17
- Update summary.
658c17
658c17
* Fri Feb 15 2008 Anthony Green <green@redhat.com> 2.99.8-1
658c17
- Upgrade to 2.99.8
658c17
658c17
* Thu Feb 14 2008 Anthony Green <green@redhat.com> 2.99.7-1
658c17
- Upgrade to 2.99.7
658c17
658c17
* Thu Feb 14 2008 Anthony Green <green@redhat.com> 2.99.6-1
658c17
- Upgrade to 2.99.6
658c17
658c17
* Thu Feb 14 2008 Anthony Green <green@redhat.com> 2.99.4-1
658c17
- Upgrade to 2.99.4
658c17
658c17
* Thu Feb 14 2008 Anthony Green <green@redhat.com> 2.99.3-1
658c17
- Upgrade to 2.99.3
658c17
658c17
* Thu Feb 14 2008 Anthony Green <green@redhat.com> 2.99.2-1
658c17
- Created.