# generated by cabal-rpm-2.1.0
# https://docs.fedoraproject.org/en-US/packaging-guidelines/Haskell/
%global pkg_name hscolour
%global pkgver %{pkg_name}-%{version}
# This default now for Fedora but keeping it for backcompat
# (link statically to Haskell libs for easier ghc version bootstrapping)
%global ghc_without_dynamic 1
# use following to bootstrap for a new arch:
#%%{?ghc_bootstrap}
#%%global ghc_bootstrapping 1
#%%global without_hscolour 1
Name: %{pkg_name}
Version: 1.24.4
Release: %autorelease
Summary: Colorize Haskell code
# the source does not state intended GPL version
License: LGPL-2.1-or-later
Url: https://hackage.haskell.org/package/%{name}
# Begin cabal-rpm sources:
Source0: https://hackage.haskell.org/package/%{pkgver}/%{pkgver}.tar.gz
# End cabal-rpm sources
# Begin cabal-rpm deps:
BuildRequires: ghc-Cabal-devel
BuildRequires: ghc-rpm-macros
BuildRequires: ghc-base-devel
BuildRequires: ghc-containers-devel
%if %{with ghc_prof}
BuildRequires: ghc-base-prof
BuildRequires: ghc-containers-prof
%endif
Requires: %{name}-common = %{version}-%{release}
# End cabal-rpm deps
%description
Hscolour is a Haskell tool to colorize Haskell code. It currently has
six output formats: ANSI terminal codes (optionally XTerm-256colour codes),
HTML 3.2 with <font> tags, HTML 4.01 with CSS, HTML 4.01 with CSS and mouseover
annotations, XHTML 1.0 with inline CSS styling, LaTeX, and mIRC chat codes.
%package common
Summary: %{name} common files
BuildArch: noarch
%description common
This package provides the %{name} common data files.
%package -n ghc-%{name}
Summary: Haskell %{name} library
Requires: %{name}-common = %{version}-%{release}
%description -n ghc-%{name}
This package provides the Haskell %{name} shared library.
%package -n ghc-%{name}-devel
Summary: Haskell %{name} library development files
Provides: ghc-%{name}-static = %{version}-%{release}
Provides: ghc-%{name}-static%{?_isa} = %{version}-%{release}
%if %{defined ghc_version}
Requires: ghc-compiler = %{ghc_version}
%endif
Requires: ghc-%{name}%{?_isa} = %{version}-%{release}
%description -n ghc-%{name}-devel
This package provides the Haskell %{name} library development files.
%if %{with haddock}
%package -n ghc-%{name}-doc
Summary: Haskell %{name} library documentation
BuildArch: noarch
Requires: ghc-filesystem
%description -n ghc-%{name}-doc
This package provides the Haskell %{name} library documentation.
%endif
%if %{with ghc_prof}
%package -n ghc-%{name}-prof
Summary: Haskell %{name} profiling library
Requires: ghc-%{name}-devel%{?_isa} = %{version}-%{release}
Supplements: (ghc-%{name}-devel and ghc-prof)
%description -n ghc-%{name}-prof
This package provides the Haskell %{name} profiling library.
%endif
%prep
# Begin cabal-rpm setup:
%setup -q
# End cabal-rpm setup
%build
# Begin cabal-rpm build:
%ghc_lib_build
# End cabal-rpm build
%install
# Begin cabal-rpm install
%ghc_lib_install
mv %{buildroot}%{_ghcdocdir}{,-common}
# End cabal-rpm install
%files
# Begin cabal-rpm files:
%{_bindir}/HsColour
# End cabal-rpm files
%files common
# Begin cabal-rpm files:
%license LICENCE-LGPL
%{_datadir}/%{pkgver}
# End cabal-rpm files
%files -n ghc-%{name} -f ghc-%{name}.files
%files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
%if %{with haddock}
%files -n ghc-%{name}-doc -f ghc-%{name}-doc.files
%license LICENCE-LGPL
%endif
%if %{with ghc_prof}
%files -n ghc-%{name}-prof -f ghc-%{name}-prof.files
%endif
%changelog
%autochangelog