[ghc/el6/master] provide ghc-devel and backport packaging improvements and cleanup

Jens Petersen petersen at fedoraproject.org
Mon Apr 25 08:42:05 UTC 2011


commit f545121e699937e1399e2f54c59f4d54a42ab4f9
Author: Jens Petersen <petersen at redhat.com>
Date:   Mon Apr 25 17:39:29 2011 +0900

    provide ghc-devel and backport packaging improvements and cleanup
    
    - provide ghc-devel for compatibility with cabal2spec-0.22.5
    - use ghc_without_shared
    - drop buildroot and buildroot cleaning
    - drop old extralibs bcond
    - no longer need to define or clean buildroot
    - smp build with max 4 cpus

 ghc.spec |   67 ++++++++++++++++++++++++++++++-------------------------------
 1 files changed, 33 insertions(+), 34 deletions(-)
---
diff --git a/ghc.spec b/ghc.spec
index 98dabc1..c8a1490 100644
--- a/ghc.spec
+++ b/ghc.spec
@@ -1,8 +1,6 @@
+# shared haskell libraries supported for x86* archs (enabled in ghc-rpm-macros)
+
 ## default enabled options ##
-# experimental shared libraries support available in ghc-6.12 for x86
-%ifarch %{ix86} x86_64
-%bcond_without shared
-%endif
 %bcond_without doc
 # test builds can made faster and smaller by disabling profiled libraries
 # (currently libHSrts_thr_p.a breaks no prof build)
@@ -12,35 +10,29 @@
 # run testsuite
 %bcond_without testsuite
 # include colored html src
-%bcond_with hscolour
+%bcond_without hscolour
 
 ## default disabled options ##
-# include extralibs
-%bcond_with extralibs
 # quick build profile
 %bcond_with quick
 
-# the debuginfo subpackage is currently empty anyway, so don't generate it
+# ghc does not output dwarf format so debuginfo is not useful
 %global debug_package %{nil}
 
 Name: ghc
-# part of haskell-platform-2010.2.0.0
+# haskell-platform-2010.2.0.0
 Version: 6.12.3
-Release: 5%{?dist}
+Release: 6%{?dist}
 Summary: Glasgow Haskell Compilation system
 # fedora ghc has only been bootstrapped on the following archs:
 ExclusiveArch: %{ix86} x86_64 ppc alpha
 License: BSD
 Group: Development/Languages
 Source0: http://www.haskell.org/ghc/dist/%{version}/ghc-%{version}-src.tar.bz2
-%if %{with extralibs}
-Source1: http://www.haskell.org/ghc/dist/%{version}/ghc-%{version}-src-extralibs.tar.bz2
-%endif
 %if %{with testsuite}
 Source2: http://www.haskell.org/ghc/dist/%{version}/testsuite-%{version}.tar.bz2
 %endif
 URL: http://haskell.org/ghc/
-BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 # introduced for f14
 Obsoletes: ghc-doc < 6.12.3-4
 Provides: ghc-doc = %{version}-%{release}
@@ -53,7 +45,9 @@ Obsoletes: ghc-time-doc < 1.1.2.4-5
 BuildRequires: ghc, ghc-rpm-macros >= 0.8.0
 BuildRequires: gmp-devel, ncurses-devel
 Requires: gcc, gmp-devel
-%if %{with shared}
+# for forwards compatibility
+Provides: ghc-devel = %{version}-%{release}
+%if %{undefined ghc_without_shared}
 # not sure if this is actually needed:
 BuildRequires: libffi-devel
 Requires: %{name}-libs = %{version}-%{release}
@@ -71,7 +65,7 @@ Patch1: ghc-6.12.1-gen_contents_index-haddock-path.patch
 
 %description
 GHC is a state-of-the-art programming suite for Haskell, a purely
-functional programming language.  It includes an optimising compiler
+functional programming language.  It includes an optimizing compiler
 generating good code for a variety of platforms, together with an
 interactive system for convenient, quick development.  The
 distribution includes space and time profiling facilities, a large
@@ -79,7 +73,7 @@ collection of libraries, and support for various language
 extensions, including concurrency, exceptions, and a foreign language
 interface.
 
-%if %{with shared}
+%if %{undefined ghc_without_shared}
 %package libs
 Summary: Shared libraries for GHC
 Group: Development/Libraries
@@ -116,19 +110,19 @@ rm -r ghc-tarballs/{mingw,perl}
 
 %build
 cat > mk/build.mk << EOF
-GhcLibWays = v %{?with_prof:p} %{?with_shared:dyn} 
+GhcLibWays = v %{?with_prof:p} %{!?ghc_without_shared:dyn} 
 %if %{without doc}
-HADDOCK_DOCS       = NO
+HADDOCK_DOCS = NO
 %endif
 %if %{without manual}
 BUILD_DOCBOOK_HTML = NO
 %endif
 %if %{with quick}
-SRC_HC_OPTS        = -H64m -O0 -fasm
-GhcStage1HcOpts    = -O -fasm
-GhcStage2HcOpts    = -O0 -fasm
-GhcLibHcOpts       = -O0 -fasm
-SplitObjs          = NO
+SRC_HC_OPTS = -H64m -O0 -fasm
+GhcStage1HcOpts = -O -fasm
+GhcStage2HcOpts = -O0 -fasm
+GhcLibHcOpts = -O0 -fasm
+SplitObjs = NO
 %endif
 %if %{without hscolour}
 HSCOLOUR_SRCS = NO
@@ -141,14 +135,14 @@ export CFLAGS="${CFLAGS:-%optflags}"
   --datadir=%{_datadir} --includedir=%{_includedir} --libdir=%{_libdir} \
   --libexecdir=%{_libexecdir} --localstatedir=%{_localstatedir} \
   --sharedstatedir=%{_sharedstatedir} --mandir=%{_mandir} \
-  %{?with_shared:--enable-shared}
+  %{!?ghc_without_shared:--enable-shared}
 
-# 8 cpus seems to break build
-#make %{_smp_mflags}
-make
+# 4 cpus or more sometimes breaks build
+[ -z "$RPM_BUILD_NCPUS" ] && RPM_BUILD_NCPUS=$(/usr/bin/getconf _NPROCESSORS_ONLN)
+[ "$RPM_BUILD_NCPUS" -gt 4 ] && RPM_BUILD_NCPUS=4
+make -j$RPM_BUILD_NCPUS
 
 %install
-rm -rf $RPM_BUILD_ROOT
 make DESTDIR=${RPM_BUILD_ROOT} install
 
 SRC_TOP=$PWD
@@ -200,7 +194,7 @@ echo 'main = putStrLn "Foo"' > testghc/foo.hs
 inplace/bin/ghc-stage2 testghc/foo.hs -o testghc/foo -O2
 [ "$(testghc/foo)" = "Foo" ]
 rm testghc/*
-%if %{with shared}
+%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" ]
@@ -210,9 +204,6 @@ rm testghc/*
 make -C testsuite/tests/ghc-regress fast
 %endif
 
-%clean
-rm -rf $RPM_BUILD_ROOT
-
 %post
 # Alas, GHC, Hugs, and nhc all come with different set of tools in
 # addition to a runFOO:
@@ -267,7 +258,7 @@ fi
 %ghost %{ghcdocbasedir}/libraries/plus.gif
 %endif
 
-%if %{with shared}
+%if %{undefined ghc_without_shared}
 %files libs -f ghc-libs.files
 %defattr(-,root,root,-)
 %endif
@@ -278,6 +269,14 @@ fi
 %endif
 
 %changelog
+* Mon Apr 25 2011 Jens Petersen <petersen at redhat.com> - 6.12.3-6
+- provide ghc-devel for compatibility with cabal2spec-0.22.5
+- use ghc_without_shared
+- drop buildroot and buildroot cleaning
+- drop old extralibs bcond
+- no longer need to define or clean buildroot
+- smp build with max 4 cpus
+
 * Wed Sep 29 2010 Jens Petersen <petersen at redhat.com> - 6.12.3-5.el6
 - build without happy and hscolour
 


More information about the scm-commits mailing list