add packaging
authorAnas Nashif <anas.nashif@intel.com>
Mon, 8 Jul 2013 00:56:29 +0000 (20:56 -0400)
committerMikko Ylinen <mikko.ylinen@intel.com>
Tue, 25 Nov 2014 14:31:53 +0000 (16:31 +0200)
.gbs.conf [new file with mode: 0644]
packaging/baselibs.conf [new file with mode: 0644]
packaging/ffi-multilib.h [new file with mode: 0644]
packaging/ffitarget-multilib.h [new file with mode: 0644]
packaging/libffi.spec [new file with mode: 0644]

diff --git a/.gbs.conf b/.gbs.conf
new file mode 100644 (file)
index 0000000..2290232
--- /dev/null
+++ b/.gbs.conf
@@ -0,0 +1,3 @@
+[general]
+upstream_branch = upstream
+upstream_tag = v${upstreamversion}
diff --git a/packaging/baselibs.conf b/packaging/baselibs.conf
new file mode 100644 (file)
index 0000000..551c07e
--- /dev/null
@@ -0,0 +1,3 @@
+libffi
+libffi-devel
+    requires "libffi-<targettype> = <version>"
diff --git a/packaging/ffi-multilib.h b/packaging/ffi-multilib.h
new file mode 100644 (file)
index 0000000..50a6226
--- /dev/null
@@ -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 100644 (file)
index 0000000..b2ed545
--- /dev/null
@@ -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.spec b/packaging/libffi.spec
new file mode 100644 (file)
index 0000000..dc38a2e
--- /dev/null
@@ -0,0 +1,98 @@
+%global multilib_arches %{ix86}  x86_64
+
+Name:           libffi
+Version:        3.0.13
+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
+
+%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}.
+
+%prep
+%setup -q
+
+
+%build
+%configure --disable-static
+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
+%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