From: Dongkyun Son Date: Wed, 19 Feb 2025 02:33:51 +0000 (+0900) Subject: Add packaging with v3.4.7 X-Git-Tag: accepted/tizen/base/20250224.033227~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fheads%2Ftizen_base_dev;p=platform%2Fupstream%2Flibffi.git Add packaging with v3.4.7 Signed-off-by: Seung-Woo Kim Signed-off-by: Dongkyun Son --- diff --git a/packaging/baselibs.conf b/packaging/baselibs.conf new file mode 100755 index 0000000..551c07e --- /dev/null +++ b/packaging/baselibs.conf @@ -0,0 +1,3 @@ +libffi +libffi-devel + requires "libffi- = " diff --git a/packaging/ffi-multilib.h b/packaging/ffi-multilib.h new file mode 100755 index 0000000..50a6226 --- /dev/null +++ b/packaging/ffi-multilib.h @@ -0,0 +1,23 @@ +/* This file is here to prevent a file conflict on multiarch systems. */ +#ifdef ffi_wrapper_h +#error "Do not define ffi_wrapper_h!" +#endif +#define ffi_wrapper_h + +#if defined(__i386__) +#include "ffi-i386.h" +#elif defined(__powerpc64__) +#include "ffi-ppc64.h" +#elif defined(__powerpc__) +#include "ffi-ppc.h" +#elif defined(__s390x__) +#include "ffi-s390x.h" +#elif defined(__s390__) +#include "ffi-s390.h" +#elif defined(__x86_64__) +#include "ffi-x86_64.h" +#else +#error "The libffi-devel package is not usable with the architecture." +#endif + +#undef ffi_wrapper_h diff --git a/packaging/ffitarget-multilib.h b/packaging/ffitarget-multilib.h new file mode 100755 index 0000000..b2ed545 --- /dev/null +++ b/packaging/ffitarget-multilib.h @@ -0,0 +1,23 @@ +/* This file is here to prevent a file conflict on multiarch systems. */ +#ifdef ffitarget_wrapper_h +#error "Do not define ffitarget_wrapper_h!" +#endif +#define ffitarget_wrapper_h + +#if defined(__i386__) +#include "ffitarget-i386.h" +#elif defined(__powerpc64__) +#include "ffitarget-ppc64.h" +#elif defined(__powerpc__) +#include "ffitarget-ppc.h" +#elif defined(__s390x__) +#include "ffitarget-s390x.h" +#elif defined(__s390__) +#include "ffitarget-s390.h" +#elif defined(__x86_64__) +#include "ffitarget-x86_64.h" +#else +#error "The libffi-devel package is not usable with the architecture." +#endif + +#undef ffitarget_wrapper_h diff --git a/packaging/libffi.manifest b/packaging/libffi.manifest new file mode 100755 index 0000000..2a0cec5 --- /dev/null +++ b/packaging/libffi.manifest @@ -0,0 +1,5 @@ + + + + + diff --git a/packaging/libffi.spec b/packaging/libffi.spec new file mode 100755 index 0000000..a8c013e --- /dev/null +++ b/packaging/libffi.spec @@ -0,0 +1,115 @@ +%define keepstatic 1 +%global multilib_arches %{ix86} x86_64 + +Name: libffi +Version: 3.4.7 +Release: 0 +Summary: A portable foreign function interface library +License: MIT +Url: http://sourceware.org/libffi +Group: Base/Toolchain +Source0: ftp://sourceware.org/pub/libffi/libffi-%{version}.tar.gz +Source1: ffi-multilib.h +Source2: ffitarget-multilib.h +Source1001: %{name}.manifest +BuildRequires: makeinfo + +%description +Compilers for high level languages generate code that follow certain +conventions. These conventions are necessary, in part, for separate +compilation to work. One such convention is the "calling convention". +The calling convention is a set of assumptions made by the compiler +about where function arguments will be found on entry to a function. A +calling convention also specifies where the return value for a function +is found. + +Some programs may not know at the time of compilation what arguments +are to be passed to a function. For instance, an interpreter may be +told at run-time about the number and types of arguments used to call a +given function. `Libffi' can be used in such programs to provide a +bridge from the interpreter program to compiled code. + +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 devel +Summary: Development files for %{name} +Requires: %{name} = %{version} +Requires: pkgconfig + +%description devel +The %{name}-devel package contains libraries and header files for +developing applications that use %{name}. + +%package devel-static +Summary: Development files for %{name} +Requires: %{name}-devel = %{version} + +%description devel-static +The %{name}-devel package contains libraries and header files for +developing applications that use %{name}. + +%prep +%setup -q + +%build +cp %{SOURCE1001} . + +export LDFLAGS+="-Wl,-z,noexecstack" +%reconfigure "--enable-portable-binary" +%{__make} %{?_smp_mflags} + +%install +%make_install + +# Determine generic arch target name for multilib wrapper +basearch=%{_arch} +%ifarch %{ix86} +basearch=i386 +%endif + +%ifarch %{multilib_arches} +# Do header file switcheroo to avoid file conflicts on systems where you +# can have both a 32- and 64-bit version of the library, and they each need +# their own correct-but-different versions of the headers to be usable. +for i in ffi ffitarget; do + mv %{buildroot}%{_includedir}/$i.h %{buildroot}%{_includedir}/$i-${basearch}.h +done +install -m644 %{SOURCE1} %{buildroot}%{_includedir}/ffi.h +install -m644 %{SOURCE2} %{buildroot}%{_includedir}/ffitarget.h +%endif + + +%post -p /sbin/ldconfig + +%postun -p /sbin/ldconfig + + +%files +%manifest libffi.manifest +%defattr(-,root,root,-) +%license LICENSE +%{_libdir}/*.so.* + +%files devel +%defattr(-,root,root,-) +%{_libdir}/pkgconfig/*.pc +%{_includedir}/ffi*.h +%{_libdir}/*.so +%{_mandir}/man3/*.gz +%{_infodir}/libffi.info.gz + +%changelog + +%files devel-static +%defattr(-,root,root,-) +%{_libdir}/*.a