From feffa9307913fbc7ab9f10f32aae8d70e289dcac Mon Sep 17 00:00:00 2001 From: Jens Petersen Date: Sat, 12 Dec 2009 10:47:38 +0000 Subject: [PATCH] - 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 --- ghc.spec | 48 +++++++++++++++++++++++++++++++++++++++++------- 1 file changed, 41 insertions(+), 7 deletions(-) diff --git a/ghc.spec b/ghc.spec index bb1098e..d0fd611 100644 --- a/ghc.spec +++ b/ghc.spec @@ -3,10 +3,11 @@ %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) %bcond_without prof -# build users_guide, etc +# build xml manuals (users_guide, etc) %bcond_without manual ## default disabled options ## @@ -23,7 +24,7 @@ Name: ghc # break of haskell-platform-2009.2.0.2 Version: 6.12.1 -Release: 0.2%{?dist} +Release: 0.3%{?dist} Summary: Glasgow Haskell Compilation system # fedora ghc has only been bootstrapped on the following archs: ExclusiveArch: %{ix86} x86_64 ppc alpha @@ -77,13 +78,17 @@ Preformatted documentation for the Glorious Glasgow Haskell Compilation System (GHC) and its libraries. It should be installed if you like to have local access to the documentation in HTML format. +%if %{with doc} %package ghc-doc Summary: Documentation for the ghc internals library Group: Development/Languages -Requires(posttrans): %{name} = %{version}-%{release} +Requires: %{name}-doc = %{version} +Requires(post): %{name}-doc = %{version} +Requires(postun): %{name}-doc = %{version} %description ghc-doc Documentation for the ghc internals library. +%endif %package ghc-devel Summary: Development files for ghc internals @@ -147,8 +152,10 @@ cat > mk/build.mk << EOF %if %{without prof} GhcLibWays = v %{?with_shared:dyn} %endif -%if %{without manual} +%if %{without doc} HADDOCK_DOCS = NO +%endif +%if %{without manual} BUILD_DOCBOOK_HTML = NO %endif %if %{with quick} @@ -190,7 +197,7 @@ SRC_TOP=$PWD ( cd $RPM_BUILD_ROOT find .%{_libdir}/%{name}-%{version} -maxdepth 1 -type d ! -name 'include' ! -name 'package.conf.d' ! -name 'ghc-%{version}' -fprintf $SRC_TOP/rpm-lib-dir.files "%%%%dir %%p\n" find .%{_libdir}/%{name}-%{version} -mindepth 1 -type d \( -name 'ghc-%{version}' -prune -o -fprintf $SRC_TOP/rpm-dev-dir.files "%%%%dir %%p\n" \) - find .%{_libdir}/%{name}-%{version} -mindepth 1 \( -name 'ghc-%{version}' -prune \) -o \( -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 \) + find .%{_libdir}/%{name}-%{version} -mindepth 1 \( -name 'ghc-%{version}*' -prune \) -o \( -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 \) find .%{_docdir}/%{name}/* -type d ! -name libraries ! -name 'ghc-%{version}' ! -name src > $SRC_TOP/ghc-doc.files ) @@ -261,11 +268,28 @@ if [ "$1" = 0 ]; then fi %posttrans +# (posttrans to make sure any old libs have been removed first) +ghc-pkg recache + +%post ghc-devel +ghc-pkg recache + +%postun ghc-devel ghc-pkg recache %posttrans doc -# (posttrans to make sure any old documentation has been removed first) -( cd %{_docdir}/ghc/libraries && ./gen_contents_index ) || : +# (posttrans to make sure any old docs have been removed first) +%ghc_reindex_haddock + +%if %{with doc} +%post ghc-doc +%ghc_reindex_haddock + +%postun ghc-doc +if [ "$1" -eq 0 ] ; then + %ghc_reindex_haddock +fi +%endif %files -f ghc.files %defattr(-,root,root,-) @@ -279,6 +303,7 @@ ghc-pkg recache %files doc -f ghc-doc.files %defattr(-,root,root,-) +%if %{with doc} %dir %{_docdir}/%{name}/libraries %{_docdir}/%{name}/libraries/frames.html %{_docdir}/%{name}/libraries/gen_contents_index @@ -292,6 +317,7 @@ ghc-pkg recache %ghost %{_docdir}/%{name}/libraries/index*.html %ghost %{_docdir}/%{name}/libraries/minus.gif %ghost %{_docdir}/%{name}/libraries/plus.gif +%endif %if %{with shared} %files libs -f ghc-libs.files @@ -304,8 +330,10 @@ ghc-pkg recache %files ghc-devel -f ghc-ghc-devel.files %defattr(-,root,root,-) +%if %{with doc} %files ghc-doc -f ghc-ghc-doc.files %defattr(-,root,root,-) +%endif %if %{with prof} %files prof -f ghc-prof.files @@ -316,6 +344,12 @@ ghc-pkg recache %endif %changelog +* Sat Dec 12 2009 Jens Petersen - 6.12.1-0.3 +- 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 + * Sat Dec 12 2009 Jens Petersen - 6.12.1-0.2 - remove redundant mingw and perl from ghc-tarballs/ - fix exclusion of ghc internals lib from base packages with -mindepth