rpms/ghc/devel cabal-bin-template.spec.in, 1.1, 1.2 cabal-binlib-template.spec.in, 1.1, 1.2 cabal-lib-template.spec.in, 1.1, 1.2 ghc-rpm-macros.ghc, 1.9, 1.10 ghc.spec, 1.63, 1.64

Jens Petersen petersen at fedoraproject.org
Mon Dec 1 05:47:07 UTC 2008


Author: petersen

Update of /cvs/extras/rpms/ghc/devel
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv10825

Modified Files:
	cabal-bin-template.spec.in cabal-binlib-template.spec.in 
	cabal-lib-template.spec.in ghc-rpm-macros.ghc ghc.spec 
Log Message:
- update macros.ghc to latest proposed revised packaging guidelines:
  - use runghc
  - drop trivial cabal_build and cabal_haddock macros
  - ghc_register_pkg and ghc_unregister_pkg replace ghc_preinst_script,
    ghc_postinst_script, ghc_preun_script, and ghc_postun_script
- lib templates' prof subpackage requires main library again
- make cabal2spec work on .cabal files too, and
  read and check name and version directly from .cabal file
- ghc-prof does not need to own libraries/ dirs owned by main package




Index: cabal-bin-template.spec.in
===================================================================
RCS file: /cvs/extras/rpms/ghc/devel/cabal-bin-template.spec.in,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- cabal-bin-template.spec.in	25 Nov 2008 09:15:16 -0000	1.1
+++ cabal-bin-template.spec.in	1 Dec 2008 05:46:36 -0000	1.2
@@ -25,7 +25,7 @@
 
 %build
 %cabal_configure
-%cabal_build
+%cabal build
 
 
 %install


Index: cabal-binlib-template.spec.in
===================================================================
RCS file: /cvs/extras/rpms/ghc/devel/cabal-binlib-template.spec.in,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- cabal-binlib-template.spec.in	25 Nov 2008 09:15:16 -0000	1.1
+++ cabal-binlib-template.spec.in	1 Dec 2008 05:46:36 -0000	1.2
@@ -48,6 +48,7 @@
 %package prof
 Summary: Profiling libraries for ghc-%{name}
 Group: Development/Libraries
+Requires: ghc-%{name} = %{version}-%{release}
 Requires: ghc-prof = %{ghc_version}
 
 %description prof
@@ -66,9 +67,9 @@
 %else
 %{nil}
 %endif
-%cabal_build
+%cabal build
 %if %{build_doc}
-%cabal_haddock
+%cabal haddock
 %endif
 %ghc_gen_scripts
 
@@ -85,14 +86,16 @@
 
 
 %post 
-%ghc_postinst_script
+%ghc_register_pkg
 %if %{build_doc}
 %ghc_reindex_haddock
 %endif
 
 
 %preun 
-%ghc_preun_script
+if [ "$1" -eq 0 ] ; then
+  %ghc_unregister_pkg
+fi
 
 
 %postun


Index: cabal-lib-template.spec.in
===================================================================
RCS file: /cvs/extras/rpms/ghc/devel/cabal-lib-template.spec.in,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- cabal-lib-template.spec.in	25 Nov 2008 09:15:16 -0000	1.1
+++ cabal-lib-template.spec.in	1 Dec 2008 05:46:36 -0000	1.2
@@ -40,6 +40,7 @@
 %package prof
 Summary: Profiling libraries for %{name}
 Group: Development/Libraries
+Requires: %{name} = %{version}-%{release}
 Requires: ghc-prof = %{ghc_version}
 
 %description prof
@@ -58,9 +59,9 @@
 %else
 %{nil}
 %endif
-%cabal_build
+%cabal build
 %if %{build_doc}
-%cabal_haddock
+%cabal haddock
 %endif
 %ghc_gen_scripts
 
@@ -77,14 +78,16 @@
 
 
 %post 
-%ghc_postinst_script
+%ghc_register_pkg
 %if %{build_doc}
 %ghc_reindex_haddock
 %endif
 
 
 %preun 
-%ghc_preun_script
+if [ "$1" -eq 0 ] ; then
+  %ghc_unregister_pkg
+fi
 
 
 %postun


Index: ghc-rpm-macros.ghc
===================================================================
RCS file: /cvs/extras/rpms/ghc/devel/ghc-rpm-macros.ghc,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -r1.9 -r1.10
--- ghc-rpm-macros.ghc	25 Nov 2008 02:52:10 -0000	1.9
+++ ghc-rpm-macros.ghc	1 Dec 2008 05:46:36 -0000	1.10
@@ -1,58 +1,31 @@
-%cabal %{_bindir}/runhaskell Setup
+%cabal %{_bindir}/runghc Setup
 
 %cabal_configure \
 %cabal configure --prefix=%{_prefix} --libdir=%{_libdir} --docdir=%{_docdir}/%{name}-%{version} --htmldir=%{pkg_docdir} --libsubdir='$compiler/$pkgid'
 
-%cabal_build \
-%cabal build \
-%{nil}
-
 %cabal_makefile \
 %cabal makefile -f cabal-rpm.mk \
 make -f cabal-rpm.mk %{_smp_mflags} \
 %{nil}
 
-%cabal_haddock \
-%cabal haddock \
-%{nil}
-
-%cabal_install \
-%cabal copy --destdir=${RPM_BUILD_ROOT} -v \
-%{nil}
+%cabal_install %cabal copy --destdir=${RPM_BUILD_ROOT} -v
 
 %ghc_gen_filelists() \
 rm -f %1.files %1-prof.files \
-echo '%defattr(-,root,root,-)' > %1-prof.files \
-find ${RPM_BUILD_ROOT}%{pkg_libdir} \\( -name '*_p.a' -o -name '*.p_hi' \\) >> %1-prof.files \
 echo '%defattr(-,root,root,-)' > %1.files \
 find ${RPM_BUILD_ROOT}%{pkg_libdir} -type d | sed 's/^/%dir /' >> %1.files \
 find ${RPM_BUILD_ROOT}%{pkg_libdir} ! \\( -type d -o -name '*_p.a' -o -name '*.p_hi' \\) >> %1.files \
+echo '%defattr(-,root,root,-)' > %1-prof.files \
+find ${RPM_BUILD_ROOT}%{pkg_libdir} \\( -name '*_p.a' -o -name '*.p_hi' \\) >> %1-prof.files \
 sed -i -e "s!${RPM_BUILD_ROOT}!!g" %1.files %1-prof.files \
 %{nil}
 
-%ghc_gen_scripts \
-%cabal register --gen-script \
-%cabal unregister --gen-script \
-%{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}%{pkg_libdir} \
-%{nil}
+%ghc_install_scripts install -m 755 register.sh unregister.sh ${RPM_BUILD_ROOT}%{pkg_libdir}
 
-%ghc_preinst_script \
-%{nil}
+%ghc_register_pkg %{pkg_libdir}/register.sh >/dev/null
 
-%ghc_postinst_script \
-%{pkg_libdir}/register.sh >&/dev/null \
-%{nil}
+%ghc_unregister_pkg %{pkg_libdir}/unregister.sh >/dev/null
 
-%ghc_preun_script \
-[ "$1" = 0 ] && %{pkg_libdir}/unregister.sh >&/dev/null \
-%{nil}
-
-%ghc_postun_script \
-%{nil}
-
-%ghc_reindex_haddock \
-( cd %{_docdir}/ghc/libraries && [ -x "./gen_contents_index" ] && ./gen_contents_index ) || : \
-%{nil}
+%ghc_reindex_haddock ( cd %{_docdir}/ghc/libraries && [ -x "./gen_contents_index" ] && ./gen_contents_index ) || :


Index: ghc.spec
===================================================================
RCS file: /cvs/extras/rpms/ghc/devel/ghc.spec,v
retrieving revision 1.63
retrieving revision 1.64
diff -u -r1.63 -r1.64
--- ghc.spec	28 Nov 2008 02:47:49 -0000	1.63
+++ ghc.spec	1 Dec 2008 05:46:36 -0000	1.64
@@ -16,7 +16,7 @@
 
 Name:		ghc
 Version:	6.10.1
-Release:	5%{?dist}
+Release:	6%{?dist}
 Summary:	Glasgow Haskell Compilation system
 # See https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=239713
 ExcludeArch:	alpha ppc64
@@ -150,7 +150,7 @@
 
 cat rpm-dir.files rpm-lib.files > rpm-base-filelist
 %if %{build_prof}
-cat rpm-dir.files rpm-prof.files > rpm-prof-filelist
+cat rpm-prof.files > rpm-prof-filelist
 %endif
 
 # these are handled as alternatives
@@ -229,9 +229,16 @@
 %endif
 
 %changelog
-* Fri Nov 28 2008 Jens Petersen <petersen at redhat.com>
+* Mon Dec  1 2008 Jens Petersen <petersen at redhat.com> - 6.10.1-6
+- update macros.ghc to latest proposed revised packaging guidelines:
+  - use runghc
+  - drop trivial cabal_build and cabal_haddock
+  - ghc_register_pkg and ghc_unregister_pkg replace ghc_preinst_script,
+    ghc_postinst_script, ghc_preun_script, and ghc_postun_script
+- library templates prof subpackage requires main library again
 - make cabal2spec work on .cabal files too, and
-  read and check name and version from .cabal
+  read and check name and version directly from .cabal file
+- ghc-prof does not need to own libraries dirs owned by main package
 
 * Tue Nov 25 2008 Jens Petersen <petersen at redhat.com> - 6.10.1-5
 - add cabal2spec and template files for easy cabal hackage packaging




More information about the fedora-extras-commits mailing list