summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJens Petersen <petersen@redhat.com>2014-02-11 22:06:01 +0900
committerJens Petersen <petersen@redhat.com>2014-02-11 22:06:01 +0900
commit3f80e38a43b3cfb328490259c15418ab51c774c1 (patch)
tree083d6cb556f41b64308d1b4a9a1f904590af8302
parent02714f7f0c6fc2abc45fa4332c69f0645e327502 (diff)
downloadpandoc-standalone-3f80e38a43b3cfb328490259c15418ab51c774c1.zip
pandoc-standalone-3f80e38a43b3cfb328490259c15418ab51c774c1.tar.gz
pandoc-standalone-3f80e38a43b3cfb328490259c15418ab51c774c1.tar.xz
tools: import spec files of all packages needed to build pandoc
-rw-r--r--tools/README21
-rw-r--r--tools/bootstrap/ghc/Cabal-fix-dynamic-exec-for-TH.patch33
-rw-r--r--tools/bootstrap/ghc/ghc-6.12.1-gen_contents_index-haddock-path.patch12
-rw-r--r--tools/bootstrap/ghc/ghc-7.4-add-support-for-ARM-hard-float-ABI-fixes-5914.patch1274
-rw-r--r--tools/bootstrap/ghc/ghc-7.4-silence-gen_contents_index.patch11
-rw-r--r--tools/bootstrap/ghc/ghc-7.4.2-Cabal-disable-ghci-libs.patch13
-rwxr-xr-xtools/bootstrap/ghc/ghc-doc-index38
-rwxr-xr-xtools/bootstrap/ghc/ghc-doc-index.cron9
-rw-r--r--tools/bootstrap/ghc/ghc-gen_contents_index-type-level.patch12
-rw-r--r--tools/bootstrap/ghc/ghc-llvmCodeGen-empty-array.patch44
-rw-r--r--tools/bootstrap/ghc/ghc-powerpc-linker-mmap.patch34
-rw-r--r--tools/bootstrap/ghc/ghc-powerpc-pthread.patch18
-rw-r--r--tools/bootstrap/ghc/ghc-use-system-libffi.patch83
-rw-r--r--tools/bootstrap/ghc/ghc-wrapper-libffi-include.patch6
-rw-r--r--tools/bootstrap/ghc/ghc.spec1259
-rw-r--r--tools/bootstrap/hscolour/hscolour.spec168
-rw-r--r--tools/cabal-dev/cabal-dev-0.9.1-tar-0.4.patch30
-rw-r--r--tools/cabal-dev/cabal-dev.spec132
-rw-r--r--tools/cabal-install/0.14/cabal-install-0.14.0-bootstrap-url.patch20
-rw-r--r--tools/cabal-install/0.14/cabal-install.spec73
-rw-r--r--tools/cabal-install/cabal-install-1.18.0.2-bootstrap-hackage-url.patch20
-rw-r--r--tools/cabal-install/cabal-install.spec75
-rw-r--r--tools/gcc44/gcc44.spec29
-rw-r--r--tools/ghc-primitive/ghc-primitive.spec84
-rw-r--r--tools/ghc-rpm-macros/AUTHORS7
-rw-r--r--tools/ghc-rpm-macros/COPYING674
-rwxr-xr-xtools/ghc-rpm-macros/cabal-tweak-dep-ver34
-rwxr-xr-xtools/ghc-rpm-macros/cabal-tweak-flag50
-rwxr-xr-xtools/ghc-rpm-macros/ghc-deps.sh84
-rw-r--r--tools/ghc-rpm-macros/ghc-rpm-macros.ghc303
-rw-r--r--tools/ghc-rpm-macros/ghc-rpm-macros.spec421
-rw-r--r--tools/ghc-split/ghc-split.spec122
-rw-r--r--tools/ghc-tar/ghc-tar.spec143
-rw-r--r--tools/ghc-vector/ghc-vector.spec108
-rw-r--r--tools/ghc-vector/vector-debian-no_ann_without_ghci.patch24
-rw-r--r--tools/ghc/Cabal-fix-dynamic-exec-for-TH.patch33
-rw-r--r--tools/ghc/ghc-6.12.1-gen_contents_index-haddock-path.patch12
-rw-r--r--tools/ghc/ghc-7.4-add-support-for-ARM-hard-float-ABI-fixes-5914.patch1274
-rw-r--r--tools/ghc/ghc-7.4-silence-gen_contents_index.patch11
-rw-r--r--tools/ghc/ghc-7.4.2-Cabal-disable-ghci-libs.patch13
-rwxr-xr-xtools/ghc/ghc-doc-index38
-rwxr-xr-xtools/ghc/ghc-doc-index.cron9
-rw-r--r--tools/ghc/ghc-gen_contents_index-type-level.patch12
-rw-r--r--tools/ghc/ghc-llvmCodeGen-empty-array.patch44
-rw-r--r--tools/ghc/ghc-powerpc-linker-mmap.patch34
-rw-r--r--tools/ghc/ghc-powerpc-pthread.patch18
-rw-r--r--tools/ghc/ghc-use-system-libffi.patch83
-rw-r--r--tools/ghc/ghc-wrapper-libffi-include.patch6
-rw-r--r--tools/ghc/ghc.spec1269
-rw-r--r--tools/haskell-platform/alex-ghc74-fix-bang-pattern.patch53
-rw-r--r--tools/haskell-platform/cabal-install.sh8
-rw-r--r--tools/haskell-platform/ghc-GLUT-extralibs.patch8
-rw-r--r--tools/haskell-platform/haskell-platform.spec505
-rw-r--r--tools/hsb2hs/hsb2hs.spec59
-rw-r--r--tools/hscolour/hscolour.spec181
55 files changed, 9138 insertions, 0 deletions
diff --git a/tools/README b/tools/README
new file mode 100644
index 0000000..7dc393d
--- /dev/null
+++ b/tools/README
@@ -0,0 +1,21 @@
+Build order:
+
+1a ghc-rpm-macros
+1aa on RHEL6 only: gcc44 (dummy compat package)
+1b ghc (bootstrap)
+1c hscolour (bootstrap)
+1d ghc-rpm-macros
+1e ghc
+
+2a ghc-primitive
+2b ghc-split
+2c ghc-vector
+2d haskell-platform
+
+(or cabal-install)
+
+6a ghc-tar
+6b cabal-dev
+
+7. hsb2hs
+
diff --git a/tools/bootstrap/ghc/Cabal-fix-dynamic-exec-for-TH.patch b/tools/bootstrap/ghc/Cabal-fix-dynamic-exec-for-TH.patch
new file mode 100644
index 0000000..5384ea7
--- /dev/null
+++ b/tools/bootstrap/ghc/Cabal-fix-dynamic-exec-for-TH.patch
@@ -0,0 +1,33 @@
+diff -u ghc-7.2.0.20110728/libraries/Cabal/cabal/Distribution/Simple/GHC.hs.orig ghc-7.2.0.20110728/libraries/Cabal/cabal/Distribution/Simple/GHC.hs
+--- ghc-7.2.0.20110728/libraries/Cabal/Cabal/Distribution/Simple/GHC.hs.orig 2011-07-29 02:12:09.000000000 +0900
++++ ghc-7.2.0.20110728/libraries/Cabal/Cabal/Distribution/Simple/GHC.hs 2011-08-05 18:08:05.192042529 +0900
+@@ -778,7 +778,10 @@
+ ++ ["-L"++libDir | libDir <- extraLibDirs exeBi]
+ ++ concat [["-framework", f] | f <- PD.frameworks exeBi]
+ ++ if dynExe
+- then ["-dynamic"]
++ then ["-dynamic",
++ "-hisuf", "dyn_hi",
++ "-osuf", "dyn_o"
++ ]
+ else []
+ ++ if profExe
+ then ["-prof",
+@@ -787,13 +790,14 @@
+ ] ++ ghcProfOptions exeBi
+ else []
+
+- -- For building exe's for profiling that use TH we actually
++ -- For building exe's for profiling or dynamic that use TH we actually
+ -- have to build twice, once without profiling and the again
+ -- with profiling. This is because the code that TH needs to
+ -- run at compile time needs to be the vanilla ABI so it can
+ -- be loaded up and run by the compiler.
+- when (withProfExe lbi && EnableExtension TemplateHaskell `elem` allExtensions exeBi)
+- (runGhcProg (binArgs False (withDynExe lbi) False))
++ when ((withProfExe lbi || withDynExe lbi) &&
++ EnableExtension TemplateHaskell `elem` allExtensions exeBi)
++ (runGhcProg (binArgs False False False))
+
+ runGhcProg (binArgs True (withDynExe lbi) (withProfExe lbi))
+
diff --git a/tools/bootstrap/ghc/ghc-6.12.1-gen_contents_index-haddock-path.patch b/tools/bootstrap/ghc/ghc-6.12.1-gen_contents_index-haddock-path.patch
new file mode 100644
index 0000000..d1034eb
--- /dev/null
+++ b/tools/bootstrap/ghc/ghc-6.12.1-gen_contents_index-haddock-path.patch
@@ -0,0 +1,12 @@
+diff -u ghc-6.12.1/libraries/gen_contents_index\~ ghc-6.12.1/libraries/gen_contents_index
+--- ghc-6.12.1/libraries/gen_contents_index~ 2009-12-11 04:11:33.000000000 +1000
++++ ghc-6.12.1/libraries/gen_contents_index 2009-12-12 21:08:02.000000000 +1000
+@@ -20,7 +20,7 @@
+ done
+ ;;
+ *)
+- HADDOCK=../../../../../bin/haddock
++ HADDOCK=/usr/bin/haddock
+ # We don't want the GHC API to swamp the index
+ HADDOCK_FILES=`ls -1 */*.haddock | grep -v '/ghc\.haddock' | sort`
+ for HADDOCK_FILE in $HADDOCK_FILES
diff --git a/tools/bootstrap/ghc/ghc-7.4-add-support-for-ARM-hard-float-ABI-fixes-5914.patch b/tools/bootstrap/ghc/ghc-7.4-add-support-for-ARM-hard-float-ABI-fixes-5914.patch
new file mode 100644
index 0000000..a9b897b
--- /dev/null
+++ b/tools/bootstrap/ghc/ghc-7.4-add-support-for-ARM-hard-float-ABI-fixes-5914.patch
@@ -0,0 +1,1274 @@
+From 83195ff5ba73779514e3d06b1457d45f849c7fc2 Mon Sep 17 00:00:00 2001
+From: Karel Gardas <karel.gardas@centrum.cz>
+Date: Wed, 25 Apr 2012 09:04:50 +0200
+Subject: [PATCH] add support for ARM hard-float ABI (fixes #5914)
+
+This patch enhances Platform's ArchARM to include ARM ABI value. It also
+tweaks configure machinery to detect hard-float ABI and to set it wherever
+needed. Finally when hard-float ABI is in use, pass appropriate compiler
+option to the LLVM's llc. Fixes #5914.
+---
+ aclocal.m4 | 2 +-
+ compiler/main/DriverPipeline.hs | 16 +-
+ compiler/nativeGen/AsmCodeGen.lhs | 2 +-
+ compiler/nativeGen/RegAlloc/Graph/TrivColorable.hs | 56 ++--
+ compiler/nativeGen/RegAlloc/Linear/FreeRegs.hs | 14 +-
+ compiler/nativeGen/RegAlloc/Linear/Main.hs | 14 +-
+ compiler/nativeGen/TargetReg.hs | 70 ++--
+ compiler/utils/Platform.hs | 12 +-
+ config.guess | 482 ++++++++++----------
+ configure.ac | 14 +
+ 10 files changed, 345 insertions(+), 337 deletions(-)
+
+diff --git a/aclocal.m4 b/aclocal.m4
+index 5652185..c196bdf 100644
+--- a/aclocal.m4
++++ b/aclocal.m4
+@@ -171,7 +171,7 @@ AC_DEFUN([FPTOOLS_SET_HASKELL_PLATFORM_VARS],
+ ;;
+ arm)
+ GET_ARM_ISA()
+- test -z "[$]2" || eval "[$]2=\"ArchARM {armISA = \$ARM_ISA, armISAExt = \$ARM_ISA_EXT}\""
++ test -z "[$]2" || eval "[$]2=\"ArchARM {armISA = \$ARM_ISA, armISAExt = \$ARM_ISA_EXT, armABI = \$ARM_ABI}\""
+ ;;
+ alpha|mips|mipseb|mipsel|hppa|hppa1_1|ia64|m68k|rs6000|s390|s390x|sparc64|vax)
+ test -z "[$]2" || eval "[$]2=ArchUnknown"
+diff -u ghc-7.4.1.20120508/compiler/main/DriverPipeline.hs.arm ghc-7.4.1.20120508/compiler/main/DriverPipeline.hs
+--- ghc-7.4.1.20120508/compiler/main/DriverPipeline.hs.arm 2012-05-15 02:10:41.000000000 +0900
++++ ghc-7.4.1.20120508/compiler/main/DriverPipeline.hs 2012-05-18 12:19:22.779955285 +0900
+@@ -1366,7 +1366,8 @@
+ SysTools.FileOption "" input_fn,
+ SysTools.Option "-o", SysTools.FileOption "" output_fn]
+ ++ map SysTools.Option lc_opts
+- ++ map SysTools.Option fpOpts)
++ ++ map SysTools.Option fpOpts
++ ++ map SysTools.Option abiOpts)
+
+ return (next_phase, output_fn)
+ where
+@@ -1378,12 +1379,19 @@
+ -- while compiling GHC source code. It's probably due to fact that it
+ -- does not enable VFP by default. Let's do this manually here
+ fpOpts = case platformArch (targetPlatform dflags) of
+- ArchARM ARMv7 ext -> if (elem VFPv3 ext)
++ ArchARM ARMv7 ext _ -> if (elem VFPv3 ext)
+ then ["-mattr=+v7,+vfp3"]
+ else if (elem VFPv3D16 ext)
+ then ["-mattr=+v7,+vfp3,+d16"]
+ else []
+ _ -> []
++ -- On Ubuntu/Debian with ARM hard float ABI, LLVM's llc still
++ -- compiles into soft-float ABI. We need to explicitly set abi
++ -- to hard
++ abiOpts = case platformArch (targetPlatform dflags) of
++ ArchARM ARMv7 _ HARD -> ["-float-abi=hard"]
++ ArchARM ARMv7 _ _ -> []
++ _ -> []
+
+ -----------------------------------------------------------------------------
+ -- LlvmMangle phase
+@@ -1532,8 +1540,8 @@
+
+ elfSectionNote :: String
+ elfSectionNote = case platformArch (targetPlatform dflags) of
+- ArchARM _ _ -> "%note"
+- _ -> "@note"
++ ArchARM _ _ _ -> "%note"
++ _ -> "@note"
+
+ -- The "link info" is a string representing the parameters of the
+ -- link. We save this information in the binary, and the next time we
+diff --git a/compiler/nativeGen/AsmCodeGen.lhs b/compiler/nativeGen/AsmCodeGen.lhs
+index 1ad1242..e976e58 100644
+--- a/compiler/nativeGen/AsmCodeGen.lhs
++++ b/compiler/nativeGen/AsmCodeGen.lhs
+@@ -200,7 +200,7 @@ nativeCodeGen dflags h us cmms
+ ,ncgExpandTop = map SPARC.CodeGen.Expand.expandTop
+ ,ncgMakeFarBranches = id
+ }
+- ArchARM _ _ ->
++ ArchARM _ _ _ ->
+ panic "nativeCodeGen: No NCG for ARM"
+ ArchPPC_64 ->
+ panic "nativeCodeGen: No NCG for PPC 64"
+diff --git a/compiler/nativeGen/RegAlloc/Graph/TrivColorable.hs b/compiler/nativeGen/RegAlloc/Graph/TrivColorable.hs
+index 6067f23..6cd3f00 100644
+--- a/compiler/nativeGen/RegAlloc/Graph/TrivColorable.hs
++++ b/compiler/nativeGen/RegAlloc/Graph/TrivColorable.hs
+@@ -107,13 +107,13 @@ trivColorable
+ trivColorable platform virtualRegSqueeze realRegSqueeze RcInteger conflicts exclusions
+ | let !cALLOCATABLE_REGS_INTEGER
+ = iUnbox (case platformArch platform of
+- ArchX86 -> 3
+- ArchX86_64 -> 5
+- ArchPPC -> 16
+- ArchSPARC -> 14
+- ArchPPC_64 -> panic "trivColorable ArchPPC_64"
+- ArchARM _ _ -> panic "trivColorable ArchARM"
+- ArchUnknown -> panic "trivColorable ArchUnknown")
++ ArchX86 -> 3
++ ArchX86_64 -> 5
++ ArchPPC -> 16
++ ArchSPARC -> 14
++ ArchPPC_64 -> panic "trivColorable ArchPPC_64"
++ ArchARM _ _ _ -> panic "trivColorable ArchARM"
++ ArchUnknown -> panic "trivColorable ArchUnknown")
+ , count2 <- accSqueeze (_ILIT(0)) cALLOCATABLE_REGS_INTEGER
+ (virtualRegSqueeze RcInteger)
+ conflicts
+@@ -127,13 +127,13 @@ trivColorable platform virtualRegSqueeze realRegSqueeze RcInteger conflicts excl
+ trivColorable platform virtualRegSqueeze realRegSqueeze RcFloat conflicts exclusions
+ | let !cALLOCATABLE_REGS_FLOAT
+ = iUnbox (case platformArch platform of
+- ArchX86 -> 0
+- ArchX86_64 -> 0
+- ArchPPC -> 0
+- ArchSPARC -> 22
+- ArchPPC_64 -> panic "trivColorable ArchPPC_64"
+- ArchARM _ _ -> panic "trivColorable ArchARM"
+- ArchUnknown -> panic "trivColorable ArchUnknown")
++ ArchX86 -> 0
++ ArchX86_64 -> 0
++ ArchPPC -> 0
++ ArchSPARC -> 22
++ ArchPPC_64 -> panic "trivColorable ArchPPC_64"
++ ArchARM _ _ _ -> panic "trivColorable ArchARM"
++ ArchUnknown -> panic "trivColorable ArchUnknown")
+ , count2 <- accSqueeze (_ILIT(0)) cALLOCATABLE_REGS_FLOAT
+ (virtualRegSqueeze RcFloat)
+ conflicts
+@@ -147,13 +147,13 @@ trivColorable platform virtualRegSqueeze realRegSqueeze RcFloat conflicts exclus
+ trivColorable platform virtualRegSqueeze realRegSqueeze RcDouble conflicts exclusions
+ | let !cALLOCATABLE_REGS_DOUBLE
+ = iUnbox (case platformArch platform of
+- ArchX86 -> 6
+- ArchX86_64 -> 0
+- ArchPPC -> 26
+- ArchSPARC -> 11
+- ArchPPC_64 -> panic "trivColorable ArchPPC_64"
+- ArchARM _ _ -> panic "trivColorable ArchARM"
+- ArchUnknown -> panic "trivColorable ArchUnknown")
++ ArchX86 -> 6
++ ArchX86_64 -> 0
++ ArchPPC -> 26
++ ArchSPARC -> 11
++ ArchPPC_64 -> panic "trivColorable ArchPPC_64"
++ ArchARM _ _ _ -> panic "trivColorable ArchARM"
++ ArchUnknown -> panic "trivColorable ArchUnknown")
+ , count2 <- accSqueeze (_ILIT(0)) cALLOCATABLE_REGS_DOUBLE
+ (virtualRegSqueeze RcDouble)
+ conflicts
+@@ -167,13 +167,13 @@ trivColorable platform virtualRegSqueeze realRegSqueeze RcDouble conflicts exclu
+ trivColorable platform virtualRegSqueeze realRegSqueeze RcDoubleSSE conflicts exclusions
+ | let !cALLOCATABLE_REGS_SSE
+ = iUnbox (case platformArch platform of
+- ArchX86 -> 8
+- ArchX86_64 -> 10
+- ArchPPC -> 0
+- ArchSPARC -> 0
+- ArchPPC_64 -> panic "trivColorable ArchPPC_64"
+- ArchARM _ _ -> panic "trivColorable ArchARM"
+- ArchUnknown -> panic "trivColorable ArchUnknown")
++ ArchX86 -> 8
++ ArchX86_64 -> 10
++ ArchPPC -> 0
++ ArchSPARC -> 0
++ ArchPPC_64 -> panic "trivColorable ArchPPC_64"
++ ArchARM _ _ _ -> panic "trivColorable ArchARM"
++ ArchUnknown -> panic "trivColorable ArchUnknown")
+ , count2 <- accSqueeze (_ILIT(0)) cALLOCATABLE_REGS_SSE
+ (virtualRegSqueeze RcDoubleSSE)
+ conflicts
+diff --git a/compiler/nativeGen/RegAlloc/Linear/FreeRegs.hs b/compiler/nativeGen/RegAlloc/Linear/FreeRegs.hs
+index 6fbbd04..fd1fd27 100644
+--- a/compiler/nativeGen/RegAlloc/Linear/FreeRegs.hs
++++ b/compiler/nativeGen/RegAlloc/Linear/FreeRegs.hs
+@@ -68,11 +68,11 @@ instance FR SPARC.FreeRegs where
+ maxSpillSlots :: Platform -> Int
+ maxSpillSlots platform
+ = case platformArch platform of
+- ArchX86 -> X86.Instr.maxSpillSlots True -- 32bit
+- ArchX86_64 -> X86.Instr.maxSpillSlots False -- not 32bit
+- ArchPPC -> PPC.Instr.maxSpillSlots
+- ArchSPARC -> SPARC.Instr.maxSpillSlots
+- ArchARM _ _ -> panic "maxSpillSlots ArchARM"
+- ArchPPC_64 -> panic "maxSpillSlots ArchPPC_64"
+- ArchUnknown -> panic "maxSpillSlots ArchUnknown"
++ ArchX86 -> X86.Instr.maxSpillSlots True -- 32bit
++ ArchX86_64 -> X86.Instr.maxSpillSlots False -- not 32bit
++ ArchPPC -> PPC.Instr.maxSpillSlots
++ ArchSPARC -> SPARC.Instr.maxSpillSlots
++ ArchARM _ _ _ -> panic "maxSpillSlots ArchARM"
++ ArchPPC_64 -> panic "maxSpillSlots ArchPPC_64"
++ ArchUnknown -> panic "maxSpillSlots ArchUnknown"
+
+diff --git a/compiler/nativeGen/RegAlloc/Linear/Main.hs b/compiler/nativeGen/RegAlloc/Linear/Main.hs
+index fc0bde4..64b0f68 100644
+--- a/compiler/nativeGen/RegAlloc/Linear/Main.hs
++++ b/compiler/nativeGen/RegAlloc/Linear/Main.hs
+@@ -180,13 +180,13 @@ linearRegAlloc
+ linearRegAlloc dflags first_id block_live sccs
+ = let platform = targetPlatform dflags
+ in case platformArch platform of
+- ArchX86 -> linearRegAlloc' platform (frInitFreeRegs :: X86.FreeRegs) first_id block_live sccs
+- ArchX86_64 -> linearRegAlloc' platform (frInitFreeRegs :: X86.FreeRegs) first_id block_live sccs
+- ArchSPARC -> linearRegAlloc' platform (frInitFreeRegs :: SPARC.FreeRegs) first_id block_live sccs
+- ArchPPC -> linearRegAlloc' platform (frInitFreeRegs :: PPC.FreeRegs) first_id block_live sccs
+- ArchARM _ _ -> panic "linearRegAlloc ArchARM"
+- ArchPPC_64 -> panic "linearRegAlloc ArchPPC_64"
+- ArchUnknown -> panic "linearRegAlloc ArchUnknown"
++ ArchX86 -> linearRegAlloc' platform (frInitFreeRegs :: X86.FreeRegs) first_id block_live sccs
++ ArchX86_64 -> linearRegAlloc' platform (frInitFreeRegs :: X86.FreeRegs) first_id block_live sccs
++ ArchSPARC -> linearRegAlloc' platform (frInitFreeRegs :: SPARC.FreeRegs) first_id block_live sccs
++ ArchPPC -> linearRegAlloc' platform (frInitFreeRegs :: PPC.FreeRegs) first_id block_live sccs
++ ArchARM _ _ _ -> panic "linearRegAlloc ArchARM"
++ ArchPPC_64 -> panic "linearRegAlloc ArchPPC_64"
++ ArchUnknown -> panic "linearRegAlloc ArchUnknown"
+
+ linearRegAlloc'
+ :: (FR freeRegs, PlatformOutputable instr, Instruction instr)
+diff --git a/compiler/nativeGen/TargetReg.hs b/compiler/nativeGen/TargetReg.hs
+index cbc4c17..13293de 100644
+--- a/compiler/nativeGen/TargetReg.hs
++++ b/compiler/nativeGen/TargetReg.hs
+@@ -50,35 +50,35 @@ import qualified SPARC.Regs as SPARC
+ targetVirtualRegSqueeze :: Platform -> RegClass -> VirtualReg -> FastInt
+ targetVirtualRegSqueeze platform
+ = case platformArch platform of
+- ArchX86 -> X86.virtualRegSqueeze
+- ArchX86_64 -> X86.virtualRegSqueeze
+- ArchPPC -> PPC.virtualRegSqueeze
+- ArchSPARC -> SPARC.virtualRegSqueeze
+- ArchPPC_64 -> panic "targetVirtualRegSqueeze ArchPPC_64"
+- ArchARM _ _ -> panic "targetVirtualRegSqueeze ArchARM"
+- ArchUnknown -> panic "targetVirtualRegSqueeze ArchUnknown"
++ ArchX86 -> X86.virtualRegSqueeze
++ ArchX86_64 -> X86.virtualRegSqueeze
++ ArchPPC -> PPC.virtualRegSqueeze
++ ArchSPARC -> SPARC.virtualRegSqueeze
++ ArchPPC_64 -> panic "targetVirtualRegSqueeze ArchPPC_64"
++ ArchARM _ _ _ -> panic "targetVirtualRegSqueeze ArchARM"
++ ArchUnknown -> panic "targetVirtualRegSqueeze ArchUnknown"
+
+ targetRealRegSqueeze :: Platform -> RegClass -> RealReg -> FastInt
+ targetRealRegSqueeze platform
+ = case platformArch platform of
+- ArchX86 -> X86.realRegSqueeze
+- ArchX86_64 -> X86.realRegSqueeze
+- ArchPPC -> PPC.realRegSqueeze
+- ArchSPARC -> SPARC.realRegSqueeze
+- ArchPPC_64 -> panic "targetRealRegSqueeze ArchPPC_64"
+- ArchARM _ _ -> panic "targetRealRegSqueeze ArchARM"
+- ArchUnknown -> panic "targetRealRegSqueeze ArchUnknown"
++ ArchX86 -> X86.realRegSqueeze
++ ArchX86_64 -> X86.realRegSqueeze
++ ArchPPC -> PPC.realRegSqueeze
++ ArchSPARC -> SPARC.realRegSqueeze
++ ArchPPC_64 -> panic "targetRealRegSqueeze ArchPPC_64"
++ ArchARM _ _ _ -> panic "targetRealRegSqueeze ArchARM"
++ ArchUnknown -> panic "targetRealRegSqueeze ArchUnknown"
+
+ targetClassOfRealReg :: Platform -> RealReg -> RegClass
+ targetClassOfRealReg platform
+ = case platformArch platform of
+- ArchX86 -> X86.classOfRealReg
+- ArchX86_64 -> X86.classOfRealReg
+- ArchPPC -> PPC.classOfRealReg
+- ArchSPARC -> SPARC.classOfRealReg
+- ArchPPC_64 -> panic "targetClassOfRealReg ArchPPC_64"
+- ArchARM _ _ -> panic "targetClassOfRealReg ArchARM"
+- ArchUnknown -> panic "targetClassOfRealReg ArchUnknown"
++ ArchX86 -> X86.classOfRealReg
++ ArchX86_64 -> X86.classOfRealReg
++ ArchPPC -> PPC.classOfRealReg
++ ArchSPARC -> SPARC.classOfRealReg
++ ArchPPC_64 -> panic "targetClassOfRealReg ArchPPC_64"
++ ArchARM _ _ _ -> panic "targetClassOfRealReg ArchARM"
++ ArchUnknown -> panic "targetClassOfRealReg ArchUnknown"
+
+ -- TODO: This should look at targetPlatform too
+ targetWordSize :: Size
+@@ -87,24 +87,24 @@ targetWordSize = intSize wordWidth
+ targetMkVirtualReg :: Platform -> Unique -> Size -> VirtualReg
+ targetMkVirtualReg platform
+ = case platformArch platform of
+- ArchX86 -> X86.mkVirtualReg
+- ArchX86_64 -> X86.mkVirtualReg
+- ArchPPC -> PPC.mkVirtualReg
+- ArchSPARC -> SPARC.mkVirtualReg
+- ArchPPC_64 -> panic "targetMkVirtualReg ArchPPC_64"
+- ArchARM _ _ -> panic "targetMkVirtualReg ArchARM"
+- ArchUnknown -> panic "targetMkVirtualReg ArchUnknown"
++ ArchX86 -> X86.mkVirtualReg
++ ArchX86_64 -> X86.mkVirtualReg
++ ArchPPC -> PPC.mkVirtualReg
++ ArchSPARC -> SPARC.mkVirtualReg
++ ArchPPC_64 -> panic "targetMkVirtualReg ArchPPC_64"
++ ArchARM _ _ _ -> panic "targetMkVirtualReg ArchARM"
++ ArchUnknown -> panic "targetMkVirtualReg ArchUnknown"
+
+ targetRegDotColor :: Platform -> RealReg -> SDoc
+ targetRegDotColor platform
+ = case platformArch platform of
+- ArchX86 -> X86.regDotColor platform
+- ArchX86_64 -> X86.regDotColor platform
+- ArchPPC -> PPC.regDotColor
+- ArchSPARC -> SPARC.regDotColor
+- ArchPPC_64 -> panic "targetRegDotColor ArchPPC_64"
+- ArchARM _ _ -> panic "targetRegDotColor ArchARM"
+- ArchUnknown -> panic "targetRegDotColor ArchUnknown"
++ ArchX86 -> X86.regDotColor platform
++ ArchX86_64 -> X86.regDotColor platform
++ ArchPPC -> PPC.regDotColor
++ ArchSPARC -> SPARC.regDotColor
++ ArchPPC_64 -> panic "targetRegDotColor ArchPPC_64"
++ ArchARM _ _ _ -> panic "targetRegDotColor ArchARM"
++ ArchUnknown -> panic "targetRegDotColor ArchUnknown"
+
+
+ targetClassOfReg :: Platform -> Reg -> RegClass
+diff --git a/compiler/utils/Platform.hs b/compiler/utils/Platform.hs
+index 47dd779..8252621 100644
+--- a/compiler/utils/Platform.hs
++++ b/compiler/utils/Platform.hs
+@@ -7,6 +7,7 @@ module Platform (
+ OS(..),
+ ArmISA(..),
+ ArmISAExt(..),
++ ArmABI(..),
+
+ target32Bit,
+ osElfTarget
+@@ -41,7 +42,9 @@ data Arch
+ | ArchSPARC
+ | ArchARM
+ { armISA :: ArmISA
+- , armISAExt :: [ArmISAExt] }
++ , armISAExt :: [ArmISAExt]
++ , armABI :: ArmABI
++ }
+ deriving (Read, Show, Eq)
+
+
+@@ -61,7 +64,7 @@ data OS
+ | OSHaiku
+ deriving (Read, Show, Eq)
+
+--- | ARM Instruction Set Architecture and Extensions
++-- | ARM Instruction Set Architecture, Extensions and ABI
+ --
+ data ArmISA
+ = ARMv5
+@@ -77,6 +80,11 @@ data ArmISAExt
+ | IWMMX2
+ deriving (Read, Show, Eq)
+
++data ArmABI
++ = SOFT
++ | SOFTFP
++ | HARD
++ deriving (Read, Show, Eq)
+
+ target32Bit :: Platform -> Bool
+ target32Bit p = platformWordSize p == 4
+diff --git a/config.guess b/config.guess
+index 463a03a..d622a44 100644
+--- a/config.guess
++++ b/config.guess
+@@ -1,10 +1,10 @@
+ #! /bin/sh
+ # Attempt to guess a canonical system name.
+ # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
+-# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
+-# Free Software Foundation, Inc.
++# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010,
++# 2011, 2012 Free Software Foundation, Inc.
+
+-timestamp='2008-11-15'
++timestamp='2012-02-10'
+
+ # This file is free software; you can redistribute it and/or modify it
+ # under the terms of the GNU General Public License as published by
+@@ -17,9 +17,7 @@ timestamp='2008-11-15'
+ # General Public License for more details.
+ #
+ # You should have received a copy of the GNU General Public License
+-# along with this program; if not, write to the Free Software
+-# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA
+-# 02110-1301, USA.
++# along with this program; if not, see <http://www.gnu.org/licenses/>.
+ #
+ # As a special exception to the GNU General Public License, if you
+ # distribute this file as part of a program that contains a
+@@ -27,16 +25,16 @@ timestamp='2008-11-15'
+ # the same distribution terms that you use for the rest of that program.
+
+
+-# Originally written by Per Bothner <per@bothner.com>.
+-# Please send patches to <config-patches@gnu.org>. Submit a context
+-# diff and a properly formatted ChangeLog entry.
++# Originally written by Per Bothner. Please send patches (context
++# diff format) to <config-patches@gnu.org> and include a ChangeLog
++# entry.
+ #
+ # This script attempts to guess a canonical system name similar to
+ # config.sub. If it succeeds, it prints the system name on stdout, and
+ # exits with 0. Otherwise, it exits with 1.
+ #
+-# The plan is that this can be called by configure scripts if you
+-# don't specify an explicit build system type.
++# You can get the latest version of this script from:
++# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD
+
+ me=`echo "$0" | sed -e 's,.*/,,'`
+
+@@ -56,8 +54,9 @@ version="\
+ GNU config.guess ($timestamp)
+
+ Originally written by Per Bothner.
+-Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001,
+-2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
++Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
++2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012
++Free Software Foundation, Inc.
+
+ This is free software; see the source for copying conditions. There is NO
+ warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
+@@ -144,7 +143,7 @@ UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
+ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
+ *:NetBSD:*:*)
+ # NetBSD (nbsd) targets should (where applicable) match one or
+- # more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*,
++ # more of the tuples: *-*-netbsdelf*, *-*-netbsdaout*,
+ # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently
+ # switched to ELF, *-*-netbsd* would select the old
+ # object file format. This provides both forward
+@@ -170,7 +169,7 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
+ arm*|i386|m68k|ns32k|sh3*|sparc|vax)
+ eval $set_cc_for_build
+ if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \
+- | grep __ELF__ >/dev/null
++ | grep -q __ELF__
+ then
+ # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout).
+ # Return netbsd for either. FIX?
+@@ -180,7 +179,7 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
+ fi
+ ;;
+ *)
+- os=netbsd
++ os=netbsd
+ ;;
+ esac
+ # The OS release
+@@ -223,7 +222,7 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
+ UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'`
+ ;;
+ *5.*)
+- UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'`
++ UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'`
+ ;;
+ esac
+ # According to Compaq, /usr/sbin/psrinfo has been available on
+@@ -269,7 +268,10 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
+ # A Xn.n version is an unreleased experimental baselevel.
+ # 1.2 uses "1.2" for uname -r.
+ echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
+- exit ;;
++ # Reset EXIT trap before exiting to avoid spurious non-zero exit code.
++ exitcode=$?
++ trap '' 0
++ exit $exitcode ;;
+ Alpha\ *:Windows_NT*:*)
+ # How do we know it's Interix rather than the generic POSIX subsystem?
+ # Should we change UNAME_MACHINE based on the output of uname instead
+@@ -295,7 +297,7 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
+ echo s390-ibm-zvmoe
+ exit ;;
+ *:OS400:*:*)
+- echo powerpc-ibm-os400
++ echo powerpc-ibm-os400
+ exit ;;
+ arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
+ echo arm-acorn-riscix${UNAME_RELEASE}
+@@ -324,12 +326,18 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
+ case `/usr/bin/uname -p` in
+ sparc) echo sparc-icl-nx7; exit ;;
+ esac ;;
++ s390x:SunOS:*:*)
++ echo ${UNAME_MACHINE}-ibm-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
++ exit ;;
+ sun4H:SunOS:5.*:*)
+ echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+ exit ;;
+ sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*)
+ echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+ exit ;;
++ i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*)
++ echo i386-pc-auroraux${UNAME_RELEASE}
++ exit ;;
+ i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*)
+ eval $set_cc_for_build
+ SUN_ARCH="i386"
+@@ -337,17 +345,7 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
+ # Note that the Sun cc does not turn __LP64__ into 1 like gcc does.
+ # This test works for both compilers.
+ if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
+- # bash is not able to generate correct code here
+- # i.e. it leaves \ns there
+- # so we need to use /usr/bin/echo to get what we want
+- # note that if config.guess is run by /bin/sh then
+- # this works as expected even without /usr/bin/echo
+- # but the problem is that configure is clever enough
+- # to find bash installed and then runs config.guess
+- # by bash instead of by /bin/sh
+- # It seems that using /usr/bin/echo here is the most
+- # portable Solaris fix
+- if /usr/bin/echo '\n#ifdef __amd64\nIS_64BIT_ARCH\n#endif' | \
++ if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \
+ (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
+ grep IS_64BIT_ARCH >/dev/null
+ then
+@@ -398,23 +396,23 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
+ # MiNT. But MiNT is downward compatible to TOS, so this should
+ # be no problem.
+ atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*)
+- echo m68k-atari-mint${UNAME_RELEASE}
++ echo m68k-atari-mint${UNAME_RELEASE}
+ exit ;;
+ atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*)
+ echo m68k-atari-mint${UNAME_RELEASE}
+- exit ;;
++ exit ;;
+ *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*)
+- echo m68k-atari-mint${UNAME_RELEASE}
++ echo m68k-atari-mint${UNAME_RELEASE}
+ exit ;;
+ milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*)
+- echo m68k-milan-mint${UNAME_RELEASE}
+- exit ;;
++ echo m68k-milan-mint${UNAME_RELEASE}
++ exit ;;
+ hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*)
+- echo m68k-hades-mint${UNAME_RELEASE}
+- exit ;;
++ echo m68k-hades-mint${UNAME_RELEASE}
++ exit ;;
+ *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*)
+- echo m68k-unknown-mint${UNAME_RELEASE}
+- exit ;;
++ echo m68k-unknown-mint${UNAME_RELEASE}
++ exit ;;
+ m68k:machten:*:*)
+ echo m68k-apple-machten${UNAME_RELEASE}
+ exit ;;
+@@ -484,8 +482,8 @@ EOF
+ echo m88k-motorola-sysv3
+ exit ;;
+ AViiON:dgux:*:*)
+- # DG/UX returns AViiON for all architectures
+- UNAME_PROCESSOR=`/usr/bin/uname -p`
++ # DG/UX returns AViiON for all architectures
++ UNAME_PROCESSOR=`/usr/bin/uname -p`
+ if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ]
+ then
+ if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \
+@@ -498,7 +496,7 @@ EOF
+ else
+ echo i586-dg-dgux${UNAME_RELEASE}
+ fi
+- exit ;;
++ exit ;;
+ M88*:DolphinOS:*:*) # DolphinOS (SVR3)
+ echo m88k-dolphin-sysv3
+ exit ;;
+@@ -555,7 +553,7 @@ EOF
+ echo rs6000-ibm-aix3.2
+ fi
+ exit ;;
+- *:AIX:*:[456])
++ *:AIX:*:[4567])
+ IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'`
+ if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then
+ IBM_ARCH=rs6000
+@@ -598,52 +596,52 @@ EOF
+ 9000/[678][0-9][0-9])
+ if [ -x /usr/bin/getconf ]; then
+ sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null`
+- sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null`
+- case "${sc_cpu_version}" in
+- 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0
+- 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1
+- 532) # CPU_PA_RISC2_0
+- case "${sc_kernel_bits}" in
+- 32) HP_ARCH="hppa2.0n" ;;
+- 64) HP_ARCH="hppa2.0w" ;;
++ sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null`
++ case "${sc_cpu_version}" in
++ 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0
++ 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1
++ 532) # CPU_PA_RISC2_0
++ case "${sc_kernel_bits}" in
++ 32) HP_ARCH="hppa2.0n" ;;
++ 64) HP_ARCH="hppa2.0w" ;;
+ '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20
+- esac ;;
+- esac
++ esac ;;
++ esac
+ fi
+ if [ "${HP_ARCH}" = "" ]; then
+ eval $set_cc_for_build
+- sed 's/^ //' << EOF >$dummy.c
++ sed 's/^ //' << EOF >$dummy.c
+
+- #define _HPUX_SOURCE
+- #include <stdlib.h>
+- #include <unistd.h>
++ #define _HPUX_SOURCE
++ #include <stdlib.h>
++ #include <unistd.h>
+
+- int main ()
+- {
+- #if defined(_SC_KERNEL_BITS)
+- long bits = sysconf(_SC_KERNEL_BITS);
+- #endif
+- long cpu = sysconf (_SC_CPU_VERSION);
++ int main ()
++ {
++ #if defined(_SC_KERNEL_BITS)
++ long bits = sysconf(_SC_KERNEL_BITS);
++ #endif
++ long cpu = sysconf (_SC_CPU_VERSION);
+
+- switch (cpu)
+- {
+- case CPU_PA_RISC1_0: puts ("hppa1.0"); break;
+- case CPU_PA_RISC1_1: puts ("hppa1.1"); break;
+- case CPU_PA_RISC2_0:
+- #if defined(_SC_KERNEL_BITS)
+- switch (bits)
+- {
+- case 64: puts ("hppa2.0w"); break;
+- case 32: puts ("hppa2.0n"); break;
+- default: puts ("hppa2.0"); break;
+- } break;
+- #else /* !defined(_SC_KERNEL_BITS) */
+- puts ("hppa2.0"); break;
+- #endif
+- default: puts ("hppa1.0"); break;
+- }
+- exit (0);
+- }
++ switch (cpu)
++ {
++ case CPU_PA_RISC1_0: puts ("hppa1.0"); break;
++ case CPU_PA_RISC1_1: puts ("hppa1.1"); break;
++ case CPU_PA_RISC2_0:
++ #if defined(_SC_KERNEL_BITS)
++ switch (bits)
++ {
++ case 64: puts ("hppa2.0w"); break;
++ case 32: puts ("hppa2.0n"); break;
++ default: puts ("hppa2.0"); break;
++ } break;
++ #else /* !defined(_SC_KERNEL_BITS) */
++ puts ("hppa2.0"); break;
++ #endif
++ default: puts ("hppa1.0"); break;
++ }
++ exit (0);
++ }
+ EOF
+ (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy`
+ test -z "$HP_ARCH" && HP_ARCH=hppa
+@@ -663,7 +661,7 @@ EOF
+ # => hppa64-hp-hpux11.23
+
+ if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) |
+- grep __LP64__ >/dev/null
++ grep -q __LP64__
+ then
+ HP_ARCH="hppa2.0w"
+ else
+@@ -734,22 +732,22 @@ EOF
+ exit ;;
+ C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*)
+ echo c1-convex-bsd
+- exit ;;
++ exit ;;
+ C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*)
+ if getsysinfo -f scalar_acc
+ then echo c32-convex-bsd
+ else echo c2-convex-bsd
+ fi
+- exit ;;
++ exit ;;
+ C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*)
+ echo c34-convex-bsd
+- exit ;;
++ exit ;;
+ C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*)
+ echo c38-convex-bsd
+- exit ;;
++ exit ;;
+ C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*)
+ echo c4-convex-bsd
+- exit ;;
++ exit ;;
+ CRAY*Y-MP:*:*:*)
+ echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
+ exit ;;
+@@ -773,14 +771,14 @@ EOF
+ exit ;;
+ F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*)
+ FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
+- FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
+- FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`
+- echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
+- exit ;;
++ FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
++ FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`
++ echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
++ exit ;;
+ 5000:UNIX_System_V:4.*:*)
+- FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
+- FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'`
+- echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
++ FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
++ FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'`
++ echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
+ exit ;;
+ i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*)
+ echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE}
+@@ -792,13 +790,12 @@ EOF
+ echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE}
+ exit ;;
+ *:FreeBSD:*:*)
+- case ${UNAME_MACHINE} in
+- pc98)
+- echo i386-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
++ UNAME_PROCESSOR=`/usr/bin/uname -p`
++ case ${UNAME_PROCESSOR} in
+ amd64)
+ echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
+ *)
+- echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
++ echo ${UNAME_PROCESSOR}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
+ esac
+ exit ;;
+ i*:CYGWIN*:*)
+@@ -807,19 +804,22 @@ EOF
+ *:MINGW*:*)
+ echo ${UNAME_MACHINE}-pc-mingw32
+ exit ;;
++ i*:MSYS*:*)
++ echo ${UNAME_MACHINE}-pc-msys
++ exit ;;
+ i*:windows32*:*)
+- # uname -m includes "-pc" on this system.
+- echo ${UNAME_MACHINE}-mingw32
++ # uname -m includes "-pc" on this system.
++ echo ${UNAME_MACHINE}-mingw32
+ exit ;;
+ i*:PW*:*)
+ echo ${UNAME_MACHINE}-pc-pw32
+ exit ;;
+- *:Interix*:[3456]*)
+- case ${UNAME_MACHINE} in
++ *:Interix*:*)
++ case ${UNAME_MACHINE} in
+ x86)
+ echo i586-pc-interix${UNAME_RELEASE}
+ exit ;;
+- EM64T | authenticamd | genuineintel)
++ authenticamd | genuineintel | EM64T)
+ echo x86_64-unknown-interix${UNAME_RELEASE}
+ exit ;;
+ IA64)
+@@ -829,6 +829,9 @@ EOF
+ [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*)
+ echo i${UNAME_MACHINE}-pc-mks
+ exit ;;
++ 8664:Windows_NT:*)
++ echo x86_64-pc-mks
++ exit ;;
+ i*:Windows_NT*:* | Pentium*:Windows_NT*:*)
+ # How do we know it's Interix rather than the generic POSIX subsystem?
+ # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we
+@@ -858,6 +861,27 @@ EOF
+ i*86:Minix:*:*)
+ echo ${UNAME_MACHINE}-pc-minix
+ exit ;;
++ aarch64:Linux:*:*)
++ echo ${UNAME_MACHINE}-unknown-linux-gnu
++ exit ;;
++ aarch64_be:Linux:*:*)
++ UNAME_MACHINE=aarch64_be
++ echo ${UNAME_MACHINE}-unknown-linux-gnu
++ exit ;;
++ alpha:Linux:*:*)
++ case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
++ EV5) UNAME_MACHINE=alphaev5 ;;
++ EV56) UNAME_MACHINE=alphaev56 ;;
++ PCA56) UNAME_MACHINE=alphapca56 ;;
++ PCA57) UNAME_MACHINE=alphapca56 ;;
++ EV6) UNAME_MACHINE=alphaev6 ;;
++ EV67) UNAME_MACHINE=alphaev67 ;;
++ EV68*) UNAME_MACHINE=alphaev68 ;;
++ esac
++ objdump --private-headers /bin/sh | grep -q ld.so.1
++ if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi
++ echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC}
++ exit ;;
+ arm*:Linux:*:*)
+ eval $set_cc_for_build
+ if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \
+@@ -865,20 +889,40 @@ EOF
+ then
+ echo ${UNAME_MACHINE}-unknown-linux-gnu
+ else
+- echo ${UNAME_MACHINE}-unknown-linux-gnueabi
++ if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \
++ | grep -q __ARM_PCS_VFP
++ then
++ echo ${UNAME_MACHINE}-unknown-linux-gnueabi
++ else
++ echo ${UNAME_MACHINE}-unknown-linux-gnueabihf
++ fi
+ fi
+ exit ;;
+ avr32*:Linux:*:*)
+ echo ${UNAME_MACHINE}-unknown-linux-gnu
+ exit ;;
+ cris:Linux:*:*)
+- echo cris-axis-linux-gnu
++ echo ${UNAME_MACHINE}-axis-linux-gnu
+ exit ;;
+ crisv32:Linux:*:*)
+- echo crisv32-axis-linux-gnu
++ echo ${UNAME_MACHINE}-axis-linux-gnu
+ exit ;;
+ frv:Linux:*:*)
+- echo frv-unknown-linux-gnu
++ echo ${UNAME_MACHINE}-unknown-linux-gnu
++ exit ;;
++ hexagon:Linux:*:*)
++ echo ${UNAME_MACHINE}-unknown-linux-gnu
++ exit ;;
++ i*86:Linux:*:*)
++ LIBC=gnu
++ eval $set_cc_for_build
++ sed 's/^ //' << EOF >$dummy.c
++ #ifdef __dietlibc__
++ LIBC=dietlibc
++ #endif
++EOF
++ eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC'`
++ echo "${UNAME_MACHINE}-pc-linux-${LIBC}"
+ exit ;;
+ ia64:Linux:*:*)
+ echo ${UNAME_MACHINE}-unknown-linux-gnu
+@@ -889,78 +933,34 @@ EOF
+ m68*:Linux:*:*)
+ echo ${UNAME_MACHINE}-unknown-linux-gnu
+ exit ;;
+- mips:Linux:*:*)
+- eval $set_cc_for_build
+- sed 's/^ //' << EOF >$dummy.c
+- #undef CPU
+- #undef mips
+- #undef mipsel
+- #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
+- CPU=mipsel
+- #else
+- #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
+- CPU=mips
+- #else
+- CPU=
+- #endif
+- #endif
+-EOF
+- eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n '
+- /^CPU/{
+- s: ::g
+- p
+- }'`"
+- test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; }
+- ;;
+- mips64:Linux:*:*)
++ mips:Linux:*:* | mips64:Linux:*:*)
+ eval $set_cc_for_build
+ sed 's/^ //' << EOF >$dummy.c
+ #undef CPU
+- #undef mips64
+- #undef mips64el
++ #undef ${UNAME_MACHINE}
++ #undef ${UNAME_MACHINE}el
+ #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
+- CPU=mips64el
++ CPU=${UNAME_MACHINE}el
+ #else
+ #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
+- CPU=mips64
++ CPU=${UNAME_MACHINE}
+ #else
+ CPU=
+ #endif
+ #endif
+ EOF
+- eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n '
+- /^CPU/{
+- s: ::g
+- p
+- }'`"
++ eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'`
+ test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; }
+ ;;
+ or32:Linux:*:*)
+- echo or32-unknown-linux-gnu
+- exit ;;
+- ppc:Linux:*:*)
+- echo powerpc-unknown-linux-gnu
+- exit ;;
+- ppc64:Linux:*:*)
+- echo powerpc64-unknown-linux-gnu
+- exit ;;
+- alpha:Linux:*:*)
+- case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
+- EV5) UNAME_MACHINE=alphaev5 ;;
+- EV56) UNAME_MACHINE=alphaev56 ;;
+- PCA56) UNAME_MACHINE=alphapca56 ;;
+- PCA57) UNAME_MACHINE=alphapca56 ;;
+- EV6) UNAME_MACHINE=alphaev6 ;;
+- EV67) UNAME_MACHINE=alphaev67 ;;
+- EV68*) UNAME_MACHINE=alphaev68 ;;
+- esac
+- objdump --private-headers /bin/sh | grep ld.so.1 >/dev/null
+- if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi
+- echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC}
++ echo ${UNAME_MACHINE}-unknown-linux-gnu
+ exit ;;
+ padre:Linux:*:*)
+ echo sparc-unknown-linux-gnu
+ exit ;;
++ parisc64:Linux:*:* | hppa64:Linux:*:*)
++ echo hppa64-unknown-linux-gnu
++ exit ;;
+ parisc:Linux:*:* | hppa:Linux:*:*)
+ # Look for CPU level
+ case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in
+@@ -969,14 +969,17 @@ EOF
+ *) echo hppa-unknown-linux-gnu ;;
+ esac
+ exit ;;
+- parisc64:Linux:*:* | hppa64:Linux:*:*)
+- echo hppa64-unknown-linux-gnu
++ ppc64:Linux:*:*)
++ echo powerpc64-unknown-linux-gnu
++ exit ;;
++ ppc:Linux:*:*)
++ echo powerpc-unknown-linux-gnu
+ exit ;;
+ s390:Linux:*:* | s390x:Linux:*:*)
+ echo ${UNAME_MACHINE}-ibm-linux
+ exit ;;
+ sh64*:Linux:*:*)
+- echo ${UNAME_MACHINE}-unknown-linux-gnu
++ echo ${UNAME_MACHINE}-unknown-linux-gnu
+ exit ;;
+ sh*:Linux:*:*)
+ echo ${UNAME_MACHINE}-unknown-linux-gnu
+@@ -984,75 +987,18 @@ EOF
+ sparc:Linux:*:* | sparc64:Linux:*:*)
+ echo ${UNAME_MACHINE}-unknown-linux-gnu
+ exit ;;
++ tile*:Linux:*:*)
++ echo ${UNAME_MACHINE}-unknown-linux-gnu
++ exit ;;
+ vax:Linux:*:*)
+ echo ${UNAME_MACHINE}-dec-linux-gnu
+ exit ;;
+ x86_64:Linux:*:*)
+- echo x86_64-unknown-linux-gnu
++ echo ${UNAME_MACHINE}-unknown-linux-gnu
+ exit ;;
+ xtensa*:Linux:*:*)
+- echo ${UNAME_MACHINE}-unknown-linux-gnu
++ echo ${UNAME_MACHINE}-unknown-linux-gnu
+ exit ;;
+- i*86:Linux:*:*)
+- # The BFD linker knows what the default object file format is, so
+- # first see if it will tell us. cd to the root directory to prevent
+- # problems with other programs or directories called `ld' in the path.
+- # Set LC_ALL=C to ensure ld outputs messages in English.
+- ld_supported_targets=`cd /; LC_ALL=C ld --help 2>&1 \
+- | sed -ne '/supported targets:/!d
+- s/[ ][ ]*/ /g
+- s/.*supported targets: *//
+- s/ .*//
+- p'`
+- case "$ld_supported_targets" in
+- elf32-i386)
+- TENTATIVE="${UNAME_MACHINE}-pc-linux-gnu"
+- ;;
+- a.out-i386-linux)
+- echo "${UNAME_MACHINE}-pc-linux-gnuaout"
+- exit ;;
+- "")
+- # Either a pre-BFD a.out linker (linux-gnuoldld) or
+- # one that does not give us useful --help.
+- echo "${UNAME_MACHINE}-pc-linux-gnuoldld"
+- exit ;;
+- esac
+- # Determine whether the default compiler is a.out or elf
+- eval $set_cc_for_build
+- sed 's/^ //' << EOF >$dummy.c
+- #include <features.h>
+- #ifdef __ELF__
+- # ifdef __GLIBC__
+- # if __GLIBC__ >= 2
+- LIBC=gnu
+- # else
+- LIBC=gnulibc1
+- # endif
+- # else
+- LIBC=gnulibc1
+- # endif
+- #else
+- #if defined(__INTEL_COMPILER) || defined(__PGI) || defined(__SUNPRO_C) || defined(__SUNPRO_CC)
+- LIBC=gnu
+- #else
+- LIBC=gnuaout
+- #endif
+- #endif
+- #ifdef __dietlibc__
+- LIBC=dietlibc
+- #endif
+-EOF
+- eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n '
+- /^LIBC/{
+- s: ::g
+- p
+- }'`"
+- test x"${LIBC}" != x && {
+- echo "${UNAME_MACHINE}-pc-linux-${LIBC}"
+- exit
+- }
+- test x"${TENTATIVE}" != x && { echo "${TENTATIVE}"; exit; }
+- ;;
+ i*86:DYNIX/ptx:4*:*)
+ # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.
+ # earlier versions are messed up and put the nodename in both
+@@ -1060,11 +1006,11 @@ EOF
+ echo i386-sequent-sysv4
+ exit ;;
+ i*86:UNIX_SV:4.2MP:2.*)
+- # Unixware is an offshoot of SVR4, but it has its own version
+- # number series starting with 2...
+- # I am not positive that other SVR4 systems won't match this,
++ # Unixware is an offshoot of SVR4, but it has its own version
++ # number series starting with 2...
++ # I am not positive that other SVR4 systems won't match this,
+ # I just have to hope. -- rms.
+- # Use sysv4.2uw... so that sysv4* matches it.
++ # Use sysv4.2uw... so that sysv4* matches it.
+ echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION}
+ exit ;;
+ i*86:OS/2:*:*)
+@@ -1081,7 +1027,7 @@ EOF
+ i*86:syllable:*:*)
+ echo ${UNAME_MACHINE}-pc-syllable
+ exit ;;
+- i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*)
++ i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*)
+ echo i386-unknown-lynxos${UNAME_RELEASE}
+ exit ;;
+ i*86:*DOS:*:*)
+@@ -1096,7 +1042,7 @@ EOF
+ fi
+ exit ;;
+ i*86:*:5:[678]*)
+- # UnixWare 7.x, OpenUNIX and OpenServer 6.
++ # UnixWare 7.x, OpenUNIX and OpenServer 6.
+ case `/bin/uname -X | grep "^Machine"` in
+ *486*) UNAME_MACHINE=i486 ;;
+ *Pentium) UNAME_MACHINE=i586 ;;
+@@ -1124,10 +1070,13 @@ EOF
+ exit ;;
+ pc:*:*:*)
+ # Left here for compatibility:
+- # uname -m prints for DJGPP always 'pc', but it prints nothing about
+- # the processor, so we play safe by assuming i386.
+- echo i386-pc-msdosdjgpp
+- exit ;;
++ # uname -m prints for DJGPP always 'pc', but it prints nothing about
++ # the processor, so we play safe by assuming i586.
++ # Note: whatever this is, it MUST be the same as what config.sub
++ # prints for the "djgpp" host, or else GDB configury will decide that
++ # this is a cross-build.
++ echo i586-pc-msdosdjgpp
++ exit ;;
+ Intel:Mach:3*:*)
+ echo i386-pc-mach3
+ exit ;;
+@@ -1162,8 +1111,18 @@ EOF
+ /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
+ && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;
+ 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*)
+- /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
+- && { echo i486-ncr-sysv4; exit; } ;;
++ /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
++ && { echo i486-ncr-sysv4; exit; } ;;
++ NCR*:*:4.2:* | MPRAS*:*:4.2:*)
++ OS_REL='.3'
++ test -r /etc/.relid \
++ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
++ /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
++ && { echo i486-ncr-sysv4.3${OS_REL}; exit; }
++ /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
++ && { echo i586-ncr-sysv4.3${OS_REL}; exit; }
++ /bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \
++ && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;
+ m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*)
+ echo m68k-unknown-lynxos${UNAME_RELEASE}
+ exit ;;
+@@ -1176,7 +1135,7 @@ EOF
+ rs6000:LynxOS:2.*:*)
+ echo rs6000-unknown-lynxos${UNAME_RELEASE}
+ exit ;;
+- PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.0*:*)
++ PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*)
+ echo powerpc-unknown-lynxos${UNAME_RELEASE}
+ exit ;;
+ SM[BE]S:UNIX_SV:*:*)
+@@ -1196,10 +1155,10 @@ EOF
+ echo ns32k-sni-sysv
+ fi
+ exit ;;
+- PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort
+- # says <Richard.M.Bartel@ccMail.Census.GOV>
+- echo i586-unisys-sysv4
+- exit ;;
++ PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort
++ # says <Richard.M.Bartel@ccMail.Census.GOV>
++ echo i586-unisys-sysv4
++ exit ;;
+ *:UNIX_System_V:4*:FTX*)
+ # From Gerald Hewes <hewes@openmarket.com>.
+ # How about differentiating between stratus architectures? -djm
+@@ -1225,11 +1184,11 @@ EOF
+ exit ;;
+ R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*)
+ if [ -d /usr/nec ]; then
+- echo mips-nec-sysv${UNAME_RELEASE}
++ echo mips-nec-sysv${UNAME_RELEASE}
+ else
+- echo mips-unknown-sysv${UNAME_RELEASE}
++ echo mips-unknown-sysv${UNAME_RELEASE}
+ fi
+- exit ;;
++ exit ;;
+ BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only.
+ echo powerpc-be-beos
+ exit ;;
+@@ -1269,6 +1228,16 @@ EOF
+ *:Darwin:*:*)
+ UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown
+ case $UNAME_PROCESSOR in
++ i386)
++ eval $set_cc_for_build
++ if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
++ if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \
++ (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
++ grep IS_64BIT_ARCH >/dev/null
++ then
++ UNAME_PROCESSOR="x86_64"
++ fi
++ fi ;;
+ unknown) UNAME_PROCESSOR=powerpc ;;
+ esac
+ echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE}
+@@ -1284,6 +1253,9 @@ EOF
+ *:QNX:*:4*)
+ echo i386-pc-qnx
+ exit ;;
++ NEO-?:NONSTOP_KERNEL:*:*)
++ echo neo-tandem-nsk${UNAME_RELEASE}
++ exit ;;
+ NSE-?:NONSTOP_KERNEL:*:*)
+ echo nse-tandem-nsk${UNAME_RELEASE}
+ exit ;;
+@@ -1329,13 +1301,13 @@ EOF
+ echo pdp10-unknown-its
+ exit ;;
+ SEI:*:*:SEIUX)
+- echo mips-sei-seiux${UNAME_RELEASE}
++ echo mips-sei-seiux${UNAME_RELEASE}
+ exit ;;
+ *:DragonFly:*:*)
+ echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
+ exit ;;
+ *:*VMS:*:*)
+- UNAME_MACHINE=`(uname -p) 2>/dev/null`
++ UNAME_MACHINE=`(uname -p) 2>/dev/null`
+ case "${UNAME_MACHINE}" in
+ A*) echo alpha-dec-vms ; exit ;;
+ I*) echo ia64-dec-vms ; exit ;;
+@@ -1350,6 +1322,12 @@ EOF
+ i*86:rdos:*:*)
+ echo ${UNAME_MACHINE}-pc-rdos
+ exit ;;
++ i*86:AROS:*:*)
++ echo ${UNAME_MACHINE}-pc-aros
++ exit ;;
++ x86_64:VMkernel:*:*)
++ echo ${UNAME_MACHINE}-unknown-esx
++ exit ;;
+ esac
+
+ #echo '(No uname command or uname output not recognized.)' 1>&2
+@@ -1372,11 +1350,11 @@ main ()
+ #include <sys/param.h>
+ printf ("m68k-sony-newsos%s\n",
+ #ifdef NEWSOS4
+- "4"
++ "4"
+ #else
+- ""
++ ""
+ #endif
+- ); exit (0);
++ ); exit (0);
+ #endif
+ #endif
+
+diff --git a/configure.ac b/configure.ac
+index 9237c77..8e3d9d2 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -210,6 +210,20 @@ AC_CANONICAL_BUILD
+ AC_CANONICAL_HOST
+ AC_CANONICAL_TARGET
+
++# Testing ARM ABI
++# required for code generation (LLVM options)
++ARM_ABI=SOFT
++echo HOST: $host
++
++case $host in
++ arm*-*-linux-gnueabihf)
++ ARM_ABI=HARD
++ ;;
++ arm*-*-linux-gnueabi)
++ ARM_ABI=SOFTFP
++ ;;
++esac
++
+ FPTOOLS_SET_PLATFORM_VARS
+
+ # Verify that the installed (bootstrap) GHC is capable of generating
+--
+1.7.4.3
+
diff --git a/tools/bootstrap/ghc/ghc-7.4-silence-gen_contents_index.patch b/tools/bootstrap/ghc/ghc-7.4-silence-gen_contents_index.patch
new file mode 100644
index 0000000..d000b8b
--- /dev/null
+++ b/tools/bootstrap/ghc/ghc-7.4-silence-gen_contents_index.patch
@@ -0,0 +1,11 @@
+--- ghc-7.4.1/libraries/gen_contents_index~ 2012-09-30 16:14:39.368295240 +0900
++++ ghc-7.4.1/libraries/gen_contents_index 2012-10-30 19:12:10.017398594 +0900
+@@ -50,7 +50,7 @@
+ esac
+
+ # Now create the combined contents and index pages
+-echo $HADDOCK_ARGS
++#echo $HADDOCK_ARGS
+ $HADDOCK --gen-index --gen-contents -o . \
+ -t "Haskell Hierarchical Libraries" \
+ -p "prologue.txt" \
diff --git a/tools/bootstrap/ghc/ghc-7.4.2-Cabal-disable-ghci-libs.patch b/tools/bootstrap/ghc/ghc-7.4.2-Cabal-disable-ghci-libs.patch
new file mode 100644
index 0000000..cdefe0d
--- /dev/null
+++ b/tools/bootstrap/ghc/ghc-7.4.2-Cabal-disable-ghci-libs.patch
@@ -0,0 +1,13 @@
+--- ghc-7.4.2/libraries/Cabal/Cabal/Distribution/Simple/Setup.hs~ 2012-06-07 02:10:40.000000000 +0900
++++ ghc-7.4.2/libraries/Cabal/Cabal/Distribution/Simple/Setup.hs 2012-08-24 20:33:00.032123967 +0900
+@@ -313,7 +313,7 @@
+ configDistPref = Flag defaultDistPref,
+ configVerbosity = Flag normal,
+ configUserInstall = Flag False, --TODO: reverse this
+- configGHCiLib = Flag True,
++ configGHCiLib = Flag False,
+ configSplitObjs = Flag False, -- takes longer, so turn off by default
+ configStripExes = Flag True,
+ configTests = Flag False,
+
+Diff finished. Fri Aug 24 20:33:10 2012
diff --git a/tools/bootstrap/ghc/ghc-doc-index b/tools/bootstrap/ghc/ghc-doc-index
new file mode 100755
index 0000000..6105d7e
--- /dev/null
+++ b/tools/bootstrap/ghc/ghc-doc-index
@@ -0,0 +1,38 @@
+#!/bin/sh
+
+LOCKFILE=/var/lock/ghc-doc-index.lock
+
+# the lockfile is not meant to be perfect, it's just in case
+# two cron scripts get run close to each other to keep
+# them from stepping on each other's toes.
+if [ -f $LOCKFILE ]; then
+ echo "Locked with $LOCKFILE"
+ exit 0
+fi
+
+if [ "$(id -u)" != "0" ]; then
+ echo Need to be root!
+ exit 1
+fi
+
+trap "{ rm -f $LOCKFILE ; exit 255; }" EXIT
+touch $LOCKFILE
+
+PKGDIRCACHE=/var/lib/ghc/pkg-dir.cache
+LISTING="env LANG=C ls -dl"
+
+# only re-index ghc docs when there are changes
+cd /usr/share/doc/ghc/html/libraries
+if [ -r "$PKGDIRCACHE" ]; then
+ $LISTING */ > $PKGDIRCACHE.new
+ DIR_DIFF=$(diff $PKGDIRCACHE $PKGDIRCACHE.new)
+else
+ $LISTING */ > $PKGDIRCACHE
+fi
+if [ -x "gen_contents_index" -a ! -r "$PKGDIRCACHE.new" -o -n "$DIR_DIFF" ]; then
+ ./gen_contents_index
+fi
+
+if [ -f $PKGDIRCACHE.new ]; then
+ mv -f $PKGDIRCACHE{.new,}
+fi
diff --git a/tools/bootstrap/ghc/ghc-doc-index.cron b/tools/bootstrap/ghc/ghc-doc-index.cron
new file mode 100755
index 0000000..4efe2ff
--- /dev/null
+++ b/tools/bootstrap/ghc/ghc-doc-index.cron
@@ -0,0 +1,9 @@
+#! /bin/bash
+# updates the library documentation index after updates
+
+# This can be disabled by uninstalling ghc-doc-index
+# or adding ghc-doc-index to "./jobs-deny".
+
+/usr/bin/ghc-doc-index
+
+exit 0
diff --git a/tools/bootstrap/ghc/ghc-gen_contents_index-type-level.patch b/tools/bootstrap/ghc/ghc-gen_contents_index-type-level.patch
new file mode 100644
index 0000000..05a9e42
--- /dev/null
+++ b/tools/bootstrap/ghc/ghc-gen_contents_index-type-level.patch
@@ -0,0 +1,12 @@
+diff -u ghc-6.12.3/libraries/gen_contents_index\~ ghc-6.12.3/libraries/gen_contents_index
+--- ghc-6.12.3/libraries/gen_contents_index~ 2010-09-14 13:03:12.000000000 +1000
++++ ghc-6.12.3/libraries/gen_contents_index 2010-11-04 16:41:32.000000000 +1000
+@@ -24,7 +24,7 @@
+ *)
+ HADDOCK=/usr/bin/haddock
+ # We don't want the GHC API to swamp the index
+- HADDOCK_FILES=`ls -1 */*.haddock | grep -v '/ghc\.haddock' | sort`
++ HADDOCK_FILES=`ls -1 */*.haddock | grep -v '/ghc\.haddock' | grep -v '/type-level\.haddock' | sort`
+ for HADDOCK_FILE in $HADDOCK_FILES
+ do
+ NAME_VERSION=`echo "$HADDOCK_FILE" | sed 's#/.*##'`
diff --git a/tools/bootstrap/ghc/ghc-llvmCodeGen-empty-array.patch b/tools/bootstrap/ghc/ghc-llvmCodeGen-empty-array.patch
new file mode 100644
index 0000000..2129e52
--- /dev/null
+++ b/tools/bootstrap/ghc/ghc-llvmCodeGen-empty-array.patch
@@ -0,0 +1,44 @@
+commit db9b63105a541e4ad3f9c55e2cfadf716445ab87
+Author: Geoffrey Mainland <gmainlan@microsoft.com>
+Date: Wed Jun 12 14:31:49 2013 +0100
+
+ Avoid generating empty llvm.used definitions.
+
+ LLVM 3.3rc3 complains when the llvm.used global is an empty array, so don't
+ define llvm.used at all when it would be empty.
+
+ Modified compiler/llvmGen/LlvmCodeGen.hs
+diff --git a/compiler/llvmGen/LlvmCodeGen.hs b/compiler/llvmGen/LlvmCodeGen.hs
+index a157a25..4f2bded 100644
+--- a/compiler/llvmGen/LlvmCodeGen.hs
++++ b/compiler/llvmGen/LlvmCodeGen.hs
+@@ -117,18 +117,18 @@ cmmProcLlvmGens :: DynFlags -> BufHandle -> UniqSupply -> LlvmEnv -> [RawCmmDecl
+ -> [[LlvmVar]] -- ^ info tables that need to be marked as 'used'
+ -> IO ()
+
+-cmmProcLlvmGens _ _ _ _ [] _ []
+- = return ()
+-
+ cmmProcLlvmGens _ h _ _ [] _ ivars
+- = let ivars' = concat ivars
+- cast x = LMBitc (LMStaticPointer (pVarLift x)) i8Ptr
+- ty = (LMArray (length ivars') i8Ptr)
+- usedArray = LMStaticArray (map cast ivars') ty
+- lmUsed = (LMGlobalVar (fsLit "llvm.used") ty Appending
+- (Just $ fsLit "llvm.metadata") Nothing False, Just usedArray)
+- in Prt.bufLeftRender h $ {-# SCC "llvm_used_ppr" #-}
+- pprLlvmData ([lmUsed], [])
++ | null ivars' = return ()
++ | otherwise = Prt.bufLeftRender h $
++ {-# SCC "llvm_used_ppr" #-}
++ pprLlvmData ([lmUsed], [])
++ where
++ ivars' = concat ivars
++ cast x = LMBitc (LMStaticPointer (pVarLift x)) i8Ptr
++ ty = (LMArray (length ivars') i8Ptr)
++ usedArray = LMStaticArray (map cast ivars') ty
++ lmUsed = (LMGlobalVar (fsLit "llvm.used") ty Appending
++ (Just $ fsLit "llvm.metadata") Nothing False, Just usedArray)
+
+ cmmProcLlvmGens dflags h us env ((CmmData _ _) : cmms) count ivars
+ = cmmProcLlvmGens dflags h us env cmms count ivars
diff --git a/tools/bootstrap/ghc/ghc-powerpc-linker-mmap.patch b/tools/bootstrap/ghc/ghc-powerpc-linker-mmap.patch
new file mode 100644
index 0000000..df0d5ff
--- /dev/null
+++ b/tools/bootstrap/ghc/ghc-powerpc-linker-mmap.patch
@@ -0,0 +1,34 @@
+diff -up ghc-7.0.2/rts/Linker.c.fix-powerpc ghc-7.0.2/rts/Linker.c
+--- ghc-7.0.2/rts/Linker.c.fix-powerpc 2011-02-28 19:10:08.000000000 +0100
++++ ghc-7.0.2/rts/Linker.c 2011-04-25 22:20:10.781092305 +0200
+@@ -70,11 +70,12 @@
+ #include <sys/wait.h>
+ #endif
+
+-#if defined(linux_HOST_OS ) || defined(freebsd_HOST_OS) || \
+- defined(dragonfly_HOST_OS) || defined(netbsd_HOST_OS ) || \
+- defined(openbsd_HOST_OS ) || \
+- ( defined(darwin_HOST_OS ) && !defined(powerpc_HOST_ARCH) )
+-/* Don't use mmap on powerpc-apple-darwin as mmap doesn't support
++#if !defined(powerpc_HOST_ARCH) && \
++ ( defined(linux_HOST_OS ) || defined(freebsd_HOST_OS) || \
++ defined(dragonfly_HOST_OS) || defined(netbsd_HOST_OS ) || \
++ defined(openbsd_HOST_OS ) || defined(darwin_HOST_OS ) || \
++ defined(kfreebsdgnu_HOST_OS) )
++/* Don't use mmap on powerpc_HOST_ARCH as mmap doesn't support
+ * reallocating but we need to allocate jump islands just after each
+ * object images. Otherwise relative branches to jump islands can fail
+ * due to 24-bits displacement overflow.
+@@ -2436,7 +2437,11 @@ static void ocFlushInstructionCacheFrom(
+ static void ocFlushInstructionCache( ObjectCode *oc )
+ {
+ /* The main object code */
+- ocFlushInstructionCacheFrom(oc->image + oc->misalignment, oc->fileSize);
++ ocFlushInstructionCacheFrom(oc->image
++#ifdef darwin_HOST_OS
++ + oc->misalignment
++#endif
++ , oc->fileSize);
+
+ /* Jump Islands */
+ ocFlushInstructionCacheFrom(oc->symbol_extras, sizeof(SymbolExtra) * oc->n_symbol_extras);
diff --git a/tools/bootstrap/ghc/ghc-powerpc-pthread.patch b/tools/bootstrap/ghc/ghc-powerpc-pthread.patch
new file mode 100644
index 0000000..d317ff7
--- /dev/null
+++ b/tools/bootstrap/ghc/ghc-powerpc-pthread.patch
@@ -0,0 +1,18 @@
+diff -up ghc-7.0.2/aclocal.m4.pthread ghc-7.0.2/aclocal.m4
+--- ghc-7.0.2/aclocal.m4.pthread 2011-02-28 13:10:03.000000000 -0500
++++ ghc-7.0.2/aclocal.m4 2011-04-20 07:12:36.489772545 -0400
+@@ -1385,7 +1385,7 @@ AC_MSG_NOTICE(Building in-tree ghc-pwd)
+ dnl except we don't want to have to know what make is called. Sigh.
+ rm -rf utils/ghc-pwd/dist-boot
+ mkdir utils/ghc-pwd/dist-boot
+- if ! "$WithGhc" -v0 -no-user-package-conf -hidir utils/ghc-pwd/dist-boot -odir utils/ghc-pwd/dist-boot -stubdir utils/ghc-pwd/dist-boot --make utils/ghc-pwd/Main.hs -o utils/ghc-pwd/dist-boot/ghc-pwd
++ if ! "$WithGhc" -optl-pthread -v0 -no-user-package-conf -hidir utils/ghc-pwd/dist-boot -odir utils/ghc-pwd/dist-boot -stubdir utils/ghc-pwd/dist-boot --make utils/ghc-pwd/Main.hs -o utils/ghc-pwd/dist-boot/ghc-pwd
+ then
+ AC_MSG_ERROR([Building ghc-pwd failed])
+ fi
+diff -up ghc-7.0.2/ghc/ghc.wrapper.pthread ghc-7.0.2/ghc/ghc.wrapper
+--- ghc-7.0.2/ghc/ghc.wrapper.pthread 2011-04-20 09:58:50.307894773 -0400
++++ ghc-7.0.2/ghc/ghc.wrapper 2011-04-20 09:59:14.477894370 -0400
+@@ -1 +1 @@
+-exec "$executablename" -B"$topdir" -pgmc "$pgmgcc" -pgma "$pgmgcc" -pgml "$pgmgcc" -pgmP "$pgmgcc -E -undef -traditional" ${1+"$@"}
++exec "$executablename" -B"$topdir" -pgmc "$pgmgcc" -pgma "$pgmgcc" -pgml "$pgmgcc" -pgmP "$pgmgcc -E -undef -traditional" -optl-pthread ${1+"$@"}
diff --git a/tools/bootstrap/ghc/ghc-use-system-libffi.patch b/tools/bootstrap/ghc/ghc-use-system-libffi.patch
new file mode 100644
index 0000000..304bcb9
--- /dev/null
+++ b/tools/bootstrap/ghc/ghc-use-system-libffi.patch
@@ -0,0 +1,83 @@
+This patch could be replaced by a configure call if
+http://hackage.haskell.org/trac/ghc/ticket/5743 were fixed.
+
+Index: ghc-7.4.0.20111219/rts/package.conf.in
+===================================================================
+--- ghc-7.4.0.20111219.orig/rts/package.conf.in 2011-12-21 23:21:03.000000000 +0100
++++ ghc-7.4.0.20111219/rts/package.conf.in 2011-12-21 23:21:04.000000000 +0100
+@@ -24,8 +24,9 @@
+ hs-libraries: "HSrts"
+
+ extra-libraries:
++ "ffi"
+ #ifdef HAVE_LIBM
+- "m" /* for ldexp() */
++ , "m" /* for ldexp() */
+ #endif
+ #ifdef HAVE_LIBRT
+ , "rt"
+Index: ghc-7.4.0.20111219/ghc.mk
+===================================================================
+--- ghc-7.4.0.20111219.orig/ghc.mk 2011-12-21 23:21:03.000000000 +0100
++++ ghc-7.4.0.20111219/ghc.mk 2011-12-21 23:21:04.000000000 +0100
+@@ -579,7 +579,6 @@
+ driver/ghci \
+ driver/ghc \
+ driver/haddock \
+- libffi \
+ includes \
+ rts
+
+Index: ghc-7.4.0.20111219/rts/ghc.mk
+===================================================================
+--- ghc-7.4.0.20111219.orig/rts/ghc.mk 2011-12-21 19:56:29.000000000 +0100
++++ ghc-7.4.0.20111219/rts/ghc.mk 2011-12-21 23:23:52.000000000 +0100
+@@ -86,8 +86,7 @@
+ ALL_RTS_DEF_LIBNAMES = base ghc-prim
+ ALL_RTS_DEF_LIBS = \
+ rts/dist/build/win32/libHSbase.dll.a \
+- rts/dist/build/win32/libHSghc-prim.dll.a \
+- libffi/build/inst/lib/libffi.dll.a
++ rts/dist/build/win32/libHSghc-prim.dll.a
+
+ # -- import libs for the regular Haskell libraries
+ define make-importlib-def # args $1 = lib name
+@@ -172,12 +171,12 @@
+ # Making a shared library for the RTS.
+ ifneq "$$(findstring dyn, $1)" ""
+ ifeq "$$(HOSTPLATFORM)" "i386-unknown-mingw32"
+-$$(rts_$1_LIB) : $$(rts_$1_OBJS) $$(ALL_RTS_DEF_LIBS) rts/libs.depend rts/dist/build/libffi-5.dll
++$$(rts_$1_LIB) : $$(rts_$1_OBJS) $$(ALL_RTS_DEF_LIBS) rts/libs.depend
+ "$$(RM)" $$(RM_OPTS) $$@
+ "$$(rts_dist_HC)" -package-name rts -shared -dynamic -dynload deploy \
+ -no-auto-link-packages -Lrts/dist/build -lffi-5 `cat rts/libs.depend` $$(rts_$1_OBJS) $$(ALL_RTS_DEF_LIBS) -o $$@
+ else
+-$$(rts_$1_LIB) : $$(rts_$1_OBJS) $$(rts_$1_DTRACE_OBJS) rts/libs.depend rts/dist/build/libffi$$(soext)
++$$(rts_$1_LIB) : $$(rts_$1_OBJS) $$(rts_$1_DTRACE_OBJS) rts/libs.depend
+ "$$(RM)" $$(RM_OPTS) $$@
+ "$$(rts_dist_HC)" -package-name rts -shared -dynamic -dynload deploy \
+ -no-auto-link-packages -Lrts/dist/build -lffi `cat rts/libs.depend` $$(rts_$1_OBJS) \
+@@ -188,9 +187,9 @@
+ endif
+ endif
+ else
+-$$(rts_$1_LIB) : $$(rts_$1_OBJS) $$(rts_$1_DTRACE_OBJS) $$(rts_ffi_objs_stamp)
++$$(rts_$1_LIB) : $$(rts_$1_OBJS) $$(rts_$1_DTRACE_OBJS)
+ "$$(RM)" $$(RM_OPTS) $$@
+- echo $$(rts_ffi_objs) $$(rts_$1_OBJS) $$(rts_$1_DTRACE_OBJS) | "$$(XARGS)" $$(XARGS_OPTS) "$$(AR_STAGE1)" \
++ echo $$(rts_$1_OBJS) $$(rts_$1_DTRACE_OBJS) | "$$(XARGS)" $$(XARGS_OPTS) "$$(AR_STAGE1)" \
+ $$(AR_OPTS_STAGE1) $$(EXTRA_AR_ARGS_STAGE1) $$@
+ endif
+
+@@ -504,10 +503,8 @@
+ # installing
+
+ INSTALL_LIBS += $(ALL_RTS_LIBS)
+-INSTALL_LIBS += $(wildcard rts/dist/build/libffi$(soext)*)
+-INSTALL_LIBS += $(wildcard rts/dist/build/libffi-5.dll)
+
+-install: install_libffi_headers
++install:
+
+ .PHONY: install_libffi_headers
+ install_libffi_headers :
diff --git a/tools/bootstrap/ghc/ghc-wrapper-libffi-include.patch b/tools/bootstrap/ghc/ghc-wrapper-libffi-include.patch
new file mode 100644
index 0000000..48870ec
--- /dev/null
+++ b/tools/bootstrap/ghc/ghc-wrapper-libffi-include.patch
@@ -0,0 +1,6 @@
+diff -u ghc-7.4.1/ghc/ghc.wrapper\~ ghc-7.4.1/ghc/ghc.wrapper
+--- ghc-7.4.1/ghc/ghc.wrapper~ 2012-02-02 03:10:32.000000000 +0900
++++ ghc-7.4.1/ghc/ghc.wrapper 2012-05-02 19:39:05.503872527 +0900
+@@ -1 +1 @@
+-exec "$executablename" -B"$topdir" ${1+"$@"}
++exec "$executablename" -B"$topdir" -optc-I$(pkg-config --variable=includedir libffi) ${1+"$@"}
diff --git a/tools/bootstrap/ghc/ghc.spec b/tools/bootstrap/ghc/ghc.spec
new file mode 100644
index 0000000..714c8dc
--- /dev/null
+++ b/tools/bootstrap/ghc/ghc.spec
@@ -0,0 +1,1259 @@
+# Shared haskell libraries are supported for x86* archs
+# (disabled for other archs in ghc-rpm-macros)
+
+# To bootstrap build a new version of ghc, uncomment the following:
+%global ghc_bootstrapping 1
+%{?ghc_bootstrap}
+%global without_testsuite 1
+%global without_haddock 1
+
+# To do a test build instead with shared libs, uncomment the following:
+#%%global ghc_bootstrapping 1
+#%%{?ghc_test}
+#%%global without_testsuite 1
+
+# unregisterized archs
+%global unregisterised_archs ppc64 s390 s390x
+
+# ghc does not output dwarf format so debuginfo is not useful
+%global debug_package %{nil}
+
+%global space %(echo -n ' ')
+%global BSDHaskellReport BSD%{space}and%{space}HaskellReport
+
+# gcc-4.1 is too old for ghc7 dyn:
+# "/usr/bin/ld: rts/dist/build/RtsStartup.dyn_o: relocation R_X86_64_PC32 against `StgRun' can not be used when making a shared object; recompile with -fPIC"
+%global gcc gcc44
+
+Name: ghc
+# part of haskell-platform
+# ghc must be rebuilt after a version bump to avoid ABI change problems
+Version: 7.4.2
+# Since library subpackages are versioned:
+# - release can only be reset if *all* library versions get bumped simultaneously
+# (sometimes after a major release)
+# - minor release numbers for a branch should be incremented monotonically
+Release: 11.0.1%{?dist}
+Summary: Glasgow Haskell Compiler
+
+License: %BSDHaskellReport
+URL: http://haskell.org/ghc/
+Group: Development/Languages
+Source0: http://www.haskell.org/ghc/dist/%{version}/ghc-%{version}-src.tar.bz2
+%if %{undefined without_testsuite}
+Source2: http://www.haskell.org/ghc/dist/%{version}/ghc-%{version}-testsuite.tar.bz2
+%endif
+Source3: ghc-doc-index.cron
+Source4: ghc-doc-index
+# absolute haddock path (was for html/libraries -> libraries)
+Patch1: ghc-6.12.1-gen_contents_index-haddock-path.patch
+# type-level too big so skip it in gen_contents_index
+Patch2: ghc-gen_contents_index-type-level.patch
+# fedora does not allow copy libraries
+Patch4: ghc-use-system-libffi.patch
+Patch7: ghc-powerpc-pthread.patch
+# http://hackage.haskell.org/trac/ghc/ticket/4999
+Patch8: ghc-powerpc-linker-mmap.patch
+# fix dynamic linking of executables using Template Haskell
+Patch9: Cabal-fix-dynamic-exec-for-TH.patch
+# add libffi include dir to ghc wrapper for archs using gcc/llc
+Patch10: ghc-wrapper-libffi-include.patch
+# latest arm hf patch
+Patch11: ghc-7.4-add-support-for-ARM-hard-float-ABI-fixes-5914.patch
+# disable building HS*.o libs for ghci
+Patch12: ghc-7.4.2-Cabal-disable-ghci-libs.patch
+# fix compilation with llvm-3.3
+Patch13: ghc-llvmCodeGen-empty-array.patch
+Patch17: ghc-7.4-silence-gen_contents_index.patch
+
+BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
+# fedora ghc has been bootstrapped on
+# %{ix86} x86_64 ppc alpha sparcv9 ppc64 armv7hl armv5tel s390 s390x
+# see ghc_arches defined in /etc/rpm/macros.ghc-srpm by redhat-rpm-macros
+ExcludeArch: sparc64 ppc
+Obsoletes: ghc-dph-base < 0.5, ghc-dph-base-devel < 0.5, ghc-dph-base-prof < 0.5
+Obsoletes: ghc-dph-par < 0.5, ghc-dph-par-devel < 0.5, ghc-dph-par-prof < 0.5
+Obsoletes: ghc-dph-prim-interface < 0.5, ghc-dph-prim-interface-devel < 0.5, ghc-dph-interface-prim-prof < 0.5
+Obsoletes: ghc-dph-prim-par < 0.5, ghc-dph-prim-par-devel < 0.5, ghc-dph-prim-par-prof < 0.5
+Obsoletes: ghc-dph-prim-seq < 0.5, ghc-dph-prim-seq-devel < 0.5, ghc-dph-prim-seq-prof < 0.5
+Obsoletes: ghc-dph-seq < 0.5, ghc-dph-seq-devel < 0.5, ghc-dph-seq-prof < 0.5
+Obsoletes: ghc-feldspar-language < 0.4, ghc-feldspar-language-devel < 0.4, ghc-feldspar-language-prof < 0.4
+%if %{undefined ghc_bootstrapping}
+BuildRequires: ghc-compiler = %{version}
+%endif
+BuildRequires: ghc-rpm-macros >= 0.15.15
+BuildRequires: ghc-bytestring-devel
+BuildRequires: ghc-containers-devel
+BuildRequires: ghc-directory-devel
+BuildRequires: ghc-haskell98-devel
+BuildRequires: ghc-pretty-devel
+BuildRequires: ghc-process-devel
+BuildRequires: gmp-devel
+BuildRequires: libffi-devel
+# for internal terminfo
+BuildRequires: ncurses-devel
+%if %{undefined without_manual}
+BuildRequires: libxslt, docbook-style-xsl
+%endif
+%if %{undefined without_testsuite}
+BuildRequires: python
+%endif
+%ifarch armv7hl armv5tel
+BuildRequires: llvm >= 3.0
+%endif
+%ifarch armv7hl
+BuildRequires: autoconf
+%endif
+%ifarch %{ix86} x86_64
+BuildRequires: %{gcc}
+%endif
+Requires: ghc-compiler = %{version}-%{release}
+%if %{undefined without_haddock}
+Requires: ghc-doc-index = %{version}-%{release}
+%endif
+Requires: ghc-libraries = %{version}-%{release}
+Requires: ghc-ghc-devel = %{version}-%{release}
+
+%description
+GHC is a state-of-the-art, open source, compiler and interactive environment
+for the functional language Haskell. Highlights:
+
+- GHC supports the entire Haskell 2010 language plus various extensions.
+- GHC has particularly good support for concurrency and parallelism,
+ including support for Software Transactional Memory (STM).
+- GHC generates fast code, particularly for concurrent programs
+ (check the results on the "Computer Language Benchmarks Game").
+- GHC works on several platforms including Windows, Mac, Linux,
+ most varieties of Unix, and several different processor architectures.
+- GHC has extensive optimisation capabilities,
+ including inter-module optimisation.
+- GHC compiles Haskell code either directly to native code or using LLVM
+ as a back-end. GHC can also generate C code as an intermediate target for
+ porting to new platforms. The interactive environment compiles Haskell to
+ bytecode, and supports execution of mixed bytecode/compiled programs.
+- Profiling is supported, both by time/allocation and heap profiling.
+- GHC comes with core libraries, and thousands more are available on Hackage.
+
+%package compiler
+Summary: GHC compiler and utilities
+License: BSD
+Group: Development/Languages
+Requires: %{gcc}%{?_isa}
+Requires: ghc-base-devel%{?_isa}
+# for alternatives
+Requires(post): chkconfig
+Requires(postun): chkconfig
+# added in f14
+Obsoletes: ghc-doc < 6.12.3-4
+%ifarch armv7hl armv5tel
+Requires: llvm >= 3.0
+%endif
+
+%description compiler
+The package contains the GHC compiler, tools and utilities.
+
+The ghc libraries are provided by ghc-devel.
+To install all of ghc, install the ghc base package.
+
+%if %{undefined without_haddock}
+%package doc-index
+Summary: GHC library development documentation indexing
+License: BSD
+Requires: ghc-compiler = %{version}-%{release}
+
+%description doc-index
+The package provides a cronjob for re-indexing installed library development
+documention.
+%endif
+
+%global ghc_version_override %{version}
+
+# needs ghc_version_override for bootstrapping
+%global _use_internal_dependency_generator 0
+%global __find_provides %{_prefix}/lib/rpm/ghc-deps.sh --provides %{buildroot}%{ghclibdir}
+%global __find_requires %{_prefix}/lib/rpm/ghc-deps.sh --requires %{buildroot}%{ghclibdir}
+
+
+%global ghc_pkg_c_deps ghc-compiler = %{ghc_version_override}-%{release}
+
+%if %{defined ghclibdir}
+%ghc_lib_subpackage Cabal 1.14.0
+%ghc_lib_subpackage -l %BSDHaskellReport array 0.4.0.0
+%ghc_lib_subpackage -l %BSDHaskellReport -c gmp-devel%{?_isa},libffi-devel%{?_isa} base 4.5.1.0
+%ghc_lib_subpackage binary 0.5.1.0
+%ghc_lib_subpackage bytestring 0.9.2.1
+%ghc_lib_subpackage -l %BSDHaskellReport containers 0.4.2.1
+%ghc_lib_subpackage -l %BSDHaskellReport deepseq 1.3.0.0
+%ghc_lib_subpackage -l %BSDHaskellReport directory 1.1.0.2
+%ghc_lib_subpackage -l %BSDHaskellReport extensible-exceptions 0.1.1.4
+%ghc_lib_subpackage filepath 1.3.0.0
+%define ghc_pkg_obsoletes ghc-bin-package-db-devel < 0.0.0.0-12
+# in ghc not ghc-libraries:
+%ghc_lib_subpackage -x ghc %{ghc_version_override}
+%undefine ghc_pkg_obsoletes
+%ghc_lib_subpackage -l HaskellReport haskell2010 1.1.0.1
+%ghc_lib_subpackage -l HaskellReport haskell98 2.0.0.1
+%ghc_lib_subpackage hoopl 3.8.7.3
+%ghc_lib_subpackage hpc 0.5.1.1
+%ghc_lib_subpackage -l %BSDHaskellReport old-locale 1.0.0.4
+%ghc_lib_subpackage -l %BSDHaskellReport old-time 1.1.0.0
+%ghc_lib_subpackage pretty 1.1.1.0
+%ghc_lib_subpackage -l %BSDHaskellReport process 1.1.0.1
+%ghc_lib_subpackage template-haskell 2.7.0.0
+%ghc_lib_subpackage time 1.4
+%ghc_lib_subpackage unix 2.5.1.1
+%endif
+
+%global version %{ghc_version_override}
+
+%package libraries
+Summary: GHC development libraries meta package
+License: %BSDHaskellReport
+Group: Development/Libraries
+Requires: ghc-compiler = %{version}-%{release}
+Obsoletes: ghc-devel < %{version}-%{release}
+Provides: ghc-devel = %{version}-%{release}
+Obsoletes: ghc-prof < %{version}-%{release}
+Provides: ghc-prof = %{version}-%{release}
+# since f15
+Obsoletes: ghc-libs < 7.0.1-3
+%{?ghc_packages_list:Requires: %(echo %{ghc_packages_list} | sed -e "s/\([^ ]*\)-\([^ ]*\)/ghc-\1-devel = \2-%{release},/g")}
+
+%description libraries
+This is a meta-package for all the development library packages in GHC
+except the ghc library, which is installed by the toplevel ghc metapackage.
+
+
+%prep
+%setup -q -n %{name}-%{version} %{!?without_testsuite:-b2}
+
+# tweaks to gen_contents_index
+%patch1 -p1 -b .orig
+%patch2 -p1
+%patch17 -p1
+
+# make sure we don't use these
+rm -r ghc-tarballs/{mingw,perl}
+# use system libffi
+%patch4 -p1 -b .libffi
+rm -r ghc-tarballs/libffi
+mkdir -p rts/dist/build
+ln -s $(pkg-config --variable=includedir libffi)/*.h rts/dist/build
+
+%patch9 -p1 -b .orig
+
+%ifnarch %{ix86} x86_64
+%patch10 -p1 -b .10-ffi
+%endif
+
+# ARM patches
+%ifarch armv7hl
+# touches aclocal.m4
+%patch11 -p1 -b .arm
+autoreconf
+%endif
+
+%patch12 -p1 -b .orig
+
+%patch13 -p1 -b .orig
+
+
+%build
+# http://hackage.haskell.org/trac/ghc/wiki/Platforms
+# cf https://github.com/gentoo-haskell/gentoo-haskell/tree/master/dev-lang/ghc
+cat > mk/build.mk << EOF
+GhcLibWays = v %{!?ghc_without_shared:dyn} %{!?without_prof:p}
+%if %{defined without_haddock}
+HADDOCK_DOCS = NO
+%endif
+%if %{defined without_manual}
+BUILD_DOCBOOK_HTML = NO
+%endif
+EOF
+
+export CFLAGS="${CFLAGS:-%optflags}"
+# use --with-gcc=%{_bindir}/gcc when bootstrapping to avoid ccache hardcoding problem
+./configure --prefix=%{_prefix} --exec-prefix=%{_exec_prefix} \
+ --bindir=%{_bindir} --sbindir=%{_sbindir} --sysconfdir=%{_sysconfdir} \
+ --datadir=%{_datadir} --includedir=%{_includedir} --libdir=%{_libdir} \
+ --libexecdir=%{_libexecdir} --localstatedir=%{_localstatedir} \
+ --sharedstatedir=%{_sharedstatedir} --mandir=%{_mandir} \
+ --with-gcc=%{_bindir}/%{gcc}
+
+make %{?_smp_mflags}
+
+
+%install
+rm -rf %{buildroot}
+make DESTDIR=%{buildroot} install
+
+for i in %{ghc_packages_list}; do
+name=$(echo $i | sed -e "s/\(.*\)-.*/\1/")
+ver=$(echo $i | sed -e "s/.*-\(.*\)/\1/")
+%ghc_gen_filelists $name $ver
+echo "%doc libraries/$name/LICENSE" >> ghc-$name%{?ghc_without_shared:-devel}.files
+done
+
+# ghc-base should own ghclibdir
+echo "%dir %{ghclibdir}" >> ghc-base%{?ghc_without_shared:-devel}.files
+
+%ghc_gen_filelists bin-package-db 0.0.0.0
+%ghc_gen_filelists ghc %{ghc_version_override}
+%ghc_gen_filelists ghc-prim 0.2.0.0
+%ghc_gen_filelists integer-gmp 0.4.0.0
+
+%define merge_filelist()\
+%if %{undefined ghc_without_shared}\
+cat ghc-%1.files >> ghc-%2.files\
+%endif\
+cat ghc-%1-devel.files >> ghc-%2-devel.files\
+cp -p libraries/%1/LICENSE libraries/LICENSE.%1\
+echo "%doc libraries/LICENSE.%1" >> ghc-%2.files
+
+%merge_filelist integer-gmp base
+%merge_filelist ghc-prim base
+%merge_filelist bin-package-db ghc
+
+# add rts libs
+%if %{undefined ghc_without_shared}
+ls %{buildroot}%{ghclibdir}/libHS*.so >> ghc-base.files
+sed -i -e "s|^%{buildroot}||g" ghc-base.files
+%endif
+ls -d %{buildroot}%{ghclibdir}/libHS*.a %{buildroot}%{ghclibdir}/package.conf.d/builtin_*.conf %{buildroot}%{ghclibdir}/include >> ghc-base-devel.files
+sed -i -e "s|^%{buildroot}||g" ghc-base-devel.files
+
+# these are handled as alternatives
+for i in hsc2hs runhaskell; do
+ if [ -x %{buildroot}%{_bindir}/$i-ghc ]; then
+ rm %{buildroot}%{_bindir}/$i
+ else
+ mv %{buildroot}%{_bindir}/$i{,-ghc}
+ fi
+ touch %{buildroot}%{_bindir}/$i
+done
+
+%ghc_strip_dynlinked
+
+%if %{undefined without_haddock}
+mkdir -p %{buildroot}%{_sysconfdir}/cron.hourly
+install -p --mode=0755 %SOURCE3 %{buildroot}%{_sysconfdir}/cron.hourly/ghc-doc-index
+mkdir -p %{buildroot}%{_localstatedir}/lib/ghc
+install -p --mode=0755 %SOURCE4 %{buildroot}%{_bindir}/ghc-doc-index
+%endif
+
+
+%check
+# stolen from ghc6/debian/rules:
+# Do some very simple tests that the compiler actually works
+rm -rf testghc
+mkdir testghc
+echo 'main = putStrLn "Foo"' > testghc/foo.hs
+inplace/bin/ghc-stage2 testghc/foo.hs -o testghc/foo
+[ "$(testghc/foo)" = "Foo" ]
+# doesn't seem to work inplace:
+#[ "$(inplace/bin/runghc testghc/foo.hs)" = "Foo" ]
+rm testghc/*
+echo 'main = putStrLn "Foo"' > testghc/foo.hs
+inplace/bin/ghc-stage2 testghc/foo.hs -o testghc/foo -O2
+[ "$(testghc/foo)" = "Foo" ]
+rm testghc/*
+%if %{undefined ghc_without_shared}
+echo 'main = putStrLn "Foo"' > testghc/foo.hs
+inplace/bin/ghc-stage2 testghc/foo.hs -o testghc/foo -dynamic
+[ "$(testghc/foo)" = "Foo" ]
+rm testghc/*
+%endif
+%if %{undefined without_testsuite}
+make test
+%endif
+
+%clean
+rm -rf $RPM_BUILD_ROOT
+
+%post compiler
+# Alas, GHC, Hugs, and nhc all come with different set of tools in
+# addition to a runFOO:
+#
+# * GHC: hsc2hs
+# * Hugs: hsc2hs, cpphs
+# * nhc: cpphs
+#
+# Therefore it is currently not possible to use --slave below to form
+# link groups under a single name 'runhaskell'. Either these tools
+# should be disentangled from the Haskell implementations, or all
+# implementations should have the same set of tools. *sigh*
+
+update-alternatives --install %{_bindir}/runhaskell runhaskell \
+ %{_bindir}/runghc 500
+update-alternatives --install %{_bindir}/hsc2hs hsc2hs \
+ %{_bindir}/hsc2hs-ghc 500
+
+%preun compiler
+if [ "$1" = 0 ]; then
+ update-alternatives --remove runhaskell %{_bindir}/runghc
+ update-alternatives --remove hsc2hs %{_bindir}/hsc2hs-ghc
+fi
+
+
+%files
+
+%files compiler
+%defattr(-,root,root,-)
+%doc ANNOUNCE HACKING LICENSE README
+%{_bindir}/ghc
+%{_bindir}/ghc-%{version}
+%{_bindir}/ghc-pkg
+%{_bindir}/ghc-pkg-%{version}
+%{_bindir}/ghci
+%{_bindir}/ghci-%{version}
+%{_bindir}/hp2ps
+%{_bindir}/hpc
+%ghost %{_bindir}/hsc2hs
+%{_bindir}/hsc2hs-ghc
+%{_bindir}/runghc
+%ghost %{_bindir}/runhaskell
+%{_bindir}/runhaskell-ghc
+%{ghclibdir}/ghc
+%{ghclibdir}/ghc-pkg
+%ifnarch %{unregisterised_archs}
+%{ghclibdir}/ghc-split
+%endif
+%{ghclibdir}/ghc-usage.txt
+%{ghclibdir}/ghci-usage.txt
+%{ghclibdir}/hsc2hs
+%dir %{ghclibdir}/package.conf.d
+%ghost %{ghclibdir}/package.conf.d/package.cache
+%{ghclibdir}/runghc
+%{ghclibdir}/settings
+%{ghclibdir}/template-hsc.h
+%{ghclibdir}/unlit
+%{_mandir}/man1/ghc.*
+%dir %{_docdir}/ghc
+%dir %{ghcdocbasedir}
+%if %{undefined without_haddock}
+%{_bindir}/ghc-doc-index
+%{_bindir}/haddock
+%{_bindir}/haddock-ghc-%{version}
+%{ghclibdir}/haddock
+%{ghclibdir}/html
+%{ghclibdir}/latex
+%if %{undefined without_manual}
+## needs pandoc
+#%{ghcdocbasedir}/Cabal
+%{ghcdocbasedir}/haddock
+%{ghcdocbasedir}/users_guide
+%endif
+%dir %{ghcdocbasedir}/libraries
+%{ghcdocbasedir}/libraries/frames.html
+%{ghcdocbasedir}/libraries/gen_contents_index
+%{ghcdocbasedir}/libraries/hscolour.css
+%{ghcdocbasedir}/libraries/ocean.css
+%{ghcdocbasedir}/libraries/prologue.txt
+%{ghcdocbasedir}/index.html
+%ghost %{ghcdocbasedir}/libraries/doc-index*.html
+%ghost %{ghcdocbasedir}/libraries/haddock-util.js
+%ghost %{ghcdocbasedir}/libraries/index*.html
+%ghost %{ghcdocbasedir}/libraries/minus.gif
+%ghost %{ghcdocbasedir}/libraries/plus.gif
+%{_localstatedir}/lib/ghc
+%endif
+
+%if %{undefined without_haddock}
+%files doc-index
+%defattr(-,root,root,-)
+%{_sysconfdir}/cron.hourly/ghc-doc-index
+%endif
+
+%files libraries
+
+
+%changelog
+* Sat Jan 18 2014 Jens Petersen <petersen@fedoraproject.org> - 7.4.2-11.0.1
+- backport to EL5
+- build with gcc44
+- bootstrap
+- exclude ppc
+
+* Tue Jun 25 2013 Jens Petersen <petersen@redhat.com>
+- fix compilation with llvm-3.3 (#977652)
+ see http://hackage.haskell.org/trac/ghc/ticket/7996
+
+* Tue Feb 5 2013 Jens Petersen <petersen@redhat.com> - 7.4.2-11
+- ghclibdir should be owned at runtime by ghc-base instead of ghc-compiler
+ (thanks Michael Scherer, #907671)
+
+* Thu Jan 17 2013 Jens Petersen <petersen@redhat.com> - 7.4.2-10
+- rebuild for F19 libffi soname bump
+
+* Wed Nov 21 2012 Jens Petersen <petersen@redhat.com> - 7.4.2-9
+- fix permissions of ghc-doc-index and only run when root
+- ghc-doc-index cronjob no longer looks at /etc/sysconfig/ghc-doc-index
+
+* Sat Nov 17 2012 Jens Petersen <petersen@redhat.com> - 7.4.2-8
+- production 7.4.2 build
+ http://www.haskell.org/ghc/docs/7.4.2/html/users_guide/release-7-4-2.html
+
+* Sat Nov 17 2012 Jens Petersen <petersen@redhat.com> - 7.4.2-7
+- 7.4.2 bootstrap
+- update base and unix library versions
+- ARM StgCRun patches not longer needed
+- use Karel Gardas' ARM hardfloat patch committed upstream
+- use _smp_mflags again
+- disable Cabal building ghci lib files
+- silence the doc re-indexing script and move the doc indexing cronjob
+ to a new ghc-doc-index subpackage (#870694)
+- do not disable hscolour in build.mk
+- drop the explicit hscolour BR
+- without_hscolour should now be set by ghc-rpm-macros for bootstrapping
+
+* Thu Jul 19 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 7.4.1-6
+- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild
+
+* Fri Jun 15 2012 Jens Petersen <petersen@redhat.com> - 7.4.1-5
+- use ghc_lib_subpackage instead of ghc_binlib_package (ghc-rpm-macros 0.91)
+
+* Wed May 2 2012 Jens Petersen <petersen@redhat.com> - 7.4.1-4
+- add ghc-wrapper-libffi-include.patch to workaround "missing libffi.h"
+ for prof compiling on secondary archs
+
+* Sat Apr 28 2012 Jens Petersen <petersen@redhat.com> - 7.4.1-3
+- build with llvm-3.0 on ARM
+- remove ARM from unregisterised_archs
+- add 4 Debian ARM patches for armel and armhf (Iain Lane)
+
+* Wed Mar 21 2012 Jens Petersen <petersen@redhat.com> - 7.4.1-2
+- full build
+
+* Wed Feb 15 2012 Jens Petersen <petersen@redhat.com> - 7.4.1-1
+- update to new 7.4.1 major release
+ http://www.haskell.org/ghc/docs/7.4.1/html/users_guide/release-7-4-1.html
+- all library versions bumped
+- binary package replaces ghc-binary
+- random library dropped
+- new hoopl library
+- deepseq is now included in ghc
+- Cabal --enable-executable-dynamic patch is upstream
+- add Cabal-fix-dynamic-exec-for-TH.patch
+- sparc linking fix is upstream
+- use Debian's system-libffi patch by Joachim Breitner
+- setup ghc-deps.sh after ghc_version_override for bootstrapping
+- drop ppc64 config, pthread and mmap patches
+- do not set GhcUnregisterised explicitly
+- add s390 and s390x to unregisterised_archs
+- Cabal manual needs pandoc
+
+* Thu Jan 19 2012 Jens Petersen <petersen@redhat.com> - 7.0.4-42
+- move ghc-ghc-devel from ghc-libraries to the ghc metapackage
+
+* Fri Jan 13 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 7.0.4-41
+- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild
+
+* Mon Nov 14 2011 Jens Petersen <petersen@redhat.com> - 7.0.4-40
+- do alternatives handling correctly (reported by Giam Teck Choon, #753661)
+ see https://fedoraproject.org/wiki/Packaging:Alternatives
+
+* Sat Nov 12 2011 Jens Petersen <petersen@redhat.com> - 7.0.4-39
+- move ghc-doc and ghc-libs obsoletes
+- add HaskellReport license also to the base and libraries subpackages
+
+* Thu Nov 10 2011 Jens Petersen <petersen@redhat.com> - 7.0.4-38
+- the post and postun scripts are now for the compiler subpackage
+
+* Wed Nov 2 2011 Jens Petersen <petersen@redhat.com> - 7.0.4-37
+- rename ghc-devel metapackage to ghc-libraries
+- require ghc-rpm-macros-0.14
+
+* Tue Nov 1 2011 Jens Petersen <petersen@redhat.com> - 7.0.4-36
+- move compiler and tools to ghc-compiler
+- the ghc base package is now a metapackage that installs all of ghc,
+ ie ghc-compiler and ghc-devel (#750317)
+- drop ghc-doc provides
+
+* Fri Oct 28 2011 Jens Petersen <petersen@redhat.com> - 7.0.4-35.1
+- rebuild against new gmp
+
+* Fri Oct 28 2011 Jens Petersen <petersen@redhat.com> - 7.0.4-35
+- add HaskellReport license tag to some of the library subpackages
+ which contain some code from the Haskell Reports
+
+* Thu Oct 20 2011 Marcela Mašláňová <mmaslano@redhat.com> - 7.0.4-34.1
+- rebuild with new gmp without compat lib
+
+* Thu Oct 20 2011 Jens Petersen <petersen@redhat.com> - 7.0.4-34
+- setup ghc-deps.sh after ghc_version_override for bootstrapping
+
+* Tue Oct 18 2011 Jens Petersen <petersen@redhat.com> - 7.0.4-33
+- add armv5tel (ported by Henrik Nordström)
+- also use ghc-deps.sh when bootstrapping (ghc-rpm-macros-0.13.13)
+
+* Mon Oct 17 2011 Jens Petersen <petersen@redhat.com> - 7.0.4-32
+- remove libffi_archs: not allowed to bundle libffi on any arch
+- include the ghc (ghci) library in ghc-devel (Narasim)
+
+* Tue Oct 11 2011 Peter Schiffer <pschiffe@redhat.com> - 7.0.4-31.1
+- rebuild with new gmp
+
+* Fri Sep 30 2011 Jens Petersen <petersen@redhat.com> - 7.0.4-31
+- build with ghc-rpm-macros >= 0.13.11 to fix provides and obsoletes versions
+ in library devel subpackages
+
+* Thu Sep 29 2011 Jens Petersen <petersen@redhat.com> - 7.0.4-30
+- no need to specify -lffi in build.mk (Henrik Nordström)
+
+* Wed Sep 28 2011 Jens Petersen <petersen@redhat.com> - 7.0.4-29
+- port to armv7hl by Henrik Nordström (#741725)
+
+* Wed Sep 14 2011 Jens Petersen <petersen@redhat.com> - 7.0.4-28
+- setup ghc-deps.sh when not bootstrapping!
+
+* Wed Sep 14 2011 Jens Petersen <petersen@redhat.com> - 7.0.4-27
+- setup dependency generation with ghc-deps.sh since it was moved to
+ ghc_lib_install in ghc-rpm-macros
+
+* Fri Jun 17 2011 Jens Petersen <petersen@redhat.com> - 7.0.4-26
+- BR same ghc version unless ghc_bootstrapping defined
+- add libffi_archs
+- drop the quick build profile
+- put dyn before p in GhcLibWays
+- explain new bootstrapping mode using ghc_bootstrap (ghc-rpm-macros-0.13.5)
+
+* Thu Jun 16 2011 Jens Petersen <petersen@redhat.com> - 7.0.4-25
+- update to 7.0.4 bugfix release
+ http://haskell.org/ghc/docs/7.0.4/html/users_guide/release-7-0-4.html
+- strip static again (upstream #5004 fixed)
+- Cabal updated to 1.10.2.0
+- re-enable testsuite
+- update summary and description
+
+* Tue Jun 14 2011 Jens Petersen <petersen@redhat.com> - 7.0.2-24
+- finally change from ExclusiveArch to ExcludeArch to target more archs
+
+* Sat May 21 2011 Jens Petersen <petersen@redhat.com> - 7.0.2-23
+- obsolete dph libraries and feldspar-language
+
+* Mon May 16 2011 Jens Petersen <petersen@redhat.com> - 7.0.2-22
+- merge prof subpackages into the devel subpackages with ghc-rpm-macros-0.13
+
+* Wed May 11 2011 Jens Petersen <petersen@redhat.com> - 7.0.2-21
+- configure with /usr/bin/gcc to help bootstrapping to new archs
+ (otherwise ccache tends to get hardcoded as gcc, which not in koji)
+- posttrans scriplet for ghc_pkg_recache is redundant
+
+* Mon May 9 2011 Jens Petersen <petersen@redhat.com> - 7.0.2-20
+- make devel and prof meta packages require libs with release
+- make ghc-*-devel subpackages require ghc with release
+
+* Wed May 04 2011 Jiri Skala <jskala@redhat.com> - 7.0.2-19.1
+- fixes path to gcc on ppc64 arch
+
+* Tue Apr 26 2011 Jens Petersen <petersen@redhat.com> - 7.0.2-19
+- add upstream ghc-powerpc-linker-mmap.patch for ppc64 (Jiri Skala)
+
+* Thu Apr 21 2011 Jiri Skala <jskala@redhat.com> - 7.0.2-18
+- bootstrap to ppc64
+
+* Fri Apr 1 2011 Jens Petersen <petersen@redhat.com> - 7.0.2-17
+- rebuild against ghc-rpm-macros-0.11.14 to provide ghc-*-doc
+
+* Fri Apr 1 2011 Jens Petersen <petersen@redhat.com> - 7.0.2-16
+- provides ghc-doc again: it is still a buildrequires for libraries
+- ghc-prof now requires ghc-devel
+- ghc-devel now requires ghc explicitly
+
+* Wed Mar 30 2011 Jens Petersen <petersen@redhat.com> - 7.0.2-15
+- do not strip static libs since it breaks ghci-7.0.2 loading libHSghc.a
+ (see http://hackage.haskell.org/trac/ghc/ticket/5004)
+- no longer provide ghc-doc
+- no longer obsolete old haddock
+
+* Tue Mar 29 2011 Jens Petersen <petersen@redhat.com> - 7.0.2-14
+- fix back missing LICENSE files in library subpackages
+- drop ghc_reindex_haddock from install script
+
+* Thu Mar 10 2011 Jens Petersen <petersen@redhat.com> - 7.0.2-13
+- rebuild against 7.0.2
+
+* Wed Mar 9 2011 Jens Petersen <petersen@redhat.com> - 7.0.2-12
+- update to 7.0.2 release
+- move bin-package-db into ghc-ghc
+- disable broken testsuite
+
+* Wed Feb 23 2011 Fabio M. Di Nitto <fdinitto@redhat.com> 7.0.1-11
+- enable build on sparcv9
+- add ghc-fix-linking-on-sparc.patch to fix ld being called
+ at the same time with --relax and -r. The two options conflict
+ on sparc.
+- bump BuildRequires on ghc-rpm-macros to >= 0.11.10 that guarantees
+ a correct build on secondary architectures.
+
+* Sun Feb 13 2011 Jens Petersen <petersen@redhat.com>
+- without_shared renamed to ghc_without_shared
+
+* Thu Feb 10 2011 Jens Petersen <petersen@redhat.com> - 7.0.1-10
+- rebuild
+
+* Thu Feb 10 2011 Jens Petersen <petersen@redhat.com> - 7.0.1-9
+- fix without_shared build (thanks Adrian Reber)
+- disable system libffi for secondary archs
+- temporarily disable ghc-*-devel BRs for ppc
+
+* Tue Feb 08 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 7.0.1-8
+- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild
+
+* Mon Jan 31 2011 Jens Petersen <petersen@redhat.com> - 7.0.1-7
+- include LICENSE files in the shared lib subpackages
+
+* Sat Jan 22 2011 Jens Petersen <petersen@redhat.com> - 7.0.1-6
+- patch Cabal to add configure option --enable-executable-dynamic
+- exclude huge ghc API library from devel and prof metapackages
+
+* Thu Jan 13 2011 Jens Petersen <petersen@redhat.com> - 7.0.1-5
+- fix no doc and no manual builds
+
+* Thu Jan 13 2011 Jens Petersen <petersen@redhat.com> - 7.0.1-4
+- add BRs for various subpackaged ghc libraries needed to build ghc
+- condition rts .so libraries for non-shared builds
+
+* Thu Dec 30 2010 Jens Petersen <petersen@redhat.com> - 7.0.1-3
+- subpackage all the libraries with ghc-rpm-macros-0.11.1
+- put rts, integer-gmp and ghc-prim in base, and ghc-binary in bin-package-db
+- drop the libs mega-subpackage
+- prof now a meta-package for backward compatibility
+- add devel meta-subpackage to easily install all ghc libraries
+- store doc cronjob package cache file under /var (#664850)
+- drop old extralibs bcond
+- no longer need to define or clean buildroot
+- ghc base package now requires ghc-base-devel
+- drop ghc-time obsoletes
+
+* Wed Nov 24 2010 Jens Petersen <petersen@redhat.com> - 7.0.1-2
+- require libffi-devel
+
+* Tue Nov 16 2010 Jens Petersen <petersen@redhat.com> - 7.0.1-1
+- update to 7.0.1 release
+- turn on system libffi now
+
+* Mon Nov 8 2010 Jens Petersen <petersen@redhat.com> - 6.12.3-9
+- disable the libffi changes for now since they break libHSffi*.so
+
+* Thu Nov 4 2010 Jens Petersen <petersen@redhat.com> - 6.12.3-8
+- add a cronjob for doc indexing
+- disable gen_contents_index when not run with --batch for cron
+- use system libffi with ghc-use-system-libffi.patch from debian
+- add bcond for system libffi
+
+* Thu Nov 4 2010 Jens Petersen <petersen@redhat.com> - 6.12.3-7
+- skip huge type-level docs from haddock re-indexing (#649228)
+
+* Thu Sep 30 2010 Jens Petersen <petersen@redhat.com> - 6.12.3-6
+- move gtk2hs obsoletes to ghc-glib and ghc-gtk
+- drop happy buildrequires
+- smp build with max 4 cpus
+
+* Fri Jul 30 2010 Jens Petersen <petersen@redhat.com> - 6.12.3-5
+- obsolete old gtk2hs packages for smooth upgrades
+
+* Thu Jul 15 2010 Jens Petersen <petersen@redhat.com> - 6.12.3-4
+- merge ghc-doc into base package
+- obsolete ghc-time and ghc-ghc-doc (ghc-rpm-macros-0.8.0)
+- note that ghc-6.12.3 is part of haskell-platform-2010.2.0.0
+
+* Thu Jun 24 2010 Jens Petersen <petersen@redhat.com> - 6.12.3-3
+- drop the broken summary and description args to the ghc-ghc package
+ and use ghc-rpm-macros-0.6.1
+
+* Wed Jun 23 2010 Jens Petersen <petersen@redhat.com> - 6.12.3-2
+- strip all dynlinked files not just shared objects (ghc-rpm-macros-0.5.9)
+
+* Mon Jun 14 2010 Jens Petersen <petersen@redhat.com> - 6.12.3-1
+- 6.12.3 release:
+ http://darcs.haskell.org/download/docs/6.12.3/html/users_guide/release-6-12-3.html
+- build with hscolour
+- use ghc-rpm-macro-0.5.8 for ghc_strip_shared macro
+
+* Fri May 28 2010 Jens Petersen <petersen@redhat.com> - 6.12.2.20100521-1
+- 6.12.3 rc1
+- ghost package.cache
+- drop ghc-utf8-string obsoletes since it is no longer provided
+- run testsuite fast
+- fix description and summary of ghc internal library (John Obbele)
+
+* Fri Apr 23 2010 Jens Petersen <petersen@redhat.com> - 6.12.2-1
+- update to 6.12.2
+- add testsuite with bcond, run it in check section, and BR python
+
+* Mon Apr 12 2010 Jens Petersen <petersen@redhat.com> - 6.12.1-6
+- ghc-6.12.1 is part of haskell-platform-2010.1.0.0
+- drop old ghc682, ghc681, haddock09 obsoletes
+- drop haddock_version and no longer provide haddock explicitly
+- update ghc-rpm-macros BR to 0.5.6 for ghc_pkg_recache
+
+* Mon Jan 11 2010 Jens Petersen <petersen@redhat.com> - 6.12.1-5
+- drop ghc-6.12.1-no-filter-libs.patch and extras packages again
+- filter ghc-ghc-prof files from ghc-prof
+- ghc-mtl package was added to fedora
+
+* Mon Jan 11 2010 Jens Petersen <petersen@redhat.com> - 6.12.1-4
+- ghc-rpm-macros-0.5.4 fixes wrong version requires between lib subpackages
+
+* Mon Jan 11 2010 Jens Petersen <petersen@redhat.com> - 6.12.1-3
+- ghc-rpm-macros-0.5.2 fixes broken pkg_name requires for lib subpackages
+
+* Tue Dec 22 2009 Jens Petersen <petersen@redhat.com> - 6.12.1-2
+- include haskeline, mtl, and terminfo for now with
+ ghc-6.12.1-no-filter-libs.patch
+- use ghc_binlibpackage, grep -v and ghc_gen_filelists to generate
+ the library subpackages (ghc-rpm-macros-0.5.1)
+- always set GhcLibWays (Lorenzo Villani)
+- use ghcdocbasedir to revert html doc path to upstream's html/ for consistency
+
+* Wed Dec 16 2009 Jens Petersen <petersen@redhat.com> - 6.12.1-1
+- pre became 6.12.1 final
+- exclude ghc .conf file from package.conf.d in base package
+- use ghc_reindex_haddock
+- add scripts for ghc-ghc-devel and ghc-ghc-doc
+- add doc bcond
+- add ghc-6.12.1-gen_contents_index-haddock-path.patch to adjust haddock path
+ since we removed html/ from libraries path
+- require ghc-rpm-macros-0.3.1 and use ghc_version_override
+
+* Sat Dec 12 2009 Jens Petersen <petersen@redhat.com> - 6.12.1-0.2
+- remove redundant mingw and perl from ghc-tarballs/
+- fix exclusion of ghc internals lib from base packages with -mindepth
+- rename the final file lists to PKGNAME.files for clarity
+
+* Fri Dec 11 2009 Jens Petersen <petersen@redhat.com> - 6.12.1-0.1
+- update to ghc-6.12.1-pre
+- separate bcond options into enabled and disabled for clarity
+- only enable shared for intel x86 archs (Lorenzo Villani)
+- add quick build profile (Lorenzo Villani)
+- remove package_debugging hack (use "make install-short")
+- drop sed BR (Lorenzo Villani)
+- put all build.mk config into one cat block (Lorenzo Villani)
+- export CFLAGS to configure (Lorenzo Villani)
+- add dynamic linking test to check section (thanks Lorenzo Villani)
+- remove old ghc66 obsoletes
+- subpackage huge ghc internals library (thanks Lorenzo Villani)
+ - BR ghc-rpm-macros >= 0.3.0
+- move html docs to docdir/ghc from html subdir (Lorenzo Villani)
+- disable smp build for now: broken for 8 cpus at least
+
+* Wed Nov 18 2009 Jens Petersen <petersen@redhat.com> - 6.12.0.20091121-1
+- update to 6.12.1 rc2
+- build shared libs, yay! and package in standalone libs subpackage
+- add bcond for manual and extralibs
+- reenable ppc secondary arch
+- don't provide ghc-haddock-*
+- remove obsolete post requires policycoreutils
+- add vanilla v to GhcLibWays when building without prof
+- handle without hscolour
+- can't smp make currently
+- lots of filelist fixes for handling shared libs
+- run ghc-pkg recache posttrans
+- no need to install gen_contents_index by hand
+- manpage is back
+
+* Thu Nov 12 2009 Bryan O'Sullivan <bos@serpentine.com> - 6.12.0.20091010-8
+- comprehensive attempts at packaging fixes
+
+* Thu Nov 12 2009 Bryan O'Sullivan <bos@serpentine.com> - 6.12.0.20091010-7
+- fix package.conf stuff
+
+* Thu Nov 12 2009 Bryan O'Sullivan <bos@serpentine.com> - 6.12.0.20091010-6
+- give up trying to install man pages
+
+* Thu Nov 12 2009 Bryan O'Sullivan <bos@serpentine.com> - 6.12.0.20091010-5
+- try to install man pages
+
+* Thu Nov 12 2009 Bryan O'Sullivan <bos@serpentine.com> - 6.12.0.20091010-3
+- fix %check
+
+* Sun Oct 11 2009 Bryan O'Sullivan <bos@serpentine.com> - 6.12.0.20091010-2
+- disable ppc for now (seems unsupported)
+- buildreq ncurses-devel
+
+* Sun Oct 11 2009 Bryan O'Sullivan <bos@serpentine.com> - 6.12.0.20091010-1
+- Update to 6.12 RC 1
+
+* Thu Oct 1 2009 Jens Petersen <petersen@redhat.com>
+- selinux file context no longer needed in post script
+- (for ghc-6.12-shared) drop ld.so.conf.d files
+
+* Fri Jul 24 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 6.10.4-2
+- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild
+
+* Tue Jul 21 2009 Bryan O'Sullivan <bos@serpentine.com> - 6.10.4-1
+- update to 6.10.4
+
+* Sat May 30 2009 Jens Petersen <petersen@redhat.com> - 6.10.3-3
+- add haddock_version and use it to obsolete haddock and ghc-haddock-*
+
+* Fri May 22 2009 Jens Petersen <petersen@redhat.com> - 6.10.3-2
+- update haddock provides and obsoletes
+- drop ghc-mk-pkg-install-inplace.patch: no longer needed with new 6.11 buildsys
+- add bcond for extralibs
+- rename doc bcond to manual
+
+* Wed May 13 2009 Jens Petersen <petersen@redhat.com> - 6.10.3-1
+- update to 6.10.3
+- haskline replaces editline, so it is no longer needed to build
+- macros.ghc moved to ghc-rpm-macros package
+- fix handling of hscolor files in filelist generation
+
+* Tue Apr 28 2009 Jens Petersen <petersen@redhat.com> - 6.10.2-4
+- add experimental bcond hscolour
+- add experimental support for building shared libraries (for ghc-6.11)
+ - add libs subpackage for shared libraries
+ - create a ld.conf.d file for libghc*.so
+ - BR libffi-devel
+- drop redundant setting of GhcLibWays in build.mk for no prof
+- drop redundant setting of HADDOCK_DOCS
+- simplify filelist names
+- add a check section based on tests from debian's package
+- be more careful about doc files in filelist
+
+* Fri Apr 24 2009 Jens Petersen <petersen@redhat.com> - 6.10.2-3
+- define ghc_version in macros.ghc in place of ghcrequires
+- drop ghc-requires script for now
+
+* Sun Apr 19 2009 Jens Petersen <petersen@redhat.com> - 6.10.2-2
+- add ghc-requires rpm script to generate ghc version dependencies
+ (thanks to Till Maas)
+- update macros.ghc:
+ - add %%ghcrequires to call above script
+ - pkg_libdir and pkg_docdir obsoleted in packages and replaced
+ by ghcpkgdir and ghcdocdir inside macros.ghc
+ - make filelist also for docs
+
+* Wed Apr 08 2009 Bryan O'Sullivan <bos@serpentine.com> - 6.10.2-1
+- Update to 6.10.2
+
+* Fri Feb 27 2009 Jens Petersen <petersen@redhat.com> - 6.10.1-13
+- ok let's stick with ExclusiveArch for brevity
+
+* Fri Feb 27 2009 Jens Petersen <petersen@redhat.com> - 6.10.1-12
+- drop ghc_archs since it breaks koji
+- fix missing -devel in ghc_gen_filelists
+- change from ExclusiveArch to ExcludeArch ppc64 since alpha was bootstrapped
+ by oliver
+
+* Wed Feb 25 2009 Jens Petersen <petersen@redhat.com> - 6.10.1-11
+- use %%ix86 for change from i386 to i586 in rawhide
+- add ghc_archs macro in macros.ghc for other packages
+- obsolete haddock09
+- use %%global instead of %%define
+- use bcond for doc and prof
+- rename ghc_gen_filelists lib filelist to -devel.files
+
+* Tue Feb 24 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 6.10.1-10
+- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild
+
+* Fri Feb 13 2009 Jens Petersen <petersen@redhat.com> - 6.10.1-9
+- require and buildrequire libedit-devel > 2.11-2
+- protect ghc_register_pkg and ghc_unregister_pkg
+
+* Fri Jan 23 2009 Jens Petersen <petersen@redhat.com> - 6.10.1-8
+- fix to libedit means can drop ncurses-devel BR workaround (#481252)
+
+* Mon Jan 19 2009 Jens Petersen <petersen@redhat.com> - 6.10.1-7
+- buildrequire ncurses-devel to fix build of missing editline package needed
+ for ghci line-editing (#478466)
+- move spec templates to cabal2spec package for easy updating
+- provide correct haddock version
+
+* Mon Dec 1 2008 Jens Petersen <petersen@redhat.com> - 6.10.1-6
+- update macros.ghc to latest proposed revised packaging guidelines:
+ - use runghc
+ - drop trivial cabal_build and cabal_haddock macros
+ - ghc_register_pkg and ghc_unregister_pkg replace ghc_preinst_script,
+ ghc_postinst_script, ghc_preun_script, and ghc_postun_script
+- library templates prof subpackage requires main library again
+- make cabal2spec work on .cabal files too, and
+ read and check name and version directly from .cabal file
+- ghc-prof does not need to own libraries dirs owned by main package
+
+* Tue Nov 25 2008 Jens Petersen <petersen@redhat.com> - 6.10.1-5
+- add cabal2spec and template files for easy cabal hackage packaging
+- simplify script macros: make ghc_preinst_script and ghc_postun_script no-ops
+ and ghc_preun_script only unregister for uninstall
+
+* Tue Nov 11 2008 Jens Petersen <petersen@redhat.com> - 6.10.1-4
+- fix broken urls to haddock docs created by gen_contents_index script
+- avoid haddock errors when upgrading by making doc post script posttrans
+
+* Wed Nov 05 2008 Bryan O'Sullivan <bos@serpentine.com> - 6.10.1-3
+- libraries/prologue.txt should not have been ghosted
+
+* Tue Nov 04 2008 Bryan O'Sullivan <bos@serpentine.com> - 6.10.1-2
+- Fix a minor packaging glitch
+
+* Tue Nov 04 2008 Bryan O'Sullivan <bos@serpentine.com> - 6.10.1-1
+- Update to 6.10.1
+
+* Thu Oct 23 2008 Jens Petersen <petersen@redhat.com> - 6.10.0.20081007-9
+- remove redundant --haddockdir from cabal_configure
+- actually ghc-pkg no longer seems to create package.conf.old backups
+- include LICENSE in doc
+
+* Thu Oct 23 2008 Jens Petersen <petersen@redhat.com> - 6.10.0.20081007-8
+- need to create ghost package.conf.old for ghc-6.10
+
+* Thu Oct 23 2008 Jens Petersen <petersen@redhat.com> - 6.10.0.20081007-7
+- use gen_contents_index to re-index haddock
+- add %%pkg_docdir to cabal_configure
+- requires(post) ghc for haddock for doc
+- improve doc file lists
+- no longer need to create ghost package.conf.old
+- remove or rename alternatives files more consistently
+
+* Tue Oct 14 2008 Bryan O'Sullivan <bos@serpentine.com> - 6.10.0.20081007-6
+- Update macros to install html and haddock bits in the right places
+
+* Tue Oct 14 2008 Bryan O'Sullivan <bos@serpentine.com> - 6.10.0.20081007-5
+- Don't use a macro to update the docs for the main doc package
+
+* Tue Oct 14 2008 Bryan O'Sullivan <bos@serpentine.com> - 6.10.0.20081007-4
+- Add ghc_haddock_reindex macro
+- Generate haddock index after installing ghc-doc package
+
+* Mon Oct 13 2008 Jens Petersen <petersen@redhat.com> - 6.10.0.20081007-3
+- provide haddock = 2.2.2
+- add selinux file context for unconfined_execmem following darcs package
+- post requires policycoreutils
+
+* Sun Oct 12 2008 Bryan O'Sullivan <bos@serpentine.com> - 6.10.0.20081007-2.fc10
+- Use libedit in preference to readline, for BSD license consistency
+- With haddock bundled now, obsolete standalone versions (but not haddock09)
+- Drop obsolete freeglut-devel, openal-devel, and haddock09 dependencies
+
+* Sun Oct 12 2008 Bryan O'Sullivan <bos@serpentine.com> - 6.10.0.20081007-1.fc10
+- Update to 6.10.1 release candidate 1
+
+* Wed Oct 1 2008 Bryan O'Sullivan <bos@serpentine.com> - 6.10.0.20080921-1.fc10
+- Drop unneeded haddock patch
+- Rename hsc2hs to hsc2hs-ghc so the alternatives symlink to it will work
+
+* Wed Sep 24 2008 Jens Petersen <petersen@redhat.com> - 6.8.3-5
+- bring back including haddock-generated lib docs, now under docdir/ghc
+- fix macros.ghc filepath (#460304)
+- spec file cleanups:
+- fix the source urls back
+- drop requires chkconfig
+- do not override __spec_install_post
+- setup docs building in build.mk
+- no longer need to remove network/include/Typeable.h
+- install binaries under libdir not libexec
+- remove hsc2hs and runhaskell binaries since they are alternatives
+
+* Wed Sep 17 2008 Jens Petersen <petersen@redhat.com> - 6.8.3-4
+- add macros.ghc for new Haskell Packaging Guidelines (#460304)
+
+* Wed Jun 18 2008 Bryan O'Sullivan <bos@serpentine.com> - 6.8.3-3
+- Add symlinks from _libdir, where ghc looks, to _libexecdir
+- Patch libraries/gen_contents_index to use haddock-0.9
+
+* Wed Jun 18 2008 Bryan O'Sullivan <bos@serpentine.com> - 6.8.3-2
+- Remove unnecessary dependency on alex
+
+* Wed Jun 18 2008 Bryan O'Sullivan <bos@serpentine.com> - 6.8.3-1
+- Upgrade to 6.8.3
+- Drop the ghc682-style naming scheme, obsolete those packages
+- Manually strip binaries
+
+* Tue Apr 8 2008 Jens Petersen <petersen@redhat.com> - 6.8.2-10
+- another rebuild attempt
+
+* Thu Feb 14 2008 Jens Petersen <petersen@redhat.com> - 6.8.2-9
+- remove unrecognized --docdir and --htmldir from configure
+- drop old buildrequires on libX11-devel and libXt-devel
+- rebuild with gcc43
+
+* Sun Jan 06 2008 Bryan O'Sullivan <bos@serpentine.com> - 6.8.2-7
+- More attempts to fix docdir
+
+* Sun Jan 06 2008 Bryan O'Sullivan <bos@serpentine.com> - 6.8.2-6
+- Fix docdir
+
+* Wed Dec 12 2007 Bryan O'Sullivan <bos@serpentine.com> - 6.8.2-1
+- Update to 6.8.2
+
+* Fri Nov 23 2007 Bryan O'Sullivan <bos@serpentine.com> - 6.8.1-2
+- Exclude alpha
+
+* Thu Nov 8 2007 Bryan O'Sullivan <bos@serpentine.com> - 6.8.1-2
+- Drop bit-rotted attempts at making package relocatable
+
+* Sun Nov 4 2007 Michel Salim <michel.sylvan@gmail.com> - 6.8.1-1
+- Update to 6.8.1
+
+* Sat Sep 29 2007 Bryan O'Sullivan <bos@serpentine.com> - 6.8.0.20070928-2
+- add happy to BuildRequires
+
+* Sat Sep 29 2007 Bryan O'Sullivan <bos@serpentine.com> - 6.8.0.20070928-1
+- prepare for GHC 6.8.1 by building a release candidate snapshot
+
+* Thu May 10 2007 Bryan O'Sullivan <bos@serpentine.com> - 6.6.1-3
+- install man page for ghc
+
+* Thu May 10 2007 Bryan O'Sullivan <bos@serpentine.com> - 6.6.1-2
+- exclude ppc64 for now, due to lack of time to bootstrap
+
+* Wed May 9 2007 Bryan O'Sullivan <bos@serpentine.com> - 6.6.1-1
+- update to 6.6.1 release
+
+* Mon Jan 22 2007 Jens Petersen <petersen@redhat.com> - 6.6-2
+- remove truncated duplicate Typeable.h header in network package
+ (Bryan O'Sullivan, #222865)
+
+* Fri Nov 3 2006 Jens Petersen <petersen@redhat.com> - 6.6-1
+- update to 6.6 release
+- buildrequire haddock >= 0.8
+- fix summary of ghcver package (Michel Salim, #209574)
+
+* Thu Sep 28 2006 Jens Petersen <petersen@redhat.com> - 6.4.2-4
+- turn on docs generation again
+
+* Mon Sep 25 2006 Jens Petersen <petersen@redhat.com> - 6.4.2-3.fc6
+- ghost package.conf.old (Gérard Milmeister)
+- set unconfined_execmem_exec_t context on executables with ghc rts (#195821)
+- turn off building docs until haddock is back
+
+* Sat Apr 29 2006 Jens Petersen <petersen@redhat.com> - 6.4.2-2.fc6
+- buildrequire libXt-devel so that the X11 package and deps get built
+ (Garrett Mitchener, #190201)
+
+* Thu Apr 20 2006 Jens Petersen <petersen@redhat.com> - 6.4.2-1.fc6
+- update to 6.4.2 release
+
+* Thu Mar 2 2006 Jens Petersen <petersen@redhat.com> - 6.4.1-3.fc5
+- buildrequire libX11-devel instead of xorg-x11-devel (Kevin Fenzi, #181024)
+- make ghc-doc require ghc (Michel Salim, #180449)
+
+* Tue Oct 11 2005 Jens Petersen <petersen@redhat.com> - 6.4.1-2.fc5
+- turn on build_doc since haddock is now in Extras
+- no longer specify ghc version to build with (Ville Skyttä, #170176)
+
+* Tue Sep 20 2005 Jens Petersen <petersen@redhat.com> - 6.4.1-1.fc5
+- 6.4.1 release
+ - the following patches are now upstream: ghc-6.4-powerpc.patch,
+ rts-GCCompact.h-x86_64.patch, ghc-6.4-dsforeign-x86_64-1097471.patch,
+ ghc-6.4-rts-adjustor-x86_64-1097471.patch
+ - builds with gcc4 so drop %%_with_gcc32
+ - x86_64 build restrictions (no ghci and split objects) no longer apply
+
+* Tue May 31 2005 Jens Petersen <petersen@redhat.com>
+- add %%dist to release
+
+* Thu May 12 2005 Jens Petersen <petersen@redhat.com> - 6.4-8
+- initial import into Fedora Extras
+
+* Thu May 12 2005 Jens Petersen <petersen@haskell.org>
+- add build_prof and build_doc switches for -doc and -prof subpackages
+- add _with_gcc32 switch since ghc-6.4 doesn't build with gcc-4.0
+
+* Wed May 11 2005 Jens Petersen <petersen@haskell.org> - 6.4-7
+- make package relocatable (ghc#1084122)
+ - add post install scripts to replace prefix in driver scripts
+- buildrequire libxslt and docbook-style-xsl instead of docbook-utils and flex
+
+* Fri May 6 2005 Jens Petersen <petersen@haskell.org> - 6.4-6
+- add ghc-6.4-dsforeign-x86_64-1097471.patch and
+ ghc-6.4-rts-adjustor-x86_64-1097471.patch from trunk to hopefully fix
+ ffi support on x86_64 (Simon Marlow, ghc#1097471)
+- use XMLDocWays instead of SGMLDocWays to build documentation fully
+
+* Mon May 2 2005 Jens Petersen <petersen@haskell.org> - 6.4-5
+- add rts-GCCompact.h-x86_64.patch to fix GC issue on x86_64 (Simon Marlow)
+
+* Thu Mar 17 2005 Jens Petersen <petersen@haskell.org> - 6.4-4
+- add ghc-6.4-powerpc.patch (Ryan Lortie)
+- disable building interpreter rather than install and delete on x86_64
+
+* Wed Mar 16 2005 Jens Petersen <petersen@haskell.org> - 6.4-3
+- make ghc require ghcver of same ver-rel
+- on x86_64 remove ghci for now since it doesn't work and all .o files
+
+* Tue Mar 15 2005 Jens Petersen <petersen@haskell.org> - 6.4-2
+- ghc requires ghcver (Amanda Clare)
+
+* Sat Mar 12 2005 Jens Petersen <petersen@haskell.org> - 6.4-1
+- 6.4 release
+ - x86_64 build no longer unregisterised
+- use sed instead of perl to tidy filelists
+- buildrequire ghc64 instead of ghc-6.4
+- no epoch for ghc64-prof's ghc64 requirement
+- install docs directly in docdir
+
+* Fri Jan 21 2005 Jens Petersen <petersen@haskell.org> - 6.2.2-2
+- add x86_64 port
+ - build unregistered and without splitobjs
+ - specify libdir to configure and install
+- rename ghc-prof to ghcXYZ-prof, which obsoletes ghc-prof
+
+* Mon Dec 6 2004 Jens Petersen <petersen@haskell.org> - 6.2.2-1
+- move ghc requires to ghcXYZ
+
+* Wed Nov 24 2004 Jens Petersen <petersen@haskell.org> - 6.2.2-0.fdr.1
+- ghc622
+ - provide ghc = %%version
+- require gcc, gmp-devel and readline-devel
+
+* Fri Oct 15 2004 Gerard Milmeister <gemi@bluewin.ch> - 6.2.2-0.fdr.1
+- New Version 6.2.2
+
+* Mon Mar 22 2004 Gerard Milmeister <gemi@bluewin.ch> - 6.2.1-0.fdr.1
+- New Version 6.2.1
+
+* Tue Dec 16 2003 Gerard Milmeister <gemi@bluewin.ch> - 6.2-0.fdr.1
+- New Version 6.2
+
+* Tue Dec 16 2003 Gerard Milmeister <gemi@bluewin.ch> - 6.0.1-0.fdr.3
+- A few minor specfile tweaks
+
+* Mon Dec 15 2003 Gerard Milmeister <gemi@bluewin.ch> - 6.0.1-0.fdr.2
+- Different file list generation
+
+* Mon Oct 20 2003 Gerard Milmeister <gemi@bluewin.ch> - 6.0.1-0.fdr.1
+- First Fedora release
+- Added generated html docs, so that haddock is not needed
+
+* Wed Sep 26 2001 Manuel Chakravarty
+- small changes for 5.04
+
+* Wed Sep 26 2001 Manuel Chakravarty
+- split documentation off into a separate package
+- adapt to new docbook setup in RH7.1
+
+* Mon Apr 16 2001 Manuel Chakravarty
+- revised for 5.00
+- also runs autoconf automagically if no ./configure found
+
+* Thu Jun 22 2000 Sven Panne
+- removed explicit usage of hslibs/docs, it belongs to ghc/docs/set
+
+* Sun Apr 23 2000 Manuel Chakravarty
+- revised for ghc 4.07; added suggestions from Pixel <pixel@mandrakesoft.com>
+- added profiling package
+
+* Tue Dec 7 1999 Manuel Chakravarty
+- version for use from CVS
+
+* Thu Sep 16 1999 Manuel Chakravarty
+- modified for GHC 4.04, patchlevel 1 (no more 62 tuple stuff); minimises use
+ of patch files - instead emits a build.mk on-the-fly
+
+* Sat Jul 31 1999 Manuel Chakravarty
+- modified for GHC 4.04
+
+* Wed Jun 30 1999 Manuel Chakravarty
+- some more improvements from vbzoli
+
+* Fri Feb 26 1999 Manuel Chakravarty
+- modified for GHC 4.02
+
+* Thu Dec 24 1998 Zoltan Vorosbaranyi
+- added BuildRoot
+- files located in /usr/local/bin, /usr/local/lib moved to /usr/bin, /usr/lib
+
+* Tue Jul 28 1998 Manuel Chakravarty
+- original version
diff --git a/tools/bootstrap/hscolour/hscolour.spec b/tools/bootstrap/hscolour/hscolour.spec
new file mode 100644
index 0000000..1933fff
--- /dev/null
+++ b/tools/bootstrap/hscolour/hscolour.spec
@@ -0,0 +1,168 @@
+# cabal2spec-0.25.2
+# https://fedoraproject.org/wiki/Packaging:Haskell
+# https://fedoraproject.org/wiki/PackagingDrafts/Haskell
+
+%global pkg_name hscolour
+
+# use following to bootstrap after building a new ghc version:
+%{?ghc_bootstrap}
+%global ghc_bootstrapping 1
+%global without_hscolour 1
+
+%global common_summary Haskell %{pkg_name} library
+
+%global common_description hscolour is a tool to colourize Haskell code.\
+It currently has six output formats: ANSI terminal codes, HTML 3.2\
+with <font> tags, HTML 4.01 with CSS, XHTML 1.0 with inline CSS\
+styling, LaTeX, and mIRC chat client codes.
+
+Name: %{pkg_name}
+Version: 1.19
+Release: 5%{?dist}
+Summary: Colourizes Haskell code
+
+Group: Development/Tools
+License: GPLv2+
+# BEGIN cabal2spec
+URL: http://hackage.haskell.org/package/%{name}
+Source0: http://hackage.haskell.org/packages/archive/%{name}/%{version}/%{name}-%{version}.tar.gz
+BuildRequires: ghc-Cabal-devel
+BuildRequires: ghc-rpm-macros %{!?without_hscolour:hscolour}
+# END cabal2spec
+BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
+
+%description
+%{common_description}
+
+
+%prep
+%setup -q
+
+
+%build
+%ghc_lib_build
+
+
+%install
+%ghc_lib_install
+
+
+# library subpackage
+%ghc_package
+
+%ghc_description
+
+
+# devel subpackage
+%ghc_devel_package
+
+%ghc_devel_description
+
+
+%ghc_devel_post_postun
+
+
+%files
+%doc LICENCE-GPL
+%attr(755,root,root) %{_bindir}/HsColour
+%{_datadir}/%{name}-%{version}
+
+
+%ghc_files LICENCE-GPL
+
+
+%changelog
+* Wed Mar 21 2012 Jens Petersen <petersen@redhat.com> - 1.19-5
+- bootstrap build
+- drop the explicit containers BR
+
+* Mon Jan 23 2012 Jens Petersen <petersen@redhat.com> - 1.19-4
+- update to cabal2spec-0.25.2
+
+* Fri Jan 13 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.19-3.2
+- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild
+
+* Fri Oct 21 2011 Marcela Mašláňová <mmaslano@redhat.com> - 1.19-2.2
+- rebuild with new gmp without compat lib
+
+* Wed Oct 12 2011 Peter Schiffer <pschiffe@redhat.com> - 1.19-2.1
+- rebuild with new gmp
+
+* Fri Jun 17 2011 Jens Petersen <petersen@redhat.com> - 1.19-2
+- use ghc_arches (cabal-0.23.2)
+
+* Fri Jun 17 2011 Jens Petersen <petersen@redhat.com> - 1.19-1
+- update to 1.19
+- use ghc_bootstrap from ghc-rpm-macros-0.13.5
+- just depends on containers
+
+* Thu May 05 2011 Jiri Skala <jskala@redhat.com> - 1.17-10
+- enable source hscolour again
+
+* Tue May 03 2011 Jiri Skala <jskala@redhat.com> - 1.17-9
+- temporily disable hscolour for ghc-7.0.2 bootstrap on ppc64
+
+* Thu Mar 10 2011 Jens Petersen <petersen@redhat.com> - 1.17-8
+- enable source hscolour again
+
+* Thu Mar 10 2011 Jens Petersen <petersen@redhat.com> - 1.17-7
+- temporily disable hscolour for ghc-7.0.2 bootstrap
+
+* Wed Feb 23 2011 Fabio M. Di Nitto <fdinitto@redhat.com> - 1.17-6
+- enable build on sparcv9
+
+* Wed Feb 09 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.17-5
+- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild
+
+* Sun Jan 23 2011 Jens Petersen <petersen@redhat.com> - 1.17-4
+- rebuild
+
+* Sat Jan 15 2011 Jens Petersen <petersen@redhat.com> - 1.17-3
+- update to cabal2spec-0.22.4
+
+* Thu Nov 25 2010 Jens Petersen <petersen@redhat.com> - 1.17-2
+- rebuilt
+
+* Mon Jul 19 2010 Jens Petersen <petersen@redhat.com> - 1.17-1
+- 1.17 release
+- use ghc-rpm-macros-0.8.1 macros: update to cabal2spec-0.22.1
+- add hscolour and obsolete doc subpackage
+
+* Sat Jun 26 2010 Jens Petersen <petersen@redhat.com> - 1.16-3
+- strip dynlinked files (cabal2spec-0.21.4)
+
+* Mon Feb 15 2010 Conrad Meyer <konrad@tylerc.org> - 1.16-1
+- Bump to 1.16
+
+* Mon Jan 11 2010 Jens Petersen <petersen@redhat.com> - 1.15-4
+- update to ghc-rpm-macros-0.5.1 and cabal2spec-0.21.1:
+- drop doc and prof bcond
+- use common summary and common_description
+- define pkg_name and use ghc_binlib_package
+
+* Wed Dec 23 2009 Jens Petersen <petersen@redhat.com> - 1.15-3
+- devel package requires shared library not base
+
+* Wed Dec 23 2009 Jens Petersen <petersen@redhat.com> - 1.15-2
+- update spec for ghc-6.12.1
+- added shared library support: needs ghc-rpm-macros 0.3.1
+
+* Fri Sep 18 2009 Jens Petersen <petersen@redhat.com> - 1.15-1
+- update to 1.15
+
+* Fri Jul 24 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.13-2
+- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild
+
+* Sun May 24 2009 Jens Petersen <petersen@redhat.com> - 1.13-1
+- update to 1.13
+- buildrequires ghc-rpm-macros (cabal2spec-0.16)
+
+* Sat Apr 25 2009 Jens Petersen <petersen@redhat.com> - 1.12-3
+- sync with cabal2spec-0.15
+
+* Tue Mar 10 2009 Jens Petersen <petersen@redhat.com> - 1.12-2
+- fix url (#488665)
+- fix HsColour permissions (#488665)
+
+* Thu Mar 5 2009 Jens Petersen <petersen@redhat.com> - 1.12-1
+- initial packaging for Fedora created by cabal2spec
diff --git a/tools/cabal-dev/cabal-dev-0.9.1-tar-0.4.patch b/tools/cabal-dev/cabal-dev-0.9.1-tar-0.4.patch
new file mode 100644
index 0000000..b2fdb2b
--- /dev/null
+++ b/tools/cabal-dev/cabal-dev-0.9.1-tar-0.4.patch
@@ -0,0 +1,30 @@
+commit 7c7ba693333c06aa59d0a915e0b4f44d56d7da0e
+Author: Trevor Elliott <awesomelyawesome@gmail.com>
+Date: Mon Oct 15 21:40:45 2012 -0700
+
+ Update for tar >= 0.4
+
+ Modified cabal-dev.cabal
+ Modified src/Distribution/Dev/AddSource.hs
+diff --git a/src/Distribution/Dev/AddSource.hs b/src/Distribution/Dev/AddSource.hs
+index e43730d..aa4d12a 100644
+--- a/src/Distribution/Dev/AddSource.hs
++++ b/src/Distribution/Dev/AddSource.hs
+@@ -164,7 +164,7 @@ readExistingIndex sandbox =
+ forceEntries es =
+ let step _ l@(Left _) = l
+ step x (Right xs) = Right (x:xs)
+- es' = T.foldEntries step (Right []) Left es
++ es' = T.foldEntries step (Right []) (Left . show) es
+ in either (const 0) length es' `seq` return es'
+
+
+@@ -344,7 +344,7 @@ forcedBS :: L.ByteString -> IO L.ByteString
+ forcedBS bs = forceBS bs >> return bs
+
+ -- |Extract a cabal file from a package tarball
+-extractCabalFile :: T.Entries -> Maybe (PackageIdentifier, L.ByteString, PackageDescription)
++extractCabalFile :: T.Entries T.FormatError -> Maybe (PackageIdentifier, L.ByteString, PackageDescription)
+ extractCabalFile = T.foldEntries step Nothing (const Nothing)
+ where
+ step ent Nothing = (,,) <$> entPackageId ent <*> entBytes ent <*> (parseDesc $ entBytes ent)
diff --git a/tools/cabal-dev/cabal-dev.spec b/tools/cabal-dev/cabal-dev.spec
new file mode 100644
index 0000000..bdb54f6
--- /dev/null
+++ b/tools/cabal-dev/cabal-dev.spec
@@ -0,0 +1,132 @@
+# https://fedoraproject.org/wiki/Packaging:Haskell
+# https://fedoraproject.org/wiki/PackagingDrafts/Haskell
+
+Name: cabal-dev
+Version: 0.9.1
+Release: 6%{?dist}
+Summary: Manage sandboxed Haskell build environments
+
+Group: Development/Tools
+License: BSD
+URL: http://hackage.haskell.org/package/%{name}
+Source0: http://hackage.haskell.org/packages/archive/%{name}/%{version}/%{name}-%{version}.tar.gz
+Patch1: cabal-dev-0.9.1-tar-0.4.patch
+
+BuildRequires: ghc-Cabal-devel
+BuildRequires: ghc-rpm-macros
+# Begin cabal-rpm deps:
+BuildRequires: ghc-HTTP-devel
+BuildRequires: ghc-bytestring-devel
+BuildRequires: ghc-containers-devel
+BuildRequires: ghc-directory-devel
+BuildRequires: ghc-filepath-devel
+BuildRequires: ghc-mtl-devel
+BuildRequires: ghc-network-devel
+BuildRequires: ghc-pretty-devel
+BuildRequires: ghc-process-devel
+BuildRequires: ghc-tar-devel
+BuildRequires: ghc-template-haskell-devel
+BuildRequires: ghc-transformers-devel
+BuildRequires: ghc-zlib-devel
+# End cabal-rpm deps
+BuildRequires: cabal-install
+BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
+Requires: cabal-install
+
+%description
+cabal-dev is a tool for managing development builds of Haskell projects.
+It supports maintaining sandboxed cabal-install repositories,
+and sandboxed ghc package databases.
+
+By default, it uses a cabal-dev directory under the current working directory
+as the sandbox.
+
+For most packages, just use cabal-dev instead of cabal, and you will get
+a sandboxed build that will not install anything (even automatically installed
+dependencies) into the user or global ghc package databases.
+
+If your build depends on patched or unreleased libraries, you can add them to
+your sandboxed build environment.
+
+
+%prep
+%setup -q
+%patch1 -p1 -b .orig
+
+cabal-tweak-dep-ver mtl "< 2.1" "< 2.2"
+cabal-tweak-dep-ver transformers "< 0.3" "< 0.4"
+cabal-tweak-dep-ver tar ">= 0.3 && < 0.4" "== 0.4.*"
+
+
+%build
+%ghc_bin_build
+
+
+%install
+%ghc_bin_install
+
+%{__rm} %buildroot%{_bindir}/ghc-pkg-6_8-compat
+
+
+%files
+%doc LICENSE
+%attr(755,root,root) %{_bindir}/%{name}
+%attr(755,root,root) %{_bindir}/fake-ghc-cabal-dev
+%{_datadir}/%{name}-%{version}
+
+
+%changelog
+* Wed Feb 13 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.9.1-6
+- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild
+
+* Fri Nov 9 2012 Jens Petersen <petersen@redhat.com> - 0.9.1-5
+- patch to build with tar-0.4
+- update with cabal-rpm
+
+* Wed Jul 18 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.9.1-4
+- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild
+
+* Sun Jun 10 2012 Jens Petersen <petersen@redhat.com> - 0.9.1-3
+- allow building with mtl-2.1 and transformers-0.3
+
+* Sat Mar 17 2012 Jens Petersen <petersen@redhat.com> - 0.9.1-2
+- drop ghc_without_dynamic for patched ghc-7.4 Cabal
+
+* Thu Feb 9 2012 Jens Petersen <petersen@redhat.com> - 0.9.1-1
+- update to 0.9.1
+- patches to buildsys for cabal-install no longer needed
+
+* Tue Jan 24 2012 Jens Petersen <petersen@redhat.com> - 0.9-4
+- build only for ghc_arches_with_ghci
+
+* Thu Jan 12 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.9-3
+- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild
+
+* Wed Oct 26 2011 Jens Petersen <petersen@redhat.com> - 0.9-2
+- rebuild against new gmp
+
+* Mon Sep 26 2011 Jens Petersen <petersen@redhat.com> - 0.9-1
+- update to 0.9
+
+* Thu Jul 21 2011 Jens Petersen <petersen@redhat.com> - 0.8-2
+- depends on template-haskell
+
+* Tue Jul 19 2011 Jens Petersen <petersen@redhat.com> - 0.8-1
+- update to 0.8
+- disable dynamic linking since it seems to break with Template Haskell
+- add new fake-ghc-cabal-dev helper program
+
+* Thu Jul 14 2011 Jens Petersen <petersen@redhat.com> - 0.7.4.1-3
+- use ghc_arches and BR Cabal (cabal2spec-0.23.2)
+
+* Tue May 3 2011 Jens Petersen <petersen@redhat.com> - 0.7.4.1-2
+- add BRs for ghc-HTTP, ghc-mtl, ghc-network, ghc-tar, and ghc-zlib devel
+- patch out cabal-install from .cabal and Setup files
+- requires cabal-install
+
+* Thu Mar 17 2011 Jens Petersen <petersen@redhat.com> - 0.7.4.1-1
+- license is BSD
+- remove ghc-pkg-6_8-compat
+
+* Thu Mar 17 2011 Fedora Haskell SIG <haskell-devel@lists.fedoraproject.org> - 0.7.4.1-0
+- initial packaging for Fedora automatically generated by cabal2spec-0.22.5
diff --git a/tools/cabal-install/0.14/cabal-install-0.14.0-bootstrap-url.patch b/tools/cabal-install/0.14/cabal-install-0.14.0-bootstrap-url.patch
new file mode 100644
index 0000000..9e0f915
--- /dev/null
+++ b/tools/cabal-install/0.14/cabal-install-0.14.0-bootstrap-url.patch
@@ -0,0 +1,20 @@
+--- cabal-install-0.14.0/bootstrap.sh~ 2012-04-18 00:17:31.000000000 +0900
++++ cabal-install-0.14.0/bootstrap.sh 2014-01-25 12:21:22.455570648 +0900
+@@ -59,7 +59,7 @@
+ TIME_VER="1.4" TIME_VER_REGEXP="1\.[1234]\.?" # >= 1.1 && < 1.5
+ RANDOM_VER="1.0.1.1" RANDOM_VER_REGEXP="1\.0\." # >= 1 && < 1.1
+
+-HACKAGE_URL="http://hackage.haskell.org/packages/archive"
++HACKAGE_URL="http://hackage.haskell.org/package"
+
+ die () {
+ echo
+@@ -116,7 +116,7 @@
+ PKG=$1
+ VER=$2
+
+- URL=${HACKAGE_URL}/${PKG}/${VER}/${PKG}-${VER}.tar.gz
++ URL=${HACKAGE_URL}/${PKG}-${VER}/${PKG}-${VER}.tar.gz
+ if which ${CURL} > /dev/null
+ then
+ ${CURL} --fail -C - -O ${URL} || die "Failed to download ${PKG}."
diff --git a/tools/cabal-install/0.14/cabal-install.spec b/tools/cabal-install/0.14/cabal-install.spec
new file mode 100644
index 0000000..b705e8e
--- /dev/null
+++ b/tools/cabal-install/0.14/cabal-install.spec
@@ -0,0 +1,73 @@
+Name: cabal-install
+Version: 0.14.0
+Release: 1%{?dist}
+Summary: Command-line interface for Cabal and Hackage
+
+License: BSD
+Group: Development/Tools
+URL: http://hackage.haskell.org/package/%{name}
+Source0: http://hackage.haskell.org/packages/archive/%{name}/%{version}/%{name}-%{version}.tar.gz
+Patch0: cabal-install-0.14.0-bootstrap-url.patch
+
+BuildRequires: ghc-Cabal-devel
+#BuildRequires: ghc-rpm-macros
+# Begin cabal-rpm deps:
+#BuildRequires: ghc-HTTP-devel
+BuildRequires: ghc-array-devel
+BuildRequires: ghc-containers-devel
+BuildRequires: ghc-directory-devel
+BuildRequires: ghc-filepath-devel
+#BuildRequires: ghc-mtl-devel
+#BuildRequires: ghc-network-devel
+BuildRequires: ghc-old-time-devel
+BuildRequires: ghc-pretty-devel
+BuildRequires: ghc-process-devel
+#BuildRequires: ghc-random-devel
+BuildRequires: ghc-time-devel
+BuildRequires: ghc-unix-devel
+#BuildRequires: ghc-zlib-devel
+# End cabal-rpm deps
+BuildRequires: zlib-devel%{?_isa}
+BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
+
+%description
+The 'cabal' command-line program simplifies the process of managing Haskell
+software by automating the fetching, configuration, compilation and
+installation of Haskell libraries and programs.
+
+The program is statically linked to Haskell libraries.
+
+
+%prep
+%setup -q
+%patch0 -p1 -b .orig
+
+
+%build
+%{nil}
+
+
+%install
+rm -rf %{buildroot}
+# bootstrap ghc-pkg registers deps
+HOME=$PWD
+export PREFIX=%{buildroot}%{_prefix}
+sh bootstrap.sh
+
+# remove all the dep devel files
+rm -r %{buildroot}%{_prefix}/{lib,share}
+
+
+%clean
+rm -rf %{buildroot}
+
+
+%files
+%defattr(-,root,root,-)
+%doc LICENSE
+%{_bindir}/cabal
+
+
+%changelog
+* Sat Jan 25 2014 Jens Petersen <petersen@redhat.com> - 0.14.0-1
+- build with bootstrap.sh patched for downloading from hackage2
diff --git a/tools/cabal-install/cabal-install-1.18.0.2-bootstrap-hackage-url.patch b/tools/cabal-install/cabal-install-1.18.0.2-bootstrap-hackage-url.patch
new file mode 100644
index 0000000..61e2444
--- /dev/null
+++ b/tools/cabal-install/cabal-install-1.18.0.2-bootstrap-hackage-url.patch
@@ -0,0 +1,20 @@
+--- cabal-install-1.18.0.2/bootstrap.sh~ 2013-10-02 12:50:10.000000000 +0900
++++ cabal-install-1.18.0.2/bootstrap.sh 2014-01-25 14:30:36.896503618 +0900
+@@ -62,7 +62,7 @@
+ RANDOM_VER="1.0.1.1" RANDOM_VER_REGEXP="1\.0\." # >= 1 && < 1.1
+ STM_VER="2.4.2"; STM_VER_REGEXP="2\." # == 2.*
+
+-HACKAGE_URL="http://hackage.haskell.org/packages/archive"
++HACKAGE_URL="http://hackage.haskell.org/package"
+
+ die () {
+ echo
+@@ -119,7 +119,7 @@
+ PKG=$1
+ VER=$2
+
+- URL=${HACKAGE_URL}/${PKG}/${VER}/${PKG}-${VER}.tar.gz
++ URL=${HACKAGE_URL}/${PKG}-${VER}/${PKG}-${VER}.tar.gz
+ if which ${CURL} > /dev/null
+ then
+ ${CURL} -L --fail -C - -O ${URL} || die "Failed to download ${PKG}."
diff --git a/tools/cabal-install/cabal-install.spec b/tools/cabal-install/cabal-install.spec
new file mode 100644
index 0000000..d15c9f6
--- /dev/null
+++ b/tools/cabal-install/cabal-install.spec
@@ -0,0 +1,75 @@
+Name: cabal-install
+Version: 1.18.0.2
+Release: 1%{?dist}
+Summary: The command-line interface for Cabal and Hackage
+
+License: BSD
+Group: Development/Tools
+URL: http://hackage.haskell.org/package/%{name}
+Source0: http://hackage.haskell.org/packages/archive/%{name}/%{version}/%{name}-%{version}.tar.gz
+Patch0: cabal-install-1.18.0.2-bootstrap-hackage-url.patch
+
+BuildRequires: ghc-Cabal-devel
+#BuildRequires: ghc-rpm-macros
+# Begin cabal-rpm deps:
+#BuildRequires: ghc-HTTP-devel
+BuildRequires: ghc-array-devel
+BuildRequires: ghc-bytestring-devel
+BuildRequires: ghc-containers-devel
+BuildRequires: ghc-directory-devel
+BuildRequires: ghc-filepath-devel
+#BuildRequires: ghc-mtl-devel
+#BuildRequires: ghc-network-devel
+BuildRequires: ghc-old-time-devel
+BuildRequires: ghc-pretty-devel
+BuildRequires: ghc-process-devel
+#BuildRequires: ghc-random-devel
+#BuildRequires: ghc-stm-devel
+BuildRequires: ghc-time-devel
+BuildRequires: ghc-unix-devel
+#BuildRequires: ghc-zlib-devel
+# End cabal-rpm deps
+BuildRequires: zlib-devel%{?_isa}
+BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
+
+%description
+The 'cabal' command-line program simplifies the process of managing Haskell
+software by automating the fetching, configuration, compilation and
+installation of Haskell libraries and programs.
+
+The program is statically linked to Haskell libraries.
+
+
+%global cabal ./dist/build/cabal/cabal
+
+
+%prep
+%setup -q
+%patch0 -p1 -b .orig
+
+
+%build
+# bootstrap ghc-pkg registers deps
+HOME=$PWD
+sh bootstrap.sh
+%cabal configure --prefix=%{_prefix} --libdir=%{_libdir} --docdir=%{?_pkgdocdir}%{!?_pkgdocdir:%{_docdir}/%{name}-%{version}}
+
+
+%install
+rm -rf %{buildroot}
+%cabal copy --destdir=%{buildroot} -v
+
+
+%clean
+rm -rf %{buildroot}
+
+
+%files
+%defattr(-,root,root,-)
+%doc LICENSE README
+%{_bindir}/cabal
+
+
+%changelog
+* Sat Jan 25 2014 Jens Petersen <petersen@redhat.com> - 1.18.0.2-1
+- build with bootstrap.sh patched for downloading from hackage2
diff --git a/tools/gcc44/gcc44.spec b/tools/gcc44/gcc44.spec
new file mode 100644
index 0000000..b7c0610
--- /dev/null
+++ b/tools/gcc44/gcc44.spec
@@ -0,0 +1,29 @@
+Summary: Dummy gcc44 package for RHEL6
+Name: gcc44
+Version: 1
+Release: 1
+License: GPlv3+
+Requires: gcc
+BuildArch: noarch
+
+%description
+This is a dummy package to allow installing
+development packages that require RHEL5 gcc44.
+
+%prep
+%{nil}
+
+%build
+%{nil}
+
+%install
+mkdir -p %{buildroot}%{_bindir}
+ln -s gcc %{buildroot}%{_bindir}/gcc44
+
+%files
+%defattr(-,root,root,-)
+%{_bindir}/gcc44
+
+%changelog
+* Sun Feb 2 2014 Jens Petersen <petersen@fedoraproject.org> - 1-1
+- Initial build.
diff --git a/tools/ghc-primitive/ghc-primitive.spec b/tools/ghc-primitive/ghc-primitive.spec
new file mode 100644
index 0000000..fa7b54c
--- /dev/null
+++ b/tools/ghc-primitive/ghc-primitive.spec
@@ -0,0 +1,84 @@
+# https://fedoraproject.org/wiki/Packaging:Haskell
+# https://fedoraproject.org/wiki/PackagingDrafts/Haskell
+
+%global pkg_name primitive
+
+%global common_summary Primitive memory-related operations
+
+%global common_description This package provides various primitive memory-related operations.
+
+Name: ghc-%{pkg_name}
+Version: 0.5.0.1
+Release: 2%{?dist}
+Summary: %{common_summary}
+
+Group: System/Libraries
+License: BSD
+URL: http://hackage.haskell.org/package/%{pkg_name}
+Source0: http://hackage.haskell.org/packages/archive/%{pkg_name}/%{version}/%{pkg_name}-%{version}.tar.gz
+
+BuildRequires: ghc-Cabal-devel
+BuildRequires: ghc-rpm-macros
+BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
+
+
+%description
+%{common_description}
+
+
+%prep
+%setup -q -n %{pkg_name}-%{version}
+
+
+%build
+%ghc_lib_build
+
+
+%install
+%ghc_lib_install
+
+
+%ghc_devel_package
+
+%ghc_devel_description
+
+
+%ghc_devel_post_postun
+
+
+%ghc_files LICENSE
+
+
+%changelog
+* Wed Feb 13 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.5.0.1-2
+- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild
+
+* Tue Nov 27 2012 Jens Petersen <petersen@redhat.com> - 0.5.0.1-1
+- update to 0.5.0.1
+
+* Sat Nov 17 2012 Jens Petersen <petersen@redhat.com>
+- update with cabal-rpm
+
+* Thu Jul 19 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.4.1-3
+- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild
+
+* Mon Jul 16 2012 Jens Petersen <petersen@redhat.com> - 0.4.1-2
+- change prof BRs to devel
+
+* Thu Mar 22 2012 Jens Petersen <petersen@redhat.com> - 0.4.1-1
+- update to 0.4.1
+
+* Wed Jan 4 2012 Jens Petersen <petersen@redhat.com> - 0.4.0.1-1
+- update to 0.4.0.1 and cabal2spec-0.25.2
+
+* Mon Oct 24 2011 Marcela Mašláňová <mmaslano@redhat.com> - 0.3.1-2.1
+- rebuild with new gmp without compat lib
+
+* Tue Sep 13 2011 Jens Petersen <petersen@redhat.com> - 0.3.1-2
+- rebuild against newer ghc-rpm-macros
+
+* Thu Sep 8 2011 Jens Petersen <petersen@redhat.com> - 0.3.1-1
+- BSD license
+
+* Thu Sep 8 2011 Fedora Haskell SIG <haskell-devel@lists.fedoraproject.org> - 0.3.1-0
+- initial packaging for Fedora automatically generated by cabal2spec-0.24.1
diff --git a/tools/ghc-rpm-macros/AUTHORS b/tools/ghc-rpm-macros/AUTHORS
new file mode 100644
index 0000000..adc72fc
--- /dev/null
+++ b/tools/ghc-rpm-macros/AUTHORS
@@ -0,0 +1,7 @@
+Maintainer:
+Jens Petersen <petersen@redhat.com>
+
+Initial implementation:
+Bryan O'Sullivan
+Jens Petersen
+Yaakov Nemoy
diff --git a/tools/ghc-rpm-macros/COPYING b/tools/ghc-rpm-macros/COPYING
new file mode 100644
index 0000000..94a9ed0
--- /dev/null
+++ b/tools/ghc-rpm-macros/COPYING
@@ -0,0 +1,674 @@
+ GNU GENERAL PUBLIC LICENSE
+ Version 3, 29 June 2007
+
+ Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+ Preamble
+
+ The GNU General Public License is a free, copyleft license for
+software and other kinds of works.
+
+ The licenses for most software and other practical works are designed
+to take away your freedom to share and change the works. By contrast,
+the GNU General Public License is intended to guarantee your freedom to
+share and change all versions of a program--to make sure it remains free
+software for all its users. We, the Free Software Foundation, use the
+GNU General Public License for most of our software; it applies also to
+any other work released this way by its authors. You can apply it to
+your programs, too.
+
+ When we speak of free software, we are referring to freedom, not
+price. Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+them if you wish), that you receive source code or can get it if you
+want it, that you can change the software or use pieces of it in new
+free programs, and that you know you can do these things.
+
+ To protect your rights, we need to prevent others from denying you
+these rights or asking you to surrender the rights. Therefore, you have
+certain responsibilities if you distribute copies of the software, or if
+you modify it: responsibilities to respect the freedom of others.
+
+ For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must pass on to the recipients the same
+freedoms that you received. You must make sure that they, too, receive
+or can get the source code. And you must show them these terms so they
+know their rights.
+
+ Developers that use the GNU GPL protect your rights with two steps:
+(1) assert copyright on the software, and (2) offer you this License
+giving you legal permission to copy, distribute and/or modify it.
+
+ For the developers' and authors' protection, the GPL clearly explains
+that there is no warranty for this free software. For both users' and
+authors' sake, the GPL requires that modified versions be marked as
+changed, so that their problems will not be attributed erroneously to
+authors of previous versions.
+
+ Some devices are designed to deny users access to install or run
+modified versions of the software inside them, although the manufacturer
+can do so. This is fundamentally incompatible with the aim of
+protecting users' freedom to change the software. The systematic
+pattern of such abuse occurs in the area of products for individuals to
+use, which is precisely where it is most unacceptable. Therefore, we
+have designed this version of the GPL to prohibit the practice for those
+products. If such problems arise substantially in other domains, we
+stand ready to extend this provision to those domains in future versions
+of the GPL, as needed to protect the freedom of users.
+
+ Finally, every program is threatened constantly by software patents.
+States should not allow patents to restrict development and use of
+software on general-purpose computers, but in those that do, we wish to
+avoid the special danger that patents applied to a free program could
+make it effectively proprietary. To prevent this, the GPL assures that
+patents cannot be used to render the program non-free.
+
+ The precise terms and conditions for copying, distribution and
+modification follow.
+
+ TERMS AND CONDITIONS
+
+ 0. Definitions.
+
+ "This License" refers to version 3 of the GNU General Public License.
+
+ "Copyright" also means copyright-like laws that apply to other kinds of
+works, such as semiconductor masks.
+
+ "The Program" refers to any copyrightable work licensed under this
+License. Each licensee is addressed as "you". "Licensees" and
+"recipients" may be individuals or organizations.
+
+ To "modify" a work means to copy from or adapt all or part of the work
+in a fashion requiring copyright permission, other than the making of an
+exact copy. The resulting work is called a "modified version" of the
+earlier work or a work "based on" the earlier work.
+
+ A "covered work" means either the unmodified Program or a work based
+on the Program.
+
+ To "propagate" a work means to do anything with it that, without
+permission, would make you directly or secondarily liable for
+infringement under applicable copyright law, except executing it on a
+computer or modifying a private copy. Propagation includes copying,
+distribution (with or without modification), making available to the
+public, and in some countries other activities as well.
+
+ To "convey" a work means any kind of propagation that enables other
+parties to make or receive copies. Mere interaction with a user through
+a computer network, with no transfer of a copy, is not conveying.
+
+ An interactive user interface displays "Appropriate Legal Notices"
+to the extent that it includes a convenient and prominently visible
+feature that (1) displays an appropriate copyright notice, and (2)
+tells the user that there is no warranty for the work (except to the
+extent that warranties are provided), that licensees may convey the
+work under this License, and how to view a copy of this License. If
+the interface presents a list of user commands or options, such as a
+menu, a prominent item in the list meets this criterion.
+
+ 1. Source Code.
+
+ The "source code" for a work means the preferred form of the work
+for making modifications to it. "Object code" means any non-source
+form of a work.
+
+ A "Standard Interface" means an interface that either is an official
+standard defined by a recognized standards body, or, in the case of
+interfaces specified for a particular programming language, one that
+is widely used among developers working in that language.
+
+ The "System Libraries" of an executable work include anything, other
+than the work as a whole, that (a) is included in the normal form of
+packaging a Major Component, but which is not part of that Major
+Component, and (b) serves only to enable use of the work with that
+Major Component, or to implement a Standard Interface for which an
+implementation is available to the public in source code form. A
+"Major Component", in this context, means a major essential component
+(kernel, window system, and so on) of the specific operating system
+(if any) on which the executable work runs, or a compiler used to
+produce the work, or an object code interpreter used to run it.
+
+ The "Corresponding Source" for a work in object code form means all
+the source code needed to generate, install, and (for an executable
+work) run the object code and to modify the work, including scripts to
+control those activities. However, it does not include the work's
+System Libraries, or general-purpose tools or generally available free
+programs which are used unmodified in performing those activities but
+which are not part of the work. For example, Corresponding Source
+includes interface definition files associated with source files for
+the work, and the source code for shared libraries and dynamically
+linked subprograms that the work is specifically designed to require,
+such as by intimate data communication or control flow between those
+subprograms and other parts of the work.
+
+ The Corresponding Source need not include anything that users
+can regenerate automatically from other parts of the Corresponding
+Source.
+
+ The Corresponding Source for a work in source code form is that
+same work.
+
+ 2. Basic Permissions.
+
+ All rights granted under this License are granted for the term of
+copyright on the Program, and are irrevocable provided the stated
+conditions are met. This License explicitly affirms your unlimited
+permission to run the unmodified Program. The output from running a
+covered work is covered by this License only if the output, given its
+content, constitutes a covered work. This License acknowledges your
+rights of fair use or other equivalent, as provided by copyright law.
+
+ You may make, run and propagate covered works that you do not
+convey, without conditions so long as your license otherwise remains
+in force. You may convey covered works to others for the sole purpose
+of having them make modifications exclusively for you, or provide you
+with facilities for running those works, provided that you comply with
+the terms of this License in conveying all material for which you do
+not control copyright. Those thus making or running the covered works
+for you must do so exclusively on your behalf, under your direction
+and control, on terms that prohibit them from making any copies of
+your copyrighted material outside their relationship with you.
+
+ Conveying under any other circumstances is permitted solely under
+the conditions stated below. Sublicensing is not allowed; section 10
+makes it unnecessary.
+
+ 3. Protecting Users' Legal Rights From Anti-Circumvention Law.
+
+ No covered work shall be deemed part of an effective technological
+measure under any applicable law fulfilling obligations under article
+11 of the WIPO copyright treaty adopted on 20 December 1996, or
+similar laws prohibiting or restricting circumvention of such
+measures.
+
+ When you convey a covered work, you waive any legal power to forbid
+circumvention of technological measures to the extent such circumvention
+is effected by exercising rights under this License with respect to
+the covered work, and you disclaim any intention to limit operation or
+modification of the work as a means of enforcing, against the work's
+users, your or third parties' legal rights to forbid circumvention of
+technological measures.
+
+ 4. Conveying Verbatim Copies.
+
+ You may convey verbatim copies of the Program's source code as you
+receive it, in any medium, provided that you conspicuously and
+appropriately publish on each copy an appropriate copyright notice;
+keep intact all notices stating that this License and any
+non-permissive terms added in accord with section 7 apply to the code;
+keep intact all notices of the absence of any warranty; and give all
+recipients a copy of this License along with the Program.
+
+ You may charge any price or no price for each copy that you convey,
+and you may offer support or warranty protection for a fee.
+
+ 5. Conveying Modified Source Versions.
+
+ You may convey a work based on the Program, or the modifications to
+produce it from the Program, in the form of source code under the
+terms of section 4, provided that you also meet all of these conditions:
+
+ a) The work must carry prominent notices stating that you modified
+ it, and giving a relevant date.
+
+ b) The work must carry prominent notices stating that it is
+ released under this License and any conditions added under section
+ 7. This requirement modifies the requirement in section 4 to
+ "keep intact all notices".
+
+ c) You must license the entire work, as a whole, under this
+ License to anyone who comes into possession of a copy. This
+ License will therefore apply, along with any applicable section 7
+ additional terms, to the whole of the work, and all its parts,
+ regardless of how they are packaged. This License gives no
+ permission to license the work in any other way, but it does not
+ invalidate such permission if you have separately received it.
+
+ d) If the work has interactive user interfaces, each must display
+ Appropriate Legal Notices; however, if the Program has interactive
+ interfaces that do not display Appropriate Legal Notices, your
+ work need not make them do so.
+
+ A compilation of a covered work with other separate and independent
+works, which are not by their nature extensions of the covered work,
+and which are not combined with it such as to form a larger program,
+in or on a volume of a storage or distribution medium, is called an
+"aggregate" if the compilation and its resulting copyright are not
+used to limit the access or legal rights of the compilation's users
+beyond what the individual works permit. Inclusion of a covered work
+in an aggregate does not cause this License to apply to the other
+parts of the aggregate.
+
+ 6. Conveying Non-Source Forms.
+
+ You may convey a covered work in object code form under the terms
+of sections 4 and 5, provided that you also convey the
+machine-readable Corresponding Source under the terms of this License,
+in one of these ways:
+
+ a) Convey the object code in, or embodied in, a physical product
+ (including a physical distribution medium), accompanied by the
+ Corresponding Source fixed on a durable physical medium
+ customarily used for software interchange.
+
+ b) Convey the object code in, or embodied in, a physical product
+ (including a physical distribution medium), accompanied by a
+ written offer, valid for at least three years and valid for as
+ long as you offer spare parts or customer support for that product
+ model, to give anyone who possesses the object code either (1) a
+ copy of the Corresponding Source for all the software in the
+ product that is covered by this License, on a durable physical
+ medium customarily used for software interchange, for a price no
+ more than your reasonable cost of physically performing this
+ conveying of source, or (2) access to copy the
+ Corresponding Source from a network server at no charge.
+
+ c) Convey individual copies of the object code with a copy of the
+ written offer to provide the Corresponding Source. This
+ alternative is allowed only occasionally and noncommercially, and
+ only if you received the object code with such an offer, in accord
+ with subsection 6b.
+
+ d) Convey the object code by offering access from a designated
+ place (gratis or for a charge), and offer equivalent access to the
+ Corresponding Source in the same way through the same place at no
+ further charge. You need not require recipients to copy the
+ Corresponding Source along with the object code. If the place to
+ copy the object code is a network server, the Corresponding Source
+ may be on a different server (operated by you or a third party)
+ that supports equivalent copying facilities, provided you maintain
+ clear directions next to the object code saying where to find the
+ Corresponding Source. Regardless of what server hosts the
+ Corresponding Source, you remain obligated to ensure that it is
+ available for as long as needed to satisfy these requirements.
+
+ e) Convey the object code using peer-to-peer transmission, provided
+ you inform other peers where the object code and Corresponding
+ Source of the work are being offered to the general public at no
+ charge under subsection 6d.
+
+ A separable portion of the object code, whose source code is excluded
+from the Corresponding Source as a System Library, need not be
+included in conveying the object code work.
+
+ A "User Product" is either (1) a "consumer product", which means any
+tangible personal property which is normally used for personal, family,
+or household purposes, or (2) anything designed or sold for incorporation
+into a dwelling. In determining whether a product is a consumer product,
+doubtful cases shall be resolved in favor of coverage. For a particular
+product received by a particular user, "normally used" refers to a
+typical or common use of that class of product, regardless of the status
+of the particular user or of the way in which the particular user
+actually uses, or expects or is expected to use, the product. A product
+is a consumer product regardless of whether the product has substantial
+commercial, industrial or non-consumer uses, unless such uses represent
+the only significant mode of use of the product.
+
+ "Installation Information" for a User Product means any methods,
+procedures, authorization keys, or other information required to install
+and execute modified versions of a covered work in that User Product from
+a modified version of its Corresponding Source. The information must
+suffice to ensure that the continued functioning of the modified object
+code is in no case prevented or interfered with solely because
+modification has been made.
+
+ If you convey an object code work under this section in, or with, or
+specifically for use in, a User Product, and the conveying occurs as
+part of a transaction in which the right of possession and use of the
+User Product is transferred to the recipient in perpetuity or for a
+fixed term (regardless of how the transaction is characterized), the
+Corresponding Source conveyed under this section must be accompanied
+by the Installation Information. But this requirement does not apply
+if neither you nor any third party retains the ability to install
+modified object code on the User Product (for example, the work has
+been installed in ROM).
+
+ The requirement to provide Installation Information does not include a
+requirement to continue to provide support service, warranty, or updates
+for a work that has been modified or installed by the recipient, or for
+the User Product in which it has been modified or installed. Access to a
+network may be denied when the modification itself materially and
+adversely affects the operation of the network or violates the rules and
+protocols for communication across the network.
+
+ Corresponding Source conveyed, and Installation Information provided,
+in accord with this section must be in a format that is publicly
+documented (and with an implementation available to the public in
+source code form), and must require no special password or key for
+unpacking, reading or copying.
+
+ 7. Additional Terms.
+
+ "Additional permissions" are terms that supplement the terms of this
+License by making exceptions from one or more of its conditions.
+Additional permissions that are applicable to the entire Program shall
+be treated as though they were included in this License, to the extent
+that they are valid under applicable law. If additional permissions
+apply only to part of the Program, that part may be used separately
+under those permissions, but the entire Program remains governed by
+this License without regard to the additional permissions.
+
+ When you convey a copy of a covered work, you may at your option
+remove any additional permissions from that copy, or from any part of
+it. (Additional permissions may be written to require their own
+removal in certain cases when you modify the work.) You may place
+additional permissions on material, added by you to a covered work,
+for which you have or can give appropriate copyright permission.
+
+ Notwithstanding any other provision of this License, for material you
+add to a covered work, you may (if authorized by the copyright holders of
+that material) supplement the terms of this License with terms:
+
+ a) Disclaiming warranty or limiting liability differently from the
+ terms of sections 15 and 16 of this License; or
+
+ b) Requiring preservation of specified reasonable legal notices or
+ author attributions in that material or in the Appropriate Legal
+ Notices displayed by works containing it; or
+
+ c) Prohibiting misrepresentation of the origin of that material, or
+ requiring that modified versions of such material be marked in
+ reasonable ways as different from the original version; or
+
+ d) Limiting the use for publicity purposes of names of licensors or
+ authors of the material; or
+
+ e) Declining to grant rights under trademark law for use of some
+ trade names, trademarks, or service marks; or
+
+ f) Requiring indemnification of licensors and authors of that
+ material by anyone who conveys the material (or modified versions of
+ it) with contractual assumptions of liability to the recipient, for
+ any liability that these contractual assumptions directly impose on
+ those licensors and authors.
+
+ All other non-permissive additional terms are considered "further
+restrictions" within the meaning of section 10. If the Program as you
+received it, or any part of it, contains a notice stating that it is
+governed by this License along with a term that is a further
+restriction, you may remove that term. If a license document contains
+a further restriction but permits relicensing or conveying under this
+License, you may add to a covered work material governed by the terms
+of that license document, provided that the further restriction does
+not survive such relicensing or conveying.
+
+ If you add terms to a covered work in accord with this section, you
+must place, in the relevant source files, a statement of the
+additional terms that apply to those files, or a notice indicating
+where to find the applicable terms.
+
+ Additional terms, permissive or non-permissive, may be stated in the
+form of a separately written license, or stated as exceptions;
+the above requirements apply either way.
+
+ 8. Termination.
+
+ You may not propagate or modify a covered work except as expressly
+provided under this License. Any attempt otherwise to propagate or
+modify it is void, and will automatically terminate your rights under
+this License (including any patent licenses granted under the third
+paragraph of section 11).
+
+ However, if you cease all violation of this License, then your
+license from a particular copyright holder is reinstated (a)
+provisionally, unless and until the copyright holder explicitly and
+finally terminates your license, and (b) permanently, if the copyright
+holder fails to notify you of the violation by some reasonable means
+prior to 60 days after the cessation.
+
+ Moreover, your license from a particular copyright holder is
+reinstated permanently if the copyright holder notifies you of the
+violation by some reasonable means, this is the first time you have
+received notice of violation of this License (for any work) from that
+copyright holder, and you cure the violation prior to 30 days after
+your receipt of the notice.
+
+ Termination of your rights under this section does not terminate the
+licenses of parties who have received copies or rights from you under
+this License. If your rights have been terminated and not permanently
+reinstated, you do not qualify to receive new licenses for the same
+material under section 10.
+
+ 9. Acceptance Not Required for Having Copies.
+
+ You are not required to accept this License in order to receive or
+run a copy of the Program. Ancillary propagation of a covered work
+occurring solely as a consequence of using peer-to-peer transmission
+to receive a copy likewise does not require acceptance. However,
+nothing other than this License grants you permission to propagate or
+modify any covered work. These actions infringe copyright if you do
+not accept this License. Therefore, by modifying or propagating a
+covered work, you indicate your acceptance of this License to do so.
+
+ 10. Automatic Licensing of Downstream Recipients.
+
+ Each time you convey a covered work, the recipient automatically
+receives a license from the original licensors, to run, modify and
+propagate that work, subject to this License. You are not responsible
+for enforcing compliance by third parties with this License.
+
+ An "entity transaction" is a transaction transferring control of an
+organization, or substantially all assets of one, or subdividing an
+organization, or merging organizations. If propagation of a covered
+work results from an entity transaction, each party to that
+transaction who receives a copy of the work also receives whatever
+licenses to the work the party's predecessor in interest had or could
+give under the previous paragraph, plus a right to possession of the
+Corresponding Source of the work from the predecessor in interest, if
+the predecessor has it or can get it with reasonable efforts.
+
+ You may not impose any further restrictions on the exercise of the
+rights granted or affirmed under this License. For example, you may
+not impose a license fee, royalty, or other charge for exercise of
+rights granted under this License, and you may not initiate litigation
+(including a cross-claim or counterclaim in a lawsuit) alleging that
+any patent claim is infringed by making, using, selling, offering for
+sale, or importing the Program or any portion of it.
+
+ 11. Patents.
+
+ A "contributor" is a copyright holder who authorizes use under this
+License of the Program or a work on which the Program is based. The
+work thus licensed is called the contributor's "contributor version".
+
+ A contributor's "essential patent claims" are all patent claims
+owned or controlled by the contributor, whether already acquired or
+hereafter acquired, that would be infringed by some manner, permitted
+by this License, of making, using, or selling its contributor version,
+but do not include claims that would be infringed only as a
+consequence of further modification of the contributor version. For
+purposes of this definition, "control" includes the right to grant
+patent sublicenses in a manner consistent with the requirements of
+this License.
+
+ Each contributor grants you a non-exclusive, worldwide, royalty-free
+patent license under the contributor's essential patent claims, to
+make, use, sell, offer for sale, import and otherwise run, modify and
+propagate the contents of its contributor version.
+
+ In the following three paragraphs, a "patent license" is any express
+agreement or commitment, however denominated, not to enforce a patent
+(such as an express permission to practice a patent or covenant not to
+sue for patent infringement). To "grant" such a patent license to a
+party means to make such an agreement or commitment not to enforce a
+patent against the party.
+
+ If you convey a covered work, knowingly relying on a patent license,
+and the Corresponding Source of the work is not available for anyone
+to copy, free of charge and under the terms of this License, through a
+publicly available network server or other readily accessible means,
+then you must either (1) cause the Corresponding Source to be so
+available, or (2) arrange to deprive yourself of the benefit of the
+patent license for this particular work, or (3) arrange, in a manner
+consistent with the requirements of this License, to extend the patent
+license to downstream recipients. "Knowingly relying" means you have
+actual knowledge that, but for the patent license, your conveying the
+covered work in a country, or your recipient's use of the covered work
+in a country, would infringe one or more identifiable patents in that
+country that you have reason to believe are valid.
+
+ If, pursuant to or in connection with a single transaction or
+arrangement, you convey, or propagate by procuring conveyance of, a
+covered work, and grant a patent license to some of the parties
+receiving the covered work authorizing them to use, propagate, modify
+or convey a specific copy of the covered work, then the patent license
+you grant is automatically extended to all recipients of the covered
+work and works based on it.
+
+ A patent license is "discriminatory" if it does not include within
+the scope of its coverage, prohibits the exercise of, or is
+conditioned on the non-exercise of one or more of the rights that are
+specifically granted under this License. You may not convey a covered
+work if you are a party to an arrangement with a third party that is
+in the business of distributing software, under which you make payment
+to the third party based on the extent of your activity of conveying
+the work, and under which the third party grants, to any of the
+parties who would receive the covered work from you, a discriminatory
+patent license (a) in connection with copies of the covered work
+conveyed by you (or copies made from those copies), or (b) primarily
+for and in connection with specific products or compilations that
+contain the covered work, unless you entered into that arrangement,
+or that patent license was granted, prior to 28 March 2007.
+
+ Nothing in this License shall be construed as excluding or limiting
+any implied license or other defenses to infringement that may
+otherwise be available to you under applicable patent law.
+
+ 12. No Surrender of Others' Freedom.
+
+ If conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License. If you cannot convey a
+covered work so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you may
+not convey it at all. For example, if you agree to terms that obligate you
+to collect a royalty for further conveying from those to whom you convey
+the Program, the only way you could satisfy both those terms and this
+License would be to refrain entirely from conveying the Program.
+
+ 13. Use with the GNU Affero General Public License.
+
+ Notwithstanding any other provision of this License, you have
+permission to link or combine any covered work with a work licensed
+under version 3 of the GNU Affero General Public License into a single
+combined work, and to convey the resulting work. The terms of this
+License will continue to apply to the part which is the covered work,
+but the special requirements of the GNU Affero General Public License,
+section 13, concerning interaction through a network will apply to the
+combination as such.
+
+ 14. Revised Versions of this License.
+
+ The Free Software Foundation may publish revised and/or new versions of
+the GNU General Public License from time to time. Such new versions will
+be similar in spirit to the present version, but may differ in detail to
+address new problems or concerns.
+
+ Each version is given a distinguishing version number. If the
+Program specifies that a certain numbered version of the GNU General
+Public License "or any later version" applies to it, you have the
+option of following the terms and conditions either of that numbered
+version or of any later version published by the Free Software
+Foundation. If the Program does not specify a version number of the
+GNU General Public License, you may choose any version ever published
+by the Free Software Foundation.
+
+ If the Program specifies that a proxy can decide which future
+versions of the GNU General Public License can be used, that proxy's
+public statement of acceptance of a version permanently authorizes you
+to choose that version for the Program.
+
+ Later license versions may give you additional or different
+permissions. However, no additional obligations are imposed on any
+author or copyright holder as a result of your choosing to follow a
+later version.
+
+ 15. Disclaimer of Warranty.
+
+ THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
+APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
+HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
+OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
+THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
+IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
+ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
+
+ 16. Limitation of Liability.
+
+ IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
+THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
+GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
+USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
+DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
+PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
+EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
+SUCH DAMAGES.
+
+ 17. Interpretation of Sections 15 and 16.
+
+ If the disclaimer of warranty and limitation of liability provided
+above cannot be given local legal effect according to their terms,
+reviewing courts shall apply local law that most closely approximates
+an absolute waiver of all civil liability in connection with the
+Program, unless a warranty or assumption of liability accompanies a
+copy of the Program in return for a fee.
+
+ END OF TERMS AND CONDITIONS
+
+ How to Apply These Terms to Your New Programs
+
+ If you develop a new program, and you want it to be of the greatest
+possible use to the public, the best way to achieve this is to make it
+free software which everyone can redistribute and change under these terms.
+
+ To do so, attach the following notices to the program. It is safest
+to attach them to the start of each source file to most effectively
+state the exclusion of warranty; and each file should have at least
+the "copyright" line and a pointer to where the full notice is found.
+
+ <one line to give the program's name and a brief idea of what it does.>
+ Copyright (C) <year> <name of author>
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+Also add information on how to contact you by electronic and paper mail.
+
+ If the program does terminal interaction, make it output a short
+notice like this when it starts in an interactive mode:
+
+ <program> Copyright (C) <year> <name of author>
+ This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
+ This is free software, and you are welcome to redistribute it
+ under certain conditions; type `show c' for details.
+
+The hypothetical commands `show w' and `show c' should show the appropriate
+parts of the General Public License. Of course, your program's commands
+might be different; for a GUI interface, you would use an "about box".
+
+ You should also get your employer (if you work as a programmer) or school,
+if any, to sign a "copyright disclaimer" for the program, if necessary.
+For more information on this, and how to apply and follow the GNU GPL, see
+<http://www.gnu.org/licenses/>.
+
+ The GNU General Public License does not permit incorporating your program
+into proprietary programs. If your program is a subroutine library, you
+may consider it more useful to permit linking proprietary applications with
+the library. If this is what you want to do, use the GNU Lesser General
+Public License instead of this License. But first, please read
+<http://www.gnu.org/philosophy/why-not-lgpl.html>.
diff --git a/tools/ghc-rpm-macros/cabal-tweak-dep-ver b/tools/ghc-rpm-macros/cabal-tweak-dep-ver
new file mode 100755
index 0000000..525b786
--- /dev/null
+++ b/tools/ghc-rpm-macros/cabal-tweak-dep-ver
@@ -0,0 +1,34 @@
+#!/bin/sh
+
+set -e +x
+
+USAGE="Usage: $0 dep old new"
+
+if [ $# -ne 3 ]; then
+ echo "$USAGE"
+ exit 1
+fi
+
+DEP=$1
+OLD=$(echo $2 | sed -e "s/*/\\\\*/g" -e "s/\./\\\\./g")
+NEW=$3
+
+CABALFILE=$(ls *.cabal)
+
+if [ $(echo $CABALFILE | wc -w) -ne 1 ]; then
+ echo "There needs to be one .cabal file in the current dir!"
+ exit 1
+fi
+
+BREAK=[^[:alnum:]-]
+
+if ! grep -q "$BREAK$DEP$BREAK[^,]*$OLD" $CABALFILE; then
+ echo "$CABALFILE does not match: $DEP $OLD"
+ exit 1
+fi
+
+if [ ! -f $CABALFILE.orig ]; then
+ BACKUP=.orig
+fi
+
+sed -i$BACKUP -e "s/\($BREAK$DEP$BREAK[^,]*\)$OLD/\1$NEW/g" $CABALFILE
diff --git a/tools/ghc-rpm-macros/cabal-tweak-flag b/tools/ghc-rpm-macros/cabal-tweak-flag
new file mode 100755
index 0000000..2db3a72
--- /dev/null
+++ b/tools/ghc-rpm-macros/cabal-tweak-flag
@@ -0,0 +1,50 @@
+#!/bin/sh
+
+# TODO:
+# support setting flag when no upstream default
+
+set -e +x
+
+USAGE="Usage: $0 FLAG [True|False]"
+
+if [ $# -ne 2 ]; then
+ echo "$USAGE"
+ exit 1
+fi
+
+FLAG=$1
+
+NEW=$2
+case $NEW in
+ True) OLD=False ;;
+ False) OLD=True ;;
+ *) echo "Flag value can only be set to True or False" ; exit 1 ;;
+esac
+
+CABALFILE=$(ls *.cabal)
+
+if [ $(echo $CABALFILE | wc -w) -ne 1 ]; then
+ echo "There needs to be one .cabal file in the current dir!"
+ exit 1
+fi
+
+if ! grep -q -i "^flag *$FLAG" $CABALFILE; then
+ echo "$CABALFILE does have flag $FLAG"
+ exit 1
+fi
+
+if ! grep -A3 -i "^flag *$FLAG" $CABALFILE | grep -q -i "default:"; then
+ echo "$CABALFILE: $FLAG flag might not have a default"
+ exit 1
+fi
+
+if ! grep -A3 -i "^flag *$FLAG" $CABALFILE | grep -q -i "default: *$OLD"; then
+ echo "$CABALFILE: $FLAG flag already defaults to $NEW"
+ exit 1
+fi
+
+if [ ! -f $CABALFILE.orig ]; then
+ BACKUP=.orig
+fi
+
+sed -i$BACKUP -e "/[Ff]lag *$FLAG/,/[Dd]efault: *$OLD/ s/\([Dd]efault: *\)$OLD/\1$NEW/" $CABALFILE
diff --git a/tools/ghc-rpm-macros/ghc-deps.sh b/tools/ghc-rpm-macros/ghc-deps.sh
new file mode 100755
index 0000000..4c164d0
--- /dev/null
+++ b/tools/ghc-rpm-macros/ghc-deps.sh
@@ -0,0 +1,84 @@
+#!/bin/sh
+# find rpm provides and requires for Haskell GHC libraries
+
+# To use add the following lines to spec file:
+# %define _use_internal_dependency_generator 0
+# %define __find_requires /usr/lib/rpm/ghc-deps.sh --requires %{buildroot}%{ghclibdir}
+# %define __find_provides /usr/lib/rpm/ghc-deps.sh --provides %{buildroot}%{ghclibdir}
+
+[ $# -ne 2 ] && echo "Usage: `basename $0` [--provides|--requires] %{buildroot}%{ghclibdir}" && exit 1
+
+MODE=$1
+PKGBASEDIR=$2
+PKGCONFDIR=$PKGBASEDIR/package.conf.d
+GHC_VER=$(basename $PKGBASEDIR | sed -e s/ghc-//)
+
+if [ ! -x "/usr/bin/ghc-pkg-${GHC_VER}" -a -x "$PKGBASEDIR/ghc-pkg" ]; then
+ GHC_PKG="$PKGBASEDIR/ghc-pkg --global-conf=$PKGCONFDIR"
+else
+ GHC_PKG="/usr/bin/ghc-pkg"
+fi
+
+case $MODE in
+ --provides) FIELD=id ;;
+ --requires) FIELD=depends ;;
+ *) echo "`basename $0`: Need --provides or --requires" ; exit 1
+esac
+
+if [ -d "$PKGBASEDIR" ]; then
+ SHARED=$(find $PKGBASEDIR -type f -name '*.so')
+fi
+
+GHCVERSION=$(ghc --numeric-version)
+
+files=$(cat)
+
+#set -x
+
+for i in $files; do
+ LIB_FILE=$(echo $i | grep /libHS | egrep -v "$PKGBASEDIR/libHS")
+ if [ "$LIB_FILE" ]; then
+ if [ -d "$PKGCONFDIR" ]; then
+ META=""
+ SELF=""
+ case $LIB_FILE in
+ *.so) META=ghc ;;
+ *_p.a) META=ghc-prof SELF=ghc-devel ;;
+ *.a) META=ghc-devel
+ if [ "$SHARED" ]; then
+ SELF=ghc
+ fi
+ ;;
+ esac
+ if [ "$META" ]; then
+ PKGVER=$(echo $LIB_FILE | sed -e "s%$PKGBASEDIR/\([^/]\+\)/libHS.*%\1%")
+ HASHS=$(${GHC_PKG} -f $PKGCONFDIR field $PKGVER $FIELD | sed -e "s/^$FIELD: \+//")
+ for i in $HASHS; do
+ case $i in
+ *-*) echo $i | sed -e "s/\(.*\)-\(.*\)/$META(\1) = \2/" ;;
+ *) ;;
+ esac
+ done
+ if [ "$MODE" = "--requires" -a "$SELF" ]; then
+ HASHS=$(${GHC_PKG} -f $PKGCONFDIR field $PKGVER id | sed -e "s/^id: \+//")
+ for i in $HASHS; do
+ echo $i | sed -e "s/\(.*\)-\(.*\)/$SELF(\1) = \2/"
+ done
+ fi
+ fi
+ fi
+ elif [ "$MODE" = "--requires" ]; then
+ if file $i | grep -q 'executable, .* dynamically linked'; then
+ BIN_DEPS=$(ldd $i | grep libHS | grep -v libHSrts | sed -e "s%^\\tlibHS\(.*\)-ghc${GHCVERSION}.so =.*%\1%")
+ if [ -d "$PKGCONFDIR" ]; then
+ PACKAGE_CONF_OPT="--package-conf=$PKGCONFDIR"
+ fi
+ for p in ${BIN_DEPS}; do
+ HASH=$(${GHC_PKG} --global $PACKAGE_CONF_OPT field $p id | sed -e "s/^id: \+//")
+ echo $HASH | sed -e "s/\(.*\)-\(.*\)/ghc(\1) = \2/"
+ done
+ fi
+ fi
+done
+
+echo $files | tr [:blank:] '\n' | /usr/lib/rpm/rpmdeps $MODE
diff --git a/tools/ghc-rpm-macros/ghc-rpm-macros.ghc b/tools/ghc-rpm-macros/ghc-rpm-macros.ghc
new file mode 100644
index 0000000..3fee4c1
--- /dev/null
+++ b/tools/ghc-rpm-macros/ghc-rpm-macros.ghc
@@ -0,0 +1,303 @@
+# RPM Macros for packaging Haskell cabalized packages -*-rpm-spec-*-
+# see https://fedoraproject.org/wiki/Packaging:Haskell for more details
+
+# "cabal"
+%cabal [ -x Setup ] || ghc --make %{!?ghc_user_conf:-no-user-package-conf} %{!?ghc_without_dynamic:-dynamic} Setup\
+./Setup
+
+# check ghc version was rebuilt against self
+%ghc_check_bootstrap\
+if [ ! "$(ghc --info | grep \\"Booter\\ version\\",\\"%{ghc_version}\\")" ]; then\
+ echo "Warning: this ghc build is not self-bootstrapped."\
+%if %{undefined ghc_bootstrapping}\
+ echo "The ghc package should be rebuilt against its current version before\
+proceeding, to avoid dependency ABI breakage from a future ghc rebuild."\
+ echo "To override set ghc_bootstrapping."\
+ echo "Aborting."\
+ exit 1\
+%endif\
+fi
+
+# configure
+%cabal_configure\
+%ghc_check_bootstrap\
+%cabal configure --prefix=%{_prefix} --libdir=%{_libdir} --docdir=%{_docdir}/%{name}-%{version} %{?pkg_name:--htmldir=%{ghclibdocdir}/%{pkg_name}-%{version}} --libsubdir='$compiler/$pkgid' --ghc %{!?ghc_without_dynamic:--enable-executable-dynamic} %{?cabal_configure_options} $cabal_configure_extra_options
+
+# install
+%cabal_install %cabal copy --destdir=%{buildroot} -v
+
+# root dir for ghc docs
+%ghcdocbasedir %{_docdir}/ghc/html
+# libraries doc dir
+%ghclibdocdir %{ghcdocbasedir}/libraries
+# pkg doc dir
+%ghcpkgdocdir %{ghcdocbasedir}/libraries/%{pkg_name}-%{version}
+# top library dir
+%ghclibdir %{_libdir}/ghc-%{ghc_version}
+
+# ghc_gen_filelists [name] [version]
+%ghc_gen_filelists()\
+%define pkgname %{?1}%{!?1:%{pkg_name}}\
+%define pkgver %{?2}%{!?2:%{version}}\
+%define pkgnamever %{pkgname}-%{pkgver}\
+%define basepkg ghc-%{pkgname}\
+%define pkgdir %{ghclibdir}/%{pkgnamever}\
+%define docdir %{ghclibdocdir}/%{pkgnamever}\
+rm -f %{basepkg}.files %{basepkg}-devel.files\
+if [ -d "%{buildroot}%{pkgdir}" ]; then\
+echo "%dir %{pkgdir}" >> %{basepkg}.files\
+%if %{undefined ghc_without_shared}\
+echo "%attr(755,root,root) %{pkgdir}/libHS%{pkgnamever}-ghc%{ghc_version}.so" >> %{basepkg}.files\
+%endif\
+fi\
+%if %{undefined ghc_exclude_docdir}\
+if [ -d "%{buildroot}%{_docdir}/%{name}-%{version}" ]; then\
+ echo "%{_docdir}/%{name}-%{version}" >> %{basepkg}.files\
+elif [ -d "%{buildroot}%{_docdir}/ghc-%{pkgnamever}" ]; then\
+ echo "%{_docdir}/ghc-%{pkgnamever}" >> %{basepkg}.files\
+fi\
+%endif\
+echo "%{ghclibdir}/package.conf.d/%{pkgnamever}*.conf" >> %{basepkg}-devel.files\
+if [ -d "%{buildroot}%{pkgdir}" ]; then\
+find %{buildroot}%{pkgdir} -mindepth 1 -type d | sed "s/^/%dir /" >> %{basepkg}-devel.files\
+find %{buildroot}%{pkgdir} ! \\( -type d -o -name "libHS*.so" \\) >> %{basepkg}-devel.files\
+fi\
+if [ -d "%{buildroot}%{docdir}" ]; then\
+echo "%{docdir}" >> %{basepkg}-devel.files\
+fi\
+for i in %{basepkg}.files %{basepkg}-devel.files; do\
+if [ -f "$i" ]; then\
+sed -i -e "s!%{buildroot}!!g" $i\
+fi\
+done\
+%{nil}
+
+%ghc_add_basepkg_file()\
+%define basepkg ghc-%{pkg_name}\
+echo "%*" >> %{basepkg}.files
+
+# compiler version
+%ghc_version %{!?ghc_version_override:%(ghc --numeric-version)}%{?ghc_version_override}
+
+# create and install package.conf file
+# cabal_pkg_conf [name] [version]
+%cabal_pkg_conf()\
+%define pkgname %{?1}%{!?1:%{pkg_name}}\
+%define pkgver %{?2}%{!?2:%{version}}\
+%define pkgnamever %{pkgname}-%{pkgver}\
+%cabal register --gen-pkg-config\
+mkdir -p %{buildroot}%{ghclibdir}/package.conf.d\
+install --mode=0644 %{pkgnamever}.conf %{buildroot}%{ghclibdir}/package.conf.d\
+%{nil}
+
+# devel pkg basic requires
+%ghc_devel_requires Requires: ghc-compiler = %{ghc_version}\
+Requires(post): ghc-compiler = %{ghc_version}\
+Requires(postun): ghc-compiler = %{ghc_version}\
+%if 0%{!?-m:1}\
+Requires: ghc-%{?pkg_name}%{!?pkg_name:%{pkgname}} = %{?pkgver}%{!?pkgver:%{version}}-%{release}\
+%endif
+
+%ghc_shared_files\
+%files -n %{basepkg} -f %{basepkg}.files\
+%defattr(-,root,root,-)\
+%{?base_doc_files:%doc %base_doc_files}\
+%{nil}
+
+# ghc_lib_package [-c cdepslist] [-h pkgdepslist]
+%ghc_lib_package(c:h:)\
+%define pkgname %{?1}%{!?1:%{pkg_name}}\
+%define basepkg ghc-%{pkgname}\
+%ghc_shared_files\
+\
+%ghc_package_devel\
+%{nil}
+
+# ghc_package [-l licensetag] [name] [version]
+%ghc_package(l:)\
+%define pkgname %{?1}%{!?1:%{pkg_name}}\
+%define pkgver %{?2}%{!?2:%{version}}\
+%define basepkg ghc-%{pkgname}\
+%package -n %{basepkg}\
+Summary: %{?common_summary}%{!?common_summary:Haskell %{pkgname} library}\
+Group: System Environment/Libraries\
+%{?1:Version: %{pkgver}}\
+%{-l:License: %{-l*}}\
+%{?ghc_pkg_obsoletes:Obsoletes: %(echo "%{ghc_pkg_obsoletes}" | sed -e "s/\\(ghc-[^, ]*\\)-devel/\\1/g")}
+
+# ghc_description [name] [version]
+%ghc_description()\
+%define pkgname %{?1}%{!?1:%{pkg_name}}\
+%define basepkg ghc-%{pkgname}\
+%description -n %{basepkg}\
+%{?common_description}%{!?common_description:Haskell %{pkgname} library.}\
+%if %{defined ghc_version} && %{undefined ghc_without_shared}\
+This package provides the shared library.\
+%endif
+
+# ghc_lib_subpackage [-c cdepslist] [-h pkgdepslist] [-l licensetag] [-x] [name] [version]
+%ghc_lib_subpackage(c:h:l:x)\
+%define pkgname %{?1}%{!?1:%{pkg_name}}\
+%define pkgver %{?2}%{!?2:%{version}}\
+%define pkgnamever %{pkgname}-%{pkgver}\
+%{!-x:%{?1:%global ghc_packages_list %{?ghc_packages_list} %{pkgnamever}}}\
+%define basepkg ghc-%{pkgname}\
+%ghc_package\
+\
+%ghc_description\
+\
+%ghc_lib_package\
+%{nil}
+
+# (deprecated) for docs post and postun
+%ghc_reindex_haddock :
+
+%ghc_devel_files\
+%files -n %{basepkg}-devel -f %{basepkg}-devel.files\
+%defattr(-,root,root,-)\
+%{?devel_doc_files:%doc %devel_doc_files}\
+%{nil}
+
+%ghc_files()\
+%{?1:%define base_doc_files %*}\
+%define basepkg ghc-%{pkg_name}\
+%ghc_shared_files\
+\
+%ghc_devel_files\
+%{nil}
+
+# ghc_devel_package [-c cdepslist] [-h pkgdepslist] [-l licensetag] [-m] [name] [version]
+# -m : meta-package
+%ghc_devel_package(c:h:l:m)\
+%define pkgname %{?1}%{!?1:%{pkg_name}}\
+%define pkgver %{?2}%{!?2:%{version}}\
+%define basepkg ghc-%{pkgname}\
+%package -n %{basepkg}-devel\
+Summary: %{?common_summary}%{!?common_summary:Haskell %{pkgname} library} development files\
+Group: Development/Libraries\
+%{?1:Version: %{pkgver}}\
+%{-l:License: %{-l*}}\
+%{?ghc_devel_requires}\
+%{-h:Requires: %{-h*}}\
+%{?ghc_pkg_c_deps:Requires: %{ghc_pkg_c_deps}}\
+%{-c:Requires: %{-c*}}\
+%{?ghc_pkg_obsoletes:Obsoletes: %{ghc_pkg_obsoletes}}\
+%{?ghc_pkg_obsoletes:Obsoletes: %(echo "%{ghc_pkg_obsoletes}" | sed -e "s/\\(ghc-[^, ]*\\)-devel/\\1-doc/g")}\
+Obsoletes: %{basepkg}-doc < %{pkgver}-%{release}\
+Provides: %{basepkg}-doc = %{pkgver}-%{release}\
+Obsoletes: %{basepkg}-prof < %{pkgver}-%{release}\
+%if %{undefined without_prof}\
+Provides: %{basepkg}-prof = %{pkgver}-%{release}\
+%endif
+
+# ghc_devel_description
+%ghc_devel_description()\
+%define pkgname %{?1}%{!?1:%{pkg_name}}\
+%define basepkg ghc-%{pkgname}\
+%description -n %{basepkg}-devel\
+%{?common_description}%{!?common_description:Haskell %{pkgname} library.}\
+\
+This package contains the development files.
+
+# ghc_devel_post_postun
+%ghc_devel_post_postun()\
+%define pkgname %{?1}%{!?1:%{pkg_name}}\
+%define basepkg ghc-%{pkgname}\
+%post -n %{basepkg}-devel\
+%ghc_pkg_recache\
+\
+%postun -n %{basepkg}-devel\
+%ghc_pkg_recache
+
+# ghc_package_devel [-c cdepslist] [-h pkgdepslist] [-l licensetag] [name] [version]
+%ghc_package_devel(c:h:l:)\
+%define pkgname %{?1}%{!?1:%{pkg_name}}\
+%define basepkg ghc-%{pkgname}\
+%ghc_devel_package\
+\
+%ghc_devel_description\
+\
+%ghc_devel_post_postun\
+\
+%ghc_devel_files\
+%{nil}
+
+# ghc_bin_build
+%ghc_bin_build\
+%global debug_package %{nil}\
+%cabal_configure\
+%cabal build
+
+# ghc_lib_build_without_haddock [name] [version]
+%ghc_lib_build_without_haddock()\
+%global debug_package %{nil}\
+%cabal_configure %{!?without_prof:-p} %{!?ghc_without_shared:--enable-shared} %{?1:--docdir=%{_docdir}/ghc-%1-%2 --htmldir=%{ghclibdocdir}/%1-%2} %{!?ghc_with_lib_for_ghci:--disable-library-for-ghci}\
+%cabal build\
+%{nil}
+
+# ghc_lib_build [name] [version]
+%ghc_lib_build()\
+%ghc_lib_build_without_haddock\
+%if %{undefined without_haddock}\
+%cabal haddock --html %{!?without_hscolour:%(if [ -x %{_bindir}/HsColour ]; then echo --hyperlink-source; fi)} --hoogle\
+%endif\
+%{nil}
+
+# ghc_strip_dynlinked
+%ghc_strip_dynlinked\
+%if %{undefined __debug_package}\
+find %{buildroot} -type f -exec sh -c "file {} | grep -q 'dynamically linked'" \\; -exec strip "{}" \\;\
+%endif
+
+# install bin package
+%ghc_bin_install()\
+%global _use_internal_dependency_generator 0\
+%global __find_requires %{_prefix}/lib/rpm/ghc-deps.sh --requires %{buildroot}%{ghclibdir}\
+%cabal_install\
+%{!?1:%ghc_strip_dynlinked}\
+%{nil}
+
+# ghc_lib_install [name] [version]
+%ghc_lib_install()\
+%global _use_internal_dependency_generator 0\
+%global __find_provides %{_prefix}/lib/rpm/ghc-deps.sh --provides %{buildroot}%{ghclibdir}\
+%global __find_requires %{_prefix}/lib/rpm/ghc-deps.sh --requires %{buildroot}%{ghclibdir}\
+%cabal_install\
+%cabal_pkg_conf\
+%ghc_gen_filelists\
+%{!?1:%ghc_strip_dynlinked}\
+%{nil}
+
+# ghc_fix_dynamic_rpath prog ...
+%ghc_fix_dynamic_rpath()\
+%if %{undefined ghc_without_dynamic}\
+PDIR=$(cd ..; pwd)\
+for i in %*; do\
+ PROG=%{buildroot}%{_bindir}/$i\
+ RPATH=$(chrpath $PROG| sed -e "s@^$PROG: RPATH=@@")\
+ case $RPATH in\
+ *$PDIR*)\
+ NEWRPATH=$(echo $RPATH | sed -e "s@$PDIR@%{ghclibdir}@g" -e "s@/dist/build@@g")\
+ chrpath -r $NEWRPATH $PROG\
+ ;;\
+ esac\
+done\
+%endif\
+%{nil}
+
+%ghc_pkg_recache %{_bindir}/ghc-pkg recache --no-user-package-conf || :
+
+# - without_hscolour, without_testsuite, and ghc_bootstrapping
+# need to be set locally in the spec file
+
+# skip prof libs, and documentation
+%ghc_test\
+%global without_prof 1\
+%global without_haddock 1\
+%global without_manual 1
+
+# skip shared and prof libs, documentation, and testsuite
+%ghc_bootstrap\
+%global ghc_without_shared 1\
+%global ghc_without_dynamic 1\
+%ghc_test
diff --git a/tools/ghc-rpm-macros/ghc-rpm-macros.spec b/tools/ghc-rpm-macros/ghc-rpm-macros.spec
new file mode 100644
index 0000000..daa74ae
--- /dev/null
+++ b/tools/ghc-rpm-macros/ghc-rpm-macros.spec
@@ -0,0 +1,421 @@
+%global debug_package %{nil}
+
+%global macros_file %{_sysconfdir}/rpm/macros.ghc
+
+# uncomment to bootstrap without hscolour
+#%%global without_hscolour 1
+
+Name: ghc-rpm-macros
+Version: 0.15.15.3
+Release: 1%{?dist}
+Summary: RPM macros for building packages for GHC
+
+Group: Development/Libraries
+License: GPLv3
+URL: https://fedoraproject.org/wiki/Packaging:Haskell
+
+# This is a Fedora maintained package, originally made for
+# the distribution. Hence the source is currently only available
+# from this package. But it could be hosted on fedorahosted.org
+# for example if other rpm distros would prefer that.
+Source0: ghc-rpm-macros.ghc
+Source1: COPYING
+Source2: AUTHORS
+Source3: ghc-deps.sh
+Source4: cabal-tweak-dep-ver
+Source5: cabal-tweak-flag
+BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
+Requires: redhat-rpm-config
+%if %{undefined without_hscolour}
+Requires: hscolour
+%endif
+
+%description
+A set of macros for building GHC packages following the Haskell Guidelines
+of the Fedora Haskell SIG. ghc needs to be installed in order to make use of
+these macros.
+
+
+%prep
+%setup -c -T
+cp %{SOURCE1} %{SOURCE2} .
+
+
+%build
+echo no build stage needed
+
+
+%install
+rm -rf $RPM_BUILD_ROOT
+
+install -p -D -m 0644 %{SOURCE0} ${RPM_BUILD_ROOT}/%{macros_file}
+
+install -p -D -m 0755 %{SOURCE3} %{buildroot}/%{_prefix}/lib/rpm/ghc-deps.sh
+
+install -p -D -m 0755 %{SOURCE4} %{buildroot}/%{_bindir}/cabal-tweak-dep-ver
+install -p -D -m 0755 %{SOURCE5} %{buildroot}/%{_bindir}/cabal-tweak-flag
+
+# this is why this package is now arch-dependent:
+# turn off shared libs and dynamic linking on secondary archs
+%ifnarch %{ix86} x86_64
+cat >> %{buildroot}/%{macros_file} <<EOF
+
+# shared libraries are only supported on primary intel archs
+%%ghc_without_dynamic 1
+%%ghc_without_shared 1
+EOF
+%endif
+
+
+%clean
+rm -rf $RPM_BUILD_ROOT
+
+
+%files
+%defattr(-,root,root,-)
+%doc COPYING AUTHORS
+%{macros_file}
+%{_prefix}/lib/rpm/ghc-deps.sh
+%{_bindir}/cabal-tweak-dep-ver
+%{_bindir}/cabal-tweak-flag
+
+
+%changelog
+* Mon Jan 13 2014 Jens Petersen <petersen@redhat.com> - 0.15.15.3-1
+- enable shared subpackages and dynamic linking on intel archs
+
+* Fri Dec 27 2013 Jens Petersen <petersen@redhat.com> - 0.15.15.2-1
+- drop the base lib pkg requires properly
+
+* Thu Dec 26 2013 Jens Petersen <petersen@redhat.com> - 0.15.15.1-1
+- rebase from 0.10.61.1 to 0.15.16 from epel6
+- disable shared libraries and dynamic linking
+ since ghc rts fails to dyn link
+- no base library packages
+- substitute _rpmconfigdir since not defined in el5 rpm
+- restore buildroot define and cleaning
+
+* Fri Oct 25 2013 Jens Petersen <petersen@redhat.com>
+- add ghcpkgdocdir
+
+* Mon Jul 22 2013 Jens Petersen <petersen@redhat.com> - 0.15.15-1
+- include docdir in library base package also when no shared library
+
+* Thu Jul 11 2013 Jens Petersen <petersen@redhat.com> - 0.15.14-1
+- create lib base package also when ghc_without_shared is set (#983137)
+ and other ghc_without_shared cleanup
+
+* Sat Jul 6 2013 Jens Petersen <petersen@redhat.com> - 0.15.13-1
+- restore docdir autopackaging for f17 and el6
+
+* Fri Jun 21 2013 Jens Petersen <petersen@redhat.com> - 0.15.12-1
+- ghc_fix_dynamic_rpath: do not assume first RPATH
+- packaging for without_shared is now done the same way as shared
+ to make non-shared arch packages same as shared ones:
+ so all archs will now have base library binary packages
+- remove deprecated ghc_exclude_docdir
+- Remove %%config from %%{_sysconfdir}/rpm/macros.*
+ (https://fedorahosted.org/fpc/ticket/259).
+- only add lib pkgdir to filelist if it exists
+ to fix haskell-platform build on secondary archs (no shared libs)
+
+* Tue Jan 22 2013 Jens Petersen <petersen@redhat.com> - 0.15.11-1
+- simplify cabal-tweak-flag script to take one flag value
+- new ghc_fix_dynamic_rpath macro for cleaning up package executables
+ linked against their own libraries
+
+* Sat Jan 19 2013 Jens Petersen <petersen@redhat.com> - 0.15.10-1
+- be more careful about library pkgdir ownership (#893777)
+- add cabal-tweak-flag script for toggling flag default
+
+* Thu Oct 25 2012 Jens Petersen <petersen@redhat.com> - 0.15.9-2
+- BR redhat-rpm-config instead of ghc-rpm-macros
+- no longer set without_hscolour in macros.ghc for bootstrapping
+
+* Tue Oct 9 2012 Jens Petersen <petersen@redhat.com> - 0.15.9-1
+- "cabal haddock" needs --html option with --hoogle to output html
+
+* Thu Sep 20 2012 Jens Petersen <petersen@redhat.com> - 0.15.8-1
+- ghc-rpm-macros now requires hscolour so packages no longer need to BR it
+- this can be disabled for bootstrapping by setting without_hscolour
+- make haddock build hoogle files
+- ghc_lib_build no longer builds redundant ghci .o library files
+
+* Wed Jul 11 2012 Jens Petersen <petersen@redhat.com> - 0.15.7-1
+- let ghc_bin_install take an arg to disable implicit stripping for subpackages
+- fix doc handling of subpackages for ghc_without_shared
+- without ghc_exclude_docdir include doc dir also for subpackages
+- rename ghc_binlib_package to ghc_lib_subpackage
+- add ghc_lib_build_without_haddock
+- no longer drop into package dirs when subpackaging with ghc_lib_build and
+ ghc_lib_install
+
+* Fri Jun 22 2012 Jens Petersen <petersen@redhat.com> - 0.15.6.1-1
+- cabal-tweak-dep-ver: be careful only to match complete dep name and
+ do not match beyond ","
+
+* Fri Jun 22 2012 Jens Petersen <petersen@redhat.com> - 0.15.6-1
+- cabal-tweak-dep-ver: new script to tweak depends version bounds in .cabal
+ from ghc-rpm-macros-0.95.5
+- ghc-dep.sh: only use buildroot package.conf.d if it exists
+- ghc-deps.sh: look in buildroot package.conf.d for program deps
+- add a meta-package option to ghc_devel_package and use in ghc_devel_requires
+- allow ghc_description, ghc_devel_description, ghc_devel_post_postun
+ to take args
+- support meta packages like haskell-platform without base lib files
+- add shell variable cabal_configure_extra_options to cabal_configure for
+ local configuration
+- do not provide prof when without_prof set
+
+* Thu Feb 23 2012 Jens Petersen <petersen@redhat.com> - 0.15.5-1
+- fix handling of devel docdir for non-shared builds
+- simplify ghc_bootstrap
+
+* Thu Jan 19 2012 Jens Petersen <petersen@redhat.com> - 0.15.4-1
+- allow dynamic linking of Setup with ghc_without_shared set
+
+* Fri Jan 6 2012 Jens Petersen <petersen@redhat.com> - 0.15.3-1
+- new ghc_add_basepkg_file to add a path to base lib package filelist
+
+* Wed Dec 28 2011 Jens Petersen <petersen@redhat.com> - 0.15.2-1
+- add ghc_devel_post_postun to help koji/mock with new macros
+
+* Tue Dec 27 2011 Jens Petersen <petersen@redhat.com> - 0.15.1-1
+- add ghc_package, ghc_description, ghc_devel_package, ghc_devel_description
+
+* Tue Dec 27 2011 Jens Petersen <petersen@redhat.com> - 0.15-1
+- new ghc_files wrapper macro for files which takes base doc files as args
+ and uses new ghc_shared_files and ghc_devel_files macros
+- when building for non-shared archs move installed docfiles to devel docdir
+
+* Fri Dec 2 2011 Jens Petersen <petersen@redhat.com> - 0.14.3-1
+- do not use ghc user config by default when compiling Setup
+- do not setup hscolour if without_hscolour defined
+
+* Thu Nov 17 2011 Jens Petersen <petersen@redhat.com> - 0.10.61-1
+- test for HsColour directly when running "cabal haddock" instead of
+ checking for without_haddock
+
+* Fri Sep 30 2011 Jens Petersen <petersen@redhat.com> - 0.10.60-1
+- fix devel subpackage's prof and doc obsoletes and provides versions
+ for multiple lib packages like ghc (reported by Henrik Nordström)
+
+* Tue Sep 13 2011 Jens Petersen <petersen@redhat.com> - 0.10.59-1
+- do not setup ghc-deps.sh when ghc_bootstrapping
+- add ghc_test build config
+- drop redundant defattr from filelists
+- move dependency generator setup from ghc_package_devel to ghc_lib_install
+- ghc_bootstrap is now a macro providing bootstrap config
+- add ghc_check_bootstrap
+
+* Mon Jun 27 2011 Jens Petersen <petersen@redhat.com> - 0.10.58-1
+- add requires for redhat-rpm-config for ghc_arches
+
+* Wed Jun 22 2011 Jens Petersen <petersen@redhat.com> - 0.10.57-1
+- ghc-deps.sh: also ignore base-3 since it is part of ghc-base
+
+* Mon Jun 13 2011 Jens Petersen <petersen@redhat.com> - 0.10.56-1
+- merge prof subpackages into devel to simplify packaging
+- condition --htmldir on pkg_name
+
+* Mon May 9 2011 Jens Petersen <petersen@redhat.com> - 0.10.55-1
+- include ghc_pkg_c_deps even when -c option used
+
+* Mon May 9 2011 Jens Petersen <petersen@redhat.com> - 0.10.54-1
+- ghc-deps.sh: ignore private ghc lib deps
+- macros.ghc: drop ghc-prof requires from ghc_prof_requires
+
+* Sat May 7 2011 Jens Petersen <petersen@redhat.com> - 0.10.53-1
+- backport ghc-deps.sh rpm dependency script for automatic versioned
+ library dependencies (without hashes)
+- drop ghc_pkg_deps from ghc_package_devel and ghc_package_prof since
+ ghc-deps.sh generates better inter-package dependencies already
+
+* Wed Mar 16 2011 Jens Petersen <petersen@redhat.com> - 0.10.52-1
+- backport ghc fixes and secondary arch support from 0.11.12:
+- add ghc_pkg_obsoletes to binlib base lib package too
+- add docdir when subpackaging packages too
+- this package is now arch-dependent
+- rename without_shared to ghc_without_shared and without_dynamic
+ to ghc_without_dynamic so that they can be globally defined for
+ secondary archs without shared libs
+- use %%undefined macro
+- disable debug_package in ghc_bin_build and ghc_lib_build
+- set ghc_without_shared and ghc_without_dynamic on secondary
+ (ie non main intel archs)
+- disable debuginfo for self
+- only link Setup dynamically if without_shared and without_dynamic not set
+- add cabal_configure_options to pass extra options to cabal_configure
+
+* Fri Feb 4 2011 Jens Petersen <petersen@redhat.com> - 0.10.51-1
+- ghc_binlib_package's -x option does not take an arg
+
+* Sat Jan 29 2011 Jens Petersen <petersen@redhat.com> - 0.10.50-1
+- merge subpackaging support from 0.11.4:
+- drop ghcdocdir and ghcpkgdir
+- new ghclibdocdir
+- improve prof summary and description
+- add without_prof and without_haddock option macros
+- add ghc_binlib_package option to exclude package from ghc_packages_list
+- condition lib base package additional description for srpm
+- use buildroot instead of RPM_BUILD_ROOT
+- rename ghcpkgbasedir to ghclibdir
+- move name and version macro options (-n and -v) to optional args
+- ghc_gen_filelists, ghc_lib_build, ghc_lib_install, cabal_pkg_conf
+ now take optional "[name] [version]" args
+- drop with_devhelp since --html-help option gone from haddock-2.8.0
+- rename ghc_requires to ghc_devel_requires
+- drop ghc_doc_requires
+
+* Wed Dec 29 2010 Jens Petersen <petersen@redhat.com> - 0.8.3-1
+- revert disabling debug_package, since with redhat-rpm-config installed
+ the behaviour depended on the position of ghc_lib_package in the spec file
+ (reported by narasim)
+
+* Thu Sep 30 2010 Jens Petersen <petersen@redhat.com> - 0.8.2-1
+- add ghc_pkg_obsoletes for obsoleting old packages
+- always obsolete -doc packages, but keep -o for now for backward compatibility
+- disable debuginfo by default
+- make shared and hscolour default
+- use without_shared and without_hscolour to disable them
+- fix without_shared build so it actually works
+- use ghcpkgbasedir
+
+* Fri Jul 16 2010 Jens Petersen <petersen@redhat.com> - 0.8.1-1
+- fix ghc_strip_dynlinked when no dynlinked files
+- devel should provide doc also when not obsoleting
+
+* Fri Jul 16 2010 Jens Petersen <petersen@redhat.com> - 0.8.0-1
+- merge -doc into -devel and provide -o obsoletes doc subpackage option
+
+* Mon Jun 28 2010 Jens Petersen <petersen@redhat.com> - 0.7.1-1
+- support hscolour'ing of src from haddock
+- really remove redundant summary and description option flags
+
+* Sat Jun 26 2010 Jens Petersen <petersen@redhat.com> - 0.7.0-1
+- new ghc_bin_build, ghc_bin_install, ghc_lib_build, ghc_lib_install
+
+* Thu Jun 24 2010 Jens Petersen <petersen@redhat.com> - 0.6.2-1
+- a couple more fallback summary tweaks
+
+* Thu Jun 24 2010 Jens Petersen <petersen@redhat.com> - 0.6.1-1
+- drop the summary -s and description -d package options since rpm does not
+ seem to allow white\ space in macro option args anyway
+
+* Wed Jun 23 2010 Jens Petersen <petersen@redhat.com> - 0.6.0-1
+- make ghc_strip_dynlinked conditional on no debug_package
+
+* Wed Jun 23 2010 Jens Petersen <petersen@redhat.com> - 0.5.9-1
+- replace ghc_strip_shared with ghc_strip_dynlinked
+
+* Sun Jun 20 2010 Jens Petersen <petersen@redhat.com> - 0.5.8-1
+- add ghc_strip_shared to strip shared libraries
+
+* Sun Jun 20 2010 Jens Petersen <petersen@redhat.com> - 0.5.7-1
+- add comments over macros
+- drop unused cabal_makefile
+
+* Mon Apr 12 2010 Jens Petersen <petersen@redhat.com> - 0.5.6-1
+- drop unused ghc_pkg_ver macro
+- add ghc_pkg_recache macro
+
+* Fri Jan 15 2010 Jens Petersen <petersen@redhat.com> - 0.5.5-1
+- drop optional 2nd version arg from ghcdocdir, ghcpkgdir, and
+ ghc_gen_filelists: multiversion subpackages are not supported
+- add ghcpkgbasedir
+- bring back some shared conditions which were dropped temporarily
+- test for ghcpkgdir and ghcdocdir in ghc_gen_filelists
+- allow optional pkgname arg for cabal_pkg_conf
+- can now package gtk2hs
+
+* Mon Jan 11 2010 Jens Petersen <petersen@redhat.com> - 0.5.4-1
+- use -v in ghc_requires and ghc_prof_requires for version
+
+* Mon Jan 11 2010 Jens Petersen <petersen@redhat.com> - 0.5.3-1
+- drop "Library for" from base lib summary
+
+* Mon Jan 11 2010 Jens Petersen <petersen@redhat.com> - 0.5.2-1
+- use -n in ghc_requires and ghc_prof_requires for when no pkg_name
+
+* Mon Jan 11 2010 Jens Petersen <petersen@redhat.com> - 0.5.1-1
+- add ghcdocbasedir
+- revert ghcdocdir to match upstream ghc
+- ghcdocdir and ghcpkgdir now take optional name version args
+- update ghc_gen_filelists to new optional name version args
+- handle docdir in ghc_gen_filelists
+- ghc_reindex_haddock uses ghcdocbasedir
+- summary and description options to ghc_binlib_package, ghc_package_devel,
+ ghc_package_doc, and ghc_package_prof
+
+* Sun Jan 10 2010 Jens Petersen <petersen@redhat.com> - 0.5.0-1
+- pkg_name must be set now for binlib packages too
+- new ghc_lib_package and ghc_binlib_package macros make packaging too easy
+- ghc_package_devel, ghc_package_doc, and ghc_package_prof helper macros
+- ghc_gen_filelists now defaults to ghc-%%{pkg_name}
+- add dynamic bcond to cabal_configure instead of cabal_configure_dynamic
+
+* Thu Dec 24 2009 Jens Petersen <petersen@redhat.com> - 0.4.0-1
+- add cabal_configure_dynamic
+- add ghc_requires, ghc_doc_requires, ghc_prof_requires
+
+* Tue Dec 15 2009 Jens Petersen <petersen@redhat.com> - 0.3.1-1
+- use ghc_version_override to override ghc_version
+- fix pkg .conf filelist match
+
+* Sat Dec 12 2009 Jens Petersen <petersen@redhat.com> - 0.3.0-1
+- major updates for ghc-6.12, package.conf.d, and shared libraries
+- add shared support to cabal_configure, ghc_gen_filelists
+- version ghcdocdir
+- replace ghc_gen_scripts, ghc_install_scripts, ghc_register_pkg, ghc_unregister_pkg
+ with cabal_pkg_conf
+- allow (ghc to) override ghc_version
+
+* Mon Nov 16 2009 Jens Petersen <petersen@redhat.com> - 0.2.5-1
+- make ghc_pkg_ver only return pkg version
+
+* Mon Nov 16 2009 Jens Petersen <petersen@redhat.com> - 0.2.4-1
+- change GHCRequires to ghc_pkg_ver
+
+* Mon Nov 16 2009 Jens Petersen <petersen@redhat.com> - 0.2.3-1
+- use the latest installed pkg version for %%GHCRequires
+
+* Mon Nov 16 2009 Jens Petersen <petersen@redhat.com> - 0.2.2-1
+- add %%GHCRequires for automatically versioned library deps
+
+* Tue Sep 22 2009 Jens Petersen <petersen@redhat.com> - 0.2.1-2
+- no, revert versioned ghcdocdir again!
+
+* Tue Sep 22 2009 Jens Petersen <petersen@redhat.com> - 0.2.1-1
+- version ghcdocdir to allow multiple doc versions like ghcpkgdir
+
+* Fri Jul 24 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.2-2
+- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild
+
+* Tue Jun 9 2009 Jens Petersen <petersen@redhat.com> - 0.2-1
+- drop version from ghcdocdir since it breaks haddock indexing
+
+* Wed May 13 2009 Yaakov M. Nemoy <ynemoy@fedoraproject.org> - 0.1-7
+- specifies the macros file as a %%conf
+
+* Sat May 9 2009 Yaakov M. Nemoy <ynemoy@fedoraproject.org> - 0.1-6
+- removes archs and replaces with noarch
+- bumps to avoid conflicts with jens
+
+* Fri May 8 2009 Jens Petersen <petersen@redhat.com> - 0.1-5
+- make it arch specific to fedora ghc archs
+- setup a build dir so it can build from the current working dir
+
+* Wed May 6 2009 Yaakov M. Nemoy <ynemoy@fedoraproject.org> - 0.1-4
+- renamed license file
+- removed some extraneous comments needed only at review time
+
+* Wed May 6 2009 Yaakov M. Nemoy <ynemoy@fedoraproject.org> - 0.1-3
+- updated license to GPLv3
+- added AUTHORS file
+
+* Tue May 5 2009 Yaakov M. Nemoy <ghc@hexago.nl> - 0.1-2
+- moved copying license from %%build to %%prep
+
+* Mon May 4 2009 Yaakov M. Nemoy <ghc@hexago.nl> - 0.1-1
+- creation of package
+
diff --git a/tools/ghc-split/ghc-split.spec b/tools/ghc-split/ghc-split.spec
new file mode 100644
index 0000000..e00ca8f
--- /dev/null
+++ b/tools/ghc-split/ghc-split.spec
@@ -0,0 +1,122 @@
+# https://fedoraproject.org/wiki/Packaging:Haskell
+# https://fedoraproject.org/wiki/PackagingDrafts/Haskell
+
+%global pkg_name split
+
+%global common_summary Combinator library for splitting lists
+
+%global common_description A collection of various methods for splitting lists into parts,\
+akin to the split functions found in several mainstream languages.
+
+Name: ghc-%{pkg_name}
+# part of haskell-platform-2012.4
+Version: 0.2.1.1
+Release: 2%{?dist}
+Summary: %{common_summary}
+
+Group: Development/Libraries
+License: BSD
+URL: http://hackage.haskell.org/package/%{pkg_name}
+Source0: http://hackage.haskell.org/packages/archive/%{pkg_name}/%{version}/%{pkg_name}-%{version}.tar.gz
+
+BuildRequires: ghc-Cabal-devel
+BuildRequires: ghc-rpm-macros
+BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
+
+
+%description
+%{common_description}
+
+
+%prep
+%setup -q -n %{pkg_name}-%{version}
+
+
+%build
+%ghc_lib_build
+
+
+%install
+%ghc_lib_install
+
+
+%ghc_devel_package
+
+%ghc_devel_description
+
+
+%ghc_devel_post_postun
+
+
+%ghc_files LICENSE
+%doc CHANGES
+
+
+%changelog
+* Wed Feb 13 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.2.1.1-2
+- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild
+
+* Tue Nov 27 2012 Jens Petersen <petersen@redhat.com> - 0.2.1.1-1
+- update to 0.2.1.1, part of haskell-platform-2012.4
+
+* Sat Nov 17 2012 Jens Petersen <petersen@redhat.com>
+- update with cabal-rpm
+
+* Thu Jul 19 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.1.4.3-3
+- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild
+
+* Mon Jul 16 2012 Jens Petersen <petersen@redhat.com> - 0.1.4.3-2
+- change prof BRs to devel
+
+* Wed Jun 13 2012 Jens Petersen <petersen@redhat.com> - 0.1.4.3-1
+- update to 0.1.4.3
+
+* Fri Mar 23 2012 Jens Petersen <petersen@redhat.com> - 0.1.4.2-2
+- add license to ghc_files
+
+* Fri Jan 6 2012 Jens Petersen <petersen@redhat.com> - 0.1.4.2-1
+- update to 0.1.4.2 and cabal2spec-0.25.2
+
+* Fri Oct 21 2011 Marcela Mašláňová <mmaslano@redhat.com> - 0.1.4-1.2
+- rebuild with new gmp without compat lib
+
+* Tue Oct 11 2011 Peter Schiffer <pschiffe@redhat.com> - 0.1.4-1.1
+- rebuild with new gmp
+
+* Sat Jul 09 2011 Ben Boeckel <mathstuf@gmail.com> - 0.1.4-1
+- Update to 0.1.4
+- Update to cabal2spec-0.24
+
+* Fri Jun 24 2011 Jens Petersen <petersen@redhat.com> - 0.1.3-5
+- BR ghc-Cabal-devel instead of ghc-prof and use ghc_arches (cabal2spec-0.23.2)
+
+* Thu Mar 10 2011 Fabio M. Di Nitto <fdinitto@redhat.com> - 0.1.3-4
+- Enable build on sparcv9
+
+* Tue Feb 08 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.1.3-3
+- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild
+
+* Sat Jan 15 2011 Ben Boeckel <mathstuf@gmail.com> - 0.1.3-2
+- Update to cabal2spec-0.22.4
+- Rebuild
+
+* Fri Dec 17 2010 Ben Boeckel <mathstuf@gmail.com> - 0.1.3-1
+- Update to 0.1.3
+
+* Sun Nov 28 2010 Ben Boeckel <mathstuf@gmail.com> - 0.1.2.3-1
+- Update to 0.1.2.3
+
+* Fri Nov 12 2010 Ben Boeckel <mathstuf@gmail.com> - 0.1.2.2-1
+- Update to 0.1.2.2
+
+* Sun Nov 07 2010 Ben Boeckel <mathstuf@gmail.com> - 0.1.2.1-2
+- Rebuild
+
+* Tue Sep 14 2010 Ben Boeckel <mathstuf@gmail.com> - 0.1.2.1-1
+- Update to 0.1.2.1
+
+* Sun Sep 05 2010 Ben Boeckel <mathstuf@gmail.com> - 0.1.2-1
+- Initial package
+
+* Sun Sep 5 2010 Fedora Haskell SIG <haskell-devel@lists.fedoraproject.org> - 0.1.2-0
+- initial packaging for Fedora automatically generated by cabal2spec-0.22.2
diff --git a/tools/ghc-tar/ghc-tar.spec b/tools/ghc-tar/ghc-tar.spec
new file mode 100644
index 0000000..0d93380
--- /dev/null
+++ b/tools/ghc-tar/ghc-tar.spec
@@ -0,0 +1,143 @@
+# https://fedoraproject.org/wiki/Packaging:Haskell
+# https://fedoraproject.org/wiki/PackagingDrafts/Haskell
+
+%global pkg_name tar
+
+%global common_summary Reading, writing and manipulating tar archive files
+
+%global common_description This library is for working with ".tar" archive files. It\
+can read and write a range of common variations of archive\
+format including V7, USTAR, POSIX and GNU formats. It\
+provides support for packing and unpacking portable archives.\
+This makes it suitable for distribution but not backup\
+because details like file ownership and exact permissions are\
+not preserved.
+
+Name: ghc-%{pkg_name}
+Version: 0.4.0.1
+Release: 2%{?dist}
+Summary: %{common_summary}
+
+Group: System/Libraries
+License: BSD
+URL: http://hackage.haskell.org/package/%{pkg_name}
+Source0: http://hackage.haskell.org/packages/archive/%{pkg_name}/%{version}/%{pkg_name}-%{version}.tar.gz
+
+BuildRequires: ghc-Cabal-devel
+BuildRequires: ghc-rpm-macros
+# Begin cabal-rpm deps:
+BuildRequires: ghc-bytestring-devel
+BuildRequires: ghc-directory-devel
+BuildRequires: ghc-filepath-devel
+BuildRequires: ghc-old-time-devel
+BuildRequires: ghc-time-devel
+# End cabal-rpm deps
+BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
+
+
+%description
+%{common_description}
+
+
+%prep
+%setup -q -n %{pkg_name}-%{version}
+
+
+%build
+%ghc_lib_build
+
+
+%install
+%ghc_lib_install
+
+
+%ghc_devel_package
+
+%ghc_devel_description
+
+
+%ghc_devel_post_postun
+
+
+%ghc_files LICENSE
+
+
+%changelog
+* Wed Feb 13 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.4.0.1-2
+- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild
+
+* Thu Nov 08 2012 Jens Petersen <petersen@redhat.com> - 0.4.0.1-1
+- update to 0.4.0.1
+
+* Thu Jul 19 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.3.2.0-2
+- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild
+
+* Tue Mar 20 2012 Jens Petersen <petersen@redhat.com> - 0.3.2.0-1
+- update to 0.3.2.0
+
+* Sun Mar 18 2012 Jens Petersen <petersen@redhat.com> - 0.3.1.0-15
+- update to cabal2spec-0.25
+
+* Fri Jan 13 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.3.1.0-14.3
+- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild
+
+* Mon Oct 24 2011 Marcela Mašláňová <mmaslano@redhat.com> - 0.3.1.0-13.3
+- rebuild with new gmp without compat lib
+
+* Fri Oct 21 2011 Marcela Mašláňová <mmaslano@redhat.com> - 0.3.1.0-13.2
+- rebuild with new gmp without compat lib
+
+* Tue Oct 11 2011 Peter Schiffer <pschiffe@redhat.com> - 0.3.1.0-13.1
+- rebuild with new gmp
+
+* Sat Jul 09 2011 Ben Boeckel <mathstuf@gmail.com> - 0.3.1.0-13
+- Update to cabal2spec-0.24
+
+* Thu Jun 23 2011 Jens Petersen <petersen@redhat.com> - 0.3.1.0-12
+- BR ghc-Cabal-devel instead of ghc-prof and use ghc_arches (cabal2spec-0.23.2)
+
+* Thu Mar 10 2011 Fabio M. Di Nitto <fdinitto@redhat.com> - 0.3.1.0-11
+- Enable build on sparcv9
+
+* Tue Feb 08 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.3.1.0-10
+- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild
+
+* Sat Jan 15 2011 Ben Boeckel <mathstuf@gmail.com> - 0.3.1.0-9
+- Update to cabal2spec-0.22.4
+- Rebuild
+
+* Thu Nov 25 2010 Jens Petersen <petersen@redhat.com> - 0.3.1.0-8
+- update url
+
+* Sun Nov 07 2010 Ben Boeckel <mathstuf@gmail.com> - 0.3.1.0-7
+- Rebuild
+- Update summary and description
+
+* Sat Sep 4 2010 Jens Petersen <petersen@redhat.com> - 0.3.1.0-6
+- add hscolour and doc obsolete (cabal2spec-0.22.2)
+
+* Sun Jun 27 2010 Jens Petersen <petersen@redhat.com> - 0.3.1.0-5
+- sync cabal2spec-0.22.1
+
+* Tue Apr 27 2010 Jens Petersen <petersen@redhat.com> - 0.3.1.0-4
+- rebuild against ghc-6.12.2
+- condition ghc_lib_package
+
+* Mon Jan 11 2010 Jens Petersen <petersen@redhat.com> - 0.3.1.0-3
+- update to ghc-rpm-macros-0.5.1 and cabal2spec-0.21.1:
+- drop doc and prof bcond
+- use ghc_lib_package
+
+* Sat Dec 26 2009 Jens Petersen <petersen@redhat.com> - 0.3.1.0-2
+- update for ghc-6.12.1: add shared library support
+- use new ghc*_requires macros: needs ghc-rpm-macros 0.4.0
+- add common_summary and common_description
+
+* Fri Aug 28 2009 Yaakov M. Nemoy <ynemoy@fedoraproject.org> - 0.3.1.0-1
+- updated to latest upstream
+
+* Sun Aug 23 2009 Yaakov M. Nemoy <loupgaroublond@gmail.com> - 0.3.0.0-2
+- updated to latest cabal2spec output
+
+* Tue Mar 3 2009 Yaakov M. Nemoy <loupgaroublond@gmail.com> - 0.3.0.0-1
+- initial packaging for Fedora created by cabal2spec
diff --git a/tools/ghc-vector/ghc-vector.spec b/tools/ghc-vector/ghc-vector.spec
new file mode 100644
index 0000000..0f1f07e
--- /dev/null
+++ b/tools/ghc-vector/ghc-vector.spec
@@ -0,0 +1,108 @@
+# https://fedoraproject.org/wiki/Packaging:Haskell
+# https://fedoraproject.org/wiki/PackagingDrafts/Haskell
+
+%global pkg_name vector
+
+%global common_summary Efficient Arrays
+
+%global common_description An efficient implementation of Int-indexed arrays (both mutable and\
+immutable), with a powerful loop fusion optimization framework.
+
+Name: ghc-%{pkg_name}
+# part of haskell-platform-2012.4
+Version: 0.10.0.1
+Release: 5%{?dist}
+Summary: %{common_summary}
+
+Group: System/Libraries
+License: BSD
+URL: http://hackage.haskell.org/package/%{pkg_name}
+Source0: http://hackage.haskell.org/packages/archive/%{pkg_name}/%{version}/%{pkg_name}-%{version}.tar.gz
+Patch1: vector-debian-no_ann_without_ghci.patch
+
+BuildRequires: ghc-Cabal-devel
+BuildRequires: ghc-rpm-macros
+# Begin cabal-rpm deps:
+BuildRequires: ghc-deepseq-devel
+BuildRequires: ghc-primitive-devel
+# End cabal-rpm deps
+BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
+
+
+%description
+%{common_description}
+
+
+%prep
+%setup -q -n %{pkg_name}-%{version}
+# Monad.hs fails on ppc too
+%ifnarch %(echo %{ghc_arches_with_ghci} | sed -e s/ppc//)
+%patch1 -p1 -b .orig
+%endif
+
+
+%build
+%ghc_lib_build
+
+
+%install
+%ghc_lib_install
+
+
+%ghc_devel_package
+
+%ghc_devel_description
+
+
+%ghc_devel_post_postun
+
+
+%ghc_files LICENSE
+
+
+%changelog
+* Wed Feb 13 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.10.0.1-5
+- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild
+
+* Wed Dec 12 2012 Jens Petersen <petersen@redhat.com> - 0.10.0.1-4
+- also skip the annotation for ppc
+
+* Thu Dec 6 2012 Jens Petersen <petersen@redhat.com> - 0.10.0.1-3
+- correct the annotation patch to not use DEBIAN_NO_GHCI
+
+* Thu Dec 6 2012 Jens Petersen <petersen@redhat.com> - 0.10.0.1-2
+- skip Data.Vector.Fusion.Stream.Monadic annotation on archs without ghci
+ and build on all archs
+
+* Tue Nov 27 2012 Jens Petersen <petersen@redhat.com> - 0.10.0.1-1
+- update to 0.10.0.1, part of haskell-platform-2012.4
+
+* Sat Nov 17 2012 Jens Petersen <petersen@redhat.com>
+- update with cabal-rpm
+
+* Thu Jul 19 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.9.1-5
+- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild
+
+* Mon Jul 16 2012 Jens Petersen <petersen@redhat.com> - 0.9.1-4
+- change prof BRs to devel
+
+* Fri Mar 23 2012 Jens Petersen <petersen@redhat.com> - 0.9.1-3
+- add license to ghc_files
+
+* Wed Mar 7 2012 Jens Petersen <petersen@redhat.com> - 0.9.1-2
+- only build on ghc_arches_with_ghci because of annotation use
+
+* Wed Jan 4 2012 Jens Petersen <petersen@redhat.com> - 0.9.1-1
+- update to 0.9.1 and cabal2spec-0.25.2
+
+* Mon Oct 24 2011 Marcela Mašláňová <mmaslano@redhat.com> - 0.7.1-2.1
+- rebuild with new gmp without compat lib
+
+* Tue Sep 13 2011 Jens Petersen <petersen@redhat.com> - 0.7.1-2
+- rebuild against newer ghc-rpm-macros
+
+* Thu Sep 8 2011 Jens Petersen <petersen@redhat.com> - 0.7.1-1
+- BSD license
+
+* Thu Sep 8 2011 Fedora Haskell SIG <haskell-devel@lists.fedoraproject.org> - 0.7.1-0
+- initial packaging for Fedora automatically generated by cabal2spec-0.24.1
diff --git a/tools/ghc-vector/vector-debian-no_ann_without_ghci.patch b/tools/ghc-vector/vector-debian-no_ann_without_ghci.patch
new file mode 100644
index 0000000..21582db
--- /dev/null
+++ b/tools/ghc-vector/vector-debian-no_ann_without_ghci.patch
@@ -0,0 +1,24 @@
+ http://hackage.haskell.org/trac/ghc/ticket/4268
+
+--- haskell-vector-0.9.1.orig/Data/Vector/Fusion/Stream/Monadic.hs 2012-02-10 23:48:51.000000000 +0100
++++ haskell-vector-0.9.1/Data/Vector/Fusion/Stream/Monadic.hs 2012-02-10 23:49:04.000000000 +0100
+@@ -94,15 +94,19 @@
+ import Data.Word ( Word8, Word16, Word32, Word, Word64 )
+
+ #if __GLASGOW_HASKELL__ >= 700
++#if 0
+ import GHC.Exts ( SpecConstrAnnotation(..) )
+ #endif
++#endif
+
+ #include "vector.h"
+
+ data SPEC = SPEC | SPEC2
+ #if __GLASGOW_HASKELL__ >= 700
++#if 0
+ {-# ANN type SPEC ForceSpecConstr #-}
+ #endif
++#endif
+
+ emptyStream :: String
+ {-# NOINLINE emptyStream #-}
diff --git a/tools/ghc/Cabal-fix-dynamic-exec-for-TH.patch b/tools/ghc/Cabal-fix-dynamic-exec-for-TH.patch
new file mode 100644
index 0000000..5384ea7
--- /dev/null
+++ b/tools/ghc/Cabal-fix-dynamic-exec-for-TH.patch
@@ -0,0 +1,33 @@
+diff -u ghc-7.2.0.20110728/libraries/Cabal/cabal/Distribution/Simple/GHC.hs.orig ghc-7.2.0.20110728/libraries/Cabal/cabal/Distribution/Simple/GHC.hs
+--- ghc-7.2.0.20110728/libraries/Cabal/Cabal/Distribution/Simple/GHC.hs.orig 2011-07-29 02:12:09.000000000 +0900
++++ ghc-7.2.0.20110728/libraries/Cabal/Cabal/Distribution/Simple/GHC.hs 2011-08-05 18:08:05.192042529 +0900
+@@ -778,7 +778,10 @@
+ ++ ["-L"++libDir | libDir <- extraLibDirs exeBi]
+ ++ concat [["-framework", f] | f <- PD.frameworks exeBi]
+ ++ if dynExe
+- then ["-dynamic"]
++ then ["-dynamic",
++ "-hisuf", "dyn_hi",
++ "-osuf", "dyn_o"
++ ]
+ else []
+ ++ if profExe
+ then ["-prof",
+@@ -787,13 +790,14 @@
+ ] ++ ghcProfOptions exeBi
+ else []
+
+- -- For building exe's for profiling that use TH we actually
++ -- For building exe's for profiling or dynamic that use TH we actually
+ -- have to build twice, once without profiling and the again
+ -- with profiling. This is because the code that TH needs to
+ -- run at compile time needs to be the vanilla ABI so it can
+ -- be loaded up and run by the compiler.
+- when (withProfExe lbi && EnableExtension TemplateHaskell `elem` allExtensions exeBi)
+- (runGhcProg (binArgs False (withDynExe lbi) False))
++ when ((withProfExe lbi || withDynExe lbi) &&
++ EnableExtension TemplateHaskell `elem` allExtensions exeBi)
++ (runGhcProg (binArgs False False False))
+
+ runGhcProg (binArgs True (withDynExe lbi) (withProfExe lbi))
+
diff --git a/tools/ghc/ghc-6.12.1-gen_contents_index-haddock-path.patch b/tools/ghc/ghc-6.12.1-gen_contents_index-haddock-path.patch
new file mode 100644
index 0000000..d1034eb
--- /dev/null
+++ b/tools/ghc/ghc-6.12.1-gen_contents_index-haddock-path.patch
@@ -0,0 +1,12 @@
+diff -u ghc-6.12.1/libraries/gen_contents_index\~ ghc-6.12.1/libraries/gen_contents_index
+--- ghc-6.12.1/libraries/gen_contents_index~ 2009-12-11 04:11:33.000000000 +1000
++++ ghc-6.12.1/libraries/gen_contents_index 2009-12-12 21:08:02.000000000 +1000
+@@ -20,7 +20,7 @@
+ done
+ ;;
+ *)
+- HADDOCK=../../../../../bin/haddock
++ HADDOCK=/usr/bin/haddock
+ # We don't want the GHC API to swamp the index
+ HADDOCK_FILES=`ls -1 */*.haddock | grep -v '/ghc\.haddock' | sort`
+ for HADDOCK_FILE in $HADDOCK_FILES
diff --git a/tools/ghc/ghc-7.4-add-support-for-ARM-hard-float-ABI-fixes-5914.patch b/tools/ghc/ghc-7.4-add-support-for-ARM-hard-float-ABI-fixes-5914.patch
new file mode 100644
index 0000000..a9b897b
--- /dev/null
+++ b/tools/ghc/ghc-7.4-add-support-for-ARM-hard-float-ABI-fixes-5914.patch
@@ -0,0 +1,1274 @@
+From 83195ff5ba73779514e3d06b1457d45f849c7fc2 Mon Sep 17 00:00:00 2001
+From: Karel Gardas <karel.gardas@centrum.cz>
+Date: Wed, 25 Apr 2012 09:04:50 +0200
+Subject: [PATCH] add support for ARM hard-float ABI (fixes #5914)
+
+This patch enhances Platform's ArchARM to include ARM ABI value. It also
+tweaks configure machinery to detect hard-float ABI and to set it wherever
+needed. Finally when hard-float ABI is in use, pass appropriate compiler
+option to the LLVM's llc. Fixes #5914.
+---
+ aclocal.m4 | 2 +-
+ compiler/main/DriverPipeline.hs | 16 +-
+ compiler/nativeGen/AsmCodeGen.lhs | 2 +-
+ compiler/nativeGen/RegAlloc/Graph/TrivColorable.hs | 56 ++--
+ compiler/nativeGen/RegAlloc/Linear/FreeRegs.hs | 14 +-
+ compiler/nativeGen/RegAlloc/Linear/Main.hs | 14 +-
+ compiler/nativeGen/TargetReg.hs | 70 ++--
+ compiler/utils/Platform.hs | 12 +-
+ config.guess | 482 ++++++++++----------
+ configure.ac | 14 +
+ 10 files changed, 345 insertions(+), 337 deletions(-)
+
+diff --git a/aclocal.m4 b/aclocal.m4
+index 5652185..c196bdf 100644
+--- a/aclocal.m4
++++ b/aclocal.m4
+@@ -171,7 +171,7 @@ AC_DEFUN([FPTOOLS_SET_HASKELL_PLATFORM_VARS],
+ ;;
+ arm)
+ GET_ARM_ISA()
+- test -z "[$]2" || eval "[$]2=\"ArchARM {armISA = \$ARM_ISA, armISAExt = \$ARM_ISA_EXT}\""
++ test -z "[$]2" || eval "[$]2=\"ArchARM {armISA = \$ARM_ISA, armISAExt = \$ARM_ISA_EXT, armABI = \$ARM_ABI}\""
+ ;;
+ alpha|mips|mipseb|mipsel|hppa|hppa1_1|ia64|m68k|rs6000|s390|s390x|sparc64|vax)
+ test -z "[$]2" || eval "[$]2=ArchUnknown"
+diff -u ghc-7.4.1.20120508/compiler/main/DriverPipeline.hs.arm ghc-7.4.1.20120508/compiler/main/DriverPipeline.hs
+--- ghc-7.4.1.20120508/compiler/main/DriverPipeline.hs.arm 2012-05-15 02:10:41.000000000 +0900
++++ ghc-7.4.1.20120508/compiler/main/DriverPipeline.hs 2012-05-18 12:19:22.779955285 +0900
+@@ -1366,7 +1366,8 @@
+ SysTools.FileOption "" input_fn,
+ SysTools.Option "-o", SysTools.FileOption "" output_fn]
+ ++ map SysTools.Option lc_opts
+- ++ map SysTools.Option fpOpts)
++ ++ map SysTools.Option fpOpts
++ ++ map SysTools.Option abiOpts)
+
+ return (next_phase, output_fn)
+ where
+@@ -1378,12 +1379,19 @@
+ -- while compiling GHC source code. It's probably due to fact that it
+ -- does not enable VFP by default. Let's do this manually here
+ fpOpts = case platformArch (targetPlatform dflags) of
+- ArchARM ARMv7 ext -> if (elem VFPv3 ext)
++ ArchARM ARMv7 ext _ -> if (elem VFPv3 ext)
+ then ["-mattr=+v7,+vfp3"]
+ else if (elem VFPv3D16 ext)
+ then ["-mattr=+v7,+vfp3,+d16"]
+ else []
+ _ -> []
++ -- On Ubuntu/Debian with ARM hard float ABI, LLVM's llc still
++ -- compiles into soft-float ABI. We need to explicitly set abi
++ -- to hard
++ abiOpts = case platformArch (targetPlatform dflags) of
++ ArchARM ARMv7 _ HARD -> ["-float-abi=hard"]
++ ArchARM ARMv7 _ _ -> []
++ _ -> []
+
+ -----------------------------------------------------------------------------
+ -- LlvmMangle phase
+@@ -1532,8 +1540,8 @@
+
+ elfSectionNote :: String
+ elfSectionNote = case platformArch (targetPlatform dflags) of
+- ArchARM _ _ -> "%note"
+- _ -> "@note"
++ ArchARM _ _ _ -> "%note"
++ _ -> "@note"
+
+ -- The "link info" is a string representing the parameters of the
+ -- link. We save this information in the binary, and the next time we
+diff --git a/compiler/nativeGen/AsmCodeGen.lhs b/compiler/nativeGen/AsmCodeGen.lhs
+index 1ad1242..e976e58 100644
+--- a/compiler/nativeGen/AsmCodeGen.lhs
++++ b/compiler/nativeGen/AsmCodeGen.lhs
+@@ -200,7 +200,7 @@ nativeCodeGen dflags h us cmms
+ ,ncgExpandTop = map SPARC.CodeGen.Expand.expandTop
+ ,ncgMakeFarBranches = id
+ }
+- ArchARM _ _ ->
++ ArchARM _ _ _ ->
+ panic "nativeCodeGen: No NCG for ARM"
+ ArchPPC_64 ->
+ panic "nativeCodeGen: No NCG for PPC 64"
+diff --git a/compiler/nativeGen/RegAlloc/Graph/TrivColorable.hs b/compiler/nativeGen/RegAlloc/Graph/TrivColorable.hs
+index 6067f23..6cd3f00 100644
+--- a/compiler/nativeGen/RegAlloc/Graph/TrivColorable.hs
++++ b/compiler/nativeGen/RegAlloc/Graph/TrivColorable.hs
+@@ -107,13 +107,13 @@ trivColorable
+ trivColorable platform virtualRegSqueeze realRegSqueeze RcInteger conflicts exclusions
+ | let !cALLOCATABLE_REGS_INTEGER
+ = iUnbox (case platformArch platform of
+- ArchX86 -> 3
+- ArchX86_64 -> 5
+- ArchPPC -> 16
+- ArchSPARC -> 14
+- ArchPPC_64 -> panic "trivColorable ArchPPC_64"
+- ArchARM _ _ -> panic "trivColorable ArchARM"
+- ArchUnknown -> panic "trivColorable ArchUnknown")
++ ArchX86 -> 3
++ ArchX86_64 -> 5
++ ArchPPC -> 16
++ ArchSPARC -> 14
++ ArchPPC_64 -> panic "trivColorable ArchPPC_64"
++ ArchARM _ _ _ -> panic "trivColorable ArchARM"
++ ArchUnknown -> panic "trivColorable ArchUnknown")
+ , count2 <- accSqueeze (_ILIT(0)) cALLOCATABLE_REGS_INTEGER
+ (virtualRegSqueeze RcInteger)
+ conflicts
+@@ -127,13 +127,13 @@ trivColorable platform virtualRegSqueeze realRegSqueeze RcInteger conflicts excl
+ trivColorable platform virtualRegSqueeze realRegSqueeze RcFloat conflicts exclusions
+ | let !cALLOCATABLE_REGS_FLOAT
+ = iUnbox (case platformArch platform of
+- ArchX86 -> 0
+- ArchX86_64 -> 0
+- ArchPPC -> 0
+- ArchSPARC -> 22
+- ArchPPC_64 -> panic "trivColorable ArchPPC_64"
+- ArchARM _ _ -> panic "trivColorable ArchARM"
+- ArchUnknown -> panic "trivColorable ArchUnknown")
++ ArchX86 -> 0
++ ArchX86_64 -> 0
++ ArchPPC -> 0
++ ArchSPARC -> 22
++ ArchPPC_64 -> panic "trivColorable ArchPPC_64"
++ ArchARM _ _ _ -> panic "trivColorable ArchARM"
++ ArchUnknown -> panic "trivColorable ArchUnknown")
+ , count2 <- accSqueeze (_ILIT(0)) cALLOCATABLE_REGS_FLOAT
+ (virtualRegSqueeze RcFloat)
+ conflicts
+@@ -147,13 +147,13 @@ trivColorable platform virtualRegSqueeze realRegSqueeze RcFloat conflicts exclus
+ trivColorable platform virtualRegSqueeze realRegSqueeze RcDouble conflicts exclusions
+ | let !cALLOCATABLE_REGS_DOUBLE
+ = iUnbox (case platformArch platform of
+- ArchX86 -> 6
+- ArchX86_64 -> 0
+- ArchPPC -> 26
+- ArchSPARC -> 11
+- ArchPPC_64 -> panic "trivColorable ArchPPC_64"
+- ArchARM _ _ -> panic "trivColorable ArchARM"
+- ArchUnknown -> panic "trivColorable ArchUnknown")
++ ArchX86 -> 6
++ ArchX86_64 -> 0
++ ArchPPC -> 26
++ ArchSPARC -> 11
++ ArchPPC_64 -> panic "trivColorable ArchPPC_64"
++ ArchARM _ _ _ -> panic "trivColorable ArchARM"
++ ArchUnknown -> panic "trivColorable ArchUnknown")
+ , count2 <- accSqueeze (_ILIT(0)) cALLOCATABLE_REGS_DOUBLE
+ (virtualRegSqueeze RcDouble)
+ conflicts
+@@ -167,13 +167,13 @@ trivColorable platform virtualRegSqueeze realRegSqueeze RcDouble conflicts exclu
+ trivColorable platform virtualRegSqueeze realRegSqueeze RcDoubleSSE conflicts exclusions
+ | let !cALLOCATABLE_REGS_SSE
+ = iUnbox (case platformArch platform of
+- ArchX86 -> 8
+- ArchX86_64 -> 10
+- ArchPPC -> 0
+- ArchSPARC -> 0
+- ArchPPC_64 -> panic "trivColorable ArchPPC_64"
+- ArchARM _ _ -> panic "trivColorable ArchARM"
+- ArchUnknown -> panic "trivColorable ArchUnknown")
++ ArchX86 -> 8
++ ArchX86_64 -> 10
++ ArchPPC -> 0
++ ArchSPARC -> 0
++ ArchPPC_64 -> panic "trivColorable ArchPPC_64"
++ ArchARM _ _ _ -> panic "trivColorable ArchARM"
++ ArchUnknown -> panic "trivColorable ArchUnknown")
+ , count2 <- accSqueeze (_ILIT(0)) cALLOCATABLE_REGS_SSE
+ (virtualRegSqueeze RcDoubleSSE)
+ conflicts
+diff --git a/compiler/nativeGen/RegAlloc/Linear/FreeRegs.hs b/compiler/nativeGen/RegAlloc/Linear/FreeRegs.hs
+index 6fbbd04..fd1fd27 100644
+--- a/compiler/nativeGen/RegAlloc/Linear/FreeRegs.hs
++++ b/compiler/nativeGen/RegAlloc/Linear/FreeRegs.hs
+@@ -68,11 +68,11 @@ instance FR SPARC.FreeRegs where
+ maxSpillSlots :: Platform -> Int
+ maxSpillSlots platform
+ = case platformArch platform of
+- ArchX86 -> X86.Instr.maxSpillSlots True -- 32bit
+- ArchX86_64 -> X86.Instr.maxSpillSlots False -- not 32bit
+- ArchPPC -> PPC.Instr.maxSpillSlots
+- ArchSPARC -> SPARC.Instr.maxSpillSlots
+- ArchARM _ _ -> panic "maxSpillSlots ArchARM"
+- ArchPPC_64 -> panic "maxSpillSlots ArchPPC_64"
+- ArchUnknown -> panic "maxSpillSlots ArchUnknown"
++ ArchX86 -> X86.Instr.maxSpillSlots True -- 32bit
++ ArchX86_64 -> X86.Instr.maxSpillSlots False -- not 32bit
++ ArchPPC -> PPC.Instr.maxSpillSlots
++ ArchSPARC -> SPARC.Instr.maxSpillSlots
++ ArchARM _ _ _ -> panic "maxSpillSlots ArchARM"
++ ArchPPC_64 -> panic "maxSpillSlots ArchPPC_64"
++ ArchUnknown -> panic "maxSpillSlots ArchUnknown"
+
+diff --git a/compiler/nativeGen/RegAlloc/Linear/Main.hs b/compiler/nativeGen/RegAlloc/Linear/Main.hs
+index fc0bde4..64b0f68 100644
+--- a/compiler/nativeGen/RegAlloc/Linear/Main.hs
++++ b/compiler/nativeGen/RegAlloc/Linear/Main.hs
+@@ -180,13 +180,13 @@ linearRegAlloc
+ linearRegAlloc dflags first_id block_live sccs
+ = let platform = targetPlatform dflags
+ in case platformArch platform of
+- ArchX86 -> linearRegAlloc' platform (frInitFreeRegs :: X86.FreeRegs) first_id block_live sccs
+- ArchX86_64 -> linearRegAlloc' platform (frInitFreeRegs :: X86.FreeRegs) first_id block_live sccs
+- ArchSPARC -> linearRegAlloc' platform (frInitFreeRegs :: SPARC.FreeRegs) first_id block_live sccs
+- ArchPPC -> linearRegAlloc' platform (frInitFreeRegs :: PPC.FreeRegs) first_id block_live sccs
+- ArchARM _ _ -> panic "linearRegAlloc ArchARM"
+- ArchPPC_64 -> panic "linearRegAlloc ArchPPC_64"
+- ArchUnknown -> panic "linearRegAlloc ArchUnknown"
++ ArchX86 -> linearRegAlloc' platform (frInitFreeRegs :: X86.FreeRegs) first_id block_live sccs
++ ArchX86_64 -> linearRegAlloc' platform (frInitFreeRegs :: X86.FreeRegs) first_id block_live sccs
++ ArchSPARC -> linearRegAlloc' platform (frInitFreeRegs :: SPARC.FreeRegs) first_id block_live sccs
++ ArchPPC -> linearRegAlloc' platform (frInitFreeRegs :: PPC.FreeRegs) first_id block_live sccs
++ ArchARM _ _ _ -> panic "linearRegAlloc ArchARM"
++ ArchPPC_64 -> panic "linearRegAlloc ArchPPC_64"
++ ArchUnknown -> panic "linearRegAlloc ArchUnknown"
+
+ linearRegAlloc'
+ :: (FR freeRegs, PlatformOutputable instr, Instruction instr)
+diff --git a/compiler/nativeGen/TargetReg.hs b/compiler/nativeGen/TargetReg.hs
+index cbc4c17..13293de 100644
+--- a/compiler/nativeGen/TargetReg.hs
++++ b/compiler/nativeGen/TargetReg.hs
+@@ -50,35 +50,35 @@ import qualified SPARC.Regs as SPARC
+ targetVirtualRegSqueeze :: Platform -> RegClass -> VirtualReg -> FastInt
+ targetVirtualRegSqueeze platform
+ = case platformArch platform of
+- ArchX86 -> X86.virtualRegSqueeze
+- ArchX86_64 -> X86.virtualRegSqueeze
+- ArchPPC -> PPC.virtualRegSqueeze
+- ArchSPARC -> SPARC.virtualRegSqueeze
+- ArchPPC_64 -> panic "targetVirtualRegSqueeze ArchPPC_64"
+- ArchARM _ _ -> panic "targetVirtualRegSqueeze ArchARM"
+- ArchUnknown -> panic "targetVirtualRegSqueeze ArchUnknown"
++ ArchX86 -> X86.virtualRegSqueeze
++ ArchX86_64 -> X86.virtualRegSqueeze
++ ArchPPC -> PPC.virtualRegSqueeze
++ ArchSPARC -> SPARC.virtualRegSqueeze
++ ArchPPC_64 -> panic "targetVirtualRegSqueeze ArchPPC_64"
++ ArchARM _ _ _ -> panic "targetVirtualRegSqueeze ArchARM"
++ ArchUnknown -> panic "targetVirtualRegSqueeze ArchUnknown"
+
+ targetRealRegSqueeze :: Platform -> RegClass -> RealReg -> FastInt
+ targetRealRegSqueeze platform
+ = case platformArch platform of
+- ArchX86 -> X86.realRegSqueeze
+- ArchX86_64 -> X86.realRegSqueeze
+- ArchPPC -> PPC.realRegSqueeze
+- ArchSPARC -> SPARC.realRegSqueeze
+- ArchPPC_64 -> panic "targetRealRegSqueeze ArchPPC_64"
+- ArchARM _ _ -> panic "targetRealRegSqueeze ArchARM"
+- ArchUnknown -> panic "targetRealRegSqueeze ArchUnknown"
++ ArchX86 -> X86.realRegSqueeze
++ ArchX86_64 -> X86.realRegSqueeze
++ ArchPPC -> PPC.realRegSqueeze
++ ArchSPARC -> SPARC.realRegSqueeze
++ ArchPPC_64 -> panic "targetRealRegSqueeze ArchPPC_64"
++ ArchARM _ _ _ -> panic "targetRealRegSqueeze ArchARM"
++ ArchUnknown -> panic "targetRealRegSqueeze ArchUnknown"
+
+ targetClassOfRealReg :: Platform -> RealReg -> RegClass
+ targetClassOfRealReg platform
+ = case platformArch platform of
+- ArchX86 -> X86.classOfRealReg
+- ArchX86_64 -> X86.classOfRealReg
+- ArchPPC -> PPC.classOfRealReg
+- ArchSPARC -> SPARC.classOfRealReg
+- ArchPPC_64 -> panic "targetClassOfRealReg ArchPPC_64"
+- ArchARM _ _ -> panic "targetClassOfRealReg ArchARM"
+- ArchUnknown -> panic "targetClassOfRealReg ArchUnknown"
++ ArchX86 -> X86.classOfRealReg
++ ArchX86_64 -> X86.classOfRealReg
++ ArchPPC -> PPC.classOfRealReg
++ ArchSPARC -> SPARC.classOfRealReg
++ ArchPPC_64 -> panic "targetClassOfRealReg ArchPPC_64"
++ ArchARM _ _ _ -> panic "targetClassOfRealReg ArchARM"
++ ArchUnknown -> panic "targetClassOfRealReg ArchUnknown"
+
+ -- TODO: This should look at targetPlatform too
+ targetWordSize :: Size
+@@ -87,24 +87,24 @@ targetWordSize = intSize wordWidth
+ targetMkVirtualReg :: Platform -> Unique -> Size -> VirtualReg
+ targetMkVirtualReg platform
+ = case platformArch platform of
+- ArchX86 -> X86.mkVirtualReg
+- ArchX86_64 -> X86.mkVirtualReg
+- ArchPPC -> PPC.mkVirtualReg
+- ArchSPARC -> SPARC.mkVirtualReg
+- ArchPPC_64 -> panic "targetMkVirtualReg ArchPPC_64"
+- ArchARM _ _ -> panic "targetMkVirtualReg ArchARM"
+- ArchUnknown -> panic "targetMkVirtualReg ArchUnknown"
++ ArchX86 -> X86.mkVirtualReg
++ ArchX86_64 -> X86.mkVirtualReg
++ ArchPPC -> PPC.mkVirtualReg
++ ArchSPARC -> SPARC.mkVirtualReg
++ ArchPPC_64 -> panic "targetMkVirtualReg ArchPPC_64"
++ ArchARM _ _ _ -> panic "targetMkVirtualReg ArchARM"
++ ArchUnknown -> panic "targetMkVirtualReg ArchUnknown"
+
+ targetRegDotColor :: Platform -> RealReg -> SDoc
+ targetRegDotColor platform
+ = case platformArch platform of
+- ArchX86 -> X86.regDotColor platform
+- ArchX86_64 -> X86.regDotColor platform
+- ArchPPC -> PPC.regDotColor
+- ArchSPARC -> SPARC.regDotColor
+- ArchPPC_64 -> panic "targetRegDotColor ArchPPC_64"
+- ArchARM _ _ -> panic "targetRegDotColor ArchARM"
+- ArchUnknown -> panic "targetRegDotColor ArchUnknown"
++ ArchX86 -> X86.regDotColor platform
++ ArchX86_64 -> X86.regDotColor platform
++ ArchPPC -> PPC.regDotColor
++ ArchSPARC -> SPARC.regDotColor
++ ArchPPC_64 -> panic "targetRegDotColor ArchPPC_64"
++ ArchARM _ _ _ -> panic "targetRegDotColor ArchARM"
++ ArchUnknown -> panic "targetRegDotColor ArchUnknown"
+
+
+ targetClassOfReg :: Platform -> Reg -> RegClass
+diff --git a/compiler/utils/Platform.hs b/compiler/utils/Platform.hs
+index 47dd779..8252621 100644
+--- a/compiler/utils/Platform.hs
++++ b/compiler/utils/Platform.hs
+@@ -7,6 +7,7 @@ module Platform (
+ OS(..),
+ ArmISA(..),
+ ArmISAExt(..),
++ ArmABI(..),
+
+ target32Bit,
+ osElfTarget
+@@ -41,7 +42,9 @@ data Arch
+ | ArchSPARC
+ | ArchARM
+ { armISA :: ArmISA
+- , armISAExt :: [ArmISAExt] }
++ , armISAExt :: [ArmISAExt]
++ , armABI :: ArmABI
++ }
+ deriving (Read, Show, Eq)
+
+
+@@ -61,7 +64,7 @@ data OS
+ | OSHaiku
+ deriving (Read, Show, Eq)
+
+--- | ARM Instruction Set Architecture and Extensions
++-- | ARM Instruction Set Architecture, Extensions and ABI
+ --
+ data ArmISA
+ = ARMv5
+@@ -77,6 +80,11 @@ data ArmISAExt
+ | IWMMX2
+ deriving (Read, Show, Eq)
+
++data ArmABI
++ = SOFT
++ | SOFTFP
++ | HARD
++ deriving (Read, Show, Eq)
+
+ target32Bit :: Platform -> Bool
+ target32Bit p = platformWordSize p == 4
+diff --git a/config.guess b/config.guess
+index 463a03a..d622a44 100644
+--- a/config.guess
++++ b/config.guess
+@@ -1,10 +1,10 @@
+ #! /bin/sh
+ # Attempt to guess a canonical system name.
+ # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
+-# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
+-# Free Software Foundation, Inc.
++# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010,
++# 2011, 2012 Free Software Foundation, Inc.
+
+-timestamp='2008-11-15'
++timestamp='2012-02-10'
+
+ # This file is free software; you can redistribute it and/or modify it
+ # under the terms of the GNU General Public License as published by
+@@ -17,9 +17,7 @@ timestamp='2008-11-15'
+ # General Public License for more details.
+ #
+ # You should have received a copy of the GNU General Public License
+-# along with this program; if not, write to the Free Software
+-# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA
+-# 02110-1301, USA.
++# along with this program; if not, see <http://www.gnu.org/licenses/>.
+ #
+ # As a special exception to the GNU General Public License, if you
+ # distribute this file as part of a program that contains a
+@@ -27,16 +25,16 @@ timestamp='2008-11-15'
+ # the same distribution terms that you use for the rest of that program.
+
+
+-# Originally written by Per Bothner <per@bothner.com>.
+-# Please send patches to <config-patches@gnu.org>. Submit a context
+-# diff and a properly formatted ChangeLog entry.
++# Originally written by Per Bothner. Please send patches (context
++# diff format) to <config-patches@gnu.org> and include a ChangeLog
++# entry.
+ #
+ # This script attempts to guess a canonical system name similar to
+ # config.sub. If it succeeds, it prints the system name on stdout, and
+ # exits with 0. Otherwise, it exits with 1.
+ #
+-# The plan is that this can be called by configure scripts if you
+-# don't specify an explicit build system type.
++# You can get the latest version of this script from:
++# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD
+
+ me=`echo "$0" | sed -e 's,.*/,,'`
+
+@@ -56,8 +54,9 @@ version="\
+ GNU config.guess ($timestamp)
+
+ Originally written by Per Bothner.
+-Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001,
+-2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
++Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
++2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012
++Free Software Foundation, Inc.
+
+ This is free software; see the source for copying conditions. There is NO
+ warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
+@@ -144,7 +143,7 @@ UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
+ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
+ *:NetBSD:*:*)
+ # NetBSD (nbsd) targets should (where applicable) match one or
+- # more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*,
++ # more of the tuples: *-*-netbsdelf*, *-*-netbsdaout*,
+ # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently
+ # switched to ELF, *-*-netbsd* would select the old
+ # object file format. This provides both forward
+@@ -170,7 +169,7 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
+ arm*|i386|m68k|ns32k|sh3*|sparc|vax)
+ eval $set_cc_for_build
+ if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \
+- | grep __ELF__ >/dev/null
++ | grep -q __ELF__
+ then
+ # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout).
+ # Return netbsd for either. FIX?
+@@ -180,7 +179,7 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
+ fi
+ ;;
+ *)
+- os=netbsd
++ os=netbsd
+ ;;
+ esac
+ # The OS release
+@@ -223,7 +222,7 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
+ UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'`
+ ;;
+ *5.*)
+- UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'`
++ UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'`
+ ;;
+ esac
+ # According to Compaq, /usr/sbin/psrinfo has been available on
+@@ -269,7 +268,10 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
+ # A Xn.n version is an unreleased experimental baselevel.
+ # 1.2 uses "1.2" for uname -r.
+ echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
+- exit ;;
++ # Reset EXIT trap before exiting to avoid spurious non-zero exit code.
++ exitcode=$?
++ trap '' 0
++ exit $exitcode ;;
+ Alpha\ *:Windows_NT*:*)
+ # How do we know it's Interix rather than the generic POSIX subsystem?
+ # Should we change UNAME_MACHINE based on the output of uname instead
+@@ -295,7 +297,7 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
+ echo s390-ibm-zvmoe
+ exit ;;
+ *:OS400:*:*)
+- echo powerpc-ibm-os400
++ echo powerpc-ibm-os400
+ exit ;;
+ arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
+ echo arm-acorn-riscix${UNAME_RELEASE}
+@@ -324,12 +326,18 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
+ case `/usr/bin/uname -p` in
+ sparc) echo sparc-icl-nx7; exit ;;
+ esac ;;
++ s390x:SunOS:*:*)
++ echo ${UNAME_MACHINE}-ibm-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
++ exit ;;
+ sun4H:SunOS:5.*:*)
+ echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+ exit ;;
+ sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*)
+ echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+ exit ;;
++ i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*)
++ echo i386-pc-auroraux${UNAME_RELEASE}
++ exit ;;
+ i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*)
+ eval $set_cc_for_build
+ SUN_ARCH="i386"
+@@ -337,17 +345,7 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
+ # Note that the Sun cc does not turn __LP64__ into 1 like gcc does.
+ # This test works for both compilers.
+ if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
+- # bash is not able to generate correct code here
+- # i.e. it leaves \ns there
+- # so we need to use /usr/bin/echo to get what we want
+- # note that if config.guess is run by /bin/sh then
+- # this works as expected even without /usr/bin/echo
+- # but the problem is that configure is clever enough
+- # to find bash installed and then runs config.guess
+- # by bash instead of by /bin/sh
+- # It seems that using /usr/bin/echo here is the most
+- # portable Solaris fix
+- if /usr/bin/echo '\n#ifdef __amd64\nIS_64BIT_ARCH\n#endif' | \
++ if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \
+ (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
+ grep IS_64BIT_ARCH >/dev/null
+ then
+@@ -398,23 +396,23 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
+ # MiNT. But MiNT is downward compatible to TOS, so this should
+ # be no problem.
+ atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*)
+- echo m68k-atari-mint${UNAME_RELEASE}
++ echo m68k-atari-mint${UNAME_RELEASE}
+ exit ;;
+ atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*)
+ echo m68k-atari-mint${UNAME_RELEASE}
+- exit ;;
++ exit ;;
+ *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*)
+- echo m68k-atari-mint${UNAME_RELEASE}
++ echo m68k-atari-mint${UNAME_RELEASE}
+ exit ;;
+ milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*)
+- echo m68k-milan-mint${UNAME_RELEASE}
+- exit ;;
++ echo m68k-milan-mint${UNAME_RELEASE}
++ exit ;;
+ hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*)
+- echo m68k-hades-mint${UNAME_RELEASE}
+- exit ;;
++ echo m68k-hades-mint${UNAME_RELEASE}
++ exit ;;
+ *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*)
+- echo m68k-unknown-mint${UNAME_RELEASE}
+- exit ;;
++ echo m68k-unknown-mint${UNAME_RELEASE}
++ exit ;;
+ m68k:machten:*:*)
+ echo m68k-apple-machten${UNAME_RELEASE}
+ exit ;;
+@@ -484,8 +482,8 @@ EOF
+ echo m88k-motorola-sysv3
+ exit ;;
+ AViiON:dgux:*:*)
+- # DG/UX returns AViiON for all architectures
+- UNAME_PROCESSOR=`/usr/bin/uname -p`
++ # DG/UX returns AViiON for all architectures
++ UNAME_PROCESSOR=`/usr/bin/uname -p`
+ if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ]
+ then
+ if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \
+@@ -498,7 +496,7 @@ EOF
+ else
+ echo i586-dg-dgux${UNAME_RELEASE}
+ fi
+- exit ;;
++ exit ;;
+ M88*:DolphinOS:*:*) # DolphinOS (SVR3)
+ echo m88k-dolphin-sysv3
+ exit ;;
+@@ -555,7 +553,7 @@ EOF
+ echo rs6000-ibm-aix3.2
+ fi
+ exit ;;
+- *:AIX:*:[456])
++ *:AIX:*:[4567])
+ IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'`
+ if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then
+ IBM_ARCH=rs6000
+@@ -598,52 +596,52 @@ EOF
+ 9000/[678][0-9][0-9])
+ if [ -x /usr/bin/getconf ]; then
+ sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null`
+- sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null`
+- case "${sc_cpu_version}" in
+- 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0
+- 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1
+- 532) # CPU_PA_RISC2_0
+- case "${sc_kernel_bits}" in
+- 32) HP_ARCH="hppa2.0n" ;;
+- 64) HP_ARCH="hppa2.0w" ;;
++ sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null`
++ case "${sc_cpu_version}" in
++ 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0
++ 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1
++ 532) # CPU_PA_RISC2_0
++ case "${sc_kernel_bits}" in
++ 32) HP_ARCH="hppa2.0n" ;;
++ 64) HP_ARCH="hppa2.0w" ;;
+ '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20
+- esac ;;
+- esac
++ esac ;;
++ esac
+ fi
+ if [ "${HP_ARCH}" = "" ]; then
+ eval $set_cc_for_build
+- sed 's/^ //' << EOF >$dummy.c
++ sed 's/^ //' << EOF >$dummy.c
+
+- #define _HPUX_SOURCE
+- #include <stdlib.h>
+- #include <unistd.h>
++ #define _HPUX_SOURCE
++ #include <stdlib.h>
++ #include <unistd.h>
+
+- int main ()
+- {
+- #if defined(_SC_KERNEL_BITS)
+- long bits = sysconf(_SC_KERNEL_BITS);
+- #endif
+- long cpu = sysconf (_SC_CPU_VERSION);
++ int main ()
++ {
++ #if defined(_SC_KERNEL_BITS)
++ long bits = sysconf(_SC_KERNEL_BITS);
++ #endif
++ long cpu = sysconf (_SC_CPU_VERSION);
+
+- switch (cpu)
+- {
+- case CPU_PA_RISC1_0: puts ("hppa1.0"); break;
+- case CPU_PA_RISC1_1: puts ("hppa1.1"); break;
+- case CPU_PA_RISC2_0:
+- #if defined(_SC_KERNEL_BITS)
+- switch (bits)
+- {
+- case 64: puts ("hppa2.0w"); break;
+- case 32: puts ("hppa2.0n"); break;
+- default: puts ("hppa2.0"); break;
+- } break;
+- #else /* !defined(_SC_KERNEL_BITS) */
+- puts ("hppa2.0"); break;
+- #endif
+- default: puts ("hppa1.0"); break;
+- }
+- exit (0);
+- }
++ switch (cpu)
++ {
++ case CPU_PA_RISC1_0: puts ("hppa1.0"); break;
++ case CPU_PA_RISC1_1: puts ("hppa1.1"); break;
++ case CPU_PA_RISC2_0:
++ #if defined(_SC_KERNEL_BITS)
++ switch (bits)
++ {
++ case 64: puts ("hppa2.0w"); break;
++ case 32: puts ("hppa2.0n"); break;
++ default: puts ("hppa2.0"); break;
++ } break;
++ #else /* !defined(_SC_KERNEL_BITS) */
++ puts ("hppa2.0"); break;
++ #endif
++ default: puts ("hppa1.0"); break;
++ }
++ exit (0);
++ }
+ EOF
+ (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy`
+ test -z "$HP_ARCH" && HP_ARCH=hppa
+@@ -663,7 +661,7 @@ EOF
+ # => hppa64-hp-hpux11.23
+
+ if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) |
+- grep __LP64__ >/dev/null
++ grep -q __LP64__
+ then
+ HP_ARCH="hppa2.0w"
+ else
+@@ -734,22 +732,22 @@ EOF
+ exit ;;
+ C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*)
+ echo c1-convex-bsd
+- exit ;;
++ exit ;;
+ C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*)
+ if getsysinfo -f scalar_acc
+ then echo c32-convex-bsd
+ else echo c2-convex-bsd
+ fi
+- exit ;;
++ exit ;;
+ C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*)
+ echo c34-convex-bsd
+- exit ;;
++ exit ;;
+ C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*)
+ echo c38-convex-bsd
+- exit ;;
++ exit ;;
+ C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*)
+ echo c4-convex-bsd
+- exit ;;
++ exit ;;
+ CRAY*Y-MP:*:*:*)
+ echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
+ exit ;;
+@@ -773,14 +771,14 @@ EOF
+ exit ;;
+ F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*)
+ FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
+- FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
+- FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`
+- echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
+- exit ;;
++ FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
++ FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`
++ echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
++ exit ;;
+ 5000:UNIX_System_V:4.*:*)
+- FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
+- FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'`
+- echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
++ FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
++ FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'`
++ echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
+ exit ;;
+ i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*)
+ echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE}
+@@ -792,13 +790,12 @@ EOF
+ echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE}
+ exit ;;
+ *:FreeBSD:*:*)
+- case ${UNAME_MACHINE} in
+- pc98)
+- echo i386-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
++ UNAME_PROCESSOR=`/usr/bin/uname -p`
++ case ${UNAME_PROCESSOR} in
+ amd64)
+ echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
+ *)
+- echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
++ echo ${UNAME_PROCESSOR}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
+ esac
+ exit ;;
+ i*:CYGWIN*:*)
+@@ -807,19 +804,22 @@ EOF
+ *:MINGW*:*)
+ echo ${UNAME_MACHINE}-pc-mingw32
+ exit ;;
++ i*:MSYS*:*)
++ echo ${UNAME_MACHINE}-pc-msys
++ exit ;;
+ i*:windows32*:*)
+- # uname -m includes "-pc" on this system.
+- echo ${UNAME_MACHINE}-mingw32
++ # uname -m includes "-pc" on this system.
++ echo ${UNAME_MACHINE}-mingw32
+ exit ;;
+ i*:PW*:*)
+ echo ${UNAME_MACHINE}-pc-pw32
+ exit ;;
+- *:Interix*:[3456]*)
+- case ${UNAME_MACHINE} in
++ *:Interix*:*)
++ case ${UNAME_MACHINE} in
+ x86)
+ echo i586-pc-interix${UNAME_RELEASE}
+ exit ;;
+- EM64T | authenticamd | genuineintel)
++ authenticamd | genuineintel | EM64T)
+ echo x86_64-unknown-interix${UNAME_RELEASE}
+ exit ;;
+ IA64)
+@@ -829,6 +829,9 @@ EOF
+ [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*)
+ echo i${UNAME_MACHINE}-pc-mks
+ exit ;;
++ 8664:Windows_NT:*)
++ echo x86_64-pc-mks
++ exit ;;
+ i*:Windows_NT*:* | Pentium*:Windows_NT*:*)
+ # How do we know it's Interix rather than the generic POSIX subsystem?
+ # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we
+@@ -858,6 +861,27 @@ EOF
+ i*86:Minix:*:*)
+ echo ${UNAME_MACHINE}-pc-minix
+ exit ;;
++ aarch64:Linux:*:*)
++ echo ${UNAME_MACHINE}-unknown-linux-gnu
++ exit ;;
++ aarch64_be:Linux:*:*)
++ UNAME_MACHINE=aarch64_be
++ echo ${UNAME_MACHINE}-unknown-linux-gnu
++ exit ;;
++ alpha:Linux:*:*)
++ case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
++ EV5) UNAME_MACHINE=alphaev5 ;;
++ EV56) UNAME_MACHINE=alphaev56 ;;
++ PCA56) UNAME_MACHINE=alphapca56 ;;
++ PCA57) UNAME_MACHINE=alphapca56 ;;
++ EV6) UNAME_MACHINE=alphaev6 ;;
++ EV67) UNAME_MACHINE=alphaev67 ;;
++ EV68*) UNAME_MACHINE=alphaev68 ;;
++ esac
++ objdump --private-headers /bin/sh | grep -q ld.so.1
++ if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi
++ echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC}
++ exit ;;
+ arm*:Linux:*:*)
+ eval $set_cc_for_build
+ if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \
+@@ -865,20 +889,40 @@ EOF
+ then
+ echo ${UNAME_MACHINE}-unknown-linux-gnu
+ else
+- echo ${UNAME_MACHINE}-unknown-linux-gnueabi
++ if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \
++ | grep -q __ARM_PCS_VFP
++ then
++ echo ${UNAME_MACHINE}-unknown-linux-gnueabi
++ else
++ echo ${UNAME_MACHINE}-unknown-linux-gnueabihf
++ fi
+ fi
+ exit ;;
+ avr32*:Linux:*:*)
+ echo ${UNAME_MACHINE}-unknown-linux-gnu
+ exit ;;
+ cris:Linux:*:*)
+- echo cris-axis-linux-gnu
++ echo ${UNAME_MACHINE}-axis-linux-gnu
+ exit ;;
+ crisv32:Linux:*:*)
+- echo crisv32-axis-linux-gnu
++ echo ${UNAME_MACHINE}-axis-linux-gnu
+ exit ;;
+ frv:Linux:*:*)
+- echo frv-unknown-linux-gnu
++ echo ${UNAME_MACHINE}-unknown-linux-gnu
++ exit ;;
++ hexagon:Linux:*:*)
++ echo ${UNAME_MACHINE}-unknown-linux-gnu
++ exit ;;
++ i*86:Linux:*:*)
++ LIBC=gnu
++ eval $set_cc_for_build
++ sed 's/^ //' << EOF >$dummy.c
++ #ifdef __dietlibc__
++ LIBC=dietlibc
++ #endif
++EOF
++ eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC'`
++ echo "${UNAME_MACHINE}-pc-linux-${LIBC}"
+ exit ;;
+ ia64:Linux:*:*)
+ echo ${UNAME_MACHINE}-unknown-linux-gnu
+@@ -889,78 +933,34 @@ EOF
+ m68*:Linux:*:*)
+ echo ${UNAME_MACHINE}-unknown-linux-gnu
+ exit ;;
+- mips:Linux:*:*)
+- eval $set_cc_for_build
+- sed 's/^ //' << EOF >$dummy.c
+- #undef CPU
+- #undef mips
+- #undef mipsel
+- #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
+- CPU=mipsel
+- #else
+- #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
+- CPU=mips
+- #else
+- CPU=
+- #endif
+- #endif
+-EOF
+- eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n '
+- /^CPU/{
+- s: ::g
+- p
+- }'`"
+- test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; }
+- ;;
+- mips64:Linux:*:*)
++ mips:Linux:*:* | mips64:Linux:*:*)
+ eval $set_cc_for_build
+ sed 's/^ //' << EOF >$dummy.c
+ #undef CPU
+- #undef mips64
+- #undef mips64el
++ #undef ${UNAME_MACHINE}
++ #undef ${UNAME_MACHINE}el
+ #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
+- CPU=mips64el
++ CPU=${UNAME_MACHINE}el
+ #else
+ #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
+- CPU=mips64
++ CPU=${UNAME_MACHINE}
+ #else
+ CPU=
+ #endif
+ #endif
+ EOF
+- eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n '
+- /^CPU/{
+- s: ::g
+- p
+- }'`"
++ eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'`
+ test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; }
+ ;;
+ or32:Linux:*:*)
+- echo or32-unknown-linux-gnu
+- exit ;;
+- ppc:Linux:*:*)
+- echo powerpc-unknown-linux-gnu
+- exit ;;
+- ppc64:Linux:*:*)
+- echo powerpc64-unknown-linux-gnu
+- exit ;;
+- alpha:Linux:*:*)
+- case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
+- EV5) UNAME_MACHINE=alphaev5 ;;
+- EV56) UNAME_MACHINE=alphaev56 ;;
+- PCA56) UNAME_MACHINE=alphapca56 ;;
+- PCA57) UNAME_MACHINE=alphapca56 ;;
+- EV6) UNAME_MACHINE=alphaev6 ;;
+- EV67) UNAME_MACHINE=alphaev67 ;;
+- EV68*) UNAME_MACHINE=alphaev68 ;;
+- esac
+- objdump --private-headers /bin/sh | grep ld.so.1 >/dev/null
+- if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi
+- echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC}
++ echo ${UNAME_MACHINE}-unknown-linux-gnu
+ exit ;;
+ padre:Linux:*:*)
+ echo sparc-unknown-linux-gnu
+ exit ;;
++ parisc64:Linux:*:* | hppa64:Linux:*:*)
++ echo hppa64-unknown-linux-gnu
++ exit ;;
+ parisc:Linux:*:* | hppa:Linux:*:*)
+ # Look for CPU level
+ case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in
+@@ -969,14 +969,17 @@ EOF
+ *) echo hppa-unknown-linux-gnu ;;
+ esac
+ exit ;;
+- parisc64:Linux:*:* | hppa64:Linux:*:*)
+- echo hppa64-unknown-linux-gnu
++ ppc64:Linux:*:*)
++ echo powerpc64-unknown-linux-gnu
++ exit ;;
++ ppc:Linux:*:*)
++ echo powerpc-unknown-linux-gnu
+ exit ;;
+ s390:Linux:*:* | s390x:Linux:*:*)
+ echo ${UNAME_MACHINE}-ibm-linux
+ exit ;;
+ sh64*:Linux:*:*)
+- echo ${UNAME_MACHINE}-unknown-linux-gnu
++ echo ${UNAME_MACHINE}-unknown-linux-gnu
+ exit ;;
+ sh*:Linux:*:*)
+ echo ${UNAME_MACHINE}-unknown-linux-gnu
+@@ -984,75 +987,18 @@ EOF
+ sparc:Linux:*:* | sparc64:Linux:*:*)
+ echo ${UNAME_MACHINE}-unknown-linux-gnu
+ exit ;;
++ tile*:Linux:*:*)
++ echo ${UNAME_MACHINE}-unknown-linux-gnu
++ exit ;;
+ vax:Linux:*:*)
+ echo ${UNAME_MACHINE}-dec-linux-gnu
+ exit ;;
+ x86_64:Linux:*:*)
+- echo x86_64-unknown-linux-gnu
++ echo ${UNAME_MACHINE}-unknown-linux-gnu
+ exit ;;
+ xtensa*:Linux:*:*)
+- echo ${UNAME_MACHINE}-unknown-linux-gnu
++ echo ${UNAME_MACHINE}-unknown-linux-gnu
+ exit ;;
+- i*86:Linux:*:*)
+- # The BFD linker knows what the default object file format is, so
+- # first see if it will tell us. cd to the root directory to prevent
+- # problems with other programs or directories called `ld' in the path.
+- # Set LC_ALL=C to ensure ld outputs messages in English.
+- ld_supported_targets=`cd /; LC_ALL=C ld --help 2>&1 \
+- | sed -ne '/supported targets:/!d
+- s/[ ][ ]*/ /g
+- s/.*supported targets: *//
+- s/ .*//
+- p'`
+- case "$ld_supported_targets" in
+- elf32-i386)
+- TENTATIVE="${UNAME_MACHINE}-pc-linux-gnu"
+- ;;
+- a.out-i386-linux)
+- echo "${UNAME_MACHINE}-pc-linux-gnuaout"
+- exit ;;
+- "")
+- # Either a pre-BFD a.out linker (linux-gnuoldld) or
+- # one that does not give us useful --help.
+- echo "${UNAME_MACHINE}-pc-linux-gnuoldld"
+- exit ;;
+- esac
+- # Determine whether the default compiler is a.out or elf
+- eval $set_cc_for_build
+- sed 's/^ //' << EOF >$dummy.c
+- #include <features.h>
+- #ifdef __ELF__
+- # ifdef __GLIBC__
+- # if __GLIBC__ >= 2
+- LIBC=gnu
+- # else
+- LIBC=gnulibc1
+- # endif
+- # else
+- LIBC=gnulibc1
+- # endif
+- #else
+- #if defined(__INTEL_COMPILER) || defined(__PGI) || defined(__SUNPRO_C) || defined(__SUNPRO_CC)
+- LIBC=gnu
+- #else
+- LIBC=gnuaout
+- #endif
+- #endif
+- #ifdef __dietlibc__
+- LIBC=dietlibc
+- #endif
+-EOF
+- eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n '
+- /^LIBC/{
+- s: ::g
+- p
+- }'`"
+- test x"${LIBC}" != x && {
+- echo "${UNAME_MACHINE}-pc-linux-${LIBC}"
+- exit
+- }
+- test x"${TENTATIVE}" != x && { echo "${TENTATIVE}"; exit; }
+- ;;
+ i*86:DYNIX/ptx:4*:*)
+ # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.
+ # earlier versions are messed up and put the nodename in both
+@@ -1060,11 +1006,11 @@ EOF
+ echo i386-sequent-sysv4
+ exit ;;
+ i*86:UNIX_SV:4.2MP:2.*)
+- # Unixware is an offshoot of SVR4, but it has its own version
+- # number series starting with 2...
+- # I am not positive that other SVR4 systems won't match this,
++ # Unixware is an offshoot of SVR4, but it has its own version
++ # number series starting with 2...
++ # I am not positive that other SVR4 systems won't match this,
+ # I just have to hope. -- rms.
+- # Use sysv4.2uw... so that sysv4* matches it.
++ # Use sysv4.2uw... so that sysv4* matches it.
+ echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION}
+ exit ;;
+ i*86:OS/2:*:*)
+@@ -1081,7 +1027,7 @@ EOF
+ i*86:syllable:*:*)
+ echo ${UNAME_MACHINE}-pc-syllable
+ exit ;;
+- i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*)
++ i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*)
+ echo i386-unknown-lynxos${UNAME_RELEASE}
+ exit ;;
+ i*86:*DOS:*:*)
+@@ -1096,7 +1042,7 @@ EOF
+ fi
+ exit ;;
+ i*86:*:5:[678]*)
+- # UnixWare 7.x, OpenUNIX and OpenServer 6.
++ # UnixWare 7.x, OpenUNIX and OpenServer 6.
+ case `/bin/uname -X | grep "^Machine"` in
+ *486*) UNAME_MACHINE=i486 ;;
+ *Pentium) UNAME_MACHINE=i586 ;;
+@@ -1124,10 +1070,13 @@ EOF
+ exit ;;
+ pc:*:*:*)
+ # Left here for compatibility:
+- # uname -m prints for DJGPP always 'pc', but it prints nothing about
+- # the processor, so we play safe by assuming i386.
+- echo i386-pc-msdosdjgpp
+- exit ;;
++ # uname -m prints for DJGPP always 'pc', but it prints nothing about
++ # the processor, so we play safe by assuming i586.
++ # Note: whatever this is, it MUST be the same as what config.sub
++ # prints for the "djgpp" host, or else GDB configury will decide that
++ # this is a cross-build.
++ echo i586-pc-msdosdjgpp
++ exit ;;
+ Intel:Mach:3*:*)
+ echo i386-pc-mach3
+ exit ;;
+@@ -1162,8 +1111,18 @@ EOF
+ /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
+ && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;
+ 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*)
+- /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
+- && { echo i486-ncr-sysv4; exit; } ;;
++ /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
++ && { echo i486-ncr-sysv4; exit; } ;;
++ NCR*:*:4.2:* | MPRAS*:*:4.2:*)
++ OS_REL='.3'
++ test -r /etc/.relid \
++ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
++ /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
++ && { echo i486-ncr-sysv4.3${OS_REL}; exit; }
++ /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
++ && { echo i586-ncr-sysv4.3${OS_REL}; exit; }
++ /bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \
++ && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;
+ m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*)
+ echo m68k-unknown-lynxos${UNAME_RELEASE}
+ exit ;;
+@@ -1176,7 +1135,7 @@ EOF
+ rs6000:LynxOS:2.*:*)
+ echo rs6000-unknown-lynxos${UNAME_RELEASE}
+ exit ;;
+- PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.0*:*)
++ PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*)
+ echo powerpc-unknown-lynxos${UNAME_RELEASE}
+ exit ;;
+ SM[BE]S:UNIX_SV:*:*)
+@@ -1196,10 +1155,10 @@ EOF
+ echo ns32k-sni-sysv
+ fi
+ exit ;;
+- PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort
+- # says <Richard.M.Bartel@ccMail.Census.GOV>
+- echo i586-unisys-sysv4
+- exit ;;
++ PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort
++ # says <Richard.M.Bartel@ccMail.Census.GOV>
++ echo i586-unisys-sysv4
++ exit ;;
+ *:UNIX_System_V:4*:FTX*)
+ # From Gerald Hewes <hewes@openmarket.com>.
+ # How about differentiating between stratus architectures? -djm
+@@ -1225,11 +1184,11 @@ EOF
+ exit ;;
+ R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*)
+ if [ -d /usr/nec ]; then
+- echo mips-nec-sysv${UNAME_RELEASE}
++ echo mips-nec-sysv${UNAME_RELEASE}
+ else
+- echo mips-unknown-sysv${UNAME_RELEASE}
++ echo mips-unknown-sysv${UNAME_RELEASE}
+ fi
+- exit ;;
++ exit ;;
+ BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only.
+ echo powerpc-be-beos
+ exit ;;
+@@ -1269,6 +1228,16 @@ EOF
+ *:Darwin:*:*)
+ UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown
+ case $UNAME_PROCESSOR in
++ i386)
++ eval $set_cc_for_build
++ if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
++ if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \
++ (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
++ grep IS_64BIT_ARCH >/dev/null
++ then
++ UNAME_PROCESSOR="x86_64"
++ fi
++ fi ;;
+ unknown) UNAME_PROCESSOR=powerpc ;;
+ esac
+ echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE}
+@@ -1284,6 +1253,9 @@ EOF
+ *:QNX:*:4*)
+ echo i386-pc-qnx
+ exit ;;
++ NEO-?:NONSTOP_KERNEL:*:*)
++ echo neo-tandem-nsk${UNAME_RELEASE}
++ exit ;;
+ NSE-?:NONSTOP_KERNEL:*:*)
+ echo nse-tandem-nsk${UNAME_RELEASE}
+ exit ;;
+@@ -1329,13 +1301,13 @@ EOF
+ echo pdp10-unknown-its
+ exit ;;
+ SEI:*:*:SEIUX)
+- echo mips-sei-seiux${UNAME_RELEASE}
++ echo mips-sei-seiux${UNAME_RELEASE}
+ exit ;;
+ *:DragonFly:*:*)
+ echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
+ exit ;;
+ *:*VMS:*:*)
+- UNAME_MACHINE=`(uname -p) 2>/dev/null`
++ UNAME_MACHINE=`(uname -p) 2>/dev/null`
+ case "${UNAME_MACHINE}" in
+ A*) echo alpha-dec-vms ; exit ;;
+ I*) echo ia64-dec-vms ; exit ;;
+@@ -1350,6 +1322,12 @@ EOF
+ i*86:rdos:*:*)
+ echo ${UNAME_MACHINE}-pc-rdos
+ exit ;;
++ i*86:AROS:*:*)
++ echo ${UNAME_MACHINE}-pc-aros
++ exit ;;
++ x86_64:VMkernel:*:*)
++ echo ${UNAME_MACHINE}-unknown-esx
++ exit ;;
+ esac
+
+ #echo '(No uname command or uname output not recognized.)' 1>&2
+@@ -1372,11 +1350,11 @@ main ()
+ #include <sys/param.h>
+ printf ("m68k-sony-newsos%s\n",
+ #ifdef NEWSOS4
+- "4"
++ "4"
+ #else
+- ""
++ ""
+ #endif
+- ); exit (0);
++ ); exit (0);
+ #endif
+ #endif
+
+diff --git a/configure.ac b/configure.ac
+index 9237c77..8e3d9d2 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -210,6 +210,20 @@ AC_CANONICAL_BUILD
+ AC_CANONICAL_HOST
+ AC_CANONICAL_TARGET
+
++# Testing ARM ABI
++# required for code generation (LLVM options)
++ARM_ABI=SOFT
++echo HOST: $host
++
++case $host in
++ arm*-*-linux-gnueabihf)
++ ARM_ABI=HARD
++ ;;
++ arm*-*-linux-gnueabi)
++ ARM_ABI=SOFTFP
++ ;;
++esac
++
+ FPTOOLS_SET_PLATFORM_VARS
+
+ # Verify that the installed (bootstrap) GHC is capable of generating
+--
+1.7.4.3
+
diff --git a/tools/ghc/ghc-7.4-silence-gen_contents_index.patch b/tools/ghc/ghc-7.4-silence-gen_contents_index.patch
new file mode 100644
index 0000000..d000b8b
--- /dev/null
+++ b/tools/ghc/ghc-7.4-silence-gen_contents_index.patch
@@ -0,0 +1,11 @@
+--- ghc-7.4.1/libraries/gen_contents_index~ 2012-09-30 16:14:39.368295240 +0900
++++ ghc-7.4.1/libraries/gen_contents_index 2012-10-30 19:12:10.017398594 +0900
+@@ -50,7 +50,7 @@
+ esac
+
+ # Now create the combined contents and index pages
+-echo $HADDOCK_ARGS
++#echo $HADDOCK_ARGS
+ $HADDOCK --gen-index --gen-contents -o . \
+ -t "Haskell Hierarchical Libraries" \
+ -p "prologue.txt" \
diff --git a/tools/ghc/ghc-7.4.2-Cabal-disable-ghci-libs.patch b/tools/ghc/ghc-7.4.2-Cabal-disable-ghci-libs.patch
new file mode 100644
index 0000000..cdefe0d
--- /dev/null
+++ b/tools/ghc/ghc-7.4.2-Cabal-disable-ghci-libs.patch
@@ -0,0 +1,13 @@
+--- ghc-7.4.2/libraries/Cabal/Cabal/Distribution/Simple/Setup.hs~ 2012-06-07 02:10:40.000000000 +0900
++++ ghc-7.4.2/libraries/Cabal/Cabal/Distribution/Simple/Setup.hs 2012-08-24 20:33:00.032123967 +0900
+@@ -313,7 +313,7 @@
+ configDistPref = Flag defaultDistPref,
+ configVerbosity = Flag normal,
+ configUserInstall = Flag False, --TODO: reverse this
+- configGHCiLib = Flag True,
++ configGHCiLib = Flag False,
+ configSplitObjs = Flag False, -- takes longer, so turn off by default
+ configStripExes = Flag True,
+ configTests = Flag False,
+
+Diff finished. Fri Aug 24 20:33:10 2012
diff --git a/tools/ghc/ghc-doc-index b/tools/ghc/ghc-doc-index
new file mode 100755
index 0000000..6105d7e
--- /dev/null
+++ b/tools/ghc/ghc-doc-index
@@ -0,0 +1,38 @@
+#!/bin/sh
+
+LOCKFILE=/var/lock/ghc-doc-index.lock
+
+# the lockfile is not meant to be perfect, it's just in case
+# two cron scripts get run close to each other to keep
+# them from stepping on each other's toes.
+if [ -f $LOCKFILE ]; then
+ echo "Locked with $LOCKFILE"
+ exit 0
+fi
+
+if [ "$(id -u)" != "0" ]; then
+ echo Need to be root!
+ exit 1
+fi
+
+trap "{ rm -f $LOCKFILE ; exit 255; }" EXIT
+touch $LOCKFILE
+
+PKGDIRCACHE=/var/lib/ghc/pkg-dir.cache
+LISTING="env LANG=C ls -dl"
+
+# only re-index ghc docs when there are changes
+cd /usr/share/doc/ghc/html/libraries
+if [ -r "$PKGDIRCACHE" ]; then
+ $LISTING */ > $PKGDIRCACHE.new
+ DIR_DIFF=$(diff $PKGDIRCACHE $PKGDIRCACHE.new)
+else
+ $LISTING */ > $PKGDIRCACHE
+fi
+if [ -x "gen_contents_index" -a ! -r "$PKGDIRCACHE.new" -o -n "$DIR_DIFF" ]; then
+ ./gen_contents_index
+fi
+
+if [ -f $PKGDIRCACHE.new ]; then
+ mv -f $PKGDIRCACHE{.new,}
+fi
diff --git a/tools/ghc/ghc-doc-index.cron b/tools/ghc/ghc-doc-index.cron
new file mode 100755
index 0000000..4efe2ff
--- /dev/null
+++ b/tools/ghc/ghc-doc-index.cron
@@ -0,0 +1,9 @@
+#! /bin/bash
+# updates the library documentation index after updates
+
+# This can be disabled by uninstalling ghc-doc-index
+# or adding ghc-doc-index to "./jobs-deny".
+
+/usr/bin/ghc-doc-index
+
+exit 0
diff --git a/tools/ghc/ghc-gen_contents_index-type-level.patch b/tools/ghc/ghc-gen_contents_index-type-level.patch
new file mode 100644
index 0000000..05a9e42
--- /dev/null
+++ b/tools/ghc/ghc-gen_contents_index-type-level.patch
@@ -0,0 +1,12 @@
+diff -u ghc-6.12.3/libraries/gen_contents_index\~ ghc-6.12.3/libraries/gen_contents_index
+--- ghc-6.12.3/libraries/gen_contents_index~ 2010-09-14 13:03:12.000000000 +1000
++++ ghc-6.12.3/libraries/gen_contents_index 2010-11-04 16:41:32.000000000 +1000
+@@ -24,7 +24,7 @@
+ *)
+ HADDOCK=/usr/bin/haddock
+ # We don't want the GHC API to swamp the index
+- HADDOCK_FILES=`ls -1 */*.haddock | grep -v '/ghc\.haddock' | sort`
++ HADDOCK_FILES=`ls -1 */*.haddock | grep -v '/ghc\.haddock' | grep -v '/type-level\.haddock' | sort`
+ for HADDOCK_FILE in $HADDOCK_FILES
+ do
+ NAME_VERSION=`echo "$HADDOCK_FILE" | sed 's#/.*##'`
diff --git a/tools/ghc/ghc-llvmCodeGen-empty-array.patch b/tools/ghc/ghc-llvmCodeGen-empty-array.patch
new file mode 100644
index 0000000..2129e52
--- /dev/null
+++ b/tools/ghc/ghc-llvmCodeGen-empty-array.patch
@@ -0,0 +1,44 @@
+commit db9b63105a541e4ad3f9c55e2cfadf716445ab87
+Author: Geoffrey Mainland <gmainlan@microsoft.com>
+Date: Wed Jun 12 14:31:49 2013 +0100
+
+ Avoid generating empty llvm.used definitions.
+
+ LLVM 3.3rc3 complains when the llvm.used global is an empty array, so don't
+ define llvm.used at all when it would be empty.
+
+ Modified compiler/llvmGen/LlvmCodeGen.hs
+diff --git a/compiler/llvmGen/LlvmCodeGen.hs b/compiler/llvmGen/LlvmCodeGen.hs
+index a157a25..4f2bded 100644
+--- a/compiler/llvmGen/LlvmCodeGen.hs
++++ b/compiler/llvmGen/LlvmCodeGen.hs
+@@ -117,18 +117,18 @@ cmmProcLlvmGens :: DynFlags -> BufHandle -> UniqSupply -> LlvmEnv -> [RawCmmDecl
+ -> [[LlvmVar]] -- ^ info tables that need to be marked as 'used'
+ -> IO ()
+
+-cmmProcLlvmGens _ _ _ _ [] _ []
+- = return ()
+-
+ cmmProcLlvmGens _ h _ _ [] _ ivars
+- = let ivars' = concat ivars
+- cast x = LMBitc (LMStaticPointer (pVarLift x)) i8Ptr
+- ty = (LMArray (length ivars') i8Ptr)
+- usedArray = LMStaticArray (map cast ivars') ty
+- lmUsed = (LMGlobalVar (fsLit "llvm.used") ty Appending
+- (Just $ fsLit "llvm.metadata") Nothing False, Just usedArray)
+- in Prt.bufLeftRender h $ {-# SCC "llvm_used_ppr" #-}
+- pprLlvmData ([lmUsed], [])
++ | null ivars' = return ()
++ | otherwise = Prt.bufLeftRender h $
++ {-# SCC "llvm_used_ppr" #-}
++ pprLlvmData ([lmUsed], [])
++ where
++ ivars' = concat ivars
++ cast x = LMBitc (LMStaticPointer (pVarLift x)) i8Ptr
++ ty = (LMArray (length ivars') i8Ptr)
++ usedArray = LMStaticArray (map cast ivars') ty
++ lmUsed = (LMGlobalVar (fsLit "llvm.used") ty Appending
++ (Just $ fsLit "llvm.metadata") Nothing False, Just usedArray)
+
+ cmmProcLlvmGens dflags h us env ((CmmData _ _) : cmms) count ivars
+ = cmmProcLlvmGens dflags h us env cmms count ivars
diff --git a/tools/ghc/ghc-powerpc-linker-mmap.patch b/tools/ghc/ghc-powerpc-linker-mmap.patch
new file mode 100644
index 0000000..df0d5ff
--- /dev/null
+++ b/tools/ghc/ghc-powerpc-linker-mmap.patch
@@ -0,0 +1,34 @@
+diff -up ghc-7.0.2/rts/Linker.c.fix-powerpc ghc-7.0.2/rts/Linker.c
+--- ghc-7.0.2/rts/Linker.c.fix-powerpc 2011-02-28 19:10:08.000000000 +0100
++++ ghc-7.0.2/rts/Linker.c 2011-04-25 22:20:10.781092305 +0200
+@@ -70,11 +70,12 @@
+ #include <sys/wait.h>
+ #endif
+
+-#if defined(linux_HOST_OS ) || defined(freebsd_HOST_OS) || \
+- defined(dragonfly_HOST_OS) || defined(netbsd_HOST_OS ) || \
+- defined(openbsd_HOST_OS ) || \
+- ( defined(darwin_HOST_OS ) && !defined(powerpc_HOST_ARCH) )
+-/* Don't use mmap on powerpc-apple-darwin as mmap doesn't support
++#if !defined(powerpc_HOST_ARCH) && \
++ ( defined(linux_HOST_OS ) || defined(freebsd_HOST_OS) || \
++ defined(dragonfly_HOST_OS) || defined(netbsd_HOST_OS ) || \
++ defined(openbsd_HOST_OS ) || defined(darwin_HOST_OS ) || \
++ defined(kfreebsdgnu_HOST_OS) )
++/* Don't use mmap on powerpc_HOST_ARCH as mmap doesn't support
+ * reallocating but we need to allocate jump islands just after each
+ * object images. Otherwise relative branches to jump islands can fail
+ * due to 24-bits displacement overflow.
+@@ -2436,7 +2437,11 @@ static void ocFlushInstructionCacheFrom(
+ static void ocFlushInstructionCache( ObjectCode *oc )
+ {
+ /* The main object code */
+- ocFlushInstructionCacheFrom(oc->image + oc->misalignment, oc->fileSize);
++ ocFlushInstructionCacheFrom(oc->image
++#ifdef darwin_HOST_OS
++ + oc->misalignment
++#endif
++ , oc->fileSize);
+
+ /* Jump Islands */
+ ocFlushInstructionCacheFrom(oc->symbol_extras, sizeof(SymbolExtra) * oc->n_symbol_extras);
diff --git a/tools/ghc/ghc-powerpc-pthread.patch b/tools/ghc/ghc-powerpc-pthread.patch
new file mode 100644
index 0000000..d317ff7
--- /dev/null
+++ b/tools/ghc/ghc-powerpc-pthread.patch
@@ -0,0 +1,18 @@
+diff -up ghc-7.0.2/aclocal.m4.pthread ghc-7.0.2/aclocal.m4
+--- ghc-7.0.2/aclocal.m4.pthread 2011-02-28 13:10:03.000000000 -0500
++++ ghc-7.0.2/aclocal.m4 2011-04-20 07:12:36.489772545 -0400
+@@ -1385,7 +1385,7 @@ AC_MSG_NOTICE(Building in-tree ghc-pwd)
+ dnl except we don't want to have to know what make is called. Sigh.
+ rm -rf utils/ghc-pwd/dist-boot
+ mkdir utils/ghc-pwd/dist-boot
+- if ! "$WithGhc" -v0 -no-user-package-conf -hidir utils/ghc-pwd/dist-boot -odir utils/ghc-pwd/dist-boot -stubdir utils/ghc-pwd/dist-boot --make utils/ghc-pwd/Main.hs -o utils/ghc-pwd/dist-boot/ghc-pwd
++ if ! "$WithGhc" -optl-pthread -v0 -no-user-package-conf -hidir utils/ghc-pwd/dist-boot -odir utils/ghc-pwd/dist-boot -stubdir utils/ghc-pwd/dist-boot --make utils/ghc-pwd/Main.hs -o utils/ghc-pwd/dist-boot/ghc-pwd
+ then
+ AC_MSG_ERROR([Building ghc-pwd failed])
+ fi
+diff -up ghc-7.0.2/ghc/ghc.wrapper.pthread ghc-7.0.2/ghc/ghc.wrapper
+--- ghc-7.0.2/ghc/ghc.wrapper.pthread 2011-04-20 09:58:50.307894773 -0400
++++ ghc-7.0.2/ghc/ghc.wrapper 2011-04-20 09:59:14.477894370 -0400
+@@ -1 +1 @@
+-exec "$executablename" -B"$topdir" -pgmc "$pgmgcc" -pgma "$pgmgcc" -pgml "$pgmgcc" -pgmP "$pgmgcc -E -undef -traditional" ${1+"$@"}
++exec "$executablename" -B"$topdir" -pgmc "$pgmgcc" -pgma "$pgmgcc" -pgml "$pgmgcc" -pgmP "$pgmgcc -E -undef -traditional" -optl-pthread ${1+"$@"}
diff --git a/tools/ghc/ghc-use-system-libffi.patch b/tools/ghc/ghc-use-system-libffi.patch
new file mode 100644
index 0000000..304bcb9
--- /dev/null
+++ b/tools/ghc/ghc-use-system-libffi.patch
@@ -0,0 +1,83 @@
+This patch could be replaced by a configure call if
+http://hackage.haskell.org/trac/ghc/ticket/5743 were fixed.
+
+Index: ghc-7.4.0.20111219/rts/package.conf.in
+===================================================================
+--- ghc-7.4.0.20111219.orig/rts/package.conf.in 2011-12-21 23:21:03.000000000 +0100
++++ ghc-7.4.0.20111219/rts/package.conf.in 2011-12-21 23:21:04.000000000 +0100
+@@ -24,8 +24,9 @@
+ hs-libraries: "HSrts"
+
+ extra-libraries:
++ "ffi"
+ #ifdef HAVE_LIBM
+- "m" /* for ldexp() */
++ , "m" /* for ldexp() */
+ #endif
+ #ifdef HAVE_LIBRT
+ , "rt"
+Index: ghc-7.4.0.20111219/ghc.mk
+===================================================================
+--- ghc-7.4.0.20111219.orig/ghc.mk 2011-12-21 23:21:03.000000000 +0100
++++ ghc-7.4.0.20111219/ghc.mk 2011-12-21 23:21:04.000000000 +0100
+@@ -579,7 +579,6 @@
+ driver/ghci \
+ driver/ghc \
+ driver/haddock \
+- libffi \
+ includes \
+ rts
+
+Index: ghc-7.4.0.20111219/rts/ghc.mk
+===================================================================
+--- ghc-7.4.0.20111219.orig/rts/ghc.mk 2011-12-21 19:56:29.000000000 +0100
++++ ghc-7.4.0.20111219/rts/ghc.mk 2011-12-21 23:23:52.000000000 +0100
+@@ -86,8 +86,7 @@
+ ALL_RTS_DEF_LIBNAMES = base ghc-prim
+ ALL_RTS_DEF_LIBS = \
+ rts/dist/build/win32/libHSbase.dll.a \
+- rts/dist/build/win32/libHSghc-prim.dll.a \
+- libffi/build/inst/lib/libffi.dll.a
++ rts/dist/build/win32/libHSghc-prim.dll.a
+
+ # -- import libs for the regular Haskell libraries
+ define make-importlib-def # args $1 = lib name
+@@ -172,12 +171,12 @@
+ # Making a shared library for the RTS.
+ ifneq "$$(findstring dyn, $1)" ""
+ ifeq "$$(HOSTPLATFORM)" "i386-unknown-mingw32"
+-$$(rts_$1_LIB) : $$(rts_$1_OBJS) $$(ALL_RTS_DEF_LIBS) rts/libs.depend rts/dist/build/libffi-5.dll
++$$(rts_$1_LIB) : $$(rts_$1_OBJS) $$(ALL_RTS_DEF_LIBS) rts/libs.depend
+ "$$(RM)" $$(RM_OPTS) $$@
+ "$$(rts_dist_HC)" -package-name rts -shared -dynamic -dynload deploy \
+ -no-auto-link-packages -Lrts/dist/build -lffi-5 `cat rts/libs.depend` $$(rts_$1_OBJS) $$(ALL_RTS_DEF_LIBS) -o $$@
+ else
+-$$(rts_$1_LIB) : $$(rts_$1_OBJS) $$(rts_$1_DTRACE_OBJS) rts/libs.depend rts/dist/build/libffi$$(soext)
++$$(rts_$1_LIB) : $$(rts_$1_OBJS) $$(rts_$1_DTRACE_OBJS) rts/libs.depend
+ "$$(RM)" $$(RM_OPTS) $$@
+ "$$(rts_dist_HC)" -package-name rts -shared -dynamic -dynload deploy \
+ -no-auto-link-packages -Lrts/dist/build -lffi `cat rts/libs.depend` $$(rts_$1_OBJS) \
+@@ -188,9 +187,9 @@
+ endif
+ endif
+ else
+-$$(rts_$1_LIB) : $$(rts_$1_OBJS) $$(rts_$1_DTRACE_OBJS) $$(rts_ffi_objs_stamp)
++$$(rts_$1_LIB) : $$(rts_$1_OBJS) $$(rts_$1_DTRACE_OBJS)
+ "$$(RM)" $$(RM_OPTS) $$@
+- echo $$(rts_ffi_objs) $$(rts_$1_OBJS) $$(rts_$1_DTRACE_OBJS) | "$$(XARGS)" $$(XARGS_OPTS) "$$(AR_STAGE1)" \
++ echo $$(rts_$1_OBJS) $$(rts_$1_DTRACE_OBJS) | "$$(XARGS)" $$(XARGS_OPTS) "$$(AR_STAGE1)" \
+ $$(AR_OPTS_STAGE1) $$(EXTRA_AR_ARGS_STAGE1) $$@
+ endif
+
+@@ -504,10 +503,8 @@
+ # installing
+
+ INSTALL_LIBS += $(ALL_RTS_LIBS)
+-INSTALL_LIBS += $(wildcard rts/dist/build/libffi$(soext)*)
+-INSTALL_LIBS += $(wildcard rts/dist/build/libffi-5.dll)
+
+-install: install_libffi_headers
++install:
+
+ .PHONY: install_libffi_headers
+ install_libffi_headers :
diff --git a/tools/ghc/ghc-wrapper-libffi-include.patch b/tools/ghc/ghc-wrapper-libffi-include.patch
new file mode 100644
index 0000000..48870ec
--- /dev/null
+++ b/tools/ghc/ghc-wrapper-libffi-include.patch
@@ -0,0 +1,6 @@
+diff -u ghc-7.4.1/ghc/ghc.wrapper\~ ghc-7.4.1/ghc/ghc.wrapper
+--- ghc-7.4.1/ghc/ghc.wrapper~ 2012-02-02 03:10:32.000000000 +0900
++++ ghc-7.4.1/ghc/ghc.wrapper 2012-05-02 19:39:05.503872527 +0900
+@@ -1 +1 @@
+-exec "$executablename" -B"$topdir" ${1+"$@"}
++exec "$executablename" -B"$topdir" -optc-I$(pkg-config --variable=includedir libffi) ${1+"$@"}
diff --git a/tools/ghc/ghc.spec b/tools/ghc/ghc.spec
new file mode 100644
index 0000000..d131f16
--- /dev/null
+++ b/tools/ghc/ghc.spec
@@ -0,0 +1,1269 @@
+# Shared haskell libraries are supported for x86* archs
+# (disabled for other archs in ghc-rpm-macros)
+
+# To bootstrap build a new version of ghc, uncomment the following:
+#%%global ghc_bootstrapping 1
+#%%{?ghc_bootstrap}
+%global without_testsuite 1
+#%%global without_haddock 1
+%global without_manual 1
+
+# To do a test build instead with shared libs, uncomment the following:
+#%%global ghc_bootstrapping 1
+#%%{?ghc_test}
+#%%global without_testsuite 1
+
+# unregisterized archs
+%global unregisterised_archs ppc64 s390 s390x
+
+# ghc does not output dwarf format so debuginfo is not useful
+%global debug_package %{nil}
+
+%global space %(echo -n ' ')
+%global BSDHaskellReport BSD%{space}and%{space}HaskellReport
+
+# gcc-4.1 is too old for ghc7 dyn:
+# "/usr/bin/ld: rts/dist/build/RtsStartup.dyn_o: relocation R_X86_64_PC32 against `StgRun' can not be used when making a shared object; recompile with -fPIC"
+%global gcc gcc44
+
+Name: ghc
+# part of haskell-platform
+# ghc must be rebuilt after a version bump to avoid ABI change problems
+Version: 7.4.2
+# Since library subpackages are versioned:
+# - release can only be reset if *all* library versions get bumped simultaneously
+# (sometimes after a major release)
+# - minor release numbers for a branch should be incremented monotonically
+Release: 11.0.3%{?dist}
+Summary: Glasgow Haskell Compiler
+
+License: %BSDHaskellReport
+URL: http://haskell.org/ghc/
+Group: Development/Languages
+Source0: http://www.haskell.org/ghc/dist/%{version}/ghc-%{version}-src.tar.bz2
+%if %{undefined without_testsuite}
+Source2: http://www.haskell.org/ghc/dist/%{version}/ghc-%{version}-testsuite.tar.bz2
+%endif
+Source3: ghc-doc-index.cron
+Source4: ghc-doc-index
+# absolute haddock path (was for html/libraries -> libraries)
+Patch1: ghc-6.12.1-gen_contents_index-haddock-path.patch
+# type-level too big so skip it in gen_contents_index
+Patch2: ghc-gen_contents_index-type-level.patch
+# fedora does not allow copy libraries
+Patch4: ghc-use-system-libffi.patch
+Patch7: ghc-powerpc-pthread.patch
+# http://hackage.haskell.org/trac/ghc/ticket/4999
+Patch8: ghc-powerpc-linker-mmap.patch
+# fix dynamic linking of executables using Template Haskell
+Patch9: Cabal-fix-dynamic-exec-for-TH.patch
+# add libffi include dir to ghc wrapper for archs using gcc/llc
+Patch10: ghc-wrapper-libffi-include.patch
+# latest arm hf patch
+Patch11: ghc-7.4-add-support-for-ARM-hard-float-ABI-fixes-5914.patch
+# disable building HS*.o libs for ghci
+Patch12: ghc-7.4.2-Cabal-disable-ghci-libs.patch
+# fix compilation with llvm-3.3
+Patch13: ghc-llvmCodeGen-empty-array.patch
+Patch17: ghc-7.4-silence-gen_contents_index.patch
+
+BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
+# fedora ghc has been bootstrapped on
+# %{ix86} x86_64 ppc alpha sparcv9 ppc64 armv7hl armv5tel s390 s390x
+# see ghc_arches defined in /etc/rpm/macros.ghc-srpm by redhat-rpm-macros
+ExcludeArch: sparc64 ppc
+Obsoletes: ghc-dph-base < 0.5, ghc-dph-base-devel < 0.5, ghc-dph-base-prof < 0.5
+Obsoletes: ghc-dph-par < 0.5, ghc-dph-par-devel < 0.5, ghc-dph-par-prof < 0.5
+Obsoletes: ghc-dph-prim-interface < 0.5, ghc-dph-prim-interface-devel < 0.5, ghc-dph-interface-prim-prof < 0.5
+Obsoletes: ghc-dph-prim-par < 0.5, ghc-dph-prim-par-devel < 0.5, ghc-dph-prim-par-prof < 0.5
+Obsoletes: ghc-dph-prim-seq < 0.5, ghc-dph-prim-seq-devel < 0.5, ghc-dph-prim-seq-prof < 0.5
+Obsoletes: ghc-dph-seq < 0.5, ghc-dph-seq-devel < 0.5, ghc-dph-seq-prof < 0.5
+Obsoletes: ghc-feldspar-language < 0.4, ghc-feldspar-language-devel < 0.4, ghc-feldspar-language-prof < 0.4
+%if %{undefined ghc_bootstrapping}
+BuildRequires: ghc-compiler = %{version}
+%endif
+BuildRequires: ghc-rpm-macros >= 0.15.15
+BuildRequires: ghc-bytestring-devel
+BuildRequires: ghc-containers-devel
+BuildRequires: ghc-directory-devel
+BuildRequires: ghc-haskell98-devel
+BuildRequires: ghc-pretty-devel
+BuildRequires: ghc-process-devel
+BuildRequires: gmp-devel
+BuildRequires: libffi-devel
+# for internal terminfo
+BuildRequires: ncurses-devel
+%if %{undefined without_manual}
+BuildRequires: libxslt, docbook-style-xsl
+%endif
+%if %{undefined without_testsuite}
+BuildRequires: python
+%endif
+%ifarch armv7hl armv5tel
+BuildRequires: llvm >= 3.0
+%endif
+%ifarch armv7hl
+BuildRequires: autoconf
+%endif
+%ifarch %{ix86} x86_64
+BuildRequires: %{gcc}
+%endif
+Requires: ghc-compiler = %{version}-%{release}
+%if %{undefined without_haddock}
+Requires: ghc-doc-index = %{version}-%{release}
+%endif
+Requires: ghc-libraries = %{version}-%{release}
+Requires: ghc-ghc-devel = %{version}-%{release}
+
+%description
+GHC is a state-of-the-art, open source, compiler and interactive environment
+for the functional language Haskell. Highlights:
+
+- GHC supports the entire Haskell 2010 language plus various extensions.
+- GHC has particularly good support for concurrency and parallelism,
+ including support for Software Transactional Memory (STM).
+- GHC generates fast code, particularly for concurrent programs
+ (check the results on the "Computer Language Benchmarks Game").
+- GHC works on several platforms including Windows, Mac, Linux,
+ most varieties of Unix, and several different processor architectures.
+- GHC has extensive optimisation capabilities,
+ including inter-module optimisation.
+- GHC compiles Haskell code either directly to native code or using LLVM
+ as a back-end. GHC can also generate C code as an intermediate target for
+ porting to new platforms. The interactive environment compiles Haskell to
+ bytecode, and supports execution of mixed bytecode/compiled programs.
+- Profiling is supported, both by time/allocation and heap profiling.
+- GHC comes with core libraries, and thousands more are available on Hackage.
+
+%package compiler
+Summary: GHC compiler and utilities
+License: BSD
+Group: Development/Languages
+Requires: %{gcc}%{?_isa}
+Requires: ghc-base-devel%{?_isa}
+# for alternatives
+Requires(post): chkconfig
+Requires(postun): chkconfig
+# added in f14
+Obsoletes: ghc-doc < 6.12.3-4
+%ifarch armv7hl armv5tel
+Requires: llvm >= 3.0
+%endif
+
+%description compiler
+The package contains the GHC compiler, tools and utilities.
+
+The ghc libraries are provided by ghc-devel.
+To install all of ghc, install the ghc base package.
+
+%if %{undefined without_haddock}
+%package doc-index
+Summary: GHC library development documentation indexing
+License: BSD
+Group: Development/Languages
+Requires: ghc-compiler = %{version}-%{release}
+
+%description doc-index
+The package provides a cronjob for re-indexing installed library development
+documention.
+%endif
+
+%global ghc_version_override %{version}
+
+# needs ghc_version_override for bootstrapping
+%global _use_internal_dependency_generator 0
+%global __find_provides %{_prefix}/lib/rpm/ghc-deps.sh --provides %{buildroot}%{ghclibdir}
+%global __find_requires %{_prefix}/lib/rpm/ghc-deps.sh --requires %{buildroot}%{ghclibdir}
+
+
+%global ghc_pkg_c_deps ghc-compiler = %{ghc_version_override}-%{release}
+
+%if %{defined ghclibdir}
+%ghc_lib_subpackage Cabal 1.14.0
+%ghc_lib_subpackage -l %BSDHaskellReport array 0.4.0.0
+%ghc_lib_subpackage -l %BSDHaskellReport -c gmp-devel%{?_isa},libffi-devel%{?_isa} base 4.5.1.0
+%ghc_lib_subpackage binary 0.5.1.0
+%ghc_lib_subpackage bytestring 0.9.2.1
+%ghc_lib_subpackage -l %BSDHaskellReport containers 0.4.2.1
+%ghc_lib_subpackage -l %BSDHaskellReport deepseq 1.3.0.0
+%ghc_lib_subpackage -l %BSDHaskellReport directory 1.1.0.2
+%ghc_lib_subpackage -l %BSDHaskellReport extensible-exceptions 0.1.1.4
+%ghc_lib_subpackage filepath 1.3.0.0
+%define ghc_pkg_obsoletes ghc-bin-package-db-devel < 0.0.0.0-12
+# in ghc not ghc-libraries:
+%ghc_lib_subpackage -x ghc %{ghc_version_override}
+%undefine ghc_pkg_obsoletes
+%ghc_lib_subpackage -l HaskellReport haskell2010 1.1.0.1
+%ghc_lib_subpackage -l HaskellReport haskell98 2.0.0.1
+%ghc_lib_subpackage hoopl 3.8.7.3
+%ghc_lib_subpackage hpc 0.5.1.1
+%ghc_lib_subpackage -l %BSDHaskellReport old-locale 1.0.0.4
+%ghc_lib_subpackage -l %BSDHaskellReport old-time 1.1.0.0
+%ghc_lib_subpackage pretty 1.1.1.0
+%ghc_lib_subpackage -l %BSDHaskellReport process 1.1.0.1
+%ghc_lib_subpackage template-haskell 2.7.0.0
+%ghc_lib_subpackage time 1.4
+%ghc_lib_subpackage unix 2.5.1.1
+%endif
+
+%global version %{ghc_version_override}
+
+%package libraries
+Summary: GHC development libraries meta package
+License: %BSDHaskellReport
+Group: Development/Libraries
+Requires: ghc-compiler = %{version}-%{release}
+Obsoletes: ghc-devel < %{version}-%{release}
+Provides: ghc-devel = %{version}-%{release}
+Obsoletes: ghc-prof < %{version}-%{release}
+Provides: ghc-prof = %{version}-%{release}
+# since f15
+Obsoletes: ghc-libs < 7.0.1-3
+%{?ghc_packages_list:Requires: %(echo %{ghc_packages_list} | sed -e "s/\([^ ]*\)-\([^ ]*\)/ghc-\1-devel = \2-%{release},/g")}
+
+%description libraries
+This is a meta-package for all the development library packages in GHC
+except the ghc library, which is installed by the toplevel ghc metapackage.
+
+
+%prep
+%setup -q -n %{name}-%{version} %{!?without_testsuite:-b2}
+
+# tweaks to gen_contents_index
+%patch1 -p1 -b .orig
+%patch2 -p1
+%patch17 -p1
+
+# make sure we don't use these
+rm -r ghc-tarballs/{mingw,perl}
+# use system libffi
+%patch4 -p1 -b .libffi
+rm -r ghc-tarballs/libffi
+mkdir -p rts/dist/build
+ln -s $(pkg-config --variable=includedir libffi)/*.h rts/dist/build
+
+%patch9 -p1 -b .orig
+
+%ifnarch %{ix86} x86_64
+%patch10 -p1 -b .10-ffi
+%endif
+
+# ARM patches
+%ifarch armv7hl
+# touches aclocal.m4
+%patch11 -p1 -b .arm
+autoreconf
+%endif
+
+%patch12 -p1 -b .orig
+
+%patch13 -p1 -b .orig
+
+
+%build
+# http://hackage.haskell.org/trac/ghc/wiki/Platforms
+# cf https://github.com/gentoo-haskell/gentoo-haskell/tree/master/dev-lang/ghc
+cat > mk/build.mk << EOF
+GhcLibWays = v %{!?ghc_without_shared:dyn} %{!?without_prof:p}
+%if %{defined without_haddock}
+HADDOCK_DOCS = NO
+%endif
+%if %{defined without_manual}
+BUILD_DOCBOOK_HTML = NO
+%endif
+EOF
+
+export CFLAGS="${CFLAGS:-%optflags}"
+# use --with-gcc=%{_bindir}/gcc when bootstrapping to avoid ccache hardcoding problem
+./configure --prefix=%{_prefix} --exec-prefix=%{_exec_prefix} \
+ --bindir=%{_bindir} --sbindir=%{_sbindir} --sysconfdir=%{_sysconfdir} \
+ --datadir=%{_datadir} --includedir=%{_includedir} --libdir=%{_libdir} \
+ --libexecdir=%{_libexecdir} --localstatedir=%{_localstatedir} \
+ --sharedstatedir=%{_sharedstatedir} --mandir=%{_mandir} \
+ --with-gcc=%{_bindir}/%{gcc}
+
+make %{?_smp_mflags}
+
+
+%install
+rm -rf %{buildroot}
+make DESTDIR=%{buildroot} install
+
+for i in %{ghc_packages_list}; do
+name=$(echo $i | sed -e "s/\(.*\)-.*/\1/")
+ver=$(echo $i | sed -e "s/.*-\(.*\)/\1/")
+%ghc_gen_filelists $name $ver
+echo "%doc libraries/$name/LICENSE" >> ghc-$name%{?ghc_without_shared:-devel}.files
+done
+
+# ghc-base should own ghclibdir
+echo "%dir %{ghclibdir}" >> ghc-base%{?ghc_without_shared:-devel}.files
+
+%ghc_gen_filelists bin-package-db 0.0.0.0
+%ghc_gen_filelists ghc %{ghc_version_override}
+%ghc_gen_filelists ghc-prim 0.2.0.0
+%ghc_gen_filelists integer-gmp 0.4.0.0
+
+%define merge_filelist()\
+%if %{undefined ghc_without_shared}\
+cat ghc-%1.files >> ghc-%2.files\
+%endif\
+cat ghc-%1-devel.files >> ghc-%2-devel.files\
+cp -p libraries/%1/LICENSE libraries/LICENSE.%1\
+echo "%doc libraries/LICENSE.%1" >> ghc-%2.files
+
+%merge_filelist integer-gmp base
+%merge_filelist ghc-prim base
+%merge_filelist bin-package-db ghc
+
+# add rts libs
+%if %{undefined ghc_without_shared}
+ls %{buildroot}%{ghclibdir}/libHS*.so >> ghc-base.files
+sed -i -e "s|^%{buildroot}||g" ghc-base.files
+%endif
+ls -d %{buildroot}%{ghclibdir}/libHS*.a %{buildroot}%{ghclibdir}/package.conf.d/builtin_*.conf %{buildroot}%{ghclibdir}/include >> ghc-base-devel.files
+sed -i -e "s|^%{buildroot}||g" ghc-base-devel.files
+
+# these are handled as alternatives
+for i in hsc2hs runhaskell; do
+ if [ -x %{buildroot}%{_bindir}/$i-ghc ]; then
+ rm %{buildroot}%{_bindir}/$i
+ else
+ mv %{buildroot}%{_bindir}/$i{,-ghc}
+ fi
+ touch %{buildroot}%{_bindir}/$i
+done
+
+%ghc_strip_dynlinked
+
+%if %{undefined without_haddock}
+mkdir -p %{buildroot}%{_sysconfdir}/cron.hourly
+install -p --mode=0755 %SOURCE3 %{buildroot}%{_sysconfdir}/cron.hourly/ghc-doc-index
+mkdir -p %{buildroot}%{_localstatedir}/lib/ghc
+install -p --mode=0755 %SOURCE4 %{buildroot}%{_bindir}/ghc-doc-index
+%endif
+
+
+%check
+# stolen from ghc6/debian/rules:
+# Do some very simple tests that the compiler actually works
+rm -rf testghc
+mkdir testghc
+echo 'main = putStrLn "Foo"' > testghc/foo.hs
+inplace/bin/ghc-stage2 testghc/foo.hs -o testghc/foo
+[ "$(testghc/foo)" = "Foo" ]
+# doesn't seem to work inplace:
+#[ "$(inplace/bin/runghc testghc/foo.hs)" = "Foo" ]
+rm testghc/*
+echo 'main = putStrLn "Foo"' > testghc/foo.hs
+inplace/bin/ghc-stage2 testghc/foo.hs -o testghc/foo -O2
+[ "$(testghc/foo)" = "Foo" ]
+rm testghc/*
+%if %{undefined ghc_without_shared}
+echo 'main = putStrLn "Foo"' > testghc/foo.hs
+inplace/bin/ghc-stage2 testghc/foo.hs -o testghc/foo -dynamic
+[ "$(testghc/foo)" = "Foo" ]
+rm testghc/*
+%endif
+%if %{undefined without_testsuite}
+make test
+%endif
+
+%clean
+rm -rf $RPM_BUILD_ROOT
+
+%post compiler
+# Alas, GHC, Hugs, and nhc all come with different set of tools in
+# addition to a runFOO:
+#
+# * GHC: hsc2hs
+# * Hugs: hsc2hs, cpphs
+# * nhc: cpphs
+#
+# Therefore it is currently not possible to use --slave below to form
+# link groups under a single name 'runhaskell'. Either these tools
+# should be disentangled from the Haskell implementations, or all
+# implementations should have the same set of tools. *sigh*
+
+update-alternatives --install %{_bindir}/runhaskell runhaskell \
+ %{_bindir}/runghc 500
+update-alternatives --install %{_bindir}/hsc2hs hsc2hs \
+ %{_bindir}/hsc2hs-ghc 500
+
+%preun compiler
+if [ "$1" = 0 ]; then
+ update-alternatives --remove runhaskell %{_bindir}/runghc
+ update-alternatives --remove hsc2hs %{_bindir}/hsc2hs-ghc
+fi
+
+
+%files
+
+%files compiler
+%defattr(-,root,root,-)
+%doc ANNOUNCE HACKING LICENSE README
+%{_bindir}/ghc
+%{_bindir}/ghc-%{version}
+%{_bindir}/ghc-pkg
+%{_bindir}/ghc-pkg-%{version}
+%{_bindir}/ghci
+%{_bindir}/ghci-%{version}
+%{_bindir}/hp2ps
+%{_bindir}/hpc
+%ghost %{_bindir}/hsc2hs
+%{_bindir}/hsc2hs-ghc
+%{_bindir}/runghc
+%ghost %{_bindir}/runhaskell
+%{_bindir}/runhaskell-ghc
+%{ghclibdir}/ghc
+%{ghclibdir}/ghc-pkg
+%ifnarch %{unregisterised_archs}
+%{ghclibdir}/ghc-split
+%endif
+%{ghclibdir}/ghc-usage.txt
+%{ghclibdir}/ghci-usage.txt
+%{ghclibdir}/hsc2hs
+%dir %{ghclibdir}/package.conf.d
+%ghost %{ghclibdir}/package.conf.d/package.cache
+%{ghclibdir}/runghc
+%{ghclibdir}/settings
+%{ghclibdir}/template-hsc.h
+%{ghclibdir}/unlit
+%dir %{_docdir}/ghc
+%dir %{ghcdocbasedir}
+%if %{undefined without_haddock}
+%{_bindir}/ghc-doc-index
+%{_bindir}/haddock
+%{_bindir}/haddock-ghc-%{version}
+%{ghclibdir}/haddock
+%{ghclibdir}/html
+%{ghclibdir}/latex
+%if %{undefined without_manual}
+%{_mandir}/man1/ghc.*
+## needs pandoc
+#%{ghcdocbasedir}/Cabal
+%{ghcdocbasedir}/haddock
+%{ghcdocbasedir}/users_guide
+%endif
+%dir %{ghcdocbasedir}/libraries
+%{ghcdocbasedir}/libraries/frames.html
+%{ghcdocbasedir}/libraries/gen_contents_index
+%{ghcdocbasedir}/libraries/hscolour.css
+%{ghcdocbasedir}/libraries/ocean.css
+%{ghcdocbasedir}/libraries/prologue.txt
+%{ghcdocbasedir}/index.html
+%ghost %{ghcdocbasedir}/libraries/doc-index*.html
+%ghost %{ghcdocbasedir}/libraries/haddock-util.js
+%ghost %{ghcdocbasedir}/libraries/index*.html
+%ghost %{ghcdocbasedir}/libraries/minus.gif
+%ghost %{ghcdocbasedir}/libraries/plus.gif
+%{_localstatedir}/lib/ghc
+%endif
+
+%if %{undefined without_haddock}
+%files doc-index
+%defattr(-,root,root,-)
+%{_sysconfdir}/cron.hourly/ghc-doc-index
+%endif
+
+%files libraries
+
+
+%changelog
+* Tue Jan 21 2014 Jens Petersen <petersen@redhat.com> - 7.4.2-11.0.3
+- add Group for ghc-doc-index
+- disable testsuite (python too old)
+- skip manpage and building manual because of docbook issues
+
+* Mon Jan 20 2014 Jens Petersen <petersen@redhat.com> - 7.4.2-11.0.2
+- production build
+
+* Sat Jan 18 2014 Jens Petersen <petersen@fedoraproject.org> - 7.4.2-11.0.1
+- backport to EL5
+- build with gcc44
+- bootstrap
+- exclude ppc
+
+* Tue Jun 25 2013 Jens Petersen <petersen@redhat.com>
+- fix compilation with llvm-3.3 (#977652)
+ see http://hackage.haskell.org/trac/ghc/ticket/7996
+
+* Tue Feb 5 2013 Jens Petersen <petersen@redhat.com> - 7.4.2-11
+- ghclibdir should be owned at runtime by ghc-base instead of ghc-compiler
+ (thanks Michael Scherer, #907671)
+
+* Thu Jan 17 2013 Jens Petersen <petersen@redhat.com> - 7.4.2-10
+- rebuild for F19 libffi soname bump
+
+* Wed Nov 21 2012 Jens Petersen <petersen@redhat.com> - 7.4.2-9
+- fix permissions of ghc-doc-index and only run when root
+- ghc-doc-index cronjob no longer looks at /etc/sysconfig/ghc-doc-index
+
+* Sat Nov 17 2012 Jens Petersen <petersen@redhat.com> - 7.4.2-8
+- production 7.4.2 build
+ http://www.haskell.org/ghc/docs/7.4.2/html/users_guide/release-7-4-2.html
+
+* Sat Nov 17 2012 Jens Petersen <petersen@redhat.com> - 7.4.2-7
+- 7.4.2 bootstrap
+- update base and unix library versions
+- ARM StgCRun patches not longer needed
+- use Karel Gardas' ARM hardfloat patch committed upstream
+- use _smp_mflags again
+- disable Cabal building ghci lib files
+- silence the doc re-indexing script and move the doc indexing cronjob
+ to a new ghc-doc-index subpackage (#870694)
+- do not disable hscolour in build.mk
+- drop the explicit hscolour BR
+- without_hscolour should now be set by ghc-rpm-macros for bootstrapping
+
+* Thu Jul 19 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 7.4.1-6
+- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild
+
+* Fri Jun 15 2012 Jens Petersen <petersen@redhat.com> - 7.4.1-5
+- use ghc_lib_subpackage instead of ghc_binlib_package (ghc-rpm-macros 0.91)
+
+* Wed May 2 2012 Jens Petersen <petersen@redhat.com> - 7.4.1-4
+- add ghc-wrapper-libffi-include.patch to workaround "missing libffi.h"
+ for prof compiling on secondary archs
+
+* Sat Apr 28 2012 Jens Petersen <petersen@redhat.com> - 7.4.1-3
+- build with llvm-3.0 on ARM
+- remove ARM from unregisterised_archs
+- add 4 Debian ARM patches for armel and armhf (Iain Lane)
+
+* Wed Mar 21 2012 Jens Petersen <petersen@redhat.com> - 7.4.1-2
+- full build
+
+* Wed Feb 15 2012 Jens Petersen <petersen@redhat.com> - 7.4.1-1
+- update to new 7.4.1 major release
+ http://www.haskell.org/ghc/docs/7.4.1/html/users_guide/release-7-4-1.html
+- all library versions bumped
+- binary package replaces ghc-binary
+- random library dropped
+- new hoopl library
+- deepseq is now included in ghc
+- Cabal --enable-executable-dynamic patch is upstream
+- add Cabal-fix-dynamic-exec-for-TH.patch
+- sparc linking fix is upstream
+- use Debian's system-libffi patch by Joachim Breitner
+- setup ghc-deps.sh after ghc_version_override for bootstrapping
+- drop ppc64 config, pthread and mmap patches
+- do not set GhcUnregisterised explicitly
+- add s390 and s390x to unregisterised_archs
+- Cabal manual needs pandoc
+
+* Thu Jan 19 2012 Jens Petersen <petersen@redhat.com> - 7.0.4-42
+- move ghc-ghc-devel from ghc-libraries to the ghc metapackage
+
+* Fri Jan 13 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 7.0.4-41
+- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild
+
+* Mon Nov 14 2011 Jens Petersen <petersen@redhat.com> - 7.0.4-40
+- do alternatives handling correctly (reported by Giam Teck Choon, #753661)
+ see https://fedoraproject.org/wiki/Packaging:Alternatives
+
+* Sat Nov 12 2011 Jens Petersen <petersen@redhat.com> - 7.0.4-39
+- move ghc-doc and ghc-libs obsoletes
+- add HaskellReport license also to the base and libraries subpackages
+
+* Thu Nov 10 2011 Jens Petersen <petersen@redhat.com> - 7.0.4-38
+- the post and postun scripts are now for the compiler subpackage
+
+* Wed Nov 2 2011 Jens Petersen <petersen@redhat.com> - 7.0.4-37
+- rename ghc-devel metapackage to ghc-libraries
+- require ghc-rpm-macros-0.14
+
+* Tue Nov 1 2011 Jens Petersen <petersen@redhat.com> - 7.0.4-36
+- move compiler and tools to ghc-compiler
+- the ghc base package is now a metapackage that installs all of ghc,
+ ie ghc-compiler and ghc-devel (#750317)
+- drop ghc-doc provides
+
+* Fri Oct 28 2011 Jens Petersen <petersen@redhat.com> - 7.0.4-35.1
+- rebuild against new gmp
+
+* Fri Oct 28 2011 Jens Petersen <petersen@redhat.com> - 7.0.4-35
+- add HaskellReport license tag to some of the library subpackages
+ which contain some code from the Haskell Reports
+
+* Thu Oct 20 2011 Marcela Mašláňová <mmaslano@redhat.com> - 7.0.4-34.1
+- rebuild with new gmp without compat lib
+
+* Thu Oct 20 2011 Jens Petersen <petersen@redhat.com> - 7.0.4-34
+- setup ghc-deps.sh after ghc_version_override for bootstrapping
+
+* Tue Oct 18 2011 Jens Petersen <petersen@redhat.com> - 7.0.4-33
+- add armv5tel (ported by Henrik Nordström)
+- also use ghc-deps.sh when bootstrapping (ghc-rpm-macros-0.13.13)
+
+* Mon Oct 17 2011 Jens Petersen <petersen@redhat.com> - 7.0.4-32
+- remove libffi_archs: not allowed to bundle libffi on any arch
+- include the ghc (ghci) library in ghc-devel (Narasim)
+
+* Tue Oct 11 2011 Peter Schiffer <pschiffe@redhat.com> - 7.0.4-31.1
+- rebuild with new gmp
+
+* Fri Sep 30 2011 Jens Petersen <petersen@redhat.com> - 7.0.4-31
+- build with ghc-rpm-macros >= 0.13.11 to fix provides and obsoletes versions
+ in library devel subpackages
+
+* Thu Sep 29 2011 Jens Petersen <petersen@redhat.com> - 7.0.4-30
+- no need to specify -lffi in build.mk (Henrik Nordström)
+
+* Wed Sep 28 2011 Jens Petersen <petersen@redhat.com> - 7.0.4-29
+- port to armv7hl by Henrik Nordström (#741725)
+
+* Wed Sep 14 2011 Jens Petersen <petersen@redhat.com> - 7.0.4-28
+- setup ghc-deps.sh when not bootstrapping!
+
+* Wed Sep 14 2011 Jens Petersen <petersen@redhat.com> - 7.0.4-27
+- setup dependency generation with ghc-deps.sh since it was moved to
+ ghc_lib_install in ghc-rpm-macros
+
+* Fri Jun 17 2011 Jens Petersen <petersen@redhat.com> - 7.0.4-26
+- BR same ghc version unless ghc_bootstrapping defined
+- add libffi_archs
+- drop the quick build profile
+- put dyn before p in GhcLibWays
+- explain new bootstrapping mode using ghc_bootstrap (ghc-rpm-macros-0.13.5)
+
+* Thu Jun 16 2011 Jens Petersen <petersen@redhat.com> - 7.0.4-25
+- update to 7.0.4 bugfix release
+ http://haskell.org/ghc/docs/7.0.4/html/users_guide/release-7-0-4.html
+- strip static again (upstream #5004 fixed)
+- Cabal updated to 1.10.2.0
+- re-enable testsuite
+- update summary and description
+
+* Tue Jun 14 2011 Jens Petersen <petersen@redhat.com> - 7.0.2-24
+- finally change from ExclusiveArch to ExcludeArch to target more archs
+
+* Sat May 21 2011 Jens Petersen <petersen@redhat.com> - 7.0.2-23
+- obsolete dph libraries and feldspar-language
+
+* Mon May 16 2011 Jens Petersen <petersen@redhat.com> - 7.0.2-22
+- merge prof subpackages into the devel subpackages with ghc-rpm-macros-0.13
+
+* Wed May 11 2011 Jens Petersen <petersen@redhat.com> - 7.0.2-21
+- configure with /usr/bin/gcc to help bootstrapping to new archs
+ (otherwise ccache tends to get hardcoded as gcc, which not in koji)
+- posttrans scriplet for ghc_pkg_recache is redundant
+
+* Mon May 9 2011 Jens Petersen <petersen@redhat.com> - 7.0.2-20
+- make devel and prof meta packages require libs with release
+- make ghc-*-devel subpackages require ghc with release
+
+* Wed May 04 2011 Jiri Skala <jskala@redhat.com> - 7.0.2-19.1
+- fixes path to gcc on ppc64 arch
+
+* Tue Apr 26 2011 Jens Petersen <petersen@redhat.com> - 7.0.2-19
+- add upstream ghc-powerpc-linker-mmap.patch for ppc64 (Jiri Skala)
+
+* Thu Apr 21 2011 Jiri Skala <jskala@redhat.com> - 7.0.2-18
+- bootstrap to ppc64
+
+* Fri Apr 1 2011 Jens Petersen <petersen@redhat.com> - 7.0.2-17
+- rebuild against ghc-rpm-macros-0.11.14 to provide ghc-*-doc
+
+* Fri Apr 1 2011 Jens Petersen <petersen@redhat.com> - 7.0.2-16
+- provides ghc-doc again: it is still a buildrequires for libraries
+- ghc-prof now requires ghc-devel
+- ghc-devel now requires ghc explicitly
+
+* Wed Mar 30 2011 Jens Petersen <petersen@redhat.com> - 7.0.2-15
+- do not strip static libs since it breaks ghci-7.0.2 loading libHSghc.a
+ (see http://hackage.haskell.org/trac/ghc/ticket/5004)
+- no longer provide ghc-doc
+- no longer obsolete old haddock
+
+* Tue Mar 29 2011 Jens Petersen <petersen@redhat.com> - 7.0.2-14
+- fix back missing LICENSE files in library subpackages
+- drop ghc_reindex_haddock from install script
+
+* Thu Mar 10 2011 Jens Petersen <petersen@redhat.com> - 7.0.2-13
+- rebuild against 7.0.2
+
+* Wed Mar 9 2011 Jens Petersen <petersen@redhat.com> - 7.0.2-12
+- update to 7.0.2 release
+- move bin-package-db into ghc-ghc
+- disable broken testsuite
+
+* Wed Feb 23 2011 Fabio M. Di Nitto <fdinitto@redhat.com> 7.0.1-11
+- enable build on sparcv9
+- add ghc-fix-linking-on-sparc.patch to fix ld being called
+ at the same time with --relax and -r. The two options conflict
+ on sparc.
+- bump BuildRequires on ghc-rpm-macros to >= 0.11.10 that guarantees
+ a correct build on secondary architectures.
+
+* Sun Feb 13 2011 Jens Petersen <petersen@redhat.com>
+- without_shared renamed to ghc_without_shared
+
+* Thu Feb 10 2011 Jens Petersen <petersen@redhat.com> - 7.0.1-10
+- rebuild
+
+* Thu Feb 10 2011 Jens Petersen <petersen@redhat.com> - 7.0.1-9
+- fix without_shared build (thanks Adrian Reber)
+- disable system libffi for secondary archs
+- temporarily disable ghc-*-devel BRs for ppc
+
+* Tue Feb 08 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 7.0.1-8
+- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild
+
+* Mon Jan 31 2011 Jens Petersen <petersen@redhat.com> - 7.0.1-7
+- include LICENSE files in the shared lib subpackages
+
+* Sat Jan 22 2011 Jens Petersen <petersen@redhat.com> - 7.0.1-6
+- patch Cabal to add configure option --enable-executable-dynamic
+- exclude huge ghc API library from devel and prof metapackages
+
+* Thu Jan 13 2011 Jens Petersen <petersen@redhat.com> - 7.0.1-5
+- fix no doc and no manual builds
+
+* Thu Jan 13 2011 Jens Petersen <petersen@redhat.com> - 7.0.1-4
+- add BRs for various subpackaged ghc libraries needed to build ghc
+- condition rts .so libraries for non-shared builds
+
+* Thu Dec 30 2010 Jens Petersen <petersen@redhat.com> - 7.0.1-3
+- subpackage all the libraries with ghc-rpm-macros-0.11.1
+- put rts, integer-gmp and ghc-prim in base, and ghc-binary in bin-package-db
+- drop the libs mega-subpackage
+- prof now a meta-package for backward compatibility
+- add devel meta-subpackage to easily install all ghc libraries
+- store doc cronjob package cache file under /var (#664850)
+- drop old extralibs bcond
+- no longer need to define or clean buildroot
+- ghc base package now requires ghc-base-devel
+- drop ghc-time obsoletes
+
+* Wed Nov 24 2010 Jens Petersen <petersen@redhat.com> - 7.0.1-2
+- require libffi-devel
+
+* Tue Nov 16 2010 Jens Petersen <petersen@redhat.com> - 7.0.1-1
+- update to 7.0.1 release
+- turn on system libffi now
+
+* Mon Nov 8 2010 Jens Petersen <petersen@redhat.com> - 6.12.3-9
+- disable the libffi changes for now since they break libHSffi*.so
+
+* Thu Nov 4 2010 Jens Petersen <petersen@redhat.com> - 6.12.3-8
+- add a cronjob for doc indexing
+- disable gen_contents_index when not run with --batch for cron
+- use system libffi with ghc-use-system-libffi.patch from debian
+- add bcond for system libffi
+
+* Thu Nov 4 2010 Jens Petersen <petersen@redhat.com> - 6.12.3-7
+- skip huge type-level docs from haddock re-indexing (#649228)
+
+* Thu Sep 30 2010 Jens Petersen <petersen@redhat.com> - 6.12.3-6
+- move gtk2hs obsoletes to ghc-glib and ghc-gtk
+- drop happy buildrequires
+- smp build with max 4 cpus
+
+* Fri Jul 30 2010 Jens Petersen <petersen@redhat.com> - 6.12.3-5
+- obsolete old gtk2hs packages for smooth upgrades
+
+* Thu Jul 15 2010 Jens Petersen <petersen@redhat.com> - 6.12.3-4
+- merge ghc-doc into base package
+- obsolete ghc-time and ghc-ghc-doc (ghc-rpm-macros-0.8.0)
+- note that ghc-6.12.3 is part of haskell-platform-2010.2.0.0
+
+* Thu Jun 24 2010 Jens Petersen <petersen@redhat.com> - 6.12.3-3
+- drop the broken summary and description args to the ghc-ghc package
+ and use ghc-rpm-macros-0.6.1
+
+* Wed Jun 23 2010 Jens Petersen <petersen@redhat.com> - 6.12.3-2
+- strip all dynlinked files not just shared objects (ghc-rpm-macros-0.5.9)
+
+* Mon Jun 14 2010 Jens Petersen <petersen@redhat.com> - 6.12.3-1
+- 6.12.3 release:
+ http://darcs.haskell.org/download/docs/6.12.3/html/users_guide/release-6-12-3.html
+- build with hscolour
+- use ghc-rpm-macro-0.5.8 for ghc_strip_shared macro
+
+* Fri May 28 2010 Jens Petersen <petersen@redhat.com> - 6.12.2.20100521-1
+- 6.12.3 rc1
+- ghost package.cache
+- drop ghc-utf8-string obsoletes since it is no longer provided
+- run testsuite fast
+- fix description and summary of ghc internal library (John Obbele)
+
+* Fri Apr 23 2010 Jens Petersen <petersen@redhat.com> - 6.12.2-1
+- update to 6.12.2
+- add testsuite with bcond, run it in check section, and BR python
+
+* Mon Apr 12 2010 Jens Petersen <petersen@redhat.com> - 6.12.1-6
+- ghc-6.12.1 is part of haskell-platform-2010.1.0.0
+- drop old ghc682, ghc681, haddock09 obsoletes
+- drop haddock_version and no longer provide haddock explicitly
+- update ghc-rpm-macros BR to 0.5.6 for ghc_pkg_recache
+
+* Mon Jan 11 2010 Jens Petersen <petersen@redhat.com> - 6.12.1-5
+- drop ghc-6.12.1-no-filter-libs.patch and extras packages again
+- filter ghc-ghc-prof files from ghc-prof
+- ghc-mtl package was added to fedora
+
+* Mon Jan 11 2010 Jens Petersen <petersen@redhat.com> - 6.12.1-4
+- ghc-rpm-macros-0.5.4 fixes wrong version requires between lib subpackages
+
+* Mon Jan 11 2010 Jens Petersen <petersen@redhat.com> - 6.12.1-3
+- ghc-rpm-macros-0.5.2 fixes broken pkg_name requires for lib subpackages
+
+* Tue Dec 22 2009 Jens Petersen <petersen@redhat.com> - 6.12.1-2
+- include haskeline, mtl, and terminfo for now with
+ ghc-6.12.1-no-filter-libs.patch
+- use ghc_binlibpackage, grep -v and ghc_gen_filelists to generate
+ the library subpackages (ghc-rpm-macros-0.5.1)
+- always set GhcLibWays (Lorenzo Villani)
+- use ghcdocbasedir to revert html doc path to upstream's html/ for consistency
+
+* Wed Dec 16 2009 Jens Petersen <petersen@redhat.com> - 6.12.1-1
+- pre became 6.12.1 final
+- exclude ghc .conf file from package.conf.d in base package
+- use ghc_reindex_haddock
+- add scripts for ghc-ghc-devel and ghc-ghc-doc
+- add doc bcond
+- add ghc-6.12.1-gen_contents_index-haddock-path.patch to adjust haddock path
+ since we removed html/ from libraries path
+- require ghc-rpm-macros-0.3.1 and use ghc_version_override
+
+* Sat Dec 12 2009 Jens Petersen <petersen@redhat.com> - 6.12.1-0.2
+- remove redundant mingw and perl from ghc-tarballs/
+- fix exclusion of ghc internals lib from base packages with -mindepth
+- rename the final file lists to PKGNAME.files for clarity
+
+* Fri Dec 11 2009 Jens Petersen <petersen@redhat.com> - 6.12.1-0.1
+- update to ghc-6.12.1-pre
+- separate bcond options into enabled and disabled for clarity
+- only enable shared for intel x86 archs (Lorenzo Villani)
+- add quick build profile (Lorenzo Villani)
+- remove package_debugging hack (use "make install-short")
+- drop sed BR (Lorenzo Villani)
+- put all build.mk config into one cat block (Lorenzo Villani)
+- export CFLAGS to configure (Lorenzo Villani)
+- add dynamic linking test to check section (thanks Lorenzo Villani)
+- remove old ghc66 obsoletes
+- subpackage huge ghc internals library (thanks Lorenzo Villani)
+ - BR ghc-rpm-macros >= 0.3.0
+- move html docs to docdir/ghc from html subdir (Lorenzo Villani)
+- disable smp build for now: broken for 8 cpus at least
+
+* Wed Nov 18 2009 Jens Petersen <petersen@redhat.com> - 6.12.0.20091121-1
+- update to 6.12.1 rc2
+- build shared libs, yay! and package in standalone libs subpackage
+- add bcond for manual and extralibs
+- reenable ppc secondary arch
+- don't provide ghc-haddock-*
+- remove obsolete post requires policycoreutils
+- add vanilla v to GhcLibWays when building without prof
+- handle without hscolour
+- can't smp make currently
+- lots of filelist fixes for handling shared libs
+- run ghc-pkg recache posttrans
+- no need to install gen_contents_index by hand
+- manpage is back
+
+* Thu Nov 12 2009 Bryan O'Sullivan <bos@serpentine.com> - 6.12.0.20091010-8
+- comprehensive attempts at packaging fixes
+
+* Thu Nov 12 2009 Bryan O'Sullivan <bos@serpentine.com> - 6.12.0.20091010-7
+- fix package.conf stuff
+
+* Thu Nov 12 2009 Bryan O'Sullivan <bos@serpentine.com> - 6.12.0.20091010-6
+- give up trying to install man pages
+
+* Thu Nov 12 2009 Bryan O'Sullivan <bos@serpentine.com> - 6.12.0.20091010-5
+- try to install man pages
+
+* Thu Nov 12 2009 Bryan O'Sullivan <bos@serpentine.com> - 6.12.0.20091010-3
+- fix %check
+
+* Sun Oct 11 2009 Bryan O'Sullivan <bos@serpentine.com> - 6.12.0.20091010-2
+- disable ppc for now (seems unsupported)
+- buildreq ncurses-devel
+
+* Sun Oct 11 2009 Bryan O'Sullivan <bos@serpentine.com> - 6.12.0.20091010-1
+- Update to 6.12 RC 1
+
+* Thu Oct 1 2009 Jens Petersen <petersen@redhat.com>
+- selinux file context no longer needed in post script
+- (for ghc-6.12-shared) drop ld.so.conf.d files
+
+* Fri Jul 24 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 6.10.4-2
+- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild
+
+* Tue Jul 21 2009 Bryan O'Sullivan <bos@serpentine.com> - 6.10.4-1
+- update to 6.10.4
+
+* Sat May 30 2009 Jens Petersen <petersen@redhat.com> - 6.10.3-3
+- add haddock_version and use it to obsolete haddock and ghc-haddock-*
+
+* Fri May 22 2009 Jens Petersen <petersen@redhat.com> - 6.10.3-2
+- update haddock provides and obsoletes
+- drop ghc-mk-pkg-install-inplace.patch: no longer needed with new 6.11 buildsys
+- add bcond for extralibs
+- rename doc bcond to manual
+
+* Wed May 13 2009 Jens Petersen <petersen@redhat.com> - 6.10.3-1
+- update to 6.10.3
+- haskline replaces editline, so it is no longer needed to build
+- macros.ghc moved to ghc-rpm-macros package
+- fix handling of hscolor files in filelist generation
+
+* Tue Apr 28 2009 Jens Petersen <petersen@redhat.com> - 6.10.2-4
+- add experimental bcond hscolour
+- add experimental support for building shared libraries (for ghc-6.11)
+ - add libs subpackage for shared libraries
+ - create a ld.conf.d file for libghc*.so
+ - BR libffi-devel
+- drop redundant setting of GhcLibWays in build.mk for no prof
+- drop redundant setting of HADDOCK_DOCS
+- simplify filelist names
+- add a check section based on tests from debian's package
+- be more careful about doc files in filelist
+
+* Fri Apr 24 2009 Jens Petersen <petersen@redhat.com> - 6.10.2-3
+- define ghc_version in macros.ghc in place of ghcrequires
+- drop ghc-requires script for now
+
+* Sun Apr 19 2009 Jens Petersen <petersen@redhat.com> - 6.10.2-2
+- add ghc-requires rpm script to generate ghc version dependencies
+ (thanks to Till Maas)
+- update macros.ghc:
+ - add %%ghcrequires to call above script
+ - pkg_libdir and pkg_docdir obsoleted in packages and replaced
+ by ghcpkgdir and ghcdocdir inside macros.ghc
+ - make filelist also for docs
+
+* Wed Apr 08 2009 Bryan O'Sullivan <bos@serpentine.com> - 6.10.2-1
+- Update to 6.10.2
+
+* Fri Feb 27 2009 Jens Petersen <petersen@redhat.com> - 6.10.1-13
+- ok let's stick with ExclusiveArch for brevity
+
+* Fri Feb 27 2009 Jens Petersen <petersen@redhat.com> - 6.10.1-12
+- drop ghc_archs since it breaks koji
+- fix missing -devel in ghc_gen_filelists
+- change from ExclusiveArch to ExcludeArch ppc64 since alpha was bootstrapped
+ by oliver
+
+* Wed Feb 25 2009 Jens Petersen <petersen@redhat.com> - 6.10.1-11
+- use %%ix86 for change from i386 to i586 in rawhide
+- add ghc_archs macro in macros.ghc for other packages
+- obsolete haddock09
+- use %%global instead of %%define
+- use bcond for doc and prof
+- rename ghc_gen_filelists lib filelist to -devel.files
+
+* Tue Feb 24 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 6.10.1-10
+- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild
+
+* Fri Feb 13 2009 Jens Petersen <petersen@redhat.com> - 6.10.1-9
+- require and buildrequire libedit-devel > 2.11-2
+- protect ghc_register_pkg and ghc_unregister_pkg
+
+* Fri Jan 23 2009 Jens Petersen <petersen@redhat.com> - 6.10.1-8
+- fix to libedit means can drop ncurses-devel BR workaround (#481252)
+
+* Mon Jan 19 2009 Jens Petersen <petersen@redhat.com> - 6.10.1-7
+- buildrequire ncurses-devel to fix build of missing editline package needed
+ for ghci line-editing (#478466)
+- move spec templates to cabal2spec package for easy updating
+- provide correct haddock version
+
+* Mon Dec 1 2008 Jens Petersen <petersen@redhat.com> - 6.10.1-6
+- update macros.ghc to latest proposed revised packaging guidelines:
+ - use runghc
+ - drop trivial cabal_build and cabal_haddock macros
+ - ghc_register_pkg and ghc_unregister_pkg replace ghc_preinst_script,
+ ghc_postinst_script, ghc_preun_script, and ghc_postun_script
+- library templates prof subpackage requires main library again
+- make cabal2spec work on .cabal files too, and
+ read and check name and version directly from .cabal file
+- ghc-prof does not need to own libraries dirs owned by main package
+
+* Tue Nov 25 2008 Jens Petersen <petersen@redhat.com> - 6.10.1-5
+- add cabal2spec and template files for easy cabal hackage packaging
+- simplify script macros: make ghc_preinst_script and ghc_postun_script no-ops
+ and ghc_preun_script only unregister for uninstall
+
+* Tue Nov 11 2008 Jens Petersen <petersen@redhat.com> - 6.10.1-4
+- fix broken urls to haddock docs created by gen_contents_index script
+- avoid haddock errors when upgrading by making doc post script posttrans
+
+* Wed Nov 05 2008 Bryan O'Sullivan <bos@serpentine.com> - 6.10.1-3
+- libraries/prologue.txt should not have been ghosted
+
+* Tue Nov 04 2008 Bryan O'Sullivan <bos@serpentine.com> - 6.10.1-2
+- Fix a minor packaging glitch
+
+* Tue Nov 04 2008 Bryan O'Sullivan <bos@serpentine.com> - 6.10.1-1
+- Update to 6.10.1
+
+* Thu Oct 23 2008 Jens Petersen <petersen@redhat.com> - 6.10.0.20081007-9
+- remove redundant --haddockdir from cabal_configure
+- actually ghc-pkg no longer seems to create package.conf.old backups
+- include LICENSE in doc
+
+* Thu Oct 23 2008 Jens Petersen <petersen@redhat.com> - 6.10.0.20081007-8
+- need to create ghost package.conf.old for ghc-6.10
+
+* Thu Oct 23 2008 Jens Petersen <petersen@redhat.com> - 6.10.0.20081007-7
+- use gen_contents_index to re-index haddock
+- add %%pkg_docdir to cabal_configure
+- requires(post) ghc for haddock for doc
+- improve doc file lists
+- no longer need to create ghost package.conf.old
+- remove or rename alternatives files more consistently
+
+* Tue Oct 14 2008 Bryan O'Sullivan <bos@serpentine.com> - 6.10.0.20081007-6
+- Update macros to install html and haddock bits in the right places
+
+* Tue Oct 14 2008 Bryan O'Sullivan <bos@serpentine.com> - 6.10.0.20081007-5
+- Don't use a macro to update the docs for the main doc package
+
+* Tue Oct 14 2008 Bryan O'Sullivan <bos@serpentine.com> - 6.10.0.20081007-4
+- Add ghc_haddock_reindex macro
+- Generate haddock index after installing ghc-doc package
+
+* Mon Oct 13 2008 Jens Petersen <petersen@redhat.com> - 6.10.0.20081007-3
+- provide haddock = 2.2.2
+- add selinux file context for unconfined_execmem following darcs package
+- post requires policycoreutils
+
+* Sun Oct 12 2008 Bryan O'Sullivan <bos@serpentine.com> - 6.10.0.20081007-2.fc10
+- Use libedit in preference to readline, for BSD license consistency
+- With haddock bundled now, obsolete standalone versions (but not haddock09)
+- Drop obsolete freeglut-devel, openal-devel, and haddock09 dependencies
+
+* Sun Oct 12 2008 Bryan O'Sullivan <bos@serpentine.com> - 6.10.0.20081007-1.fc10
+- Update to 6.10.1 release candidate 1
+
+* Wed Oct 1 2008 Bryan O'Sullivan <bos@serpentine.com> - 6.10.0.20080921-1.fc10
+- Drop unneeded haddock patch
+- Rename hsc2hs to hsc2hs-ghc so the alternatives symlink to it will work
+
+* Wed Sep 24 2008 Jens Petersen <petersen@redhat.com> - 6.8.3-5
+- bring back including haddock-generated lib docs, now under docdir/ghc
+- fix macros.ghc filepath (#460304)
+- spec file cleanups:
+- fix the source urls back
+- drop requires chkconfig
+- do not override __spec_install_post
+- setup docs building in build.mk
+- no longer need to remove network/include/Typeable.h
+- install binaries under libdir not libexec
+- remove hsc2hs and runhaskell binaries since they are alternatives
+
+* Wed Sep 17 2008 Jens Petersen <petersen@redhat.com> - 6.8.3-4
+- add macros.ghc for new Haskell Packaging Guidelines (#460304)
+
+* Wed Jun 18 2008 Bryan O'Sullivan <bos@serpentine.com> - 6.8.3-3
+- Add symlinks from _libdir, where ghc looks, to _libexecdir
+- Patch libraries/gen_contents_index to use haddock-0.9
+
+* Wed Jun 18 2008 Bryan O'Sullivan <bos@serpentine.com> - 6.8.3-2
+- Remove unnecessary dependency on alex
+
+* Wed Jun 18 2008 Bryan O'Sullivan <bos@serpentine.com> - 6.8.3-1
+- Upgrade to 6.8.3
+- Drop the ghc682-style naming scheme, obsolete those packages
+- Manually strip binaries
+
+* Tue Apr 8 2008 Jens Petersen <petersen@redhat.com> - 6.8.2-10
+- another rebuild attempt
+
+* Thu Feb 14 2008 Jens Petersen <petersen@redhat.com> - 6.8.2-9
+- remove unrecognized --docdir and --htmldir from configure
+- drop old buildrequires on libX11-devel and libXt-devel
+- rebuild with gcc43
+
+* Sun Jan 06 2008 Bryan O'Sullivan <bos@serpentine.com> - 6.8.2-7
+- More attempts to fix docdir
+
+* Sun Jan 06 2008 Bryan O'Sullivan <bos@serpentine.com> - 6.8.2-6
+- Fix docdir
+
+* Wed Dec 12 2007 Bryan O'Sullivan <bos@serpentine.com> - 6.8.2-1
+- Update to 6.8.2
+
+* Fri Nov 23 2007 Bryan O'Sullivan <bos@serpentine.com> - 6.8.1-2
+- Exclude alpha
+
+* Thu Nov 8 2007 Bryan O'Sullivan <bos@serpentine.com> - 6.8.1-2
+- Drop bit-rotted attempts at making package relocatable
+
+* Sun Nov 4 2007 Michel Salim <michel.sylvan@gmail.com> - 6.8.1-1
+- Update to 6.8.1
+
+* Sat Sep 29 2007 Bryan O'Sullivan <bos@serpentine.com> - 6.8.0.20070928-2
+- add happy to BuildRequires
+
+* Sat Sep 29 2007 Bryan O'Sullivan <bos@serpentine.com> - 6.8.0.20070928-1
+- prepare for GHC 6.8.1 by building a release candidate snapshot
+
+* Thu May 10 2007 Bryan O'Sullivan <bos@serpentine.com> - 6.6.1-3
+- install man page for ghc
+
+* Thu May 10 2007 Bryan O'Sullivan <bos@serpentine.com> - 6.6.1-2
+- exclude ppc64 for now, due to lack of time to bootstrap
+
+* Wed May 9 2007 Bryan O'Sullivan <bos@serpentine.com> - 6.6.1-1
+- update to 6.6.1 release
+
+* Mon Jan 22 2007 Jens Petersen <petersen@redhat.com> - 6.6-2
+- remove truncated duplicate Typeable.h header in network package
+ (Bryan O'Sullivan, #222865)
+
+* Fri Nov 3 2006 Jens Petersen <petersen@redhat.com> - 6.6-1
+- update to 6.6 release
+- buildrequire haddock >= 0.8
+- fix summary of ghcver package (Michel Salim, #209574)
+
+* Thu Sep 28 2006 Jens Petersen <petersen@redhat.com> - 6.4.2-4
+- turn on docs generation again
+
+* Mon Sep 25 2006 Jens Petersen <petersen@redhat.com> - 6.4.2-3.fc6
+- ghost package.conf.old (Gérard Milmeister)
+- set unconfined_execmem_exec_t context on executables with ghc rts (#195821)
+- turn off building docs until haddock is back
+
+* Sat Apr 29 2006 Jens Petersen <petersen@redhat.com> - 6.4.2-2.fc6
+- buildrequire libXt-devel so that the X11 package and deps get built
+ (Garrett Mitchener, #190201)
+
+* Thu Apr 20 2006 Jens Petersen <petersen@redhat.com> - 6.4.2-1.fc6
+- update to 6.4.2 release
+
+* Thu Mar 2 2006 Jens Petersen <petersen@redhat.com> - 6.4.1-3.fc5
+- buildrequire libX11-devel instead of xorg-x11-devel (Kevin Fenzi, #181024)
+- make ghc-doc require ghc (Michel Salim, #180449)
+
+* Tue Oct 11 2005 Jens Petersen <petersen@redhat.com> - 6.4.1-2.fc5
+- turn on build_doc since haddock is now in Extras
+- no longer specify ghc version to build with (Ville Skyttä, #170176)
+
+* Tue Sep 20 2005 Jens Petersen <petersen@redhat.com> - 6.4.1-1.fc5
+- 6.4.1 release
+ - the following patches are now upstream: ghc-6.4-powerpc.patch,
+ rts-GCCompact.h-x86_64.patch, ghc-6.4-dsforeign-x86_64-1097471.patch,
+ ghc-6.4-rts-adjustor-x86_64-1097471.patch
+ - builds with gcc4 so drop %%_with_gcc32
+ - x86_64 build restrictions (no ghci and split objects) no longer apply
+
+* Tue May 31 2005 Jens Petersen <petersen@redhat.com>
+- add %%dist to release
+
+* Thu May 12 2005 Jens Petersen <petersen@redhat.com> - 6.4-8
+- initial import into Fedora Extras
+
+* Thu May 12 2005 Jens Petersen <petersen@haskell.org>
+- add build_prof and build_doc switches for -doc and -prof subpackages
+- add _with_gcc32 switch since ghc-6.4 doesn't build with gcc-4.0
+
+* Wed May 11 2005 Jens Petersen <petersen@haskell.org> - 6.4-7
+- make package relocatable (ghc#1084122)
+ - add post install scripts to replace prefix in driver scripts
+- buildrequire libxslt and docbook-style-xsl instead of docbook-utils and flex
+
+* Fri May 6 2005 Jens Petersen <petersen@haskell.org> - 6.4-6
+- add ghc-6.4-dsforeign-x86_64-1097471.patch and
+ ghc-6.4-rts-adjustor-x86_64-1097471.patch from trunk to hopefully fix
+ ffi support on x86_64 (Simon Marlow, ghc#1097471)
+- use XMLDocWays instead of SGMLDocWays to build documentation fully
+
+* Mon May 2 2005 Jens Petersen <petersen@haskell.org> - 6.4-5
+- add rts-GCCompact.h-x86_64.patch to fix GC issue on x86_64 (Simon Marlow)
+
+* Thu Mar 17 2005 Jens Petersen <petersen@haskell.org> - 6.4-4
+- add ghc-6.4-powerpc.patch (Ryan Lortie)
+- disable building interpreter rather than install and delete on x86_64
+
+* Wed Mar 16 2005 Jens Petersen <petersen@haskell.org> - 6.4-3
+- make ghc require ghcver of same ver-rel
+- on x86_64 remove ghci for now since it doesn't work and all .o files
+
+* Tue Mar 15 2005 Jens Petersen <petersen@haskell.org> - 6.4-2
+- ghc requires ghcver (Amanda Clare)
+
+* Sat Mar 12 2005 Jens Petersen <petersen@haskell.org> - 6.4-1
+- 6.4 release
+ - x86_64 build no longer unregisterised
+- use sed instead of perl to tidy filelists
+- buildrequire ghc64 instead of ghc-6.4
+- no epoch for ghc64-prof's ghc64 requirement
+- install docs directly in docdir
+
+* Fri Jan 21 2005 Jens Petersen <petersen@haskell.org> - 6.2.2-2
+- add x86_64 port
+ - build unregistered and without splitobjs
+ - specify libdir to configure and install
+- rename ghc-prof to ghcXYZ-prof, which obsoletes ghc-prof
+
+* Mon Dec 6 2004 Jens Petersen <petersen@haskell.org> - 6.2.2-1
+- move ghc requires to ghcXYZ
+
+* Wed Nov 24 2004 Jens Petersen <petersen@haskell.org> - 6.2.2-0.fdr.1
+- ghc622
+ - provide ghc = %%version
+- require gcc, gmp-devel and readline-devel
+
+* Fri Oct 15 2004 Gerard Milmeister <gemi@bluewin.ch> - 6.2.2-0.fdr.1
+- New Version 6.2.2
+
+* Mon Mar 22 2004 Gerard Milmeister <gemi@bluewin.ch> - 6.2.1-0.fdr.1
+- New Version 6.2.1
+
+* Tue Dec 16 2003 Gerard Milmeister <gemi@bluewin.ch> - 6.2-0.fdr.1
+- New Version 6.2
+
+* Tue Dec 16 2003 Gerard Milmeister <gemi@bluewin.ch> - 6.0.1-0.fdr.3
+- A few minor specfile tweaks
+
+* Mon Dec 15 2003 Gerard Milmeister <gemi@bluewin.ch> - 6.0.1-0.fdr.2
+- Different file list generation
+
+* Mon Oct 20 2003 Gerard Milmeister <gemi@bluewin.ch> - 6.0.1-0.fdr.1
+- First Fedora release
+- Added generated html docs, so that haddock is not needed
+
+* Wed Sep 26 2001 Manuel Chakravarty
+- small changes for 5.04
+
+* Wed Sep 26 2001 Manuel Chakravarty
+- split documentation off into a separate package
+- adapt to new docbook setup in RH7.1
+
+* Mon Apr 16 2001 Manuel Chakravarty
+- revised for 5.00
+- also runs autoconf automagically if no ./configure found
+
+* Thu Jun 22 2000 Sven Panne
+- removed explicit usage of hslibs/docs, it belongs to ghc/docs/set
+
+* Sun Apr 23 2000 Manuel Chakravarty
+- revised for ghc 4.07; added suggestions from Pixel <pixel@mandrakesoft.com>
+- added profiling package
+
+* Tue Dec 7 1999 Manuel Chakravarty
+- version for use from CVS
+
+* Thu Sep 16 1999 Manuel Chakravarty
+- modified for GHC 4.04, patchlevel 1 (no more 62 tuple stuff); minimises use
+ of patch files - instead emits a build.mk on-the-fly
+
+* Sat Jul 31 1999 Manuel Chakravarty
+- modified for GHC 4.04
+
+* Wed Jun 30 1999 Manuel Chakravarty
+- some more improvements from vbzoli
+
+* Fri Feb 26 1999 Manuel Chakravarty
+- modified for GHC 4.02
+
+* Thu Dec 24 1998 Zoltan Vorosbaranyi
+- added BuildRoot
+- files located in /usr/local/bin, /usr/local/lib moved to /usr/bin, /usr/lib
+
+* Tue Jul 28 1998 Manuel Chakravarty
+- original version
diff --git a/tools/haskell-platform/alex-ghc74-fix-bang-pattern.patch b/tools/haskell-platform/alex-ghc74-fix-bang-pattern.patch
new file mode 100644
index 0000000..cbc5fe4
--- /dev/null
+++ b/tools/haskell-platform/alex-ghc74-fix-bang-pattern.patch
@@ -0,0 +1,53 @@
+# Author : Erik de Castro Lopo <erikd@mega-nerd.com>
+# Description : Fix generated haskell code so it doesn't fail with -Werror.
+# Debian Version : 2.3.5
+# Date : Sun, 17 Apr 2011 15:45:41 +1000
+
+--- a/templates/GenericTemplate.hs
++++ b/templates/GenericTemplate.hs
+@@ -9,7 +9,7 @@
+
+ #ifdef ALEX_GHC
+ #define ILIT(n) n#
+-#define FAST_INT_BINDING(n) (n)
++#define FAST_INT_BINDING(n) (!(n))
+ #define IBOX(n) (I# (n))
+ #define FAST_INT Int#
+ #define LT(n,m) (n <# m)
+@@ -57,10 +57,10 @@
+ ALEX_IF_BIGENDIAN
+ narrow16Int# i
+ where
+- i = word2Int# ((high `uncheckedShiftL#` 8#) `or#` low)
+- high = int2Word# (ord# (indexCharOffAddr# arr (off' +# 1#)))
+- low = int2Word# (ord# (indexCharOffAddr# arr off'))
+- off' = off *# 2#
++ !i = word2Int# ((high `uncheckedShiftL#` 8#) `or#` low)
++ !high = int2Word# (ord# (indexCharOffAddr# arr (off' +# 1#)))
++ !low = int2Word# (ord# (indexCharOffAddr# arr off'))
++ !off' = off *# 2#
+ ALEX_ELSE
+ indexInt16OffAddr# arr off
+ ALEX_ENDIF
+--- a/src/Scan.x
++++ b/src/Scan.x
+@@ -11,7 +11,7 @@
+ -------------------------------------------------------------------------------
+
+ {
+-{-# OPTIONS_GHC -w #-}
++{-# OPTIONS_GHC -w -XBangPatterns #-}
+
+ module Scan(lexer, AlexPosn(..), Token(..), Tkn(..), tokPosn) where
+
+--- a/src/Main.hs
++++ b/src/Main.hs
+@@ -203,7 +203,7 @@
+ hPutStrLn hdl code
+
+ optsToInject :: Target -> [CLIFlags] -> String
+-optsToInject GhcTarget _ = "{-# LANGUAGE CPP,MagicHash #-}\n"
++optsToInject GhcTarget _ = "{-# LANGUAGE CPP,MagicHash,BangPatterns #-}\n"
+ optsToInject _ _ = "{-# LANGUAGE CPP #-}\n"
+
+ importsToInject :: Target -> [CLIFlags] -> String
diff --git a/tools/haskell-platform/cabal-install.sh b/tools/haskell-platform/cabal-install.sh
new file mode 100644
index 0000000..fdcf006
--- /dev/null
+++ b/tools/haskell-platform/cabal-install.sh
@@ -0,0 +1,8 @@
+CABALBIN=${HOME}/.cabal/bin
+
+if ! echo ${PATH} | /bin/grep -q ${CABALBIN} ; then
+ if [ -d ${CABALBIN} ]; then
+ PATH=${PATH}:${CABALBIN}
+ fi
+fi
+unset CABALBIN
diff --git a/tools/haskell-platform/ghc-GLUT-extralibs.patch b/tools/haskell-platform/ghc-GLUT-extralibs.patch
new file mode 100644
index 0000000..9092408
--- /dev/null
+++ b/tools/haskell-platform/ghc-GLUT-extralibs.patch
@@ -0,0 +1,8 @@
+diff -u GLUT-2.1.1.2/GLUT.cabal\~ GLUT-2.1.1.2/GLUT.cabal
+--- GLUT-2.1.1.2/GLUT.cabal~ 2008-06-19 21:39:19.000000000 +1000
++++ GLUT-2.1.1.2/GLUT.cabal 2010-06-10 18:03:20.000000000 +1000
+@@ -58,3 +58,4 @@
+ build-depends: base < 3
+ build-depends: OpenGL >= 2.2
+ extensions: CPP, ForeignFunctionInterface
++ extra-libraries: glut
diff --git a/tools/haskell-platform/haskell-platform.spec b/tools/haskell-platform/haskell-platform.spec
new file mode 100644
index 0000000..abd3db5
--- /dev/null
+++ b/tools/haskell-platform/haskell-platform.spec
@@ -0,0 +1,505 @@
+# https://fedoraproject.org/wiki/Packaging:Haskell
+# https://fedoraproject.org/wiki/PackagingDrafts/Haskell
+
+%global ghc_compiler_version 7.4.2
+%global alex_version 3.0.2
+%global cabal_install_version 0.14.0
+%global happy_version 1.18.10
+
+%global primitive_version 0.5.0.1
+%global split_version 0.2.1.1
+%global vector_version 0.10.0.1
+
+%global ghc_exclude_docdir 1
+
+Name: haskell-platform
+Version: 2012.4.0.0
+# Since library subpackages are versioned:
+# - release can only be reset if all library versions get bumped simultaneously
+# (eg for a major release)
+# - minor release numbers should be incremented monotonically
+Release: 22.1%{?dist}
+Summary: Standard Haskell distribution
+
+Group: Development/Tools
+License: BSD
+URL: http://hackage.haskell.org/platform
+Source0: http://lambda.haskell.org/platform/download/%{version}/%{name}-%{version}.tar.gz
+Patch1: ghc-GLUT-extralibs.patch
+Patch2: alex-ghc74-fix-bang-pattern.patch
+
+BuildRequires: ghc-Cabal-devel
+BuildRequires: ghc-rpm-macros
+# for fixing RPATH in the binary programs
+BuildRequires: chrpath
+BuildRequires: ghc-compiler = %{ghc_compiler_version}
+# GLUT
+BuildRequires: freeglut-devel%{?_isa}
+# OpenGL
+BuildRequires: mesa-libGL-devel%{?_isa},mesa-libGLU-devel%{?_isa}
+# QuickCheck
+BuildRequires: ghc-extensible-exceptions-devel
+%ifarch %{ghc_arches_with_ghci}
+BuildRequires: ghc-template-haskell-devel
+%endif
+# haskell-src
+BuildRequires: ghc-haskell98-devel
+# parallel, text
+BuildRequires: ghc-deepseq-devel
+# random
+BuildRequires: ghc-time-devel
+# regex-base, text
+BuildRequires: ghc-bytestring-devel
+# zlib
+BuildRequires: zlib-devel%{?_isa}
+# part of HP-2012.4
+BuildRequires: ghc-split-devel = %{split_version}
+BuildRequires: ghc-primitive-devel = %{primitive_version}
+BuildRequires: ghc-vector-devel = %{vector_version}
+BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
+# ghci "ghc" library is not officially part of hackage-platform
+Requires: ghc-compiler = %{ghc_compiler_version}
+Requires: alex = %{alex_version}-%{release}
+Requires: cabal-install = %{cabal_install_version}-%{release}
+Requires: happy = %{happy_version}-%{release}
+Requires: ghc-haskell-platform-devel = %{version}-%{release}
+
+%description
+Haskell Platform is a suite of stable and well used Haskell libraries
+and tools. It provides a good starting environment for Haskell development.
+
+
+%global BSDHaskellReport BSD%{space}and%{space}HaskellReport
+
+%global haskell_platform_version %{version}
+
+# follows order of platform.packages
+%if %{defined ghclibdir}
+%ghc_lib_subpackage HUnit 1.2.5.1
+%ghc_lib_subpackage -c mesa-libGL-devel%{?_isa},mesa-libGLU-devel%{?_isa} OpenGL 2.2.3.1
+%ghc_lib_subpackage -c freeglut-devel%{?_isa} GLUT 2.1.2.1
+%ghc_lib_subpackage html 1.0.1.2
+%ghc_lib_subpackage parallel 3.2.0.3
+%ghc_lib_subpackage -l %BSDHaskellReport random 1.0.1.1
+%ghc_lib_subpackage QuickCheck 2.5.1.1
+# alex
+%ghc_lib_subpackage stm 2.4
+%ghc_lib_subpackage async 2.0.1.3
+%ghc_lib_subpackage syb 0.3.7
+%ghc_lib_subpackage haskell-src 1.0.1.5
+%ghc_lib_subpackage text 0.11.2.3
+%ghc_lib_subpackage transformers 0.3.0.0
+%ghc_lib_subpackage mtl 2.1.2
+%ghc_lib_subpackage fgl 5.4.2.4
+# happy
+%ghc_lib_subpackage parsec 3.1.3
+%ghc_lib_subpackage network 2.3.1.0
+%ghc_lib_subpackage HTTP 4000.2.5
+%ghc_lib_subpackage regex-base 0.93.2
+%ghc_lib_subpackage regex-posix 0.95.2
+%ghc_lib_subpackage regex-compat 0.95.1
+%ghc_lib_subpackage xhtml 3000.2.1
+%ghc_lib_subpackage cgi 3001.1.7.4
+%ghc_lib_subpackage -c zlib-devel%{?_isa} zlib 0.5.4.0
+# cabal-install
+%endif
+
+%package -n alex
+Version: %{alex_version}
+Summary: Lexer generator for Haskell
+Group: Development/Tools
+License: BSD
+URL: http://hackage.haskell.org/package/alex
+BuildRequires: autoconf docbook-style-xsl libxslt
+%ifarch ppc ppc64 s390 s390x
+# for the BangPatterns patch
+BuildRequires: alex
+%endif
+
+%description -n alex
+Alex is a tool for generating lexical analysers in Haskell from a
+description of the tokens to be recognised in the form of regular
+expressions. It is similar to the tool lex or flex for C/C++.
+
+
+%package -n cabal-install
+Version: %{cabal_install_version}
+Summary: Haskell package tool
+Group: Development/Tools
+License: BSD
+URL: http://hackage.haskell.org/package/%{name}
+Source1: cabal-install.sh
+Requires: ghc-compiler
+
+%description -n cabal-install
+The 'cabal' command-line program simplifies the process of managing Haskell
+packages by automating fetching, configuration, compilation and
+installation of Haskell libraries and programs from Hackage.
+
+
+%package -n happy
+Version: %{happy_version}
+Summary: LALR(1) Parser Generator for Haskell
+License: BSD
+Group: Development/Tools
+URL: http://hackage.haskell.org/package/happy
+BuildRequires: autoconf, docbook-dtds, docbook-style-xsl, libxslt, libxml2
+
+%description -n happy
+Happy is a parser generator system for Haskell, similar to the tool
+`yacc' for C. Like `yacc', it takes a file containing an annotated BNF
+specification of a grammar and produces a Haskell module containing a
+parser for the grammar.
+
+Happy is flexible: you can have several Happy parsers in the same
+program, and several entry points to a single grammar. Happy can work
+in conjunction with a lexical analyser supplied by the user (either
+hand-written or generated by another program).
+
+
+%global version %{haskell_platform_version}
+
+%ghc_devel_package -m haskell-platform %{version}
+%{?ghc_packages_list:Requires: %(echo %{ghc_packages_list} | sed -e "s/\([^ ]*\)-\([^ ]*\)/ghc-\1-devel = \2-%{release},/g")}
+Requires: ghc-libraries = %{ghc_compiler_version}
+# part of HP-2012.4
+Requires: ghc-primitive-devel = %{primitive_version}
+Requires: ghc-split-devel = %{split_version}
+Requires: ghc-vector-devel = %{vector_version}
+# added in F17 devel cycle
+Obsoletes: ghc-haskell-platform < %{version}-%{release}
+
+%ghc_devel_description haskell-platform
+Haskell Platform is a suite of stable and well used Haskell libraries
+and tools. It provides a good starting environment for Haskell development.
+
+
+%prep
+%setup -q -n %{name}-%{version}
+
+cd packages/GLUT-*
+%patch1 -p1 -b .orig
+
+%ifarch ppc ppc64 s390 s390x
+cd ../alex-%{alex_version}
+%patch2 -p1 -b .orig
+%endif
+
+cd ../..
+
+
+%build
+HOME=$PWD
+PATH=$HOME/.cabal/bin:$PATH
+#%%define cabal_configure_options --global "--package-db=../../packages/package.conf.inplace" "--ghc-pkg-option=--package-conf=../../packages/package.conf.inplace"
+#%%define cabal_configure_options --package-conf=../package.conf.d
+%define cabal_configure_options --user
+
+cd packages
+for i in $(egrep -v "^(primitive|split|vector)-" platform.packages); do
+name=$(echo $i | sed -e "s/\(.*\)-.*/\1/")
+ver=$(echo $i | sed -e "s/.*-\(.*\)/\1/")
+cd $name-$ver
+case $name in
+alex|cabal-install|happy)
+%ghc_bin_build
+;;
+# ghc-7.4.1 haddock breaks on GLUT
+GLUT)
+%ghc_lib_build_without_haddock $name $ver
+./Setup register --inplace
+;;
+haskell-platform)
+cabal_configure_extra_options="--with-cabal-install=../cabal-install-%{cabal_install_version}/dist/build/cabal/cabal --with-happy=../happy-%{happy_version}/dist/build/happy/happy --with-alex=../alex-%{alex_version}/dist/build/alex/alex"
+%ghc_lib_build_without_haddock $name $ver
+cabal_configure_extra_options=
+;;
+*)
+%ghc_lib_build $name $ver
+./Setup register --inplace
+;;
+esac
+cd ..
+done
+
+# build alex documentation
+for i in alex-%{alex_version} happy-%{happy_version}; do
+cd $i/doc
+autoreconf
+%configure
+make html
+cd ../..
+done
+
+%install
+HOME=$PWD
+PATH=$HOME/.cabal/bin:$PATH
+
+cd packages
+
+PACKAGES_DIR=$PWD
+
+for i in $(egrep -v "^(primitive|split|vector)-" platform.packages); do
+name=$(echo $i | sed -e "s/\(.*\)-.*/\1/")
+ver=$(echo $i | sed -e "s/.*-\(.*\)/\1/")
+cd $name-$ver
+case $name in
+alex|cabal-install|happy)
+%ghc_bin_install $name $ver
+;;
+*)
+%ghc_lib_install $name $ver
+echo "%doc packages/$name-$ver/LICENSE" >> ghc-$name%{?ghc_without_shared:-devel}.files
+;;
+esac
+cd ..
+done
+
+cd cabal-install-%{cabal_install_version}
+mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/bash_completion.d
+cp -p bash-completion/cabal $RPM_BUILD_ROOT%{_sysconfdir}/bash_completion.d
+mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/profile.d
+install -pm 644 %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/profile.d
+cd ..
+
+%ghc_strip_dynlinked
+
+# haskell-platform
+if [ -d %{buildroot}%{_docdir}/ghc-haskell-platform-%{version} ]; then
+ mv %{buildroot}%{_docdir}/ghc-haskell-platform{,-devel}-%{version}
+fi
+
+mv %{buildroot}%{_datadir}/HUnit-*/* %{buildroot}%{_docdir}/ghc-HUnit-*/
+
+mv */*.files ..
+cd ..
+
+# fix RPATHs in programs linking to HP user libs
+%if %{undefined ghc_without_dynamic}
+for i in alex cabal happy; do
+ PROG=%{buildroot}%{_bindir}/$i
+ RPATH=$(chrpath $PROG| sed -e "s!^$PROG: RPATH=!!")
+ case $RPATH in
+ *$PACKAGES_DIR*)
+ NEWRPATH=$(echo $RPATH | sed -e "s!$PACKAGES_DIR!%{ghclibdir}!g" -e "s!/dist/build!!g")
+ chrpath -r $NEWRPATH $PROG
+ ;;
+ esac
+done
+%endif
+
+
+%ghc_devel_post_postun haskell-platform
+
+
+%files
+%doc packages/%{name}-%{version}/LICENSE
+
+
+# protect for koji
+%if %{defined ghc_devel_files}
+%files -n ghc-haskell-platform-devel -f ghc-haskell-platform-devel.files
+%doc packages/haskell-platform-%{version}/LICENSE
+%endif
+
+
+%files -n alex
+%doc packages/alex-%{alex_version}/ANNOUNCE
+%doc packages/alex-%{alex_version}/LICENSE
+%doc packages/alex-%{alex_version}/README
+%doc packages/alex-%{alex_version}/TODO
+#%doc packages/alex-%{alex_version}/doc/alex
+%doc packages/alex-%{alex_version}/examples
+%{_bindir}/alex
+%{_datadir}/alex-%{alex_version}
+
+
+%files -n cabal-install
+%doc packages/cabal-install-%{cabal_install_version}/LICENSE
+%doc packages/cabal-install-%{cabal_install_version}/README
+%{_bindir}/cabal
+%{_sysconfdir}/bash_completion.d
+%{_sysconfdir}/profile.d/cabal-install.sh
+
+
+%files -n happy
+%doc packages/happy-%{happy_version}/ANNOUNCE
+%doc packages/happy-%{happy_version}/CHANGES
+%doc packages/happy-%{happy_version}/LICENSE
+%doc packages/happy-%{happy_version}/README
+%doc packages/happy-%{happy_version}/TODO
+%doc packages/happy-%{happy_version}/doc/happy
+%{_bindir}/happy
+%{_datadir}/happy-%{happy_version}
+
+
+%changelog
+* Thu Feb 14 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2012.4.0.0-22
+- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild
+
+* Thu Dec 6 2012 Jens Petersen <petersen@redhat.com> - 2012.4.0.0-21
+- vector was patched to build on all archs (#883479)
+
+* Wed Dec 5 2012 Jens Petersen <petersen@redhat.com> - 2012.4.0.0-20
+- keep split, vector, and primitive in their own existing src packages
+- allow building on ghc archs without ghci: ie without vector library (#883479)
+
+* Sat Oct 20 2012 Jens Petersen <petersen@redhat.com> - 2012.4.0.0-19
+- update to 2012.4.0.0
+- new subpackages: async, split, vector, and primitive (vector dep)
+- drop explicit BR hscolour
+
+* Mon Jul 23 2012 Jens Petersen <petersen@redhat.com> - 2012.2.0.0-18
+- also apply the alex fix-bang-pattern patch for s390 and s390x
+
+* Thu Jul 19 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2012.2.0.0-17
+- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild
+
+* Mon Jul 16 2012 Jens Petersen <petersen@redhat.com> - 2012.2.0.0-16
+- change prof BRs to devel
+
+* Thu Jun 7 2012 Jens Petersen <petersen@redhat.com> - 2012.2.0.0-15
+- update to 2012.2.0.0
+- build the whole of haskell-platform now from this package
+ and subpackage like ghc's libraries
+- add alex fix-bang-pattern.diff patch from Debian to fix build on ppc archs
+ - requires BR alex
+- drop common_summary and common_description for subpackaging
+- no longer need to unset debug_package
+- make sure all the dynamically linked files get stripped
+- needs ghc-rpm-macros 0.95.2 or later to build
+- use chrpath to fix the program RPATHs when dynamically linked to HP libs
+
+* Wed May 9 2012 Jens Petersen <petersen@redhat.com> - 2011.4.0.741-2
+- update cabal-install to 0.14.0
+
+* Sat Mar 24 2012 Jens Petersen <petersen@redhat.com> - 2011.4.0.741-1
+- update to ghc-7.4.1 and latest libraries
+- temporarily just a meta-package
+
+* Wed Mar 21 2012 Jens Petersen <petersen@redhat.com> - 2011.4.0.0-7
+- require ghc-compiler instead of ghc to avoid the ghc lib
+
+* Fri Jan 20 2012 Jens Petersen <petersen@redhat.com> - 2011.4.0.0-6
+- update to cabal2spec-0.25.2
+
+* Thu Jan 19 2012 Jens Petersen <petersen@redhat.com> - 2011.4.0.0-5
+- update the description
+
+* Thu Jan 19 2012 Jens Petersen <petersen@redhat.com> - 2011.4.0.0-4
+- update the source url
+
+* Fri Jan 13 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2011.4.0.0-3
+- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild
+
+* Sun Jan 1 2012 Jens Petersen <petersen@redhat.com> - 2011.4.0.0-2
+- define ghc_without_shared since ghc-haskell-platform-devel no longer
+ requires ghc-haskell-platform
+
+* Wed Dec 28 2011 Jens Petersen <petersen@redhat.com> - 2011.4.0.0-1
+- update to 2011.4.0.0
+- reenable ppc64
+- drop ghc-haskell-platform subpackage
+- require ghc-libraries instead of ghc-devel
+
+* Tue Jun 21 2011 Jens Petersen <petersen@redhat.com> - 2011.2.0.1-2
+- ghc_arches replaces ghc_excluded_archs (cabal2spec-0.23.2)
+
+* Mon Jun 20 2011 Jens Petersen <petersen@redhat.com> - 2011.2.0.1-1
+- update to 2011.2.0.1: ghc-7.0.3 and text-0.11.0.6
+- update source url
+- use ghc_excluded_archs
+- exclude ppc64: no QuickCheck
+- bump ghc to 7.0.4
+- use top_prefix for path to haskell-platform subdir in large tarball
+- drop upstream_version
+
+* Fri May 27 2011 Jens Petersen <petersen@redhat.com> - 2011.2.0.0-5
+- drop the prof subpackage
+
+* Wed May 25 2011 Jens Petersen <petersen@redhat.com> - 2011.2.0.0-4
+- add ppc64 arch
+
+* Mon Mar 28 2011 Jens Petersen <petersen@redhat.com> - 2011.2.0.0-3
+- remove duplicate license file from ghc-haskell-platform
+
+* Mon Mar 28 2011 Jens Petersen <petersen@redhat.com> - 2011.2.0.0-2
+- fix the install scripts:
+- ghc_reindex_haddock is now redundant
+- use ghc_pkg_recache
+
+* Fri Mar 11 2011 Jens Petersen <petersen@redhat.com> - 2011.2.0.0-1
+- 2011.2.0.0 final
+
+* Thu Mar 10 2011 Fabio M. Di Nitto <fdinitto@redhat.com> - 2011.1.0.0-0.6
+- Enable build on sparcv9
+
+* Tue Feb 15 2011 Jens Petersen <petersen@redhat.com> - 2011.1.0.0-0.5
+- update to latest haskell-platform-2011.1 snapshot
+
+* Wed Feb 09 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2011.1.0.0-0.4
+- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild
+
+* Sat Jan 22 2011 Jens Petersen <petersen@redhat.com> - 2011.1.0.0-0.3
+- make ghc-haskell-platform-devel require ghc-devel and ghc_devel_requires
+- build with ghc_lib_build and without_haddock
+
+* Tue Jan 18 2011 Jens Petersen <petersen@redhat.com> - 2011.1.0.0-0.2
+- update to cabal2spec-0.22.4
+
+* Sun Dec 5 2010 Jens Petersen <petersen@redhat.com> - 2011.1.0.0-0.1
+- update to 2011.1.0.0 alpha snapshot
+
+* Fri Nov 26 2010 Jens Petersen <petersen@redhat.com> - 2010.2.0.0.701-1
+- bump some versions for ghc-7.0.1
+- add hscolour
+- no haddock documentation to build
+- remove duplicate LICENSE file
+
+* Fri Jul 23 2010 Jens Petersen <petersen@redhat.com> - 2010.2.0.0-1
+- update to 2010.2.0.0 final release (no actual changes)
+
+* Sun Jul 18 2010 Jens Petersen <petersen@redhat.com> - 2010.2.0.0-0.1
+- drop debuginfo again: ghc_strip_dynlinked got fixed in ghc-rpm-macros-0.8.1
+
+* Fri Jul 16 2010 Jens Petersen <petersen@redhat.com> - 2010.2.0.0-0.1
+- update to 2010.2.0.0 RC
+- obsolete ghc-haskell-platform-doc in line with ghc-rpm-macros-0.8.0
+- add License to base library too
+
+* Sun Jun 27 2010 Jens Petersen <petersen@redhat.com> - 2010.1.0.0.6123-1
+- bump ghc to 6.12.3
+- sync cabal2spec-0.22.1
+- enable debugging for now to avoid empty strip error
+
+* Thu Apr 29 2010 Jens Petersen <petersen@redhat.com> - 2010.1.0.0.6122-1
+- break haskell-platform-2010.1.0.0 with ghc-6.12.2
+
+* Wed Mar 24 2010 Jens Petersen <petersen@redhat.com> - 2010.1.0.0-1
+- update to 2010.1.0.0 beta release
+- update versions of alex, cgi, network, parallel, QuickCheck, HTTP
+- new deepseq dep (#576482)
+
+* Thu Jan 28 2010 Jens Petersen <petersen@redhat.com> - 2009.3.1.20100115-0.2
+- add filelist for shared libs
+- update devel post and postun
+
+* Sat Jan 16 2010 Jens Petersen <petersen@redhat.com> - 2009.3.1.20100115-0.1
+- update to darcs snapshot patched for ghc-6.12.1
+- update to ghc-rpm-macros-0.5.1 and cabal2spec-0.21.1:
+- drop doc and prof bcond
+- use common_summary and common_description
+- use ghc_lib_package and ghc_pkg_deps
+- build shared library
+- drop redundant buildroot and its install cleaning
+
+* Mon Sep 28 2009 Jens Petersen <petersen@redhat.com> - 2009.2.0.2-3
+- fix rpmlint warnings (bos, #523883)
+
+* Mon Sep 28 2009 Jens Petersen <petersen@redhat.com> - 2009.2.0.2-2
+- add all the buildrequires (#523883)
+- create ghcpkgdir since metapackage
+- nothing in bindir
+
+* Thu Sep 17 2009 Jens Petersen <petersen@redhat.com> - 2009.2.0.2-1
+- initial packaging for Fedora
diff --git a/tools/hsb2hs/hsb2hs.spec b/tools/hsb2hs/hsb2hs.spec
new file mode 100644
index 0000000..eb4b784
--- /dev/null
+++ b/tools/hsb2hs/hsb2hs.spec
@@ -0,0 +1,59 @@
+Name: hsb2hs
+Version: 0.1
+Release: 1%{?dist}
+Summary: Preprocesses a file, adding blobs from files as string literals
+
+License: BSD
+Group: Developments/Tools
+URL: http://hackage.haskell.org/package/%{name}
+Source0: http://hackage.haskell.org/packages/archive/%{name}/%{version}/%{name}-%{version}.tar.gz
+
+BuildRequires: ghc-Cabal-devel
+BuildRequires: ghc-rpm-macros
+# Begin cabal-rpm deps:
+BuildRequires: ghc-bytestring-devel
+BuildRequires: ghc-containers-devel
+BuildRequires: ghc-directory-devel
+BuildRequires: ghc-filepath-devel
+#BuildRequires: ghc-preprocessor-tools-devel
+# End cabal-rpm deps
+BuildRequires: cabal-dev
+BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
+
+%description
+hsb2hs is a preprocessor that allows you to include the contents of files as
+string literals in your Haskell programs and libraries. It is an alternative to
+file-embed for those who do not want to rely on Template Haskell.
+
+
+%global cabal cabal-dev
+
+
+%prep
+%setup -q
+
+
+%build
+%cabal install-deps
+%cabal configure --prefix=%{_prefix} --libdir=%{_libdir} --docdir=%{?_pkgdocdir}%{!?_pkgdocdir:%{_docdir}/%{name}-%{version}}
+%cabal build
+
+%install
+rm -rf %{buildroot}
+%cabal copy --destdir=%{buildroot} -v
+
+
+
+%clean
+rm -rf %{buildroot}
+
+
+%files
+%defattr(-,root,root,-)
+%doc LICENSE
+%{_bindir}/%{name}
+
+
+%changelog
+* Thu Jan 30 2014 Fedora Haskell SIG <haskell@lists.fedoraproject.org> - 0.1
+- spec file generated by cabal-rpm-0.8.7
diff --git a/tools/hscolour/hscolour.spec b/tools/hscolour/hscolour.spec
new file mode 100644
index 0000000..8e8fb4b
--- /dev/null
+++ b/tools/hscolour/hscolour.spec
@@ -0,0 +1,181 @@
+# cabal2spec-0.25.2
+# https://fedoraproject.org/wiki/Packaging:Haskell
+# https://fedoraproject.org/wiki/PackagingDrafts/Haskell
+
+%global pkg_name hscolour
+
+# use following to bootstrap after building a new ghc version:
+#%%{?ghc_bootstrap}
+#%%global ghc_bootstrapping 1
+#%%global without_hscolour 1
+
+%global common_summary Haskell %{pkg_name} library
+
+%global common_description hscolour is a tool to colourize Haskell code.\
+It currently has six output formats: ANSI terminal codes, HTML 3.2\
+with <font> tags, HTML 4.01 with CSS, XHTML 1.0 with inline CSS\
+styling, LaTeX, and mIRC chat client codes.
+
+Name: %{pkg_name}
+Version: 1.19
+Release: 5.2%{?dist}
+Summary: Colourizes Haskell code
+
+Group: Development/Tools
+License: GPLv2+
+# BEGIN cabal2spec
+URL: http://hackage.haskell.org/package/%{name}
+Source0: http://hackage.haskell.org/packages/archive/%{name}/%{version}/%{name}-%{version}.tar.gz
+BuildRequires: ghc-Cabal-devel
+BuildRequires: ghc-rpm-macros %{!?without_hscolour:hscolour}
+# END cabal2spec
+BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
+
+%description
+%{common_description}
+
+
+%prep
+%setup -q
+
+
+%build
+%ghc_lib_build
+
+
+%install
+rm -rf $RPM_BUILD_ROOT
+%ghc_lib_install
+
+
+%clean
+rm -rf $RPM_BUILD_ROOT
+
+
+# library subpackage
+%ghc_package
+
+%ghc_description
+
+
+# devel subpackage
+%ghc_devel_package
+
+%ghc_devel_description
+
+
+%ghc_devel_post_postun
+
+
+%files
+%defattr(-,root,root,-)
+%doc LICENCE-GPL
+%attr(755,root,root) %{_bindir}/HsColour
+%{_datadir}/%{name}-%{version}
+
+
+%ghc_files LICENCE-GPL
+
+
+%changelog
+* Mon Jan 13 2014 Jens Petersen <petersen@redhat.com> - 1.19-5.2
+- add defattr
+
+* Fri Dec 27 2013 Jens Petersen <petersen@redhat.com> - 1.19-5.1
+- normal full build
+- add el5 buildroot lines
+
+* Wed Mar 21 2012 Jens Petersen <petersen@redhat.com> - 1.19-5
+- bootstrap build
+- drop the explicit containers BR
+
+* Mon Jan 23 2012 Jens Petersen <petersen@redhat.com> - 1.19-4
+- update to cabal2spec-0.25.2
+
+* Fri Jan 13 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.19-3.2
+- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild
+
+* Fri Oct 21 2011 Marcela Mašláňová <mmaslano@redhat.com> - 1.19-2.2
+- rebuild with new gmp without compat lib
+
+* Wed Oct 12 2011 Peter Schiffer <pschiffe@redhat.com> - 1.19-2.1
+- rebuild with new gmp
+
+* Fri Jun 17 2011 Jens Petersen <petersen@redhat.com> - 1.19-2
+- use ghc_arches (cabal-0.23.2)
+
+* Fri Jun 17 2011 Jens Petersen <petersen@redhat.com> - 1.19-1
+- update to 1.19
+- use ghc_bootstrap from ghc-rpm-macros-0.13.5
+- just depends on containers
+
+* Thu May 05 2011 Jiri Skala <jskala@redhat.com> - 1.17-10
+- enable source hscolour again
+
+* Tue May 03 2011 Jiri Skala <jskala@redhat.com> - 1.17-9
+- temporily disable hscolour for ghc-7.0.2 bootstrap on ppc64
+
+* Thu Mar 10 2011 Jens Petersen <petersen@redhat.com> - 1.17-8
+- enable source hscolour again
+
+* Thu Mar 10 2011 Jens Petersen <petersen@redhat.com> - 1.17-7
+- temporily disable hscolour for ghc-7.0.2 bootstrap
+
+* Wed Feb 23 2011 Fabio M. Di Nitto <fdinitto@redhat.com> - 1.17-6
+- enable build on sparcv9
+
+* Wed Feb 09 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.17-5
+- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild
+
+* Sun Jan 23 2011 Jens Petersen <petersen@redhat.com> - 1.17-4
+- rebuild
+
+* Sat Jan 15 2011 Jens Petersen <petersen@redhat.com> - 1.17-3
+- update to cabal2spec-0.22.4
+
+* Thu Nov 25 2010 Jens Petersen <petersen@redhat.com> - 1.17-2
+- rebuilt
+
+* Mon Jul 19 2010 Jens Petersen <petersen@redhat.com> - 1.17-1
+- 1.17 release
+- use ghc-rpm-macros-0.8.1 macros: update to cabal2spec-0.22.1
+- add hscolour and obsolete doc subpackage
+
+* Sat Jun 26 2010 Jens Petersen <petersen@redhat.com> - 1.16-3
+- strip dynlinked files (cabal2spec-0.21.4)
+
+* Mon Feb 15 2010 Conrad Meyer <konrad@tylerc.org> - 1.16-1
+- Bump to 1.16
+
+* Mon Jan 11 2010 Jens Petersen <petersen@redhat.com> - 1.15-4
+- update to ghc-rpm-macros-0.5.1 and cabal2spec-0.21.1:
+- drop doc and prof bcond
+- use common summary and common_description
+- define pkg_name and use ghc_binlib_package
+
+* Wed Dec 23 2009 Jens Petersen <petersen@redhat.com> - 1.15-3
+- devel package requires shared library not base
+
+* Wed Dec 23 2009 Jens Petersen <petersen@redhat.com> - 1.15-2
+- update spec for ghc-6.12.1
+- added shared library support: needs ghc-rpm-macros 0.3.1
+
+* Fri Sep 18 2009 Jens Petersen <petersen@redhat.com> - 1.15-1
+- update to 1.15
+
+* Fri Jul 24 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.13-2
+- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild
+
+* Sun May 24 2009 Jens Petersen <petersen@redhat.com> - 1.13-1
+- update to 1.13
+- buildrequires ghc-rpm-macros (cabal2spec-0.16)
+
+* Sat Apr 25 2009 Jens Petersen <petersen@redhat.com> - 1.12-3
+- sync with cabal2spec-0.15
+
+* Tue Mar 10 2009 Jens Petersen <petersen@redhat.com> - 1.12-2
+- fix url (#488665)
+- fix HsColour permissions (#488665)
+
+* Thu Mar 5 2009 Jens Petersen <petersen@redhat.com> - 1.12-1
+- initial packaging for Fedora created by cabal2spec