Jerry James dcc9b78
# Only a static library is provided, so no debug information can be extracted.
173d1eb
%global debug_package %{nil}
173d1eb
Jerry James dcc9b78
# This package uses assembly to do its work.  This is the entire list of
Jerry James dcc9b78
# supported architectures understood by RPM, even those not currently supported
Jerry James dcc9b78
# by Fedora.  RPM hasn't heard about line continuations, hence the mess.
943ac78
%global ffcall_arches %{ix86} x86_64 amd64 %{alpha} %{arm} parisc hppa1.0 hppa1.1 hppa1.2 hppa2.0 ia64 m68k %{mips32} ppc ppc8260 ppc8560 ppc32dy4 ppciseries ppcpseries %{power64} s390 s390x %{sparc}
Jerry James dcc9b78
2d8e2ca
Name:           ffcall
943ac78
Version:        1.13
4733f16
Release:        2%{?dist}
2d8e2ca
Summary:        Libraries for foreign function call interfaces
2d8e2ca
2d8e2ca
License:        GPLv2+
173d1eb
URL:            http://www.gnu.org/software/libffcall/
943ac78
# Upstream no longer provides tarballs.  To generate the tarball:
943ac78
#   git clone git://git.savannah.gnu.org/libffcall.git
943ac78
#   cd libffcall
943ac78
#   git reset --hard 0455e86c9c24f7bc2bd7ed036b5815223254a965
943ac78
#   rm -fr .git*
943ac78
#   cd ..
943ac78
#   tar cJf ffcall-%%{version}.tar.xz libfcall
943ac78
Source0:        %{name}-%{version}.tar.xz
4733f16
# Fix multiple errors in the 32-bit x86 assembly syntax conversion
4733f16
Patch0:         %{name}-i386.patch
Jerry James dcc9b78
daaeacc
BuildRequires:  gcc
943ac78
BuildRequires:  gnulib-devel
943ac78
BuildRequires:  libtool
daaeacc
Jerry James dcc9b78
Provides:       %{name}-static = %{version}-%{release}
2d8e2ca
Jerry James dcc9b78
ExclusiveArch:  %{ffcall_arches}
2d8e2ca
2d8e2ca
%description
2d8e2ca
This is a collection of four libraries which can be used to build
173d1eb
foreign function call interfaces in embedded interpreters.  The four
173d1eb
packages are:
173d1eb
 - avcall: calling C functions with variable arguments
173d1eb
 - vacall: C functions accepting variable argument prototypes
173d1eb
 - trampoline: closures as first-class C functions
173d1eb
 - callback: closures with variable arguments as first-class C functions
173d1eb
   (a reentrant combination of vacall and trampoline)
2d8e2ca
2d8e2ca
2d8e2ca
%prep
943ac78
%setup -q -n libffcall
4733f16
%patch0
978f9ba
943ac78
# Preserve timestamps
943ac78
for fil in $(find . -name Makefile\*); do
943ac78
  sed -i 's/^[[:blank:]]*cp[[:blank:]]/&-p /' $fil
943ac78
done
943ac78
943ac78
# Upstream does not ship a configure script, and autogen.sh wants to download
943ac78
make -f Makefile.maint \
943ac78
         gnulib-clean glm4/gnulib-cache.m4 gnulib-imported-files \
943ac78
         GNULIB_TOOL="%{_bindir}/gnulib-tool"
943ac78
make -C callback/vacall_r -f Makefile.maint copied-files
943ac78
make -C callback/trampoline_r -f Makefile.maint copied-files
943ac78
make -f Makefile.maint totally-clean
943ac78
autoreconf -fi -I $PWD/m4 -I $PWD/glm4
943ac78
943ac78
# Throw away OS X code that causes a syntax error on Linux
943ac78
sed -i '\%/EH_FRAME_SECTION%,/EOF/d;/Likewise/aEOF' common/asm-x86_64.sh
943ac78
943ac78
# On ARM, the script throws away .file directives, but not .loc directives,
943ac78
# leading to a compilation error.  Keep both for better debuginfo.
943ac78
sed -i '/\.file/d' common/asm-arm.sh
943ac78
943ac78
# We are not AIX.  We are Linux.
943ac78
sed -i 's, $(srcdir)/avcall-powerpc64-aix\.s,,' avcall/Makefile.in
943ac78
sed -i 's, $(srcdir)/vacall-powerpc64-aix\.s,,' vacall/Makefile.in
943ac78
sed -i 's, $(srcdir)/vacall-powerpc64-aix\.s,,' callback/vacall_r/Makefile.in
943ac78
943ac78
# Endianness comparisons always fail, but we don't care because we only want to
943ac78
# build for the host architecture.
943ac78
sed -i '/^\([[:blank:]]*\)cmp[[:blank:]]/d' avcall/Makefile.devel \
943ac78
  vacall/Makefile.devel callback/vacall_r/Makefile.devel
943ac78
943ac78
# We are not really cross-compiling, even though the Makefile thinks so
943ac78
cat > cross << EOF
943ac78
#!/bin/sh
943ac78
shift 2
943ac78
if [ "\$1" = "-V" ]; then
943ac78
  shift 2
943ac78
fi
943ac78
gcc $CFLAGS \$@
943ac78
EOF
943ac78
chmod a+x cross
2d8e2ca
2d8e2ca
%build
943ac78
# Use our fake cross-compilation script
943ac78
PATH=$PATH:$PWD
943ac78
export CFLAGS="$RPM_OPT_FLAGS -fPIC"
943ac78
%ifarch %{arm}
943ac78
CFLAGS="$CFLAGS -fno-strict-aliasing"
943ac78
%endif
2d8e2ca
%configure
943ac78
943ac78
# Find out what ffcall thinks the arch name is
943ac78
FFARCH=$(sed -n "s/HOST_CPU_C_ABI='\(.*\)'/\1/p" config.log)
943ac78
4733f16
%ifarch %{ix86}
4733f16
make -f Makefile.maint common/asm-i386.h
4733f16
%endif
4733f16
943ac78
# Construct files needed for the build; failure is not necessarily fatal
943ac78
make -C avcall -f Makefile.devel avcall-$FFARCH-linux.s || :
943ac78
make -C avcall -f Makefile.devel avcall-$FFARCH-macro.S || :
943ac78
make -C vacall -f Makefile.devel vacall-$FFARCH-linux.s || :
943ac78
make -C vacall -f Makefile.devel vacall-$FFARCH-macro.S || :
943ac78
make -C callback/vacall_r -f Makefile.devel vacall-$FFARCH-linux.s || :
943ac78
make -C callback/vacall_r -f Makefile.devel vacall-$FFARCH-macro.S || :
943ac78
943ac78
# Build the actual library
2d8e2ca
make # %{?_smp_mflags}
2d8e2ca
2d8e2ca
%install
2d8e2ca
mkdir -p $RPM_BUILD_ROOT%{_libdir}
2d8e2ca
mkdir -p $RPM_BUILD_ROOT%{_mandir}
2d8e2ca
make install DESTDIR=$RPM_BUILD_ROOT
2d8e2ca
rm -fr $RPM_BUILD_ROOT%{_datadir}/html
2d8e2ca
rm -f $RPM_BUILD_ROOT%{_libdir}/*.la
Jerry James dcc9b78
cd $RPM_BUILD_ROOT%{_mandir}/man3
Jerry James dcc9b78
Jerry James dcc9b78
# Advertise supported architectures
Jerry James 0a62d78
mkdir -p $RPM_BUILD_ROOT%{_rpmconfigdir}/macros.d
Jerry James 0a62d78
cat > $RPM_BUILD_ROOT%{_rpmconfigdir}/macros.d/macros.%{name} << EOF
Jerry James dcc9b78
# arches that ffcall supports
Jerry James dcc9b78
%%ffcall_arches %{ffcall_arches}
Jerry James dcc9b78
EOF
Jerry James dcc9b78
Jerry James dcc9b78
# Fix man pages with overly generic names (bz 800360)
Jerry James dcc9b78
for page in *; do
Jerry James dcc9b78
  mv $page %{name}-$page
Jerry James dcc9b78
done
2d8e2ca
2d8e2ca
%files
Jerry James 03f330a
%license COPYING
Jerry James 03f330a
%doc README NEWS
2d8e2ca
%doc avcall/avcall.html
2d8e2ca
%doc callback/callback.html
2d8e2ca
%doc callback/trampoline_r/trampoline_r.html
2d8e2ca
%doc trampoline/trampoline.html
2d8e2ca
%doc vacall/vacall.html
2d8e2ca
%{_libdir}/*.a
2d8e2ca
%{_includedir}/*
2d8e2ca
%{_mandir}/man*/*
Jerry James 0a62d78
%{_rpmconfigdir}/macros.d/macros.%{name}
2d8e2ca
2d8e2ca
2d8e2ca
%changelog
4733f16
* Fri Feb 24 2017 Jerry James <loganjerry@gmail.com> - 1.13-2
4733f16
- Fix missing symbols in the i386 build
4733f16
943ac78
* Fri Feb 24 2017 Jerry James <loganjerry@gmail.com> - 1.13-1
943ac78
- New upstream release
943ac78
2f111ef
* Fri Feb 10 2017 Fedora Release Engineering <releng@fedoraproject.org> - 1.12-3
2f111ef
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild
2f111ef
dcbf92f
* Wed Feb 03 2016 Fedora Release Engineering <releng@fedoraproject.org> - 1.12-2
dcbf92f
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
dcbf92f
3bd81cd
* Tue Sep 29 2015 Jerry James <loganjerry@gmail.com> - 1.12-1
3bd81cd
- New upstream release
3bd81cd
012f745
* Wed Jun 17 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.10-18.20120424cvs
012f745
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild
012f745
Jerry James 03f330a
* Fri Feb 13 2015 Jerry James <loganjerry@gmail.com> - 1.10-17.20120424cvs
Jerry James 03f330a
- Use license macro
Jerry James 03f330a
31fff07
* Sat Aug 16 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.10-16.20120424cvs
31fff07
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild
31fff07
f58b6e2
* Sat Jun 07 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.10-15.20120424cvs
f58b6e2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild
f58b6e2
Jerry James 0a62d78
* Mon Feb  3 2014 Jerry James <loganjerry@gmail.com> - 1.10-14.20120424cvs
Jerry James 0a62d78
- Update location of rpm macro file for rpm >= 4.11
Jerry James 0a62d78
Jerry James cbbc846
* Fri Sep  6 2013 Jerry James <loganjerry@gmail.com> - 1.10-13.20120424cvs
Jerry James cbbc846
- Update -arm patch to really use the EABI and hopefully fix clisp
Jerry James cbbc846
Jerry James dd17361
* Wed Sep  4 2013 Jerry James <loganjerry@gmail.com> - 1.10-12.20120424cvs
Jerry James dd17361
- Add -arm patch to fix clisp build failure
Jerry James dd17361
80cc160
* Sat Aug 03 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.10-11.20120424cvs
80cc160
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild
80cc160
Jerry James dcc9b78
* Wed Mar 27 2013 Jerry James <loganjerry@gmail.com> - 1.10-10.20120424cvs
Jerry James dcc9b78
- Update to CVS 20120424
Jerry James dcc9b78
- List all architectures supported by this package (bz 925335)
Jerry James dcc9b78
- Rename man pages to avoid conflicts (bz 800360)
Jerry James dcc9b78
- Add Provides: ffcall-static
Jerry James dcc9b78
7c6a64b
* Wed Feb 13 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.10-9.20100903cvs
7c6a64b
- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild
7c6a64b
a9153ae
* Thu Jul 19 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.10-8.20100903cvs
a9153ae
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild
a9153ae
978f9ba
* Tue Jan 10 2012 Jerry James <loganjerry@gmail.com> - 1.10-7.20100903cvs
978f9ba
- Clean out prebuilt object files
978f9ba
- Add trampoline patch to force use of mmap() to get executable memory
978f9ba
978f9ba
* Mon Jan  9 2012 Jerry James <loganjerry@gmail.com> - 1.10-6.20100903cvs
173d1eb
- Update to CVS 20100903
173d1eb
- Minor spec file cleanups
173d1eb
ab62980
* Tue Feb 08 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.10-5.20080704cvs.1
ab62980
- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild
ab62980
e2e8764
* Fri Jul 24 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.10-4.20080704cvs.1
e2e8764
- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild
e2e8764
bcb6675
* Tue Feb 24 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.10-3.20080704cvs.1
bcb6675
- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild
bcb6675
608d45d
* Wed Dec 10 2008 Jochen Schmitt <Jochen herr-schmitt de> - 1.10-2.20080704cvs.1
608d45d
- Fix -FPIC issue (BZ #475112)
608d45d
5d87966
* Fri Jul  4 2008 Gerard Milmeister <gemi@bluewin.ch> - 1.10-2.20080704cvs
5d87966
- update to cvs 20080704
5d87966
- support for ppc64
5d87966
2d8e2ca
* Mon Feb 25 2008 Gerard Milmeister <gemi@bluewin.ch> - 1.10-1
2d8e2ca
- first Fedora release