Summary:	Foreign function interface library
Summary(ja): 	Foreign function interface ライブラリ
Name:		libffi321
Version:	3.2.1
Release: 	1%{?_dist_release}
Source0:	ftp://sourceware.org/pub/libffi/libffi-%{version}.tar.gz
Patch0:		libffi-3.1-fix-include-path.patch
License:	Distributable
Group:		System Environment/Libraries
URL:		http://sourceware.org/libffi/

BuildRequires:	gcc
BuildRequires:	texinfo
BuildRoot:	%{_tmppath}/%{name}-%{version}-root
Obsoletes:	libffi < 3.3
Provides:	libffi = %{version}-%{release}

Vendor: Project Vine
Distribution: Vine Linux

%description
A foreign function interface is the popular name for the interface
that allows code written in one language to call code written in
another language. 

%description -l ja
Foreign function interface は一般に普及しているインターフェイスで、
ある言語で書かれたコードから、他の言語で書かれたコードを呼び出すこ
とを可能にします。

#-----------------------------------------------------------------------------

%prep

%setup -q -n libffi-%{version}
%patch0 -p1

%build
autoreconf -ifv
%configure
%{__make}


%install
%{__rm} -rf ${RPM_BUILD_ROOT}
%{__make} install DESTDIR=${RPM_BUILD_ROOT}

# move include files.
%{__mv} ${RPM_BUILD_ROOT}/%{_libdir}/libffi-%{version}/include ${RPM_BUILD_ROOT}/%{_includedir}
sed -i -e "s|^includedir=.*include$|includedir=%{_includedir}|" \
	${RPM_BUILD_ROOT}/%{_libdir}/pkgconfig/libffi.pc

# remove unnecessary files.
%{__rm} -rf ${RPM_BUILD_ROOT}/%{_libdir}/libffi.la
%{__rm} -rf ${RPM_BUILD_ROOT}/%{_infodir}/dir

rm -f %{buildroot}%{_libdir}/pkgconfig/*
rm -f %{buildroot}%{_libdir}/libffi.a
rm -f %{buildroot}%{_libdir}/libffi.so
rm -f %{buildroot}%{_includedir}/*.h
rm -f %{buildroot}%{_infodir}/*
rm -f %{buildroot}%{_mandir}/man3/*


%clean
%{__rm} -rf ${RPM_BUILD_ROOT}

%post -p /sbin/ldconfig
%postun -p /sbin/ldconfig


%files
%defattr(-,root,root)
%license LICENSE
%doc ChangeLog* README  
%{_libdir}/libffi.so.*


%changelog
* Wed Apr 15 2020 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 3.2.1-1
- renamed from libffi to libffi321.
- built for compatibility.

* Tue Jan 02 2018 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 3.2.1-1
- updated to 3.2.1.
- imported Patch0 from rawhide.

* Sun Jul 06 2014 Yoji TOYODA <bsyamato@sea.plala.or.jp> 3.0.13-1
- update to 3.0.13

* Wed Aug 17 2011 Yoji TOYODA <bsyamato@sea.plala.or.jp> 3.0.9-4
- create compat32 sub packages

* Fri Nov 26 2010 Shu KONNO <owa@bg.wakwak.com> 3.0.9-3
- fixed includedir in libffi.pc

* Tue Sep 21 2010 IWAI, Masaharu <iwai@alib.jp> 3.0.9-2
- build with rpm-4.8.1-1 for pkg-config file

* Tue Feb 23 2010 Ryoichi INAGAKI <ryo1@bc.wakwak.com> - 3.0.9-1
- new upstream release
- built with new toolchain

* Wed Jan 21 2009 MATSUBAYASHI Kohji <shaolin@vinelinux.org> - 3.0.8-1
- new upstream release
- spec in UTF-8

* Thu Apr 17 2008 MATSUBAYASHI Kohji <shaolin@vinelinux.org> 3.0.5-1
- updated to new upstream release

* Wed Apr 02 2008 Kazutaka HARADA <kazutaka@dc4.so-net.ne.jp> 3.0.4-1
- apply new versioning policy

* Sun Mar 02 2008 Kazutaka HARADA <kazutaka@dc4.so-net.ne.jp> 3.0.4-0vl1
- initial build for Vine Linux
