[ghc-rpm-macros] don't build .o when no ghci; support meta-packages; optional common_summary and common_description

Jens Petersen petersen at fedoraproject.org
Fri May 25 13:10:14 UTC 2012


commit 6b6cf52f6de50212075bc9b15c61b5174c866eed
Author: Jens Petersen <petersen at redhat.com>
Date:   Fri May 25 22:10:06 2012 +0900

    don't build .o when no ghci; support meta-packages; optional common_summary and common_description
    
    - only  build ghci .o library files on ghc_arches_with_ghci
    - support meta packages like haskell-platform without base lib files
    - make it possible not to have to use common_summary and common_description

 ghc-rpm-macros.ghc  |   33 ++++++++++++++++++++-------------
 ghc-rpm-macros.spec |    7 ++++++-
 2 files changed, 26 insertions(+), 14 deletions(-)
---
diff --git a/ghc-rpm-macros.ghc b/ghc-rpm-macros.ghc
index 4b94a4e..ff5b0de 100644
--- a/ghc-rpm-macros.ghc
+++ b/ghc-rpm-macros.ghc
@@ -21,7 +21,10 @@ 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}
+%ifnarch %{ghc_arches_with_ghci}\
+%define disable_library_for_ghci --disable-library-for-ghci\
+%endif\
+%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} %{?disable_library_for_ghci} %{?cabal_configure_options}
 
 # install
 %cabal_install %cabal copy --destdir=%{buildroot} -v
@@ -73,7 +76,11 @@ fi\
 if [ -d "%{buildroot}%{docdir}" ]; then\
 echo "%{docdir}" >> %{basepkg}-devel.files\
 fi\
-sed -i -e "s!%{buildroot}!!g" %{!?ghc_without_shared:%{basepkg}.files} %{basepkg}-devel.files\
+for i in %{!?ghc_without_shared:%{basepkg}.files} %{basepkg}-devel.files; do\
+if [ -f "$i" ];\
+sed -i -e "s!%{buildroot}!!g" $i\
+fi\
+done\
 %{nil}
 
 %ghc_add_basepkg_file()\
@@ -124,7 +131,7 @@ Requires:       ghc-%{?pkg_name}%{!?pkg_name:%{pkgname}} = %{?pkgver}%{!?pkgver:
 %define pkgver %{?2}%{!?2:%{version}}\
 %define basepkg ghc-%{pkgname}\
 %package -n %{basepkg}\
-Summary:        %{?common_summary}%{!?common_summary:Haskell %{pkgname} library}\
+%{?common_summary:Summary:        %{common_summary}}\
 Group:          System Environment/Libraries\
 %{?1:Version:        %{pkgver}}\
 %{-l:License:        %{-l*}}\
@@ -135,10 +142,12 @@ Group:          System Environment/Libraries\
 %define pkgname %{?1}%{!?1:%{pkg_name}}\
 %define basepkg ghc-%{pkgname}\
 %description -n %{basepkg}\
-%{?common_description}%{!?common_description:Haskell %{pkgname} library.}\
+%if %{defined common_description}\
+%{common_description}\
 %if %{defined ghc_version} && %{undefined ghc_without_shared}\
 This package provides the shared library.\
 %endif
+%endif
 
 # ghc_binlib_package [-c cdepslist] [-h pkgdepslist] [-l licensetag] [-x] [name] [version]
 %ghc_binlib_package(c:h:l:x)\
@@ -181,7 +190,7 @@ This package provides the shared library.\
 %define pkgver %{?2}%{!?2:%{version}}\
 %define basepkg ghc-%{pkgname}\
 %package -n %{basepkg}-devel\
-Summary:        %{?common_summary}%{!?common_summary:Haskell %{pkgname} library} development files\
+%{?common_summary:Summary:        %{common_summary} development files}\
 Group:          Development/Libraries\
 %{?1:Version:        %{pkgver}}\
 %{-l:License:        %{-l*}}\
@@ -202,9 +211,11 @@ Provides:       %{basepkg}-prof = %{pkgver}-%{release}\
 %define pkgname %{?1}%{!?1:%{pkg_name}}\
 %define basepkg ghc-%{pkgname}\
 %description -n %{basepkg}-devel\
-%{?common_description}%{!?common_description:Haskell %{pkgname} library.}\
+%if %{defined common_description}
+%{common_description}\
 \
-This package contains the development files.
+This package contains the development files.\
+%endif
 
 # ghc_devel_post_postun
 %ghc_devel_post_postun\
@@ -250,29 +261,25 @@ find %{buildroot} -type f -exec sh -c "file {} | grep -q 'dynamically linked'" \
 %if %{undefined without_haddock}\
 %cabal haddock %{!?without_hscolour:%(if [ -x %{_bindir}/HsColour ]; then echo --hyperlink-source; fi)}\
 %endif\
-%{?1:cd -}\
+%{?1:cd ..}\
 %{nil}
 
 # install bin package
 %ghc_bin_install\
-%if %{undefined ghc_bootstrapping}\
 %global _use_internal_dependency_generator 0\
 %global __find_requires %{_rpmconfigdir}/ghc-deps.sh --requires %{buildroot}%{ghclibdir}\
-%endif\
 %cabal_install\
 %ghc_strip_dynlinked
 
 # ghc_lib_install [name] [version]
 %ghc_lib_install()\
-%if %{undefined ghc_bootstrapping}\
 %global _use_internal_dependency_generator 0\
 %global __find_provides %{_rpmconfigdir}/ghc-deps.sh --provides %{buildroot}%{ghclibdir}\
 %global __find_requires %{_rpmconfigdir}/ghc-deps.sh --requires %{buildroot}%{ghclibdir}\
-%endif\
 %{?1:cd %1-%2}\
 %cabal_install\
 %cabal_pkg_conf\
-%{?1:cd -}\
+%{?1:cd ..}\
 %ghc_gen_filelists\
 %{!?1:%ghc_strip_dynlinked}\
 %{nil}
diff --git a/ghc-rpm-macros.spec b/ghc-rpm-macros.spec
index b569e03..82d414f 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.90
+Version:        0.91
 Release:        1%{?dist}
 Summary:        Macros for building packages for GHC
 
@@ -60,6 +60,11 @@ EOF
 
 
 %changelog
+* Fri May 25 2012 Jens Petersen <petersen at redhat.com> - 0.91-1
+- only  build ghci .o library files on ghc_arches_with_ghci
+- support meta packages like haskell-platform without base lib files
+- make it possible not to have to use common_summary and common_description
+
 * Mon Mar 19 2012 Jens Petersen <petersen at redhat.com> - 0.90-1
 - use new rpm metadata hash format for ghc-7.4
 - drop prof meta hash data


More information about the scm-commits mailing list