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

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

License:        LGPLv2+
URL:            http://www.polyml.org
Source0:        http://downloads.sourceforge.net/%{name}/%{name}.%{version}.tar.gz
# 2013-09-17 snapshot of http://www.polyml.org/docs/.
Source1:        polyml-docs.tar.xz
# Bug fixes from upstream's polyml-5.5.2-fixes subversion branch.
Patch0:         %{name}-5.5.2-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:  gmp-devel
BuildRequires:  lesstif-devel
BuildRequires:  libffi-devel
BuildRequires:  libX11-devel
BuildRequires:  libXext-devel
BuildRequires:  libXt-devel
Requires:       polyml-libs%{?_isa} = %{version}-%{release}

# list of supported arches from configure.ac
ExclusiveArch: %{arm} %{ix86} x86_64 ia64 %{sparc} ppc

%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
Requires:       polyml = %{version}-%{release}
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 -n polyml.%{version}
%setup -q -T -D -a 1 -n polyml.%{version}
%patch0 -p1

%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

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

%post libs -p /sbin/ldconfig

%postun libs -p /sbin/ldconfig

%files
%doc TODO.txt
%{_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 docs index.html images

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

%changelog
* 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