Compare commits

...

19 Commits
master ... f14

Author SHA1 Message Date
Jens Petersen 577502b69e drop redundant posttrans scriptlet 2011-05-11 12:40:46 +09:00
Jens Petersen ae236304a4 add missing %files libs 2011-05-10 11:26:09 +09:00
Jens Petersen b8adf39866 re-instate ghc-libs, ghc-rpm-macros-0.10.55 for automatic deps; tighten interpackage deps
- ghc-rpm-macros-0.10.55 for automatic lib dependencies
- ghc now requires ghc-devel with ver-rel
- ghc-devel now require ghc with ver-rel
- ghc-prof now requires ghc-devel with ver-rel
- make devel and prof meta packages require subpackages with ver-rel
- make ghc-*-devel subpackages require ghc with ver-rel
- bring back ghc-libs to avoid yum resolver problems (#702934)
- drop haddock obsoletes
- use without_hscolour
2011-05-09 18:21:35 +09:00
Jens Petersen ebc56c8308 bring back LICENSE files in library subpackages 2011-03-29 15:10:39 +09:00
Jens Petersen 4079a6cab0 fix bin-package-db obsoletes with ghc-rpm-macros-0.10.52 and use ghc_without_shared 2011-03-28 17:37:22 +09:00
Jens Petersen 0edbeeddba fix without_shared build; move bin-package-db into ghc-ghc 2011-03-10 13:23:05 +09:00
Jens Petersen add2492106 actually need ghc-rpm-macros-0.10.51 to build 2011-02-04 15:57:28 +10:00
Jens Petersen 49fb3f0cac add dph* and syb, include base3 in base, handle libffi 2011-02-04 13:52:51 +10:00
Jens Petersen 92c205dac8 backport packaging changes from rawhide including subpackaging of libraries
- subpackage all the libraries with latest ghc-rpm-macros-0.10.50
- 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
- drop old extralibs bcond
- no longer need to define or clean buildroot
- ghc base package now requires ghc-devel
- drop ghc-time obsoletes
- fix no doc and no manual builds
- include LICENSE files in the shared lib subpackages
2011-01-31 14:24:52 +10:00
Jens Petersen c43f369901 Merge remote branch 'origin/master' into f14/master 2010-11-04 16:49:14 +10:00
Jens Petersen 666b0c544e Merge remote branch 'origin/master' into f14/master 2010-10-01 16:26:57 +10:00
Jens Petersen 35e70c8f21 Merge remote branch 'origin/master' into f14/master 2010-10-01 14:50:17 +10:00
Jens Petersen 7f512f4d2e Merge remote branch 'origin/master' into f14/master 2010-10-01 14:34:21 +10:00
Jens Petersen 1e273b4ce5 Merge remote branch 'origin/master' into f14/master 2010-10-01 14:00:22 +10:00
Jens Petersen 63d6d4e060 Merge remote branch 'origin/master' into f14/master 2010-09-30 20:24:29 +10:00
Jens Petersen decc0d3762 Merge remote branch 'origin/master' into f14/master 2010-09-30 19:21:42 +10:00
Jens Petersen fd8502dcea Merge remote branch 'origin/master' into f14/master 2010-09-30 18:32:57 +10:00
Jens Petersen 5aec86879b move gtk2hs obsoletes to ghc-glib and ghc-gtk 2010-09-30 18:32:44 +10:00
Jens Petersen db6a2868bb obsolete old gtk2hs packages for smooth upgrades 2010-07-31 19:25:48 +10:00
1 changed files with 206 additions and 97 deletions

303
ghc.spec
View File

@ -1,8 +1,7 @@
# shared haskell libraries supported for x86* archs
# (disabled for other archs 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)
@ -11,57 +10,49 @@
%bcond_without manual
# run testsuite
%bcond_without testsuite
# include colored html src
%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: 7%{?dist}
# 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: 8.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
# BR for lib and binlib packages
Provides: ghc-doc = %{version}-%{release}
# introduced for f11
Obsoletes: haddock < 2.4.2-3, ghc-haddock-devel < 2.4.2-3
Obsoletes: ghc-haddock-doc < 2.4.2-3
# introduced for f14
Obsoletes: ghc-time-devel < 1.1.2.4-5
Obsoletes: ghc-time-doc < 1.1.2.4-5
BuildRequires: ghc, ghc-rpm-macros >= 0.8.2
BuildRequires: gmp-devel, ncurses-devel
Requires: gcc, gmp-devel
%if %{with shared}
# not sure if this is actually needed:
BuildRequires: libffi-devel
Requires: %{name}-libs = %{version}-%{release}
%endif
BuildRequires: ghc, ghc-rpm-macros >= 0.10.55
BuildRequires: gmp-devel, libffi-devel
#BuildRequires: ghc-directory-devel, ghc-process-devel, ghc-pretty-devel, ghc-containers-devel, ghc-haskell98-devel, ghc-bytestring-devel
# for internal terminfo
BuildRequires: ncurses-devel
Requires: gcc
# for backwards compatibility
Requires: ghc-devel = %{version}-%{release}
# llvm is an optional dependency
%if %{with manual}
BuildRequires: libxslt, docbook-style-xsl
%endif
%if %{with hscolour}
%if %{undefined without_hscolour}
BuildRequires: hscolour
%endif
%if %{with testsuite}
@ -72,7 +63,7 @@ Patch2: ghc-gen_contents_index-type-level.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
@ -80,35 +71,76 @@ collection of libraries, and support for various language
extensions, including concurrency, exceptions, and a foreign language
interface.
%if %{with shared}
%global ghc_version_override %{version}
%global ghc_pkg_c_deps ghc = %{ghc_version_override}-%{release}
%if %{defined ghclibdir}
%ghc_binlib_package Cabal 1.8.0.6
%ghc_binlib_package array 0.3.0.1
%ghc_binlib_package -c gmp-devel base 4.2.0.2
%ghc_binlib_package bytestring 0.9.1.7
%ghc_binlib_package containers 0.3.0.0
%ghc_binlib_package directory 1.0.1.1
%ghc_binlib_package dph-base 0.4.0
%ghc_binlib_package dph-par 0.4.0
%ghc_binlib_package dph-prim-interface 0.4.0
%ghc_binlib_package dph-prim-par 0.4.0
%ghc_binlib_package dph-prim-seq 0.4.0
%ghc_binlib_package dph-seq 0.4.0
%ghc_binlib_package extensible-exceptions 0.1.1.1
%ghc_binlib_package filepath 1.1.0.4
%define ghc_pkg_obsoletes ghc-bin-package-db-devel < 0.0.0.0-8.2
%ghc_binlib_package -x ghc %{ghc_version_override}
%undefine ghc_pkg_obsoletes
%ghc_binlib_package haskell98 1.0.1.1
%ghc_binlib_package hpc 0.5.0.5
%ghc_binlib_package old-locale 1.0.0.2
%ghc_binlib_package old-time 1.0.0.5
%ghc_binlib_package pretty 1.0.1.1
%ghc_binlib_package process 1.0.1.3
%ghc_binlib_package random 1.0.0.2
%ghc_binlib_package syb 0.1.0.2
%ghc_binlib_package template-haskell 2.4.0.1
%ghc_binlib_package time 1.1.4
%ghc_binlib_package unix 2.4.0.2
%endif
%global version %{ghc_version_override}
%if %{undefined ghc_without_shared}
%package libs
Summary: Shared libraries for GHC
Group: Development/Libraries
Obsoletes: ghc-time < 1.1.2.4-5
Summary: GHC shared libraries meta package
Group: System Environment/Libraries
%{?ghc_packages_list:Requires: %(echo %{ghc_packages_list} | sed -e "s/\([^ ]*\)-\([^ ]*\)/ghc-\1 = \2-%{release},/g")}
%description libs
Shared libraries for Glorious Glasgow Haskell Compilation System (GHC).
Meta package for GHC's shared libraries.
%endif
%package devel
Summary: GHC development libraries meta package
Group: Development/Libraries
Requires: ghc = %{version}-%{release}
%{?ghc_packages_list:Requires: %(echo %{ghc_packages_list} | sed -e "s/\([^ ]*\)-\([^ ]*\)/ghc-\1-devel = \2-%{release},/g")}
%description devel
This is a meta-package for all the development library packages in GHC.
%if %{with prof}
%package prof
Summary: Profiling libraries for GHC
Summary: GHC profiling libraries meta-package
Group: Development/Libraries
Requires: %{name} = %{version}-%{release}
Obsoletes: ghc-haddock-prof < 2.4.2-3
Obsoletes: ghc-time-prof < 1.1.2.4-5
Requires: ghc-devel = %{version}-%{release}
%{?ghc_packages_list:Requires: %(echo %{ghc_packages_list} | sed -e "s/\([^ ]*\)-\([^ ]*\)/ghc-\1-prof = \2-%{release},/g")}
%description prof
Profiling libraries for Glorious Glasgow Haskell Compilation System (GHC).
This is a meta-package for all the profiling library packages in GHC.
They should be installed when GHC's profiling subsystem is needed.
%endif
%global ghc_version_override %{version}
%ghc_binlib_package -n ghc -o 6.12.3-4
%prep
%setup -q -n %{name}-%{version} %{?with_extralibs:-b1} %{?with_testsuite:-b2}
%setup -q -n %{name}-%{version} %{?with_testsuite:-b2}
# absolute haddock path (was for html/libraries -> libraries)
%patch1 -p1 -b .orig
# type-level too big so skip it in gen_contents_index
@ -119,21 +151,21 @@ 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}
%if %{undefined without_hscolour}
HSCOLOUR_SRCS = NO
%endif
EOF
@ -144,40 +176,59 @@ 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}
# 4 cpus or more sometimes breaks build
[ -z "$RPM_BUILD_NCPUS" ] && RPM_BUILD_NCPUS=$(/usr/bin/getconf _NPROCESSORS_ONLN)
# >4 cpus tends to break build
[ -z "$RPM_BUILD_NCPUS" ] && RPM_BUILD_NCPUS=$(%{_bindir}/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
( cd $RPM_BUILD_ROOT
# library directories
find .%{_libdir}/%{name}-%{version} -maxdepth 1 -type d ! -name 'include' ! -name 'package.conf.d' -fprintf $SRC_TOP/rpm-lib-dir.files "%%%%dir %%p\n"
# library devel subdirs
find .%{_libdir}/%{name}-%{version} -mindepth 1 -type d \( -fprintf $SRC_TOP/rpm-dev-dir.files "%%%%dir %%p\n" \)
# split dyn, devel, conf and prof files
find .%{_libdir}/%{name}-%{version} -mindepth 1 \( -name 'libHS*-ghc%{version}.so' -fprintf $SRC_TOP/rpm-lib.files "%%%%attr(755,root,root) %%p\n" \) -o \( \( -name '*.p_hi' -o -name '*_p.a' \) -fprint $SRC_TOP/ghc-prof.files \) -o \( \( -name '*.hi' -o -name '*.dyn_hi' -o -name 'libHS*.a' -o -name 'HS*.o' -o -name '*.h' -o -name '*.conf' -o -type f -not -name 'package.cache' \) -fprint $SRC_TOP/rpm-base.files \)
# manuals (src dir are subdirs so dont duplicate them)
find .%{_docdir}/%{name}/html/* -type d ! -name libraries ! -name src > $SRC_TOP/rpm-doc-dir.files
)
%ghc_gen_filelists base 3.0.3.2
for suff in {,-devel,-prof}.files; do
mv ghc-base{,3}$suff
done
# make paths absolute (filter "./usr" to "/usr")
sed -i -e "s|\.%{_prefix}|%{_prefix}|" *.files
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
if [ -r "libraries/$name/LICENSE" ]; then
echo "%doc libraries/$name/LICENSE" >> ghc-$name%{?ghc_without_shared:-devel}.files
fi
done
cat rpm-lib-dir.files rpm-lib.files > ghc-libs.files
cat rpm-dev-dir.files rpm-base.files rpm-doc-dir.files > ghc.files
%ghc_gen_filelists bin-package-db 0.0.0.0
%ghc_gen_filelists ghc %{ghc_version_override}
%ghc_gen_filelists ghc-binary 0.5.0.2
%ghc_gen_filelists ghc-prim 0.2.0.0
%ghc_gen_filelists integer-gmp 0.2.0.1
# subpackage ghc libraries
sed -i -e "/ghc-%{version}\/ghc-%{version}/d" ghc.files ghc-libs.files ghc-prof.files
sed -i -e "/ghc-%{version}\/package.conf.d\/ghc-%{version}-.*.conf\$/d" ghc.files
sed -i -e "/html\/libraries\/ghc-%{version}\$/d" ghc.files
%ghc_gen_filelists ghc
%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\
cat ghc-%1-prof.files >> ghc-%2-prof.files\
if [ -r "libraries/%1/LICENSE" ]; then\
cp -p libraries/%1/LICENSE libraries/LICENSE.%1\
echo "%doc libraries/LICENSE.%1" >> ghc-%2.files\
fi
%merge_filelist integer-gmp base
%merge_filelist ghc-prim base
%merge_filelist base3 base
%merge_filelist ghc-binary ghc
%merge_filelist bin-package-db ghc
%if %{undefined ghc_without_shared}
ls $RPM_BUILD_ROOT%{ghclibdir}/libHS*.so >> ghc-base.files
sed -i -e "s|^$RPM_BUILD_ROOT||g" ghc-base.files
%endif
ls -d $RPM_BUILD_ROOT%{ghclibdir}/libHS*.a $RPM_BUILD_ROOT%{ghclibdir}/HSffi.o $RPM_BUILD_ROOT%{ghclibdir}/package.conf.d/builtin_*.conf $RPM_BUILD_ROOT%{ghclibdir}/include >> ghc-base-devel.files
sed -i -e "s|^$RPM_BUILD_ROOT||g" ghc-base-devel.files
# these are handled as alternatives
for i in hsc2hs runhaskell; do
@ -204,7 +255,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" ]
@ -214,9 +265,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:
@ -241,21 +289,38 @@ if [ "$1" = 0 ]; then
update-alternatives --remove hsc2hs %{_bindir}/hsc2hs-ghc
fi
%posttrans
# (posttrans to make sure any old libs and docs have been removed first)
%ghc_pkg_recache
%ghc_reindex_haddock
%files -f ghc.files
%files
%defattr(-,root,root,-)
%doc ANNOUNCE HACKING LICENSE README
%{_bindir}/*
%dir %{_libdir}/%{name}-%{version}
%ghost %{_libdir}/%{name}-%{version}/package.conf.d/package.cache
%if %{with manual}
%{_mandir}/man1/ghc.*
%endif
%dir %{ghclibdir}
%{ghclibdir}/extra-gcc-opts
%{ghclibdir}/ghc
%{ghclibdir}/ghc-asm
%{ghclibdir}/ghc-pkg
%{ghclibdir}/ghc-split
%{ghclibdir}/ghc-usage.txt
%{ghclibdir}/ghci-usage.txt
%{ghclibdir}/hsc2hs
%if %{with doc}
%{ghclibdir}/haddock
%{ghclibdir}/html
%endif
%dir %{ghclibdir}/package.conf.d
%ghost %{ghclibdir}/package.conf.d/package.cache
%{ghclibdir}/runghc
%{ghclibdir}/template-hsc.h
%{ghclibdir}/unlit
%{_mandir}/man1/ghc.*
%dir %{_docdir}/ghc
%dir %{ghcdocbasedir}
%if %{with doc}
%{ghcdocbasedir}/html
%if %{with manual}
%{ghcdocbasedir}/Cabal
%{ghcdocbasedir}/haddock
%{ghcdocbasedir}/users_guide
%endif
%dir %{ghcdocbasedir}/libraries
%{ghcdocbasedir}/libraries/frames.html
%{ghcdocbasedir}/libraries/gen_contents_index
@ -271,17 +336,61 @@ fi
%ghost %{ghcdocbasedir}/libraries/plus.gif
%endif
%if %{with shared}
%files libs -f ghc-libs.files
%files devel
%defattr(-,root,root,-)
%if %{undefined ghc_without_shared}
%files libs
%defattr(-,root,root,-)
%endif
%if %{with prof}
%files prof -f ghc-prof.files
%files prof
%defattr(-,root,root,-)
%endif
%changelog
* Wed May 11 2011 Jens Petersen <petersen@redhat.com> - 6.12.3-8.6
- drop redundant posttrans scriptlet
* Tue May 10 2011 Jens Petersen <petersen@redhat.com> - 6.12.3-8.5
- add missing %%files libs
* Mon May 9 2011 Jens Petersen <petersen@redhat.com> - 6.12.3-8.4
- ghc-rpm-macros-0.10.55 for automatic lib dependencies
- ghc now requires ghc-devel with ver-rel
- ghc-devel now require ghc with ver-rel
- ghc-prof now requires ghc-devel with ver-rel
- make devel and prof meta packages require subpackages with ver-rel
- make ghc-*-devel subpackages require ghc with ver-rel
- bring back ghc-libs to avoid yum resolver problems (#702934)
- drop haddock obsoletes
- use without_hscolour
* Tue Mar 29 2011 Jens Petersen <petersen@redhat.com> - 6.12.3-8.3
- fix back missing LICENSE files in library subpackages
* Mon Mar 28 2011 Jens Petersen <petersen@redhat.com> - 6.12.3-8.2
- fix the bin-package-db obsoletes with ghc-rpm-macros-0.10.52
- use ghc_without_shared
* Thu Mar 10 2011 Jens Petersen <petersen@redhat.com> - 6.12.3-8.1
- fix without_shared build
- move bin-package-db into ghc-ghc
* Sun Jan 30 2011 Jens Petersen <petersen@redhat.com> - 6.12.3-8
- subpackage all the libraries with latest ghc-rpm-macros-0.10.50
- put rts, ffi, 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
- drop old extralibs bcond
- no longer need to define or clean buildroot
- ghc base package now requires ghc-devel
- drop ghc-time obsoletes
- fix no doc and no manual builds
- include LICENSE files in the shared lib subpackages
* Thu Nov 4 2010 Jens Petersen <petersen@redhat.com> - 6.12.3-7
- skip huge type-level docs from haddock re-indexing (#649228)
@ -384,7 +493,7 @@ fi
- add bcond for manual and extralibs
- reenable ppc secondary arch
- don't provide ghc-haddock-*
- remove obsoltete post requires policycoreutils
- remove obsolete post requires policycoreutils
- add vanilla v to GhcLibWays when building without prof
- handle without hscolour
- can't smp make currently