rpms/haddock/devel haddock.spec,1.18,1.19

Jens Petersen petersen at fedoraproject.org
Mon Mar 9 06:02:02 UTC 2009


Author: petersen

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

Modified Files:
	haddock.spec 
Log Message:
- update to cabal2spec-0.12:
  - use global and bcond
  - arch list
  - ghc-paths is renamed to ghc-ghc-paths
- devel subpackage obsoletes old library subpackage
- move docs to doc subpackage




Index: haddock.spec
===================================================================
RCS file: /cvs/extras/rpms/haddock/devel/haddock.spec,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -r1.18 -r1.19
--- haddock.spec	25 Feb 2009 03:14:36 -0000	1.18
+++ haddock.spec	9 Mar 2009 06:01:32 -0000	1.19
@@ -1,29 +1,36 @@
-%define ghc_version 6.10.1
+%global ghc_version 6.10.1
+
+%global pkg_libdir %{_libdir}/ghc-%{ghc_version}/%{name}-%{version}
+%global pkg_docdir %{_docdir}/ghc/libraries/%{name}-%{version}
+
+%bcond_without doc
+%bcond_without prof
 
-%define pkg_libdir %{_libdir}/ghc-%{ghc_version}/%{name}-%{version}
-%define pkg_docdir %{_docdir}/ghc/libraries/%{name}-%{version}
 # ghc does not emit debug information
-%define debug_package %{nil}
+%global debug_package %{nil}
 
 Name:           haddock
 Version:        2.4.1
-Release:        3%{?dist}
-Summary:        Haskell Documentation tool
+Release:        4%{?dist}
+Summary:        Haskell documentation tool
 
 Group:          Development/Tools
 License:        BSD
 URL:            http://www.haskell.org/haddock/
 Source0:        http://hackage.haskell.org/packages/archive/%{name}/%{version}/%{name}-%{version}.tar.gz
 BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
-# ghc has only been bootstrapped on the following archs:
-ExclusiveArch:	i386 x86_64 ppc
+# fedora ghc archs:
+ExclusiveArch:  %{ix86} x86_64 ppc alpha
 BuildRequires:  ghc = %{ghc_version}
-Buildrequires:  ghc-paths-devel
-# for profiling
-BuildRequires:  ghc-prof = %{ghc_version}
-BuildRequires:  ghc-paths-prof
-# for doc/
+Buildrequires:  ghc-ghc-paths-devel
+%if %{with doc}
 BuildRequires:  libxslt, docbook-style-xsl, autoconf
+BuildRequires:  ghc-doc = %{ghc_version}
+%endif
+%if %{with prof}
+BuildRequires:  ghc-prof = %{ghc_version}
+BuildRequires:  ghc-ghc-paths-prof
+%endif
 
 %description
 Haddock is a tool for automatically generating hyperlinked documentation from
@@ -34,25 +41,41 @@
 functions and types in the source code in a lightweight syntax.
 
 
-%package -n ghc-%{name}
-Summary:  Libraries for working with Haddock from Haskell code
-Group:    Development/Libraries
-Provides:  ghc-%{name}-devel = %{version}-%{release}
-Requires:  ghc = %{ghc_version}
-Obsoletes: ghc682-haddock < 2.0.0.0-3
+%package -n ghc-%{name}-devel
+Summary:        Haskell source documentation library
+Group:          Development/Libraries
+Requires:       ghc = %{ghc_version}
+Obsoletes:      ghc-haddock < 2.4.1-4
+Obsoletes:      ghc682-haddock < 2.0.0.0-3
+Requires(post): ghc = %{ghc_version}
+Requires(preun): ghc = %{ghc_version}
 
-%description -n ghc-%{name}
+%description -n ghc-%{name}-devel
 Libraries for working with Haddock from Haskell code.
 
+%if %{with doc}
+%package -n ghc-%{name}-doc
+Summary: Documentation for %{name}
+Group: Development/Libraries
+Requires: ghc-doc = %{ghc_version}
+Requires(post): ghc-doc = %{ghc_version}
+Requires(postun): ghc-doc = %{ghc_version}
+
+%description -n ghc-%{name}-doc
+This package contains development documentation files for the %{name} library.
+%endif
 
+
+%if %{with prof}
 %package -n ghc-%{name}-prof
-Summary: Profiling libraries for %{name}
-Group: Development/Libraries
-Requires: ghc-%{name} = %{version}-%{release}
-Requires: ghc-prof = %{ghc_version}
+Summary:        Profiling libraries for %{name}
+Group:          Development/Libraries
+Requires:       ghc-%{name}-devel = %{version}-%{release}
+Requires:       ghc-prof = %{ghc_version}
 
 %description -n ghc-%{name}-prof
 This package contains profiling libraries for %{name}.
+%endif
 
 
 %prep
@@ -60,19 +83,21 @@
 
 
 %build
-%cabal_configure --ghc -p
+%cabal_configure --ghc %{!?without_prof:-p}
 %cabal build
+%if %{with doc}
 %cabal haddock
-%ghc_gen_scripts
-
 cd doc
 test -f configure || autoreconf
 ./configure
 make html
+cd -
+%endif
+%ghc_gen_scripts
 
 
 %install
-rm -rf ${RPM_BUILD_ROOT}
+rm -rf $RPM_BUILD_ROOT
 %cabal_install
 %ghc_install_scripts
 %ghc_gen_filelists ghc-%{name}
@@ -82,45 +107,70 @@
 
 
 %clean
-rm -rf ${RPM_BUILD_ROOT}
-
+rm -rf $RPM_BUILD_ROOT
 
 %post
 semanage fcontext -a -t unconfined_execmem_exec_t %{_bindir}/%{name} >/dev/null 2>&1
 restorecon %{_bindir}/%{name}
 
-%post -n ghc-%{name}
+%post -n ghc-%{name}-devel
 %ghc_register_pkg
+
+
+%if %{with doc}
+%post -n ghc-%{name}-doc
 %ghc_reindex_haddock
+%endif
+
 
-%preun -n ghc-%{name}
+%preun -n ghc-%{name}-devel
 if [ "$1" -eq 0 ] ; then
   %ghc_unregister_pkg
 fi
 
-%postun -n ghc-%{name}
+
+%if %{with doc}
+%postun -n ghc-%{name}-doc
 if [ "$1" -eq 0 ] ; then
   %ghc_reindex_haddock
 fi
+%endif
+
 
 %files
 %defattr(-,root,root,-)
 %doc CHANGES LICENSE README
-%doc doc/haddock/*
 %{_bindir}/haddock-%{version}
 %{_datadir}/haddock-%{version}
 
 
-%files -n ghc-%{name} -f ghc-%{name}.files
+%files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
+%defattr(-,root,root,-)
+
+
+%if %{with doc}
+%files -n ghc-%{name}-doc
 %defattr(-,root,root,-)
 %{pkg_docdir}
+%doc doc/haddock/*
+%endif
 
 
+%if %{with prof}
 %files -n ghc-%{name}-prof -f ghc-%{name}-prof.files
 %defattr(-,root,root,-)
+%endif
 
 
 %changelog
+* Mon Mar  9 2009 Jens Petersen <petersen at redhat.com> - 2.4.1-4
+- update to cabal2spec-0.12:
+  - use global and bcond
+  - arch list
+  - ghc-paths is renamed to ghc-ghc-paths
+- devel subpackage obsoletes old library subpackage
+- move docs to doc subpackage
+
 * Tue Feb 24 2009 Fedora Release Engineering <rel-eng at lists.fedoraproject.org> - 2.4.1-3
 - Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild
 




More information about the fedora-extras-commits mailing list