[ghc-rpm-macros] fix handling of devel docdir for non-shared builds

Jens Petersen petersen at fedoraproject.org
Thu Feb 23 09:10:54 UTC 2012


commit 8cf968c984749f89939dffe9c3797af1aad3a25e
Author: Jens Petersen <petersen at redhat.com>
Date:   Thu Feb 23 18:10:50 2012 +0900

    fix handling of devel docdir for non-shared builds
    
    - simplify ghc_bootstrap

 ghc-rpm-macros.ghc  |   37 ++++++++++++++++++-------------------
 ghc-rpm-macros.spec |    6 +++++-
 2 files changed, 23 insertions(+), 20 deletions(-)
---
diff --git a/ghc-rpm-macros.ghc b/ghc-rpm-macros.ghc
index e620a83..85f3afc 100644
--- a/ghc-rpm-macros.ghc
+++ b/ghc-rpm-macros.ghc
@@ -48,20 +48,23 @@ echo "%dir %{pkgdir}" >> %{basepkg}.files\
 echo "%attr(755,root,root) %{pkgdir}/libHS%{pkgnamever}-ghc%{ghc_version}.so" >> %{basepkg}.files\
 fi\
 %endif\
-%if 0%{!?1:1} && %{undefined ghc_exclude_docdir}\
-if [ -d "%{buildroot}%{_docdir}/%{name}-%{version}" ]; then\
-  echo "%{_docdir}/%{name}-%{version}" >> %{basepkg}%{?ghc_without_shared:-devel}.files\
-elif [ -d "%{buildroot}%{_docdir}/ghc-%{pkgnamever}" ]; then\
-  echo "%{_docdir}/ghc-%{pkgnamever}" >> %{basepkg}%{?ghc_without_shared:-devel}.files\
-fi\
-%endif\
 %if 0%{!?1:1} && %{defined ghc_without_shared}\
 if [ "%{name}" = "ghc-%{pkg_name}" ]; then\
   if [ -d "%{buildroot}%{_docdir}/%{name}-%{version}" ]; then\
     mv %{buildroot}%{_docdir}/%{name}-%{version} %{buildroot}%{_docdir}/%{name}-devel-%{version}\
+%if %{undefined ghc_exclude_docdir}\
+    echo "%{_docdir}/%{name}-devel-%{version}" >> %{basepkg}-devel.files\
+%endif\
   fi\
 fi\
 %endif\
+%if 0%{!?1:1} && %{undefined ghc_exclude_docdir}\
+if [ -d "%{buildroot}%{_docdir}/%{name}-%{version}" ]; then\
+  echo "%{_docdir}/%{name}-%{version}" >> %{basepkg}%{?ghc_without_shared:-devel}.files\
+elif [ -d "%{buildroot}%{_docdir}/ghc-%{pkgnamever}" ]; then\
+  echo "%{_docdir}/ghc-%{pkgnamever}" >> %{basepkg}%{?ghc_without_shared:-devel}.files\
+fi\
+%endif\
 echo "%{ghclibdir}/package.conf.d/%{pkgnamever}*.conf" >> %{basepkg}-devel.files\
 if [ -d "%{buildroot}%{pkgdir}" ]; then\
 find %{buildroot}%{pkgdir} -type d | sed "s/^/%dir /" >> %{basepkg}-devel.files\
@@ -273,21 +276,17 @@ find %{buildroot} -type f -exec sh -c "file {} | grep -q 'dynamically linked'" \
 %{!?1:%ghc_strip_dynlinked}\
 %{nil}
 
-# skip shared and prof libs, documentation, and testsuite
-# - without_hscolour needs to be set locally in the spec file
-%ghc_bootstrap\
-%global ghc_without_shared 1\
-%global ghc_without_dynamic 1\
-%global without_prof 1\
-%global without_haddock 1\
-%global without_manual 1\
-%global without_testsuite 1\
-# needs to be set also in ghc.spec\
-%global ghc_bootstrapping 1
+# - without_hscolour, without_testsuite, and ghc_bootstrapping
+#   need to be set locally in the spec file
 
 # skip prof libs, and documentation
-# - without_hscolour needs to be set locally in the spec file
 %ghc_test\
 %global without_prof 1\
 %global without_haddock 1\
 %global without_manual 1
+
+# skip shared and prof libs, documentation, and testsuite
+%ghc_bootstrap\
+%global ghc_without_shared 1\
+%global ghc_without_dynamic 1\
+%ghc_test
diff --git a/ghc-rpm-macros.spec b/ghc-rpm-macros.spec
index 303e00a..bccb4c6 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.15.4
+Version:        0.15.5
 Release:        1%{?dist}
 Summary:        Macros for building packages for GHC
 
@@ -59,6 +59,10 @@ EOF
 
 
 %changelog
+* Thu Feb 23 2012 Jens Petersen <petersen at redhat.com> - 0.15.5-1
+- fix handling of devel docdir for non-shared builds
+- simplify ghc_bootstrap
+
 * Thu Jan 19 2012 Jens Petersen <petersen at redhat.com> - 0.15.4-1
 - allow dynamic linking of Setup with ghc_without_shared set
 


More information about the scm-commits mailing list