2013-05-08 14:29:53 +02:00
|
|
|
#
|
|
|
|
# spec file for package ffcall
|
|
|
|
#
|
2023-09-12 13:07:55 +02:00
|
|
|
# Copyright (c) 2023 SUSE LLC
|
2013-05-08 14:29:53 +02:00
|
|
|
#
|
|
|
|
# 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.
|
|
|
|
|
2019-07-10 09:05:17 +02:00
|
|
|
# Please submit bugfixes or comments via https://bugs.opensuse.org/
|
2013-05-08 14:29:53 +02:00
|
|
|
#
|
|
|
|
|
2013-05-14 14:47:53 +02:00
|
|
|
|
2013-05-08 14:29:53 +02:00
|
|
|
# This package uses assembly to do its work. This is the entire list of
|
|
|
|
# supported architectures understood by RPM, even those not currently supported
|
|
|
|
# by Fedora. RPM hasn't heard about line continuations, hence the mess.
|
2019-09-12 17:48:08 +02:00
|
|
|
%global ffcall_arches %ix86 x86_64 %alpha %arm aarch64 parisc hppa1.0 hppa1.1 hppa1.2 hppa2.0 ia64 m68k mips mipsel ppc ppc64 ppc64le ppc8260 ppc8560 ppc32dy4 ppciseries ppcpseries riscv64 s390 s390x %sparc sparc64
|
2013-05-08 14:29:53 +02:00
|
|
|
|
|
|
|
Name: ffcall
|
2021-11-04 15:31:56 +01:00
|
|
|
Version: 2.4
|
2016-02-14 00:08:21 +01:00
|
|
|
Release: 0
|
2013-05-08 14:29:53 +02:00
|
|
|
Summary: Libraries for foreign function call interfaces
|
2019-09-12 17:51:03 +02:00
|
|
|
# As this package only provides a static library together with the header files
|
2019-07-10 09:05:17 +02:00
|
|
|
License: GPL-2.0-or-later
|
2013-05-14 14:47:53 +02:00
|
|
|
Group: Development/Libraries/Other
|
2013-05-08 14:51:47 +02:00
|
|
|
Provides: %{name}-devel = %version-%release
|
2021-05-06 09:52:32 +02:00
|
|
|
URL: https://www.gnu.org/software/libffcall/
|
2018-02-20 12:14:55 +01:00
|
|
|
# https://git.savannah.gnu.org/cgit/libffcall.git/snapshot/libffcall-<version>.tar.gz
|
2017-06-26 10:14:55 +02:00
|
|
|
Source0: https://ftp.gnu.org/gnu/libffcall/libffcall-%{version}.tar.gz
|
2019-08-26 09:38:33 +02:00
|
|
|
Source1: https://ftp.gnu.org/gnu/libffcall/libffcall-%{version}.tar.gz.sig
|
|
|
|
Source2: https://savannah.gnu.org/project/memberlist-gpgkeys.php?group=libffcall&download=1#/%{name}.keyring
|
2023-09-12 13:07:55 +02:00
|
|
|
Patch1: riscv-pic.patch
|
2019-07-10 09:05:17 +02:00
|
|
|
Provides: ffcall-devel
|
2022-04-27 11:07:50 +02:00
|
|
|
Requires: libavcall1 = %{version}-%{release}
|
|
|
|
Requires: libcallback1 = %{version}-%{release}
|
|
|
|
Requires: libffcall0 = %{version}-%{release}
|
|
|
|
Requires: libtrampoline1 = %{version}-%{release}
|
2013-05-08 14:29:53 +02:00
|
|
|
ExclusiveArch: %{ffcall_arches}
|
|
|
|
|
2021-05-06 10:28:58 +02:00
|
|
|
%if ! %{defined _rpmmacrodir}
|
2021-05-06 10:30:39 +02:00
|
|
|
%define _rpmmacrodir %{_sysconfdir}/rpm
|
2021-05-06 10:28:58 +02:00
|
|
|
%endif
|
|
|
|
|
2013-05-08 14:29:53 +02:00
|
|
|
%description
|
|
|
|
This is a collection of four libraries which can be used to build
|
|
|
|
foreign function call interfaces in embedded interpreters. The four
|
|
|
|
packages are:
|
|
|
|
- avcall: calling C functions with variable arguments
|
|
|
|
- vacall: C functions accepting variable argument prototypes
|
|
|
|
- trampoline: closures as first-class C functions
|
|
|
|
- callback: closures with variable arguments as first-class C functions
|
|
|
|
(a reentrant combination of vacall and trampoline)
|
|
|
|
|
2022-04-27 11:07:50 +02:00
|
|
|
%package -n libavcall1
|
|
|
|
Summary: FFI library for variadic argument functions
|
|
|
|
Group: System/Libraries
|
|
|
|
Conflicts: libffcall0 < %{version}-%{release}
|
|
|
|
|
|
|
|
%description -n libavcall1
|
|
|
|
A library for building foreign function call interfaces in embedded
|
|
|
|
interpreters.
|
|
|
|
This library allows calling C functions with variable argument
|
|
|
|
prototypes.
|
|
|
|
|
|
|
|
%package -n libcallback1
|
|
|
|
Summary: FFI library for closures with variable arguments
|
|
|
|
Group: System/Libraries
|
|
|
|
Conflicts: libffcall0 < %{version}-%{release}
|
|
|
|
|
|
|
|
%description -n libcallback1
|
|
|
|
A library for building foreign function call interfaces in embedded
|
|
|
|
interpreters.
|
|
|
|
|
|
|
|
This library allows for closures with variable arguments as
|
|
|
|
first-class C functions (a reentrant combination of vacall and
|
|
|
|
trampoline).
|
|
|
|
|
|
|
|
%package -n libffcall0
|
2017-09-11 11:55:00 +02:00
|
|
|
Summary: Libraries for foreign function call interfaces
|
|
|
|
Group: System/Libraries
|
|
|
|
|
2022-04-27 11:07:50 +02:00
|
|
|
%description -n libffcall0
|
|
|
|
A library for building foreign function call interfaces in embedded
|
|
|
|
interpreters.
|
|
|
|
|
|
|
|
%package -n libtrampoline1
|
|
|
|
Summary: FFI library for closures as first-class C functions
|
|
|
|
Group: System/Libraries
|
|
|
|
Conflicts: libffcall0 < %{version}-%{release}
|
|
|
|
|
|
|
|
%description -n libtrampoline1
|
|
|
|
A library for building foreign function call interfaces in embedded
|
|
|
|
interpreters.
|
|
|
|
This library allows using closures (lambdas) as first-class C
|
|
|
|
functions.
|
2013-05-08 14:29:53 +02:00
|
|
|
|
|
|
|
%prep
|
2024-02-29 15:11:30 +01:00
|
|
|
%autosetup -p1 -n libffcall-%{version}
|
|
|
|
|
2017-06-26 10:14:55 +02:00
|
|
|
if ! test -e /usr/include/asm/cachectl.h
|
|
|
|
then
|
|
|
|
# FIX-OPENSUSE -- Remove this if there is no <asm/cachectl.h>
|
|
|
|
for c in callback/trampoline_r/trampoline.c trampoline/trampoline.c
|
|
|
|
do
|
|
|
|
echo 'No <asm/cachectl.h> on this architecture %arch'
|
|
|
|
sed -ri '/^#ifdef linux/,/^#else/{ \@#include <asm/cachectl.h>@d }' $c
|
|
|
|
done
|
|
|
|
fi
|
2013-05-08 14:29:53 +02:00
|
|
|
|
|
|
|
# Remove prebuilt object files
|
|
|
|
find . -name \*.o | xargs rm -f
|
|
|
|
|
|
|
|
%build
|
2019-10-14 12:31:59 +02:00
|
|
|
%global _lto_cflags %{?_lto_cflags} -ffat-lto-objects
|
2018-02-20 12:14:55 +01:00
|
|
|
export CFLAGS="%{optflags} -g -fPIC -fno-strict-aliasing"
|
|
|
|
export STRIP=true STRIPPROG=true
|
|
|
|
%configure --disable-rpath --with-gnu-ld --enable-thread=posix
|
2017-06-26 10:29:02 +02:00
|
|
|
if test -e /.build.log
|
|
|
|
then
|
|
|
|
grep -E '^#define (CODE|HAVE)' config.h
|
2017-06-26 15:05:39 +02:00
|
|
|
sed -rn '/checking whether code in malloc\(\)ed memory is executable/,/result: /p' config.log
|
2017-06-26 10:29:02 +02:00
|
|
|
fi
|
2013-05-08 14:29:53 +02:00
|
|
|
make # %{?_smp_mflags}
|
|
|
|
|
|
|
|
%install
|
|
|
|
mkdir -p %{buildroot}%{_libdir}
|
|
|
|
mkdir -p %{buildroot}%{_mandir}
|
2017-06-27 17:34:25 +02:00
|
|
|
mkdir -p %{buildroot}%{_defaultdocdir}/%{name}
|
2018-02-20 12:14:55 +01:00
|
|
|
export STRIP=true STRIPPROG=true
|
|
|
|
make install DESTDIR=%{buildroot} STRIP=true STRIPPROG=true
|
2013-05-08 14:29:53 +02:00
|
|
|
rm -fr %{buildroot}%{_datadir}/html
|
|
|
|
rm -f %{buildroot}%{_libdir}/*.la
|
2017-06-27 17:42:12 +02:00
|
|
|
if test %debug = yes ; then
|
|
|
|
install config.log %{buildroot}%{_defaultdocdir}/%{name}
|
2017-06-27 17:48:29 +02:00
|
|
|
echo %{_defaultdocdir}/%{name}/config.log > list
|
|
|
|
else
|
|
|
|
> list
|
2017-06-27 17:42:12 +02:00
|
|
|
fi
|
2013-05-08 14:29:53 +02:00
|
|
|
cd %{buildroot}%{_mandir}/man3
|
|
|
|
|
|
|
|
# Advertise supported architectures
|
2021-05-06 09:52:32 +02:00
|
|
|
mkdir -p %{buildroot}%{_rpmmacrodir}
|
|
|
|
cat > %{buildroot}%{_rpmmacrodir}/macros.%{name} << EOF
|
2013-05-08 14:29:53 +02:00
|
|
|
# arches that ffcall supports
|
|
|
|
%%ffcall_arches %{ffcall_arches}
|
|
|
|
EOF
|
|
|
|
|
|
|
|
# Fix man pages with overly generic names (bz 800360)
|
|
|
|
for page in *; do
|
|
|
|
mv $page %{name}-$page
|
|
|
|
done
|
|
|
|
|
2023-09-12 13:07:55 +02:00
|
|
|
%check
|
|
|
|
make check
|
|
|
|
|
2022-04-27 11:07:50 +02:00
|
|
|
%post -n libavcall1 -p /sbin/ldconfig
|
|
|
|
%postun -n libavcall1 -p /sbin/ldconfig
|
|
|
|
%post -n libcallback1 -p /sbin/ldconfig
|
|
|
|
%postun -n libcallback1 -p /sbin/ldconfig
|
|
|
|
%post -n libffcall0 -p /sbin/ldconfig
|
|
|
|
%postun -n libffcall0 -p /sbin/ldconfig
|
|
|
|
%post -n libtrampoline1 -p /sbin/ldconfig
|
|
|
|
%postun -n libtrampoline1 -p /sbin/ldconfig
|
2017-09-11 11:55:00 +02:00
|
|
|
|
2017-06-27 17:48:29 +02:00
|
|
|
%files -f list
|
2019-07-10 09:13:48 +02:00
|
|
|
%if 0%{?sle_version} > 120200 || 0%{?suse_version} > 1320
|
2019-07-10 09:08:00 +02:00
|
|
|
%license COPYING
|
2019-07-10 09:13:48 +02:00
|
|
|
%else
|
|
|
|
%doc COPYING
|
|
|
|
%endif
|
2019-07-10 09:08:00 +02:00
|
|
|
%doc README NEWS
|
2013-05-08 14:29:53 +02:00
|
|
|
%doc avcall/avcall.html
|
|
|
|
%doc callback/callback.html
|
|
|
|
%doc callback/trampoline_r/trampoline_r.html
|
|
|
|
%doc trampoline/trampoline.html
|
|
|
|
%doc vacall/vacall.html
|
|
|
|
%{_libdir}/*.a
|
2017-09-11 11:55:00 +02:00
|
|
|
%{_libdir}/*.so
|
2013-05-08 14:29:53 +02:00
|
|
|
%{_includedir}/*
|
|
|
|
%doc %{_mandir}/man*/*
|
2021-05-06 09:52:32 +02:00
|
|
|
%{_rpmmacrodir}/macros.%{name}
|
2013-05-08 14:29:53 +02:00
|
|
|
|
2022-04-27 11:07:50 +02:00
|
|
|
%files -n libavcall1
|
|
|
|
%{_libdir}/libavcall.so.*
|
|
|
|
|
|
|
|
%files -n libcallback1
|
|
|
|
%{_libdir}/libcallback.so.*
|
|
|
|
|
|
|
|
%files -n libffcall0
|
|
|
|
%{_libdir}/libffcall.so.*
|
|
|
|
|
|
|
|
%files -n libtrampoline1
|
|
|
|
%{_libdir}/libtrampoline.so.*
|
2017-09-11 11:55:00 +02:00
|
|
|
|
2013-05-08 14:29:53 +02:00
|
|
|
%changelog
|