From ed9a00f761aeec1cbf292b60198737b873ed4e49 Mon Sep 17 00:00:00 2001 From: Jens Petersen Date: Fri, 17 Jun 2011 12:29:21 +0900 Subject: [PATCH] add ghc_check_bootstrap --- ghc-rpm-macros.ghc | 15 ++++++++++----- ghc-rpm-macros.spec | 11 ++++++----- 2 files changed, 16 insertions(+), 10 deletions(-) diff --git a/ghc-rpm-macros.ghc b/ghc-rpm-macros.ghc index df7db99..79bef3c 100644 --- a/ghc-rpm-macros.ghc +++ b/ghc-rpm-macros.ghc @@ -5,17 +5,22 @@ %cabal [ -x Setup ] || ghc --make %{!?ghc_without_shared:%{!?ghc_without_dynamic:-dynamic}} Setup\ ./Setup -# configure -%cabal_configure\ -%if %{undefined ghc_bootstrap}\ +# check ghc version was rebuilt against self +%ghc_check_bootstrap\ if [ ! "$(ghc --info | grep \\"Booter\\ version\\",\\"%{ghc_version}\\")" ]; then\ - echo "Aborting since this ghc build is not self-bootstrapped.\ + echo "Warning: this ghc build is not self-bootstrapped.\ The ghc package should be rebuilt against its current version first\ to prevent dependency ABI breakage from a future ghc rebuild.\ (This can be overridden understanding this risk, by defining ghc_bootstrap.)"\ +%if %{undefined ghc_bootstrap}\ + echo "Aborting."\ exit 1\ -fi\ %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_shared:--enable-shared} %{!?ghc_without_dynamic:--enable-executable-dynamic} %{?cabal_configure_options} # install diff --git a/ghc-rpm-macros.spec b/ghc-rpm-macros.spec index e1dfa84..28b5356 100644 --- a/ghc-rpm-macros.spec +++ b/ghc-rpm-macros.spec @@ -3,7 +3,7 @@ %global macros_file %{_sysconfdir}/rpm/macros.ghc Name: ghc-rpm-macros -Version: 0.13.3 +Version: 0.13.4 Release: 1%{?dist} Summary: Macros for building packages for GHC @@ -34,11 +34,9 @@ echo no build stage needed %install -mkdir -p ${RPM_BUILD_ROOT}/%{_sysconfdir}/rpm -install -p -m 0644 %{SOURCE0} ${RPM_BUILD_ROOT}/%{macros_file} +install -p -D -m 0644 %{SOURCE0} ${RPM_BUILD_ROOT}/%{macros_file} -mkdir -p %{buildroot}/%{_prefix}/lib/rpm -install -p %{SOURCE3} %{buildroot}/%{_prefix}/lib/rpm +install -p -D -m 0755 %{SOURCE3} %{buildroot}/%{_prefix}/lib/rpm/ghc-deps.sh # this is why this package is now arch-dependent: # turn off shared libs and dynamic linking on secondary archs @@ -60,6 +58,9 @@ EOF %changelog +* Fri Jun 17 2011 Jens Petersen - 0.13.4-1 +- add ghc_check_bootstrap + * Thu Jun 2 2011 Jens Petersen - 0.13.3-1 - rename macros.ghc-pkg back to macros.ghc - move the devel summary prefix back to a suffix