File ghc-cryptohash.spec of Package ghc-cryptohash

#
# spec file for package ghc-cryptohash
#
# Copyright (c) 2013 SUSE LINUX Products 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 cryptohash

Name:           ghc-cryptohash
Version:        0.11.9
Release:        0
Summary:        Collection of crypto hashes, fast, pure and practical
License:        BSD-3-Clause
Group:          System/Libraries

Url:            http://hackage.haskell.org/package/%{pkg_name}
Source0:        http://hackage.haskell.org/packages/archive/%{pkg_name}/%{version}/%{pkg_name}-%{version}.tar.gz
BuildRoot:      %{_tmppath}/%{name}-%{version}-build

BuildRequires:  ghc-Cabal-devel
BuildRequires:  ghc-rpm-macros
# Begin cabal-rpm deps:
BuildRequires:  ghc-byteable-devel
BuildRequires:  ghc-bytestring-devel
BuildRequires:  ghc-cryptonite-devel
BuildRequires:  ghc-memory-devel
# End cabal-rpm deps

%description
A collection of crypto hashes, with a practical incremental and one-pass, pure
APIs, with performance close to the fastest implementations available in other
languages.

The implementations are made in C with a haskell FFI wrapper that hide the C
implementation.

Simple examples using the unified API:

> import Crypto.Hash > > sha1 :: ByteString -> Digest SHA1 > sha1 = hash > >
hexSha3_512 :: ByteString -> String > hexSha3_512 bs = show (hash bs :: Digest
SHA3_512)

Simple examples using the module API:

> import qualified Crypto.Hash.SHA1 as SHA1 > > main = putStrLn $ show $
SHA1.hash (Data.ByteString.pack [0..255])

> import qualified Crypto.Hash.SHA3 as SHA3 > > main = putStrLn $ show $ digest
> where digest = SHA3.finalize ctx > ctx = foldl' SHA3.update iCtx (map
Data.ByteString.pack [ [1,2,3], [4,5,6] ] > iCtx = SHA3.init 224.


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

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


%prep
%setup -q -n %{pkg_name}-%{version}

%build
%ghc_lib_build

%install
%ghc_lib_install

%post devel
%ghc_pkg_recache

%postun devel
%ghc_pkg_recache

%files -f %{name}.files
%defattr(-,root,root,-)
%doc LICENSE

%files devel -f %{name}-devel.files
%defattr(-,root,root,-)
%doc README.md

%changelog
openSUSE Build Service is sponsored by