812b066
%define ghcver ghc66
01ca420
01ca420
# speed up test builds by not building profiled libraries
01ca420
%define build_prof 1
4eb22b2
%define build_doc 1
01ca420
01ca420
Name:		ghc
812b066
Version:	6.6
2047747
Release:	2%{?dist}
01ca420
Summary:	Glasgow Haskell Compilation system
01ca420
License:	BSD style
01ca420
Group:		Development/Languages
812b066
Source0:	http://www.haskell.org/ghc/dist/%{version}/ghc-%{version}-src.tar.bz2
812b066
Source1:	http://www.haskell.org/ghc/dist/%{version}/ghc-%{version}-src-extralibs.tar.bz2
01ca420
URL:		http://haskell.org/ghc/
01ca420
Requires:	%{ghcver} = %{version}-%{release}
01ca420
BuildRoot:	%{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
9c5a6c2
BuildRequires:  ghc, sed
64398ad
Buildrequires:  gmp-devel, readline-devel
64398ad
Buildrequires:  libX11-devel, libXt-devel
64398ad
Buildrequires:  freeglut-devel, openal-devel
01ca420
%if %{build_doc}
64398ad
# haddock generates docs in libraries
812b066
Buildrequires: libxslt, docbook-style-xsl, haddock >= 0.8
01ca420
%endif
64398ad
Prefix:		%{_prefix}
01ca420
01ca420
%description
01ca420
GHC is a state-of-the-art programming suite for Haskell, a purely
01ca420
functional programming language.  It includes an optimising compiler
01ca420
generating good code for a variety of platforms, together with an
01ca420
interactive system for convenient, quick development.  The
01ca420
distribution includes space and time profiling facilities, a large
01ca420
collection of libraries, and support for various language
01ca420
extensions, including concurrency, exceptions, and a foreign language
01ca420
interface.
01ca420
01ca420
%package -n %{ghcver}
812b066
Summary:	Glasgow Haskell Compilation system
01ca420
Group:		Development/Languages
01ca420
Requires:	gcc gmp-devel readline-devel
01ca420
01ca420
%description -n %{ghcver}
01ca420
GHC is a state-of-the-art programming suite for Haskell, a purely
01ca420
functional programming language.  It includes an optimising compiler
01ca420
generating good code for a variety of platforms, together with an
01ca420
interactive system for convenient, quick development.  The
01ca420
distribution includes space and time profiling facilities, a large
01ca420
collection of libraries, and support for various language
01ca420
extensions, including concurrency, exceptions, and a foreign language
01ca420
interfaces.
01ca420
01ca420
This package contains all the main files and libraries of version %{version}.
01ca420
01ca420
%if %{build_prof}
01ca420
%package -n %{ghcver}-prof
01ca420
Summary:	Profiling libraries for GHC
01ca420
Group:		Development/Libraries
01ca420
Requires:	%{ghcver} = %{version}-%{release}
01ca420
Obsoletes:	ghc-prof
01ca420
01ca420
%description -n %{ghcver}-prof
01ca420
Profiling libraries for Glorious Glasgow Haskell Compilation System
01ca420
(GHC).  They should be installed when GHC's profiling subsystem is
01ca420
needed.
01ca420
%endif
01ca420
01ca420
%package doc
01ca420
Summary:	Documentation for GHC
01ca420
Group:		Development/Languages
c12a20f
Requires:	%{name}
01ca420
01ca420
%description doc
01ca420
Preformatted documentation for the Glorious Glasgow Haskell
01ca420
Compilation System (GHC) and its libraries.  It should be installed if
01ca420
you like to have local access to the documentation in HTML format.
01ca420
01ca420
# the debuginfo subpackage is currently empty anyway, so don't generate it
01ca420
%define debug_package %{nil}
01ca420
%define __spec_install_post /usr/lib/rpm/brp-compress
01ca420
01ca420
%prep
812b066
%setup -q -n ghc-%{version} -b1
01ca420
01ca420
%build
01ca420
%if !%{build_prof}
01ca420
echo "GhcLibWays=" >> mk/build.mk
01ca420
echo "GhcRTSWays=thr debug" >> mk/build.mk
01ca420
%endif
01ca420
1ae0da0
./configure --prefix=%{_prefix} --libdir=%{_libdir}
01ca420
2047747
# drop truncated copy of header (#222865)
2047747
rm libraries/network/include/Typeable.h
2047747
01ca420
make all
01ca420
%if %{build_doc}
01ca420
make html
01ca420
%endif
01ca420
01ca420
%install
01ca420
rm -rf $RPM_BUILD_ROOT
01ca420
01ca420
make prefix=$RPM_BUILD_ROOT%{_prefix} libdir=$RPM_BUILD_ROOT%{_libdir}/%{name}-%{version} install
01ca420
01ca420
%if %{build_doc}
01ca420
make datadir=$RPM_BUILD_ROOT%{_docdir}/ghc-%{version} XMLDocWays="html" install-docs
01ca420
%endif
01ca420
01ca420
SRC_TOP=$PWD
01ca420
rm -f rpm-*-filelist rpm-*.files
01ca420
( cd $RPM_BUILD_ROOT
01ca420
  find .%{_libdir}/%{name}-%{version} \( -type d -fprintf $SRC_TOP/rpm-dir.files "%%%%dir %%p\n" \) -o \( -type f \( -name '*.p_hi' -o -name '*_p.a' \) -fprint $SRC_TOP/rpm-prof.files \) -o \( -not -name 'package.conf' -fprint $SRC_TOP/rpm-lib.files \)
01ca420
)
01ca420
01ca420
# make paths absolute (filter "./usr" to "/usr")
01ca420
sed -i -e "s|\.%{_prefix}|%{_prefix}|" rpm-*.files
01ca420
01ca420
cat rpm-dir.files rpm-lib.files > rpm-base-filelist
01ca420
%if %{build_prof}
01ca420
cat rpm-dir.files rpm-prof.files > rpm-prof-filelist
01ca420
%endif
01ca420
8896457
# create package.conf.old
8896457
touch $RPM_BUILD_ROOT%{_libdir}/ghc-%{version}/package.conf.old
8896457
8896457
01ca420
%clean
01ca420
rm -rf $RPM_BUILD_ROOT
01ca420
8896457
01ca420
%post
01ca420
## tweak prefix in drivers scripts if relocating
01ca420
if [ "${RPM_INSTALL_PREFIX}" != "%{_prefix}" ]; then
01ca420
  BINDIR=`echo %{_bindir} | sed -e "s|%{_prefix}|${RPM_INSTALL_PREFIX}|"`
01ca420
  sed -i "s|%{_prefix}|${RPM_INSTALL_PREFIX}|" ${BINDIR}/{ghcprof,hsc2hs}
01ca420
fi
01ca420
8896457
/usr/bin/chcon -t unconfined_execmem_exec_t %{_bindir}/{hasktags,runghc,runhaskell} >/dev/null 2>&1 || :
8896457
8896457
01ca420
%post -n %{ghcver}
01ca420
## tweak prefix in drivers scripts if relocating
01ca420
if [ "${RPM_INSTALL_PREFIX}" != "%{_prefix}" ]; then
01ca420
  BINDIR=`echo %{_bindir} | sed -e "s|%{_prefix}|${RPM_INSTALL_PREFIX}|"`
01ca420
  LIBDIR=`echo %{_libdir} | sed -e "s|%{_prefix}|${RPM_INSTALL_PREFIX}|"`
01ca420
  sed -i "s|%{_prefix}|${RPM_INSTALL_PREFIX}|" ${BINDIR}/ghc*-%{version} ${LIBDIR}/ghc-%{version}/package.conf
01ca420
fi
01ca420
8896457
/usr/bin/chcon -t unconfined_execmem_exec_t %{_libdir}/ghc-%{version}/{ghc-%{version},ghc-pkg.bin,hsc2hs-bin} >/dev/null 2>&1 || :
8896457
8896457
01ca420
%files
01ca420
%defattr(-,root,root,-)
01ca420
%{_bindir}/*
01ca420
%exclude %{_bindir}/ghc*%{version}
01ca420
8896457
01ca420
%files -n %{ghcver} -f rpm-base-filelist
01ca420
%defattr(-,root,root,-)
812b066
%doc ANNOUNCE HACKING LICENSE README
01ca420
%{_bindir}/ghc*%{version}
01ca420
%config(noreplace) %{_libdir}/ghc-%{version}/package.conf
8896457
%ghost %{_libdir}/ghc-%{version}/package.conf.old
8896457
01ca420
01ca420
%if %{build_prof}
01ca420
%files -n %{ghcver}-prof -f rpm-prof-filelist
01ca420
%defattr(-,root,root,-)
01ca420
%endif
01ca420
8896457
01ca420
%if %{build_doc}
01ca420
%files doc
01ca420
%defattr(-,root,root,-)
01ca420
%{_docdir}/%{name}-%{version}
01ca420
%endif
01ca420
8896457
01ca420
%changelog
2047747
* Mon Jan 22 2007 Jens Petersen <petersen@redhat.com> - 6.6-2
2047747
- remove truncated duplicate Typeable.h header in network package
2047747
  (Bryan O'Sullivan, #222865)
2047747
812b066
* Fri Nov  3 2006 Jens Petersen <petersen@redhat.com> - 6.6-1
812b066
- update to 6.6 release
812b066
- buildrequire haddock >= 0.8
812b066
- fix summary of ghcver package (Michel Salim, #209574)
812b066
4eb22b2
* Thu Sep 28 2006 Jens Petersen <petersen@redhat.com> - 6.4.2-4
4eb22b2
- turn on docs generation again
4eb22b2
8896457
* Mon Sep 25 2006 Jens Petersen <petersen@redhat.com> - 6.4.2-3.fc6
8896457
- ghost package.conf.old (Gérard Milmeister)
8896457
- set unconfined_execmem_exec_t context on executables with ghc rts (#195821)
a97ca19
- turn off building docs until haddock is back
8896457
64398ad
* Sat Apr 29 2006 Jens Petersen <petersen@redhat.com> - 6.4.2-2.fc6
64398ad
- buildrequire libXt-devel so that the X11 package and deps get built
64398ad
  (Garrett Mitchener, #190201)
64398ad
64398ad
* Thu Apr 20 2006 Jens Petersen <petersen@redhat.com> - 6.4.2-1.fc6
9c5a6c2
- update to 6.4.2 release
9c5a6c2
9c5a6c2
* Thu Mar  2 2006 Jens Petersen <petersen@redhat.com> - 6.4.1-3.fc5
c12a20f
- buildrequire libX11-devel instead of xorg-x11-devel (Kevin Fenzi, #181024)
c12a20f
- make ghc-doc require ghc (Michel Salim, #180449)
c12a20f
9c5a6c2
* Tue Oct 11 2005 Jens Petersen <petersen@redhat.com> - 6.4.1-2.fc5
3c45d54
- turn on build_doc since haddock is now in Extras
1ae0da0
- no longer specify ghc version to build with (Ville Skyttä, #170176)
3c45d54
9c5a6c2
* Tue Sep 20 2005 Jens Petersen <petersen@redhat.com> - 6.4.1-1.fc5
af099c0
- 6.4.1 release
af099c0
  - the following patches are now upstream: ghc-6.4-powerpc.patch,
af099c0
    rts-GCCompact.h-x86_64.patch, ghc-6.4-dsforeign-x86_64-1097471.patch,
af099c0
    ghc-6.4-rts-adjustor-x86_64-1097471.patch
af099c0
  - builds with gcc4 so drop %%_with_gcc32
af099c0
  - x86_64 build restrictions (no ghci and split objects) no longer apply
af099c0
a677d5c
* Tue May 31 2005 Jens Petersen <petersen@redhat.com>
a677d5c
- add %%dist to release
a677d5c
01ca420
* Thu May 12 2005 Jens Petersen <petersen@redhat.com> - 6.4-8
01ca420
- initial import into Fedora Extras
01ca420
01ca420
* Thu May 12 2005 Jens Petersen <petersen@haskell.org>
01ca420
- add build_prof and build_doc switches for -doc and -prof subpackages
01ca420
- add _with_gcc32 switch since ghc-6.4 doesn't build with gcc-4.0
01ca420
01ca420
* Wed May 11 2005 Jens Petersen <petersen@haskell.org> - 6.4-7
01ca420
- make package relocatable (ghc#1084122)
01ca420
  - add post install scripts to replace prefix in driver scripts
01ca420
- buildrequire libxslt and docbook-style-xsl instead of docbook-utils and flex
01ca420
01ca420
* Fri May  6 2005 Jens Petersen <petersen@haskell.org> - 6.4-6
01ca420
- add ghc-6.4-dsforeign-x86_64-1097471.patch and
01ca420
  ghc-6.4-rts-adjustor-x86_64-1097471.patch from trunk to hopefully fix
01ca420
  ffi support on x86_64 (Simon Marlow, ghc#1097471)
01ca420
- use XMLDocWays instead of SGMLDocWays to build documentation fully
01ca420
01ca420
* Mon May  2 2005 Jens Petersen <petersen@haskell.org> - 6.4-5
01ca420
- add rts-GCCompact.h-x86_64.patch to fix GC issue on x86_64 (Simon Marlow)
01ca420
01ca420
* Thu Mar 17 2005 Jens Petersen <petersen@haskell.org> - 6.4-4
01ca420
- add ghc-6.4-powerpc.patch (Ryan Lortie)
01ca420
- disable building interpreter rather than install and delete on x86_64
01ca420
01ca420
* Wed Mar 16 2005 Jens Petersen <petersen@haskell.org> - 6.4-3
01ca420
- make ghc require ghcver of same ver-rel
01ca420
- on x86_64 remove ghci for now since it doesn't work and all .o files
01ca420
01ca420
* Tue Mar 15 2005 Jens Petersen <petersen@haskell.org> - 6.4-2
01ca420
- ghc requires ghcver (Amanda Clare)
01ca420
01ca420
* Sat Mar 12 2005 Jens Petersen <petersen@haskell.org> - 6.4-1
01ca420
- 6.4 release
01ca420
  - x86_64 build no longer unregisterised
01ca420
- use sed instead of perl to tidy filelists
01ca420
- buildrequire ghc64 instead of ghc-6.4
01ca420
- no epoch for ghc64-prof's ghc64 requirement
01ca420
- install docs directly in docdir
01ca420
01ca420
* Fri Jan 21 2005 Jens Petersen <petersen@haskell.org> - 6.2.2-2
01ca420
- add x86_64 port
01ca420
  - build unregistered and without splitobjs
01ca420
  - specify libdir to configure and install
01ca420
- rename ghc-prof to ghcXYZ-prof, which obsoletes ghc-prof
01ca420
01ca420
* Mon Dec  6 2004 Jens Petersen <petersen@haskell.org> - 6.2.2-1
01ca420
- move ghc requires to ghcXYZ
01ca420
01ca420
* Wed Nov 24 2004 Jens Petersen <petersen@haskell.org> - 6.2.2-0.fdr.1
01ca420
- ghc622
01ca420
  - provide ghc = %%version
01ca420
- require gcc, gmp-devel and readline-devel
01ca420
01ca420
* Fri Oct 15 2004 Gerard Milmeister <gemi@bluewin.ch> - 6.2.2-0.fdr.1
01ca420
- New Version 6.2.2
01ca420
01ca420
* Mon Mar 22 2004 Gerard Milmeister <gemi@bluewin.ch> - 6.2.1-0.fdr.1
01ca420
- New Version 6.2.1
01ca420
01ca420
* Tue Dec 16 2003 Gerard Milmeister <gemi@bluewin.ch> - 6.2-0.fdr.1
01ca420
- New Version 6.2
01ca420
01ca420
* Tue Dec 16 2003 Gerard Milmeister <gemi@bluewin.ch> - 6.0.1-0.fdr.3
01ca420
- A few minor specfile tweaks
01ca420
01ca420
* Mon Dec 15 2003 Gerard Milmeister <gemi@bluewin.ch> - 6.0.1-0.fdr.2
01ca420
- Different file list generation
01ca420
01ca420
* Mon Oct 20 2003 Gerard Milmeister <gemi@bluewin.ch> - 6.0.1-0.fdr.1
01ca420
- First Fedora release
01ca420
- Added generated html docs, so that haddock is not needed
01ca420
01ca420
* Wed Sep 26 2001 Manuel Chakravarty
01ca420
- small changes for 5.04
01ca420
01ca420
* Wed Sep 26 2001 Manuel Chakravarty
01ca420
- split documentation off into a separate package
01ca420
- adapt to new docbook setup in RH7.1
01ca420
01ca420
* Mon Apr 16 2001 Manuel Chakravarty
01ca420
- revised for 5.00
01ca420
- also runs autoconf automagically if no ./configure found
01ca420
01ca420
* Thu Jun 22 2000 Sven Panne
01ca420
- removed explicit usage of hslibs/docs, it belongs to ghc/docs/set
01ca420
01ca420
* Sun Apr 23 2000 Manuel Chakravarty
01ca420
- revised for ghc 4.07; added suggestions from Pixel <pixel@mandrakesoft.com>
01ca420
- added profiling package
01ca420
01ca420
* Tue Dec 7 1999 Manuel Chakravarty
01ca420
- version for use from CVS
01ca420
01ca420
* Thu Sep 16 1999 Manuel Chakravarty
01ca420
- modified for GHC 4.04, patchlevel 1 (no more 62 tuple stuff); minimises use
01ca420
  of patch files - instead emits a build.mk on-the-fly
01ca420
01ca420
* Sat Jul 31 1999 Manuel Chakravarty
01ca420
- modified for GHC 4.04
01ca420
01ca420
* Wed Jun 30 1999 Manuel Chakravarty
01ca420
- some more improvements from vbzoli
01ca420
01ca420
* Fri Feb 26 1999 Manuel Chakravarty
01ca420
- modified for GHC 4.02
01ca420
01ca420
* Thu Dec 24 1998 Zoltan Vorosbaranyi 
01ca420
- added BuildRoot
01ca420
- files located in /usr/local/bin, /usr/local/lib moved to /usr/bin, /usr/lib
01ca420
01ca420
* Tue Jul 28 1998 Manuel Chakravarty
01ca420
- original version