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