File ghc-blank-canvas.spec of Package ghc-blank-canvas

#
# spec file for package ghc-blank-canvas
#
# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via http://bugs.opensuse.org/
#


%global pkg_name blank-canvas
%bcond_with tests
Name:           ghc-%{pkg_name}
Version:        0.6
Release:        0
Summary:        HTML5 Canvas Graphics Library
License:        BSD-3-Clause
Group:          Development/Libraries/Haskell
URL:            https://hackage.haskell.org/package/%{pkg_name}
Source0:        https://hackage.haskell.org/package/%{pkg_name}-%{version}/%{pkg_name}-%{version}.tar.gz
Source1:        https://hackage.haskell.org/package/%{pkg_name}-%{version}/revision/11.cabal#/%{pkg_name}.cabal
BuildRequires:  ghc-Cabal-devel
BuildRequires:  ghc-aeson-devel
BuildRequires:  ghc-base-compat-devel
BuildRequires:  ghc-base64-bytestring-devel
BuildRequires:  ghc-bytestring-devel
BuildRequires:  ghc-colour-devel
BuildRequires:  ghc-containers-devel
BuildRequires:  ghc-data-default-class-devel
BuildRequires:  ghc-http-types-devel
BuildRequires:  ghc-kansas-comet-devel
BuildRequires:  ghc-mime-types-devel
BuildRequires:  ghc-rpm-macros
BuildRequires:  ghc-scotty-devel
BuildRequires:  ghc-stm-devel
BuildRequires:  ghc-text-devel
BuildRequires:  ghc-text-show-devel
BuildRequires:  ghc-transformers-devel
BuildRequires:  ghc-vector-devel
BuildRequires:  ghc-wai-devel
BuildRequires:  ghc-wai-extra-devel
BuildRequires:  ghc-warp-devel
%if %{with tests}
BuildRequires:  ghc-directory-devel
BuildRequires:  ghc-process-devel
BuildRequires:  ghc-shake-devel
BuildRequires:  ghc-time-devel
BuildRequires:  ghc-unix-devel
%endif

%description
'blank-canvas' is a Haskell binding to the complete
<https://developer.mozilla.org/en-US/docs/Web/API/Canvas_API HTML5 Canvas API>.
'blank-canvas' allows Haskell users to write, in Haskell, interactive images
onto their web browsers. 'blank-canvas' gives the user a single full-window
canvas, and provides many well-documented functions for rendering images.

For more details, read <https://github.com/ku-fpg/blank-canvas/wiki>.

%package devel
Summary:        Haskell %{pkg_name} library development files
Group:          Development/Libraries/Haskell
Requires:       %{name} = %{version}-%{release}
Requires:       ghc-compiler = %{ghc_version}
Requires(post): ghc-compiler = %{ghc_version}
Requires(postun): ghc-compiler = %{ghc_version}

%description devel
This package provides the Haskell %{pkg_name} library development files.

%prep
%setup -q -n %{pkg_name}-%{version}
cp -p %{SOURCE1} %{pkg_name}.cabal

%build
# Required to fix build errors on i586: https://github.com/ku-fpg/blank-canvas/issues/76
%define cabal_configure_options --ghc-option=-fsimpl-tick-factor=200
%ghc_lib_build

%install
%ghc_lib_install

%check
%cabal_test

%post devel
%ghc_pkg_recache

%postun devel
%ghc_pkg_recache

%files -f %{name}.files
%doc LICENSE
%dir %{_datadir}/%{pkg_name}-%{version}
%dir %{_datadir}/%{pkg_name}-%{version}/static
%{_datadir}/%{pkg_name}-%{version}/static/index.html
%{_datadir}/%{pkg_name}-%{version}/static/jquery.js
%{_datadir}/%{pkg_name}-%{version}/static/jquery-json.js

%files devel -f %{name}-devel.files
%doc Changelog.md README.md

%changelog
openSUSE Build Service is sponsored by