c040208
%bcond_with bootstrap
c040208
71e48fa
%global multilib_arches %{ix86} ppc ppc64 ppc64p7 s390 s390x x86_64
5a0f802
852f77e
Name:		libffi
Anthony Green 1bd5eb5
Version:	3.1
e39a957
Release:	24%{?dist}
852f77e
Summary:	A portable foreign function interface library
Anthony Green e4104c0
License:	MIT
852f77e
URL:		http://sourceware.org/libffi
7c8473e
13e42c2
Source0:	ftp://sourceware.org/pub/libffi/libffi-%{version}.tar.gz
5a0f802
Source1:	ffi-multilib.h
5a0f802
Source2:	ffitarget-multilib.h
Anthony Green 1bd5eb5
Patch0:		libffi-3.1-fix-include-path.patch
Anthony Green fe5ad41
Patch1:		libffi-3.1-fix-exec-stack.patch
6464022
Patch2:		libffi-aarch64-rhbz1174037.patch
4fc6914
Patch3:		libffi-3.1-aarch64-fix-exec-stack.patch
852f77e
7c8473e
BuildRequires: gcc
c040208
%if %{without bootstrap}
c040208
BuildRequires: gcc-c++
c040208
BuildRequires: dejagnu
c040208
%endif
7c8473e
852f77e
%description
852f77e
Compilers for high level languages generate code that follow certain
852f77e
conventions.  These conventions are necessary, in part, for separate
852f77e
compilation to work.  One such convention is the "calling convention".
852f77e
The calling convention is a set of assumptions made by the compiler
852f77e
about where function arguments will be found on entry to a function.  A
852f77e
calling convention also specifies where the return value for a function
852f77e
is found.  
852f77e
852f77e
Some programs may not know at the time of compilation what arguments
852f77e
are to be passed to a function.  For instance, an interpreter may be
852f77e
told at run-time about the number and types of arguments used to call a
852f77e
given function.  `Libffi' can be used in such programs to provide a
852f77e
bridge from the interpreter program to compiled code.
852f77e
852f77e
The `libffi' library provides a portable, high level programming
852f77e
interface to various calling conventions.  This allows a programmer to
852f77e
call any function specified by a call interface description at run time.
852f77e
852f77e
FFI stands for Foreign Function Interface.  A foreign function
852f77e
interface is the popular name for the interface that allows code
852f77e
written in one language to call code written in another language.  The
852f77e
`libffi' library really only provides the lowest, machine dependent
852f77e
layer of a fully featured foreign function interface.  A layer must
852f77e
exist above `libffi' that handles type conversions for values passed
852f77e
between the two languages.  
852f77e
852f77e
852f77e
%package	devel
852f77e
Summary:	Development files for %{name}
852f77e
Requires:	%{name} = %{version}-%{release}
4fc6914
Requires:	pkgconfig
852f77e
852f77e
%description	devel
852f77e
The %{name}-devel package contains libraries and header files for
852f77e
developing applications that use %{name}.
852f77e
852f77e
852f77e
%prep
852f77e
%setup -q
f8dded0
%patch0 -p1 -b .fixpath
Anthony Green fe5ad41
%patch1 -p1 -b .execstack
6464022
%patch2 -p1 -b .aarch64
4fc6914
%patch3 -p1 -b .aarch64execstack
852f77e
852f77e
852f77e
%build
852f77e
%configure --disable-static
852f77e
make %{?_smp_mflags}
852f77e
c040208
%check
c040208
%if %{without bootstrap}
c040208
%make_build check
c040208
%endif
852f77e
852f77e
%install
852f77e
make install DESTDIR=$RPM_BUILD_ROOT
852f77e
find $RPM_BUILD_ROOT -name '*.la' -exec rm -f {} ';'
852f77e
rm -f $RPM_BUILD_ROOT%{_infodir}/dir
852f77e
5a0f802
# Determine generic arch target name for multilib wrapper
5a0f802
basearch=%{_arch}
5a0f802
%ifarch %{ix86}
5a0f802
basearch=i386
5a0f802
%endif
5a0f802
71e48fa
mkdir -p $RPM_BUILD_ROOT%{_includedir}
5a0f802
%ifarch %{multilib_arches}
5a0f802
# Do header file switcheroo to avoid file conflicts on systems where you
5a0f802
# can have both a 32- and 64-bit version of the library, and they each need
5a0f802
# their own correct-but-different versions of the headers to be usable.
5a0f802
for i in ffi ffitarget; do
Anthony Green 1bd5eb5
  mv $RPM_BUILD_ROOT%{_libdir}/libffi-%{version}/include/$i.h $RPM_BUILD_ROOT%{_includedir}/$i-${basearch}.h
5a0f802
done
5a0f802
install -m644 %{SOURCE1} $RPM_BUILD_ROOT%{_includedir}/ffi.h
5a0f802
install -m644 %{SOURCE2} $RPM_BUILD_ROOT%{_includedir}/ffitarget.h
Anthony Green b3340e8
%else
71e48fa
mv $RPM_BUILD_ROOT%{_libdir}/libffi-%{version}/include/{ffi,ffitarget}.h $RPM_BUILD_ROOT%{_includedir}
5a0f802
%endif
Anthony Green b3340e8
rm -rf $RPM_BUILD_ROOT%{_libdir}/libffi-%{version}
852f77e
852f77e
654c7ef
%ldconfig_scriptlets
852f77e
852f77e
%files
ebed642
%license LICENSE
ebed642
%doc README
852f77e
%{_libdir}/*.so.*
852f77e
852f77e
%files devel
852f77e
%{_libdir}/pkgconfig/*.pc
c603019
%{_includedir}/ffi*.h
852f77e
%{_libdir}/*.so
852f77e
%{_mandir}/man3/*.gz
34c0933
%{_infodir}/libffi.info.*
852f77e
852f77e
%changelog
e39a957
* Wed Jan 29 2020 Fedora Release Engineering <releng@fedoraproject.org> - 3.1-24
e39a957
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
e39a957
4fbfbe5
* Thu Jul 25 2019 Fedora Release Engineering <releng@fedoraproject.org> - 3.1-23
4fbfbe5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
4fbfbe5
c040208
* Tue Jul  9 2019 Florian Weimer <fweimer@redhat.com> - 3.1-22
c040208
- Run test suite during build (#1727088)
c040208
Anthony Green e4104c0
* Wed Jun 19 2019 Anthony Green <green@redhat.com> - 3.1-21
Anthony Green e4104c0
- Fix license tag
Anthony Green e4104c0
34c0933
* Wed Apr 24 2019 Björn Esser <besser82@fedoraproject.org> - 3.1-20
34c0933
- Remove hardcoded gzip suffix from GNU info pages
34c0933
4f59ea6
* Fri Feb 01 2019 Fedora Release Engineering <releng@fedoraproject.org> - 3.1-19
4f59ea6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
4f59ea6
7c8473e
* Sun Jul 22 2018 Peter Robinson <pbrobinson@fedoraproject.org> 3.1-28
7c8473e
- Fix FTBFS
7c8473e
a67ea03
* Fri Jul 13 2018 Fedora Release Engineering <releng@fedoraproject.org> - 3.1-17
a67ea03
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
a67ea03
5df41d3
* Wed Feb 07 2018 Fedora Release Engineering <releng@fedoraproject.org> - 3.1-16
5df41d3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
5df41d3
654c7ef
* Sat Feb 03 2018 Igor Gnatenko <ignatenkobrain@fedoraproject.org> - 3.1-15
654c7ef
- Switch to %%ldconfig_scriptlets
654c7ef
ccffc17
* Thu Aug 03 2017 Fedora Release Engineering <releng@fedoraproject.org> - 3.1-14
ccffc17
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild
ccffc17
662f416
* Wed Jul 26 2017 Fedora Release Engineering <releng@fedoraproject.org> - 3.1-13
662f416
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
662f416
e3a78d2
* Wed Jul  5 2017 Jens Petersen <petersen@redhat.com> - 3.1-12
e3a78d2
- protect install-info in the rpm scriptlets
e3a78d2
  https://fedoraproject.org/wiki/Packaging:Scriptlets#Texinfo
e3a78d2
4fc6914
* Tue Jun 20 2017 Anthony Green <green@redhat.com> - 3.1-11
4fc6914
- fix exec stack problem on aarch64 build
4fc6914
2455877
* Fri Feb 10 2017 Fedora Release Engineering <releng@fedoraproject.org> - 3.1-10
2455877
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild
2455877
18d9d42
* Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 3.1-9
18d9d42
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
18d9d42
142e58a
* Wed Jun 17 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 3.1-8
142e58a
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild
142e58a
6464022
* Thu Jan 15 2015 Peter Robinson <pbrobinson@fedoraproject.org> 3.1-7
6464022
- Add patch to fix issues on aarch64 (rhbz 1174037)
6464022
21da08a
* Sun Aug 17 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 3.1-6
21da08a
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild
21da08a
ebed642
* Thu Jul 17 2014 Tom Callaway <spot@fedoraproject.org> - 3.1-5
ebed642
- fix license handling
ebed642
Anthony Green fe5ad41
* Sun Jun 29 2014 Anthony Green <green@redhat.com> - 3.1-4
Anthony Green fe5ad41
- fix exec stack problem on 32-bit build
Anthony Green fe5ad41
a41ac6e
* Thu Jun 12 2014 Dan Horák <dan[at]danny.cz> - 3.1-3
a41ac6e
- fix header path in pkgconfig file
a41ac6e
450db82
* Sat Jun 07 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 3.1-2
450db82
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild
450db82
Anthony Green b3340e8
* Mon May 19 2014 Anthony Green <green@redhat.com> - 3.1-1
Anthony Green b3340e8
- fix non-multiarch builds (arm).
Anthony Green b3340e8
Anthony Green 1bd5eb5
* Mon May 19 2014 Anthony Green <green@redhat.com> - 3.1-0
Anthony Green 1bd5eb5
- update to 3.1.
Anthony Green 1bd5eb5
a06c6a6
* Sat Aug 03 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 3.0.13-5
a06c6a6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild
a06c6a6
1c448e5
* Tue May 28 2013 Tom Callaway <spot@fedoraproject.org> - 3.0.13-4
1c448e5
- fix typos in wrapper headers
1c448e5
5a0f802
* Mon May 27 2013 Tom Callaway <spot@fedoraproject.org> - 3.0.13-3
5a0f802
- make header files multilib safe
5a0f802
c603019
* Sat May 25 2013 Tom Callaway <spot@fedoraproject.org> - 3.0.13-2
c603019
- fix incorrect header pathing (and .pc file)
c603019
Anthony Green f05ce37
* Wed Mar 20 2013 Anthony Green <green@redhat.com> - 3.0.13-1
Anthony Green f05ce37
- update to 3.0.13
Anthony Green f05ce37
bf88038
* Thu Feb 14 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 3.0.11-2
bf88038
- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild
bf88038
c4152dc
* Mon Jan 14 2013 Dennis Gilmore <dennis@ausil.us> - 3.0.11-1
c4152dc
- update to 3.0.11
c4152dc
13e42c2
* Fri Nov 02 2012 Deepak Bhole <dbhole@redhat.com> - 3.0.10-4
13e42c2
- Fixed source location
13e42c2
356a806
* Fri Aug 10 2012 Dennis Gilmore <dennis@ausil.us> - 3.0.10-3
356a806
- drop back to 3.0.10, 3.0.11 was never pushed anywhere as the soname bump broke buildroots
356a806
- as 3.0.11 never went out no epoch needed.
356a806
d65ba29
* Thu Jul 19 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 3.0.11-2
d65ba29
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild
d65ba29
Anthony Green 2d5d2b1
* Fri Apr 13 2012 Anthony Green <green@redhat.com> - 3.0.11-1
Anthony Green 2d5d2b1
- Upgrade to 3.0.11.
Anthony Green 2d5d2b1
3b0df0a
* Fri Jan 13 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 3.0.10-2
3b0df0a
- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild
3b0df0a
Anthony Green 2919e3e
* Tue Aug 23 2011 Anthony Green <green@redhat.com> - 3.0.10-1
Anthony Green 2919e3e
- Upgrade to 3.0.10. 
Anthony Green 2919e3e
a95b47f
* Fri Mar 18 2011 Dan Horák <dan[at]danny.cz> - 3.0.9-3
a95b47f
- added patch for being careful when defining relatively generic symbols
a95b47f
ef8a313
* Mon Feb 07 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 3.0.9-2
ef8a313
- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild
ef8a313
bce594c
* Tue Dec 29 2009 Anthony Green <green@redhat.com> - 3.0.9-1
bce594c
- Upgrade
bce594c
26f44d9
* Fri Jul 24 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 3.0.5-3
26f44d9
- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild
26f44d9
6f19f43
* Wed Feb 25 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 3.0.5-2
6f19f43
- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild
6f19f43
cc7083f
* Tue Jul 08 2008 Anthony Green <green@redhat.com> 3.0.5-1
cc7083f
- Upgrade to 3.0.5
cc7083f
2375866
* Fri Feb 15 2008 Anthony Green <green@redhat.com> 3.0.1-1
2375866
- Upgrade to 3.0.1
2375866
852f77e
* Fri Feb 15 2008 Anthony Green <green@redhat.com> 2.99.9-1
852f77e
- Upgrade to 2.99.9
852f77e
- Require pkgconfig for the devel package.
852f77e
- Update summary.
852f77e
852f77e
* Fri Feb 15 2008 Anthony Green <green@redhat.com> 2.99.8-1
852f77e
- Upgrade to 2.99.8
852f77e
852f77e
* Thu Feb 14 2008 Anthony Green <green@redhat.com> 2.99.7-1
852f77e
- Upgrade to 2.99.7
852f77e
852f77e
* Thu Feb 14 2008 Anthony Green <green@redhat.com> 2.99.6-1
852f77e
- Upgrade to 2.99.6
852f77e
852f77e
* Thu Feb 14 2008 Anthony Green <green@redhat.com> 2.99.4-1
852f77e
- Upgrade to 2.99.4
852f77e
852f77e
* Thu Feb 14 2008 Anthony Green <green@redhat.com> 2.99.3-1
852f77e
- Upgrade to 2.99.3
852f77e
852f77e
* Thu Feb 14 2008 Anthony Green <green@redhat.com> 2.99.2-1
852f77e
- Created.