[ghc-rpm-macros/el6/master] backport 0.8.1 from f14

Jens Petersen petersen at fedoraproject.org
Wed Sep 29 02:23:23 UTC 2010


commit bb32cc7744efb79c502c5feed8daa07f7c864197
Author: Jens Petersen <petersen at redhat.com>
Date:   Wed Sep 29 12:23:24 2010 +1000

    backport 0.8.1 from f14

 ghc-rpm-macros.ghc  |  165 +++++++++++++++++++++++++--------------------------
 ghc-rpm-macros.spec |  108 ++++++++++++++++++++++++++--------
 2 files changed, 166 insertions(+), 107 deletions(-)
---
diff --git a/ghc-rpm-macros.ghc b/ghc-rpm-macros.ghc
index 0795dbe..2f99c79 100644
--- a/ghc-rpm-macros.ghc
+++ b/ghc-rpm-macros.ghc
@@ -3,61 +3,69 @@
 
 # configure
 %cabal_configure \
-%cabal configure --prefix=%{_prefix} --libdir=%{_libdir} --docdir=%{_docdir}/%{name}-%{version} --htmldir=%{ghcdocdir} --libsubdir='$compiler/$pkgid'
+%cabal configure --prefix=%{_prefix} --libdir=%{_libdir} --docdir=%{_docdir}/%{name}-%{version} --htmldir=%{ghcdocdir} --libsubdir='$compiler/$pkgid' %{?with_shared:--enable-shared} %{?with_dynamic:--ghc-option=-dynamic}
 
 # install
 %cabal_install %cabal copy --destdir=${RPM_BUILD_ROOT} -v
 
 # root dir for ghc docs
-%ghcdocbasedir %{_docdir}/ghc
+%ghcdocbasedir %{_docdir}/ghc/html
 # ghcdocdir [pkgname]
-%ghcdocdir %{ghcdocbasedir}/libraries/%{?pkg_name}%{!?pkg_name:%{name}}
+%ghcdocdir() %{ghcdocbasedir}/libraries/%{?1}%{!?1:%{pkg_name}}-%{version}
 # top library dir
 %ghcpkgbasedir %{_libdir}/ghc-%{ghc_version}
 # ghcpkgdir [pkgname]
-%ghcpkgdir %{ghcpkgbasedir}/%{?pkg_name}%{!?pkg_name:%name}-%{version}
+%ghcpkgdir() %{ghcpkgbasedir}/%{?1}%{!?1:%{pkg_name}}-%{version}
 
 # ghc_gen_filelists [pkgname]
 %ghc_gen_filelists() \
-basefile=%{?1}%{!?1:ghc-%{pkg_name}}\
-rm -f ${basefile}-devel.files ${basefile}-prof.files ${basefile}-doc.files \
-echo '%defattr(-,root,root,-)' > ${basefile}-devel.files \
+pkgname=%{?1}%{!?1:%{pkg_name}} \
+basefile=ghc-${pkgname} \
+pkgnamever=${pkgname}-%{version} \
+rm -f ${basefile}.files ${basefile}-devel.files ${basefile}-prof.files \
+echo "%defattr(-,root,root,-)" > ${basefile}.files \
 if [ -d "${RPM_BUILD_ROOT}%{_docdir}/%{name}-%{version}" ]; then \
-  %{!?1:echo "%{_docdir}/%{name}-%{version}" >> ${basefile}-devel.files} %{?1::} \
+  %{!?1:echo "%{_docdir}/%{name}-%{version}" >> ${basefile}%{!?with_shared:-devel}.files} %{?1::} \
 fi \
-find ${RPM_BUILD_ROOT}%{ghcpkgdir} -type d | sed 's/^/%dir /' >> ${basefile}-devel.files \
-find ${RPM_BUILD_ROOT}%{ghcpkgdir} ! \\( -type d -o -name '*_p.a' -o -name '*.p_hi' \\) >> ${basefile}-devel.files \
-echo '%defattr(-,root,root,-)' > ${basefile}-prof.files \
-find ${RPM_BUILD_ROOT}%{ghcpkgdir} \\( -name '*_p.a' -o -name '*.p_hi' \\) >> ${basefile}-prof.files \
-sed -i -e "s!${RPM_BUILD_ROOT}!!g" ${basefile}-devel.files ${basefile}-prof.files \
-echo '%defattr(-,root,root,-)' > ${basefile}-doc.files \
-echo '%{ghcdocdir}' >> ${basefile}-doc.files \
+%if %{with shared} \
+if [ -d "${RPM_BUILD_ROOT}%{ghcpkgdir}" ]; then \
+echo "%dir %{ghcpkgdir}" >> ${basefile}.files \
+echo "%attr(755,root,root) %{ghcpkgdir}/libHS${pkgnamever}-ghc%{ghc_version}.so" >> ${basefile}.files \
+fi \
+%endif \
+echo "%defattr(-,root,root,-)" > ${basefile}-devel.files \
+echo "%{_libdir}/ghc-%{ghc_version}/package.conf.d/${pkgnamever}*.conf" >> ${basefile}-devel.files \
+if [ -d "${RPM_BUILD_ROOT}%{ghcpkgdir}" ]; then \
+find ${RPM_BUILD_ROOT}%{ghcpkgdir} -type d | sed "s/^/%dir /" >> ${basefile}-devel.files \
+find ${RPM_BUILD_ROOT}%{ghcpkgdir} ! \\( -type d -o -name "*_p.a" -o -name "*.p_hi" -o -name "libHS*.so" \\) >> ${basefile}-devel.files \
+fi \
+echo "%defattr(-,root,root,-)" > ${basefile}-prof.files \
+if [ -d "${RPM_BUILD_ROOT}%{ghcpkgdir}" ]; then \
+find ${RPM_BUILD_ROOT}%{ghcpkgdir} \\( -name "*_p.a" -o -name "*.p_hi" \\) >> ${basefile}-prof.files \
+fi \
+if [ -d "${RPM_BUILD_ROOT}%{ghcdocdir}" ]; then \
+echo "%{ghcdocdir}" >> ${basefile}-devel.files \
+fi \
+sed -i -e "s!${RPM_BUILD_ROOT}!!g" ${basefile}.files ${basefile}-devel.files ${basefile}-prof.files \
 %{nil}
 
-%ghc_gen_scripts %cabal register --gen-script ; %cabal unregister --gen-script
-
-%ghc_install_scripts install -m 755 register.sh unregister.sh ${RPM_BUILD_ROOT}%{ghcpkgdir}
-
-%ghc_register_pkg %{ghcpkgdir}/register.sh >/dev/null || :
-
-%ghc_unregister_pkg %{ghcpkgdir}/unregister.sh >/dev/null || :
-
 # compiler version
 %ghc_version %{!?ghc_version_override:%(ghc --numeric-version)}%{?ghc_version_override}
 
-%ghc_pkg_ver() %(ghc-pkg list --global --simple-output %1|sed -e "s/.*%1-//")
-
-# create and install package scripts
+# create and install package.conf file
+# cabal_pkg_conf [pkgname]
 %cabal_pkg_conf \
-%ghc_gen_scripts\
-%ghc_install_scripts\
-%{nil}
+%cabal register --gen-pkg-config \
+mkdir -p $RPM_BUILD_ROOT%{_libdir}/ghc-%{ghc_version}/package.conf.d \
+install --mode=0644 %{?1}%{!?1:%{pkg_name}}-%{version}.conf $RPM_BUILD_ROOT%{_libdir}/ghc-%{ghc_version}/package.conf.d
 
 # devel pkg basic requires
 %ghc_requires Requires:       ghc = %{ghc_version}\
 Requires(post): ghc = %{ghc_version}\
-Requires(preun): ghc = %{ghc_version}\
-%{nil}
+Requires(postun): ghc = %{ghc_version}\
+%if %{with shared}\
+Requires:       ghc-%{-n:%{-n*}}%{!-n:%{pkg_name}} = %{-v:%{-v*}}%{!-v:%{version}}-%{release}\
+%endif
 
 # doc pkg basic requires
 %ghc_doc_requires Requires:       ghc-doc = %{ghc_version}\
@@ -66,40 +74,61 @@ Requires(postun): ghc-doc = %{ghc_version}
 
 # prof pkg basic requires
 %ghc_prof_requires Requires:       ghc-prof = %{ghc_version}\
-Requires:       ghc-%{?pkg_name}%{!?pkg_name:%name}-devel = %{version}-%{release}
+Requires:       ghc-%{-n:%{-n*}}%{!-n:%{pkg_name}}-devel = %{-v:%{-v*}}%{!-v:%{version}}-%{release}
 
-# ghc_lib_package [-c cdepslist] [-h pkgdepslist]
-%ghc_lib_package(c:h:)\
-%define ghc_pkg_name ghc-%{?pkg_name}%{!?pkg_name:%name}\
+# ghc_lib_package [-n pkgname] [-c cdepslist] [-h pkgdepslist] [-o obsolete-docver]
+%ghc_lib_package(n:c:h:o:)\
+%define ghc_pkg_name %{-n:ghc-%{-n*}}%{!-n:ghc-%{pkg_name}}\
+%if %{with shared}\
+%files -n %{ghc_pkg_name} -f %{ghc_pkg_name}.files\
+%defattr(-,root,root,-)\
+%endif\
 \
 %ghc_package_devel\
 \
-%ghc_package_doc\
-\
 %ghc_package_prof\
 %{nil}
 
-# ghc_binlib_package [-c cdepslist] [-h pkgdepslist] [-l licensetag]
-%ghc_binlib_package(c:h:l:)\
-%define local_pkg_name %{?pkg_name}%{!?pkg_name:%name}\
+# ghc_binlib_package [-n pkgname] [-c cdepslist] [-h pkgdepslist] [-l licensetag] [-v version] [-o obsolete-docver]
+%ghc_binlib_package(n:c:h:l:v:o:)\
+%define local_pkg_name %{-n:%{-n*}}%{!-n:%{pkg_name}}\
 %define ghc_pkg_name ghc-%{local_pkg_name}\
+%package -n %{ghc_pkg_name}\
+Summary:        %{?common_summary}%{!?common_summary:%{local_pkg_name} library}\
+Group:          System Environment/Libraries\
+%{-v:Version:        %{-v*}}\
+%{-l:License:        %{-l*}}\
+\
+%description -n %{ghc_pkg_name}\
+%{?common_description}%{!?common_description:Haskell %{local_pkg_name} library.}\
+\
+This package provides the shared library.\
 \
 %ghc_lib_package\
 %{nil}
 
-# ghc_package_devel [-c cdepslist] [-h pkgdepslist] [-l licensetag]
-%ghc_package_devel(c:h:l:)\
-%define local_pkg_name %{?pkg_name}%{!?pkg_name:%name}\
+%ghc_pkg_recache %{_bindir}/ghc-pkg recache --no-user-package-conf || :
+
+# for docs post and postun
+%ghc_reindex_haddock ( cd %{ghcdocbasedir}/libraries && [ -x "./gen_contents_index" ] && ./gen_contents_index ) || :
+
+# ghc_package_devel [-n pkgname] [-c cdepslist] [-h pkgdepslist] [-l licensetag] [-v version] [-o obsolete-docver]
+%ghc_package_devel(n:c:h:l:v:o:)\
+%define local_pkg_name %{-n:%{-n*}}%{!-n:%{pkg_name}}\
 %define ghc_pkg_name ghc-%{local_pkg_name}\
 %package -n %{ghc_pkg_name}-devel\
 Summary:        %{?common_summary}%{!?common_summary:%{local_pkg_name} library} development files\
 Group:          Development/Libraries\
+%{-v:Version:        %{-v*}}\
 %{-l:License:        %{-l*}}\
 %{?ghc_requires}\
+%{?ghc_doc_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*}}\
+%{-o:Obsoletes:      %{ghc_pkg_name}-doc < %{-o*}}\
+Provides:       %{ghc_pkg_name}-doc = %{version}-%{release}\
 \
 %description -n %{ghc_pkg_name}-devel\
 %{?common_description}%{!?common_description:Haskell %{local_pkg_name} library.}\
@@ -107,55 +136,25 @@ Group:          Development/Libraries\
 This package contains the development files.\
 \
 %post -n %{ghc_pkg_name}-devel\
-%ghc_register_pkg\
-\
-%preun -n %{ghc_pkg_name}-devel\
-%ghc_unregister_pkg\
-\
-%files -n %{ghc_pkg_name}-devel -f %{ghc_pkg_name}-devel.files\
-%defattr(-,root,root,-)\
-%{nil}
-
-# for docs post and postun
-# re-index haddock
-%ghc_reindex_haddock ( cd %{ghcdocbasedir}/libraries && [ -x "./gen_contents_index" ] && ./gen_contents_index ) || :
-
-# ghc_package_doc [-h pkgdepslist] [-l licensetag]
-%ghc_package_doc(h:l:)\
-%define local_pkg_name %{?pkg_name}%{!?pkg_name:%name}\
-%define ghc_pkg_name ghc-%{local_pkg_name}\
-%package -n %{ghc_pkg_name}-doc\
-Summary:        Documentation for %{?common_summary}%{!?common_summary:%{local_pkg_name} library}\
-Group:          Development/Libraries\
-%{-l:License:        %{-l*}}\
-%{?ghc_doc_requires}\
-%{!-h:%{?ghc_pkg_deps:Requires:       %(echo %{ghc_pkg_deps} | sed -e "s/\\(ghc-[^, ]*\\)-devel/\\1-doc/g")}}\
-%{-h:Requires:       %(echo %{-h*} | sed -e "s/\\(ghc-[^, ]*\\)-devel/\\1-doc/g")}\
-\
-%description -n %{ghc_pkg_name}-doc\
-%{?common_description}%{!?common_description:Haskell %{local_pkg_name} library.}\
-\
-This package contains development documentation files.\
-\
-%post -n %{ghc_pkg_name}-doc\
+%ghc_pkg_recache\
 %ghc_reindex_haddock\
 \
-%postun -n %{ghc_pkg_name}-doc\
-if [ "$1" -eq 0 ] ; then\
-  %ghc_reindex_haddock\
-fi\
+%postun -n %{ghc_pkg_name}-devel\
+%ghc_pkg_recache\
+%ghc_reindex_haddock\
 \
-%files -n %{ghc_pkg_name}-doc -f %{ghc_pkg_name}-doc.files\
+%files -n %{ghc_pkg_name}-devel -f %{ghc_pkg_name}-devel.files\
 %defattr(-,root,root,-)\
 %{nil}
 
-# ghc_package_prof [-c cdepslist] [-h pkgdepslist] [-l licensetag]
-%ghc_package_prof(h:l:)\
-%define local_pkg_name %{?pkg_name}%{!?pkg_name:%name}\
+# ghc_package_prof [-n pkgname] [-c cdepslist] [-h pkgdepslist] [-l licensetag] [-v version]
+%ghc_package_prof(n:h:l:v:)\
+%define local_pkg_name %{-n:%{-n*}}%{!-n:%{pkg_name}}\
 %define ghc_pkg_name ghc-%{local_pkg_name}\
 %package -n %{ghc_pkg_name}-prof\
 Summary:        Profiling libraries for %{?common_summary}%{!?common_summary:%{local_pkg_name}}\
 Group:          Development/Libraries\
+%{-v:Version:        %{-v*}}\
 %{-l:License:        %{-l*}}\
 %{?ghc_prof_requires}\
 %{!-h:%{?ghc_pkg_deps:Requires:       %(echo %{ghc_pkg_deps} | sed -e "s/\\(ghc-[^, ]*\\)-devel/\\1-prof/g")}}\
@@ -185,7 +184,7 @@ find $RPM_BUILD_ROOT -type f -exec sh -c "file {} | grep -q 'dynamically linked'
 %ghc_lib_build\
 %cabal_configure --ghc -p\
 %cabal build\
-%cabal haddock
+%cabal haddock %{?with_hscolour:--hyperlink-source}
 
 # ghc_bin_install
 %ghc_bin_install\
diff --git a/ghc-rpm-macros.spec b/ghc-rpm-macros.spec
index c44ec84..0827cca 100644
--- a/ghc-rpm-macros.spec
+++ b/ghc-rpm-macros.spec
@@ -1,5 +1,5 @@
 Name:		ghc-rpm-macros
-Version:	0.7.0.610.4
+Version:	0.8.1
 Release:	1%{?dist}
 Summary:	Macros for building packages for GHC
 
@@ -48,34 +48,94 @@ rm -rf $RPM_BUILD_ROOT
 
 
 %changelog
-* Sat Jul 31 2010 Jens Petersen <petersen at redhat.com> - 0.7.0.610.4-1
-- fix backport of ghc_gen_filelists pkg_name arg handling
+* Fri Jul 16 2010 Jens Petersen <petersen at redhat.com> - 0.8.1-1
+- fix ghc_strip_dynlinked when no dynlinked files
+- devel should provide doc also when not obsoleting
 
-* Sat Jul 31 2010 Jens Petersen <petersen at redhat.com> - 0.7.0.610.3-1
-- make ghc_gen_filelists pkg_name arg optional
+* Fri Jul 16 2010 Jens Petersen <petersen at redhat.com> - 0.8.0-1
+- merge -doc into -devel and provide -o obsoletes doc subpackage option
 
-* Sat Jul 31 2010 Jens Petersen <petersen at redhat.com> - 0.7.0.610.2-1
-- also backport cabal_pkg_conf for f13 compatibility
-- fix ghc_strip_dynlinked when no dynlinked files
+* Mon Jun 28 2010 Jens Petersen <petersen at redhat.com> - 0.7.1-1
+- support hscolour'ing of src from haddock
+- really remove redundant summary and description option flags
+
+* Sat Jun 26 2010 Jens Petersen <petersen at redhat.com> - 0.7.0-1
+- new ghc_bin_build, ghc_bin_install, ghc_lib_build, ghc_lib_install
+
+* Thu Jun 24 2010 Jens Petersen <petersen at redhat.com> - 0.6.2-1
+- a couple more fallback summary tweaks
+
+* Thu Jun 24 2010 Jens Petersen <petersen at redhat.com> - 0.6.1-1
+- drop the summary -s and description -d package options since rpm does not
+  seem to allow white\ space in macro option args anyway
+
+* Wed Jun 23 2010 Jens Petersen <petersen at redhat.com> - 0.6.0-1
+- make ghc_strip_dynlinked conditional on no debug_package
+
+* Wed Jun 23 2010 Jens Petersen <petersen at redhat.com> - 0.5.9-1
+- replace ghc_strip_shared with ghc_strip_dynlinked
+
+* Sun Jun 20 2010 Jens Petersen <petersen at redhat.com> - 0.5.8-1
+- add ghc_strip_shared to strip shared libraries
 
-* Sat Jul 31 2010 Jens Petersen <petersen at redhat.com> - 0.7.0.610.1-1
-- backport 0.7.1 to ghc-6.10:
-- add ghc_bin_build, ghc_bin_install, ghc_lib_build, ghc_lib_install,
-  ghc_strip_dynlinked, ghcdocbasedir, and drop unused cabal_makefile
+* Sun Jun 20 2010 Jens Petersen <petersen at redhat.com> - 0.5.7-1
+- add comments over macros
+- drop unused cabal_makefile
+
+* Mon Apr 12 2010 Jens Petersen <petersen at redhat.com> - 0.5.6-1
+- drop unused ghc_pkg_ver macro
+- add ghc_pkg_recache macro
+
+* Fri Jan 15 2010 Jens Petersen <petersen at redhat.com> - 0.5.5-1
+- drop optional 2nd version arg from ghcdocdir, ghcpkgdir, and
+  ghc_gen_filelists: multiversion subpackages are not supported
+- add ghcpkgbasedir
+- bring back some shared conditions which were dropped temporarily
+- test for ghcpkgdir and ghcdocdir in ghc_gen_filelists
+- allow optional pkgname arg for cabal_pkg_conf
+- can now package gtk2hs
+
+* Mon Jan 11 2010 Jens Petersen <petersen at redhat.com> - 0.5.4-1
+- use -v in ghc_requires and ghc_prof_requires for version
+
+* Mon Jan 11 2010 Jens Petersen <petersen at redhat.com> - 0.5.3-1
+- drop "Library for" from base lib summary
+
+* Mon Jan 11 2010 Jens Petersen <petersen at redhat.com> - 0.5.2-1
+- use -n in ghc_requires and ghc_prof_requires for when no pkg_name
+
+* Mon Jan 11 2010 Jens Petersen <petersen at redhat.com> - 0.5.1-1
+- add ghcdocbasedir
+- revert ghcdocdir to match upstream ghc
+- ghcdocdir and ghcpkgdir now take optional name version args
+- update ghc_gen_filelists to new optional name version args
+- handle docdir in ghc_gen_filelists
 - ghc_reindex_haddock uses ghcdocbasedir
+- summary and description options to ghc_binlib_package, ghc_package_devel,
+  ghc_package_doc, and ghc_package_prof
+
+* Sun Jan 10 2010 Jens Petersen <petersen at redhat.com> - 0.5.0-1
+- pkg_name must be set now for binlib packages too
+- new ghc_lib_package and ghc_binlib_package macros make packaging too easy
 - ghc_package_devel, ghc_package_doc, and ghc_package_prof helper macros
-- Notes:
-- no shared libraries in ghc-6.10.4 so shared and dynmic are not supported
-- no name-ver override to maintain compatibility with optional pkg_name
-  in current released f12 binlib packages
-- for same reason ghcdocdir, ghcpkgdir, ghc_gen_filelists do not take
-  optional name arg
-- ghc-6.10.4 haddock does not support hscolour
-
-* Thu Dec 24 2009 Jens Petersen <petersen at redhat.com> - 0.2.6-1
-- backport:
-  - add ghc_requires, ghc_doc_requires, ghc_prof_requires
-  - allow ghc_version_override to override ghc_version (for ghc)
+- ghc_gen_filelists now defaults to ghc-%%{pkg_name}
+- add dynamic bcond to cabal_configure instead of cabal_configure_dynamic
+
+* Thu Dec 24 2009 Jens Petersen <petersen at redhat.com> - 0.4.0-1
+- add cabal_configure_dynamic
+- add ghc_requires, ghc_doc_requires, ghc_prof_requires
+
+* Tue Dec 15 2009 Jens Petersen <petersen at redhat.com> - 0.3.1-1
+- use ghc_version_override to override ghc_version
+- fix pkg .conf filelist match
+
+* Sat Dec 12 2009 Jens Petersen <petersen at redhat.com> - 0.3.0-1
+- major updates for ghc-6.12, package.conf.d, and shared libraries
+- add shared support to cabal_configure, ghc_gen_filelists
+- version ghcdocdir
+- replace ghc_gen_scripts, ghc_install_scripts, ghc_register_pkg, ghc_unregister_pkg
+  with cabal_pkg_conf
+- allow (ghc to) override ghc_version
 
 * Mon Nov 16 2009 Jens Petersen <petersen at redhat.com> - 0.2.5-1
 - make ghc_pkg_ver only return pkg version


More information about the scm-commits mailing list