- update to ghc-rpm-macros-0.5.1 and cabal2spec-0.21.1:

- drop doc and prof bcond
- use common summary and common_description
- define pkg_name and use ghc_binlib_package
epel9
Jens Petersen 15 years ago
parent 1e5bf1e245
commit 49240042a4

@ -1,13 +1,19 @@
%bcond_without doc
%bcond_without prof
%global pkg_name hscolour
%global common_summary Haskell %{pkg_name} library
%global common_description hscolour is a small Haskell package to colourize Haskell code.\
It currently has five output formats: ANSI terminal codes,\
HTML 3.2 with font tags, HTML 4.01 with CSS, LaTeX, and mIRC chat codes.
%bcond_without shared
# ghc does not emit debug information
# debuginfo is not useful for ghc
%global debug_package %{nil}
Name: hscolour
Name: %{pkg_name}
Version: 1.15
Release: 3%{?dist}
Release: 4%{?dist}
Summary: Colourizes Haskell code
Group: Development/Tools
@ -16,70 +22,22 @@ URL: http://www.cs.york.ac.uk/fp/darcs/hscolour/
Source0: http://hackage.haskell.org/packages/archive/%{name}/%{version}/%{name}-%{version}.tar.gz
# fedora ghc archs:
ExclusiveArch: %{ix86} x86_64 ppc alpha
BuildRequires: ghc, ghc-rpm-macros >= 0.3.1
%if %{with doc}
BuildRequires: ghc, ghc-rpm-macros >= 0.5.1
BuildRequires: ghc-doc
%endif
%if %{with prof}
BuildRequires: ghc-prof
%endif
%{?ghc_pkg_deps:BuildRequires: %{ghc_pkg_deps}, %(echo %{ghc_pkg_deps} | sed -e "s/\(ghc-[^, ]\+\)-devel/\1-doc,\1-prof/g")}
%description
hscolour is a small Haskell script to colourize Haskell code.
It currently has five output formats: ANSI terminal codes,
HTML 3.2 with font tags, HTML 4.01 with CSS, LaTeX, and mIRC chat codes.
%if %{with shared}
%package -n ghc-%{name}
Summary: Haskell library for %{name}
Group: System Environment/Libraries
%description -n ghc-%{name}
Haskell %{name} library for ghc.
%endif
%package -n ghc-%{name}-devel
Summary: Haskell %{name} library development files
Group: Development/Libraries
Requires: ghc = %{ghc_version}
Requires(post): ghc = %{ghc_version}
Requires(postun): ghc = %{ghc_version}
%if %{with shared}
Requires: ghc-%{name} = %{version}-%{release}
%endif
%description -n ghc-%{name}-devel
This package contains the development files for %{name}
built for ghc-%{ghc_version}.
%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
%{common_description}
%files
%defattr(-,root,root,-)
%doc README index.html LICENCE-GPL
%attr(755,root,root) %{_bindir}/HsColour
%{_datadir}/%{name}-%{version}
%if %{with prof}
%package -n ghc-%{name}-prof
Summary: Profiling libraries for %{name}
Group: Development/Libraries
License: LGPLv2+
Requires: ghc-%{name}-devel = %{version}-%{release}
Requires: ghc-prof = %{ghc_version}
%description -n ghc-%{name}-prof
This package contains profiling libraries for %{name}
built for ghc-%{ghc_version}.
%endif
%ghc_binlib_package
%prep
@ -88,80 +46,29 @@ built for ghc-%{ghc_version}.
%build
# dynamic + prof breaks cabal looking for p_dyn
%cabal_configure --ghc %{?with_prof:-p}
%cabal_configure --ghc -p
%cabal build
%if %{with doc}
%cabal haddock
%endif
%install
%cabal_install
%cabal_pkg_conf
%ghc_gen_filelists ghc-%{name}
%ghc_gen_filelists
%clean
rm -rf $RPM_BUILD_ROOT
%post -n ghc-%{name}-devel
ghc-pkg recache
%if %{with doc}
%post -n ghc-%{name}-doc
%ghc_reindex_haddock
%endif
%preun -n ghc-%{name}-devel
ghc-pkg recache
%if %{with doc}
%postun -n ghc-%{name}-doc
if [ "$1" -eq 0 ] ; then
%ghc_reindex_haddock
fi
%endif
%files
%defattr(-,root,root,-)
%doc README
%attr(755,root,root) %{_bindir}/HsColour
%{_datadir}/%{name}-%{version}
%if %{with shared}
%files -n ghc-%{name} -f ghc-%{name}.files
%defattr(-,root,root,-)
%doc LICENCE-GPL
%endif
%files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
%defattr(-,root,root,-)
%if %{without shared}
%doc LICENCE-LGPL
%endif
%if %{with doc}
%files -n ghc-%{name}-doc -f ghc-%{name}-doc.files
%defattr(-,root,root,-)
%endif
%if %{with prof}
%files -n ghc-%{name}-prof -f ghc-%{name}-prof.files
%defattr(-,root,root,-)
%endif
%changelog
* Mon Jan 11 2010 Jens Petersen <petersen@redhat.com> - 1.15-4
- update to ghc-rpm-macros-0.5.1 and cabal2spec-0.21.1:
- drop doc and prof bcond
- use common summary and common_description
- define pkg_name and use ghc_binlib_package
* Wed Dec 23 2009 Jens Petersen <petersen@redhat.com> - 1.15-3
- devel package requires shared library not base

Loading…
Cancel
Save