From cd30bb354741cb11e02ecee22daa30cacbdb4838 Mon Sep 17 00:00:00 2001 From: Jens Petersen Date: Mon, 28 Mar 2011 15:57:59 +0900 Subject: [PATCH] check PKGBASEDIR, ghc bootstrapping, ghc_reindex_haddock nop, drop ghc-*-doc provides - ghc-deps.sh: check PKGBASEDIR exists to avoid warning for bin package - abort cabal_configure if ghc is not self-bootstrapped - make ghc_reindex_haddock a safe no-op - no longer provide ghc-*-doc - no longer run ghc_reindex_haddock in ghc-*-devel scripts --- ghc-deps.sh | 4 +++- ghc-rpm-macros.ghc | 17 +++++++++++------ ghc-rpm-macros.spec | 11 +++++++++-- 3 files changed, 23 insertions(+), 9 deletions(-) diff --git a/ghc-deps.sh b/ghc-deps.sh index b964ce9..125a097 100755 --- a/ghc-deps.sh +++ b/ghc-deps.sh @@ -18,7 +18,9 @@ case $MODE in *) echo "`basename $0`: Need --provides or --requires" ; exit 1 esac -SHARED=$(find $PKGBASEDIR -type f -name '*.so') +if [ -d "$PKGBASEDIR" ]; then + SHARED=$(find $PKGBASEDIR -type f -name '*.so') +fi GHCVERSION=$(ghc --numeric-version) diff --git a/ghc-rpm-macros.ghc b/ghc-rpm-macros.ghc index eab61e5..17f5c49 100644 --- a/ghc-rpm-macros.ghc +++ b/ghc-rpm-macros.ghc @@ -7,6 +7,15 @@ # configure %cabal_configure\ +%if %{undefined ghc_bootstrap}\ +if ! ghc --info | grep -q "(\"Booter version\",\"%{ghc_version}\")"; then\ + echo "Aborting since this ghc build is not ABI self-bootstrapped.\ +The ghc package should be rebuilt against its current version first\ +to prevent avoid any potential future dependency breakage.\ +(This can be overridden by defining ghc_bootstrap at your own risk.)"\ + exit 1\ +fi\ +%endif\ %cabal configure --prefix=%{_prefix} --libdir=%{_libdir} --docdir=%{_docdir}/%{name}-%{version} --htmldir=%{ghclibdocdir}/%{pkg_name}-%{version} --libsubdir='$compiler/$pkgid' --ghc %{!?ghc_without_shared:--enable-shared} %{!?ghc_without_dynamic:--enable-executable-dynamic} %{?cabal_configure_options} # install @@ -128,9 +137,8 @@ This package provides the shared library.\ %ghc_pkg_recache %{_bindir}/ghc-pkg recache --no-user-package-conf || : -# for docs post and postun -%ghc_reindex_haddock\ -%{nil} +# (deprecated) for docs post and postun +%ghc_reindex_haddock : # ghc_package_devel [-c cdepslist] [-h pkgdepslist] [-l licensetag] [name] [version] %ghc_package_devel(c:h:l:)\ @@ -154,7 +162,6 @@ Group: Development/Libraries\ %{?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 < %{version}-%{release}\ -Provides: %{basepkg}-doc = %{version}-%{release}\ \ %description -n %{basepkg}-devel\ %{?common_description}%{!?common_description:Haskell %{pkgname} library.}\ @@ -163,11 +170,9 @@ This package contains the development files.\ \ %post -n %{basepkg}-devel\ %ghc_pkg_recache\ -%ghc_reindex_haddock\ \ %postun -n %{basepkg}-devel\ %ghc_pkg_recache\ -%ghc_reindex_haddock\ \ %files -n %{basepkg}-devel -f %{basepkg}-devel.files\ %defattr(-,root,root,-)\ diff --git a/ghc-rpm-macros.spec b/ghc-rpm-macros.spec index 7ed0006..9db505f 100644 --- a/ghc-rpm-macros.spec +++ b/ghc-rpm-macros.spec @@ -1,7 +1,7 @@ %global debug_package %{nil} Name: ghc-rpm-macros -Version: 0.11.12 +Version: 0.11.13 Release: 1%{?dist} Summary: Macros for building packages for GHC @@ -58,6 +58,13 @@ EOF %changelog +* Mon Mar 28 2011 Jens Petersen - 0.11.13-1 +- ghc-deps.sh: check PKGBASEDIR exists to avoid warning for bin package +- abort cabal_configure if ghc is not self-bootstrapped +- make ghc_reindex_haddock a safe : no-op +- no longer provide ghc-*-doc +- no longer run ghc_reindex_haddock in ghc-*-devel scripts + * Thu Mar 10 2011 Jens Petersen - 0.11.12-1 - add ghc_pkg_obsoletes to binlib base lib package too @@ -72,7 +79,7 @@ EOF - 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) + (ie non main intel) archs - disable debuginfo for self * Fri Feb 11 2011 Jens Petersen - 0.11.9-1