From 8a8de3a39a77c0c5af03592f82b937a96d01b4b9 Mon Sep 17 00:00:00 2001 From: Jens Petersen Date: Fri, 22 Jun 2012 12:49:41 +0900 Subject: [PATCH] new cabal_tweak_dep_ver macro for tweaking versions of depends %cabal_tweak_dep_ver dep old new [backup] changes old version bound to new for dep with optional backup suffix eg %cabal_tweak_dep_ver haskell-src-exts 1.12 1.14 2 --- ghc-rpm-macros.ghc | 8 ++++++++ ghc-rpm-macros.spec | 5 ++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/ghc-rpm-macros.ghc b/ghc-rpm-macros.ghc index 13879bf..ff555d9 100644 --- a/ghc-rpm-macros.ghc +++ b/ghc-rpm-macros.ghc @@ -18,6 +18,14 @@ proceeding, to avoid dependency ABI breakage from a future ghc rebuild."\ %endif\ fi +# tweak depends versions +# cabal_tweak_dep_ver dep old new [backup] +%cabal_tweak_dep_ver()\ +if ! grep -q "%1[ >=].*%2"; then\ + exit 1\ +fi\ +sed -i.%{?3}%{!?3:%1} -e "s/\(%1[ >=].*\)%2/\1%3/g" %{pkg_name}-%{version}/%{pkg_name}.cabal + # configure %cabal_configure\ %ghc_check_bootstrap\ diff --git a/ghc-rpm-macros.spec b/ghc-rpm-macros.spec index 862b6d5..82a7a62 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.95.3 +Version: 0.95.4 Release: 1%{?dist} Summary: Macros for building packages for GHC @@ -60,6 +60,9 @@ EOF %changelog +* Fri Jun 22 2012 Jens Petersen - 0.95.4-1 +- add cabal_tweak_dep_ver macro to tweak a depend's version bound in .cabal + * Sat Jun 9 2012 Jens Petersen - 0.95.3-1 - ghc-dep.sh: only use buildroot package.conf.d if it exists