File libffi.spec of Package libffi

#
# spec file for package libffi
#
# Copyright (c) 2012 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
#
# Please submit bugfixes or comments via http://bugs.opensuse.org/
#

Name:           libffi
%define libsoname %{name}6

Summary:        A portable foreign Function Interface Library
Version:        3.0.11
Release:        0
License:        MIT
Group:          System/Libraries
Url:            http://sourceware.org/libffi/
Source:         ftp://sourceware.org/pub/libffi/%{name}-%{version}.tar.gz
Source1:        baselibs.conf
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
BuildRequires:  pkg-config

%define debug_package_requires %{libsoname} = %{version}-%{release}

%description
The libffi library provides a portable, high level programming
interface to various calling conventions. This allows a programmer
to call any function specified by a call interface description at
run-time.

FFI stands for Foreign Function Interface. 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.
The libffi library really only provides the lowest, machine
dependent layer of a fully featured foreign function interface. A
layer must exist above libffi that handles type conversions for
values passed between the two languages.


%package -n %{libsoname}
Summary:        Shared library for libffi
Group:          System/Libraries

%description -n %{libsoname}
A portable foreign Function Interface Library.
This package contains the shared libffi library.

%package -n %{name}-devel
Summary:        Development package for libffi
Group:          Development/Libraries/C and C++
Requires:       %{libsoname} = %{version}
Requires:       pkg-config

%description -n %{name}-devel
A portable foreign Function Interface Library.
This package contains the files needed to compile programs that use
the libffi library.

%prep
%setup -q

%build
%configure --disable-static
make %{?_smp_mflags}

%install
%makeinstall
find %{buildroot} -name "*.la" -exec rm {} \;
mkdir -p %{buildroot}%{_includedir}
mv %{buildroot}%{_libdir}/%{name}-%{version}/include/* %{buildroot}%{_includedir}

%preun -n %{name}-devel
%install_info_delete --info-dir="%{_infodir}" "%{_infodir}/libffi.info.gz"

%post -n %{libsoname} -p /sbin/ldconfig
%postun -n %{libsoname} -p /sbin/ldconfig

%post -n %{name}-devel
%install_info --info-dir="%{_infodir}" "%{_infodir}/libffi.info.gz"

%clean
rm -rf %{buildroot}

%files -n %{libsoname}
%defattr(-,root,root)
%{_libdir}/%{name}.so.*

%files -n %{name}-devel
%defattr(-,root,root)
%doc ChangeLog* LICENSE README
%{_includedir}/ffi*
%{_libdir}/%{name}.so
%{_libdir}/pkgconfig/%{name}.pc
%{_infodir}/%{name}.info.gz
%{_mandir}/man3/ffi*

%changelog