Blob Blame History Raw
# The memory management scheme does not work with PIE
%undefine _hardened_build

Name:           polyml
Version:        5.6
Release:        3%{?dist}
Summary:        Poly/ML compiler and runtime system

License:        LGPLv2+
URL:            http://www.polyml.org/
Source0:        https://github.com/%{name}/%{name}/archive/v%{version}.tar.gz
# Patch from the fixes-5.6 git branch, with post-release bug fixes
Patch0:         %{name}-fixes.patch

# The standard solution to kill the libtool-induced RPATH is to edit the
# libtool script to kill it.  However, that causes problems for us as we need
# to run polyimport at build time.  With the standard approach, it cannot find
# its libraries.
#
# A clean solution would involve upstream changing their Makefiles.  We use
# the unclean solution instead: go with the flow, then strip the RPATHs out
# of the binaries at the end.
BuildRequires:  chrpath
BuildRequires:  gcc-c++
BuildRequires:  gmp-devel
BuildRequires:  motif-devel
BuildRequires:  libffi-devel
BuildRequires:  libX11-devel
BuildRequires:  libXext-devel
BuildRequires:  libXt-devel

Requires:       gcc-c++
Requires:       polyml-libs%{?_isa} = %{version}-%{release}

# list of supported arches from configure.ac
ExclusiveArch: %{ix86} x86_64 sparc sparcv8 sparcv9 sparcv9v ppc %{power64} %{arm} aarch64 ia64 mips mipsel

%description
Poly/ML is a full implementation of Standard ML available as
open-source.  This release supports the ML97 version of the language
and the Standard Basis Library.

%package doc
Summary:        Poly/ML documentation
BuildArch:      noarch

%description doc
Documentation for Poly/ML.

%package libs
Summary:        Poly/ML runtime libraries

%description libs
Runtime libraries for Poly/ML.

%prep
%setup -q
%patch0 -p1

%ifarch %{power64}
# Temporary workaround for https://github.com/polyml/polyml/issues/77
sed -i 's/NOFLSH/(int)NOFLSH/' libpolyml/unix_specific.cpp
%endif

%build
# Some hand-coded assembler is included.  Because it does not contain an
# explicit section marker stating that the stack section does not need the
# executable bit, gas assumes that it does.  The linker then propagates the
# execstack flag into the executables, which is bad news for people running
# SELinux.  The execstack flag is not really needed, so we go through the
# contortions below to keep it off.
%configure --enable-shared --disable-static --with-system-libffi \
  CPPFLAGS="-D_GNU_SOURCE" \
  CFLAGS="${RPM_OPT_FLAGS} -fno-strict-aliasing -Wa,--noexecstack" \
  CXXFLAGS="${RPM_OPT_FLAGS} -fno-strict-aliasing -Wa,--noexecstack" \
  CCASFLAGS="-Wa,--noexecstack" LDFLAGS="$RPM_LD_FLAGS -Wl,-z,noexecstack"
make %{?_smp_mflags}
chrpath -d .libs/poly
chrpath -d .libs/polyimport

# Change polyc to avoid adding an rpath, and also don't link to extra libraries
# unnecessarily.
sed -i 's/-Wl,-rpath,\${LIBDIR} //;s/-lffi //;s/-lgmp //' polyc

%install
make install DESTDIR=$RPM_BUILD_ROOT
rm -f $RPM_BUILD_ROOT%{_libdir}/*.la

%check
make check

%post libs -p /sbin/ldconfig

%postun libs -p /sbin/ldconfig

%files
%{_bindir}/poly
%{_bindir}/polyc
%{_bindir}/polyimport
%{_libdir}/libpolymain.a
%{_libdir}/libpolyml.so
%{_libdir}/pkgconfig/polyml.pc
%{_mandir}/man1/poly.1*
%{_mandir}/man1/polyc.1*
%{_mandir}/man1/polyimport.1*

%files doc
%doc documentation/*
%license COPYING

%files libs
%license COPYING
%{_libdir}/libpolyml.so.*

%changelog
* Tue Jan 24 2017 Jerry James <loganjerry@gmail.com> - 5.6-3
- Do not require libgmp or libffi at runtime (bz 1394556)
- Do not add unnecessary rpaths to user programs
- Add bug fixes from upstream's bug fix branch

* Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 5.6-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild

* Mon Jan 25 2016 Jerry James <loganjerry@gmail.com> - 5.6-1
- New upstream version
- Update the ExclusiveArch list
- Add a check script

* Thu Oct 08 2015 Ralf Corsépius <corsepiu@fedoraproject.org> - 5.5.2-9
- Build against motif on fedora >= 24.

* Thu Jun 18 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 5.5.2-8
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild

* Sat May  2 2015 Jerry James <loganjerry@gmail.com> - 5.5.2-7
- Update -5.5.2-fixes.patch to add the following:
  o Initialise the largeObjectCache fully in the constructor.  When
    MTGCProcessMarkPointers is subclassed in RescanMarked the resulting object
    is created on the stack and the largeObjectCache can contain invalid data
    if it is not cleared (trunc commit 2007)

* Mon Apr 20 2015 Jerry James <loganjerry@gmail.com> - 5.5.2-6
- Update -5.5.2-fixes.patch to add the following:
  o Ensure the large object cache pointer is cleared when processing the roots
    as well as for the marking tasks (trunk commit 2006)
- Do not harden the build; breaks the memory management scheme

* Sat Feb 21 2015 Jerry James <loganjerry@gmail.com> - 5.5.2-5
- Use license macro

* Sun Aug 17 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 5.5.2-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild

* Mon Jul 28 2014 Jerry James <loganjerry@gmail.com> - 5.5.2-3
- Add -5.5.2-fixes patch to fix the following:
  o Check for negative sized arrays (trunk commit 1950)
  o Fix segfault in FFI when malloc runs out of memory (trunk commit 1953)

* Sat Jun 07 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 5.5.2-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild

* Fri May  9 2014 Jerry James <loganjerry@gmail.com> - 5.5.2-1
- New upstream release
- All patches have been upstreamed; drop them

* Tue Nov  5 2013 Jerry James <loganjerry@gmail.com> - 5.5.1-2
- Add -5.5.1-fixes patch to fix two optimizer bugs (trunk commits 1855 and
  1867), and to fix TexIO.inputN and StreamIO.inputN to return immediately if
  asked for zero characters (trunk commit 1874).

* Tue Sep 17 2013 Jerry James <loganjerry@gmail.com> - 5.5.1-1
- New upstream version

* Sun Aug 04 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 5.5-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild

* Mon Jun 10 2013 Jerry James <loganjerry@gmail.com> - 5.5-4
- Update -5.5-fixes patch to r1789 to fix an assertion failure during GC.
- Build with -D_FILE_OFFSET_BITS=64 and add -largefile patch.
- Link with RPM_LD_FLAGS.

* Tue Apr 23 2013 Jerry James <loganjerry@gmail.com> - 5.5-3
- Update -5.5-fixes patch to r1693 to fix a bug in Real.fromInt on x86.

* Mon Feb 11 2013 Jerry James <loganjerry@gmail.com> - 5.5-2
- Apply post-release fixes from upstream
- Drop the -sem-wait patch; no longer needed

* Thu Sep 20 2012 Jerry James <loganjerry@gmail.com> - 5.5-1
- New upstream version

* Sat Jul 21 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 5.4.1-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild

* Sat Jan  7 2012 Jerry James <loganjerry@gmail.com> - 5.4.1-2
- Rebuild for GCC 4.7
- Minor spec file cleanups

* Wed Oct 26 2011 Marcela Mašláňová <mmaslano@redhat.com> - 5.4.1-1.2
- rebuild with new gmp without compat lib

* Wed Oct 12 2011 Peter Schiffer <pschiffe@redhat.com> - 5.4.1-1.1
- rebuild with new gmp

* Mon Aug  8 2011 Jerry James <loganjerry@gmail.com> - 5.4.1-1
- New upstream release

* Fri Apr 29 2011 Dan Horák <dan[at]danny.cz> - 5.4-3
- updated the supported arch list

* Wed Feb 09 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 5.4-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild

* Thu Feb  3 2011 Jerry James <loganjerry@gmail.com> - 5.4-1
- Update to 5.4
- Update the -doc files.
- Enable building the portable (non-native) version on unsupported arches.
- Get rid of the execstack flag; prevents running on SELinux-enabled systems.
- Kill RPATH in the executables.
- Add a BR on gmp-devel.
- Add the -sem-wait patch.

* Sun Jul 26 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 5.2.1-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild

* Mon Jun 15 2009 Gerard Milmeister <gemi@bluewin.ch> - 5.2.1-1
- new release 5.2.1

* Sun Oct 19 2008 Gerard Milmeister <gemi@bluewin.ch> - 5.2-1
- new release 5.2

* Mon Feb 18 2008 Fedora Release Engineering <rel-eng@fedoraproject.org> - 5.1-4
- Autorebuild for GCC 4.3

* Wed Jan  2 2008 Gerard Milmeister <gemi@bluewin.ch> - 5.1-3
- Exclude arch ppc64

* Wed Jan  2 2008 Gerard Milmeister <gemi@bluewin.ch> - 5.1-1
- new release 5.1

* Tue Mar 27 2007 Gerard Milmeister <gemi@bluewin.ch> - 5.0-2
- spec file fixes

* Mon Feb 12 2007 Gerard Milmeister <gemi@bluewin.ch> - 5.0-1
- new version 5.0