[ghc-rpm-macros] drop ghc_pkg_deps from ghc_package_devel and ghc_package_prof

Jens Petersen petersen at fedoraproject.org
Sun May 8 14:09:23 UTC 2011


commit 8af86b797a234acda904e0abfa6cc366c2c5f541
Author: Jens Petersen <petersen at redhat.com>
Date:   Sun May 8 23:09:07 2011 +0900

    drop ghc_pkg_deps from ghc_package_devel and ghc_package_prof

 ghc-deps.sh         |    8 ++++----
 ghc-rpm-macros.ghc  |    4 +---
 ghc-rpm-macros.spec |    7 ++++++-
 3 files changed, 11 insertions(+), 8 deletions(-)
---
diff --git a/ghc-deps.sh b/ghc-deps.sh
index 125a097..00e2440 100755
--- a/ghc-deps.sh
+++ b/ghc-deps.sh
@@ -30,7 +30,7 @@ files=$(cat)
 
 for i in $files; do
     LIB_FILE=$(echo $i | grep /libHS | egrep -v "$PKGBASEDIR/libHS")
-    if [ -n "$LIB_FILE" ]; then
+    if [ "$LIB_FILE" ]; then
 	if [ -d "$PKGCONFDIR" ]; then
 	    META=""
 	    SELF=""
@@ -38,12 +38,12 @@ for i in $files; do
 		*.so) META=ghc ;;
 		*_p.a) META=ghc-prof SELF=ghc-devel ;;
 		*.a) META=ghc-devel
-		    if [ -n "$SHARED" ]; then
+		    if [ "$SHARED" ]; then
 			SELF=ghc
 		    fi
 		    ;;
 	    esac
-	    if [ -n "$META" ]; then
+	    if [ "$META" ]; then
 		PKGVER=$(echo $LIB_FILE | sed -e "s%$PKGBASEDIR/\([^/]\+\)/libHS.*%\1%")
 		HASHS=$(ghc-pkg -f $PKGCONFDIR field $PKGVER $FIELD | sed -e "s/^$FIELD: \+//")
 		for i in $HASHS; do
@@ -52,7 +52,7 @@ for i in $files; do
 			*) ;;
 		    esac
 		done
-		if [ "$MODE" = "--requires" -a -n "$SELF" ]; then
+		if [ "$MODE" = "--requires" -a "$SELF" ]; then
 		    HASHS=$(ghc-pkg -f $PKGCONFDIR field $PKGVER id | sed -e "s/^id: \+//")
 		    for i in $HASHS; do
 			echo $i | sed -e "s/\(.*\)-\(.*\)/$SELF(\1) = \2/"
diff --git a/ghc-rpm-macros.ghc b/ghc-rpm-macros.ghc
index 28ff7ec..ccb9f06 100644
--- a/ghc-rpm-macros.ghc
+++ b/ghc-rpm-macros.ghc
@@ -16,7 +16,7 @@ to prevent dependency ABI breakage with a future ghc rebuild.\
   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}
+%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
 %cabal_install %cabal copy --destdir=%{buildroot} -v
@@ -155,7 +155,6 @@ Group:          Development/Libraries\
 %{?1:Version:        %{pkgver}}\
 %{-l:License:        %{-l*}}\
 %{?ghc_devel_requires}\
-%{!-h:%{?ghc_pkg_deps:Requires:       %{ghc_pkg_deps}}}\
 %{-h:Requires:       %{-h*}}\
 %{!-c:%{?ghc_pkg_c_deps:Requires:       %{ghc_pkg_c_deps}}}\
 %{-c:Requires:       %{-c*}}\
@@ -191,7 +190,6 @@ Group:          Development/Libraries\
 %{?1:Version:        %{pkgver}}\
 %{-l:License:        %{-l*}}\
 %{?ghc_prof_requires}\
-%{!-h:%{?ghc_pkg_deps:Requires:       %(echo "%{ghc_pkg_deps}" | sed -e "s/\\(ghc-[^, ]*\\)-devel/\\1-prof/g")}}\
 %{-h:Requires:       %(echo "%{-h*}" | sed -e "s/\\(ghc-[^, ]*\\)-devel/\\1-prof/g")}\
 %{?ghc_pkg_obsoletes:Obsoletes:      %(echo "%{ghc_pkg_obsoletes}" | sed -e "s/\\(ghc-[^, ]*\\)-devel/\\1-prof/g")}\
 \
diff --git a/ghc-rpm-macros.spec b/ghc-rpm-macros.spec
index a9fcf96..4544177 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.14
+Version:	0.12.0
 Release:	1%{?dist}
 Summary:	Macros for building packages for GHC
 
@@ -58,6 +58,11 @@ EOF
 
 
 %changelog
+* Sat May  7 2011 Jens Petersen <petersen at redhat.com> - 0.12.0-1
+- drop ghc_pkg_deps from ghc_package_devel and ghc_package_prof since
+  ghc-deps.sh generates better inter-package dependencies already
+- condition --htmldir on pkg_name
+
 * Fri Apr  1 2011 Jens Petersen <petersen at redhat.com> - 0.11.14-1
 - provides ghc-*-doc still needed for current lib templates
 


More information about the scm-commits mailing list