%define pkg_name    yaml
%define pkg_version 0.11.0.0
%define pkg_release 1%{?_dist_release}

Summary: Support for parsing and rendering YAML documents
Name:    %{pkg_name}
Version: %{pkg_version}
Release: %{pkg_release}

License: BSD3
Group:   Applications/Text
URL:     http://hackage.haskell.org

Source0: packages

Source11: transformers-compat-0.6.2.tar.gz
Source12: transformers-compat.cabal
Source13: unliftio-core-0.1.2.0.tar.gz
Source14: unliftio-core.cabal
Source15: vector-algorithms-0.8.0.1.tar.gz
Source16: vector-algorithms.cabal
Source17: exceptions-0.10.0.tar.gz
Source18: exceptions.cabal
Source19: mono-traversable-1.0.9.0.tar.gz
Source20: mono-traversable.cabal
Source21: resourcet-1.2.2.tar.gz
Source22: resourcet.cabal
Source23: conduit-1.3.1.tar.gz
Source24: conduit.cabal
Source25: libyaml-0.1.0.0.tar.gz
Source26: libyaml.cabal
Source27: yaml-0.11.0.0.tar.gz
Source28: yaml.cabal

BuildRoot: %{_tmppath}/%{name}-%{version}-root

BuildRequires: ghc haskell-platform
BuildRequires: libffi-devel gmp-devel zlib-devel
BuildRequires: libghc-dlist
BuildRequires: libghc-old-locale
BuildRequires: libghc-aeson
BuildRequires: libghc-semigroups


BuildRequires: docbook-utils docbook-utils-pdf docbook-style-xsl

Requires: ghc haskell-platform
Requires: haskell-platform-dep
Requires: libghc-dlist
Requires: libghc-old-locale
Requires: libghc-aeson
Requires: libghc-semigroups


Vendor: Project Vine
Distribution: Vine Linux
Packager: ara_t


%description
This package includes the full libyaml C library version 0.1.5
 by Kirill Simonov in the package so you don't need to worry
 about any non-Haskell dependencies.

The package is broken down into two primary modules.
"Data.Yaml" provides a high-level interface based around the JSON datatypes
 provided by the @aeson@ package.
"Text.Libyaml" provides a lower-level, streaming interface.
For most users, "Data.Yaml" is recommended.
#'


 %prep
%{__rm} -rf ${RPM_BUILD_ROOT}

%build
%ghc_pkg_init

for pkg in `sed '$d' %{SOURCE0}`; do
    %{__tar} xzf %{_sourcedir}/${pkg}.tar.gz
    pushd ${pkg}
        %ghc_fix_dependencies ${pkg}
        %cabal_configure2 %{name} ${pkg}
        %cabal_build
        %cabal_haddock
        %cabal_copy_resister %{name}_${pkg}
    popd
done

# build yaml
for pkg in `tail -n 1 %{SOURCE0}`; do
    %{__tar} xzf %{_sourcedir}/${pkg}.tar.gz
    pushd ${pkg}
        %ghc_fix_dependencies ${pkg}
        %cabal_configure2 %{name}/${pkg} \
                          -f -no-exe
        %cabal_build
        %cabal_haddock
        %cabal_copy_resister %{pkg_name}-%{version}
    popd
done


%install
# copy documents
pushd %{_builddir}/%{pkg_name}-%{version}
    %{__cp} ChangeLog.md README.md \
     ${RPM_BUILD_ROOT}%{_docdir}/%{name}/%{pkg_name}-%{version}
popd


%clean
%{__rm} -rf ${RPM_BUILD_ROOT}

%post
%ghc_pkg_recache

%postun
%ghc_pkg_recache


%files
%defattr(-, root, root)
%{_bindir}/
%{_libdir}/ghc-%{ghc_version}/
%{_libdir}/ghc-lib/
%{_docdir}/%{name}/


%changelog
* Mon Dec 17 2018 Toshiaki Ara <ara_t@384.jp> 0.11.0.0-1
- update to 0.11.0.0
- build using ghc-8.6.3

* Thu Aug 09 2018 Toshiaki Ara <ara_t@384.jp> 0.9.0-2
- rebuild with ghc-8.4.3-2

* Sat Jul 21 2018 Toshiaki Ara <ara_t@384.jp> 0.9.0-1
- update to 0.9.0
- build using ghc-8.4.3

* Fri May 18 2018 Toshiaki Ara <ara_t@384.jp> 0.8.30-1
- update to 0.8.30
- rebuild using ghc-8.4.2
- rewrite using macro

* Tue Jan 09 2018 Toshiaki Ara <ara_t@384.jp> 0.8.25.1-1
- update to 0.8.25.1
- build using ghc-8.2.2

* Tue Feb 21 2017 Toshiaki Ara <ara_t@384.jp> 0.8.21.2-2
- build using ghc-8.0.2

* Fri Feb 03 2017 Toshiaki Ara <ara_t@384.jp> 0.8.21.2-1
- update to 0.8.21.2
- build using ghc-8.0.1

* Wed May 04 2016 Toshiaki Ara <ara_t@384.jp> 0.8.16-3
- rebuilt

* Tue Apr 12 2016 Toshiaki Ara <ara_t@384.jp> 0.8.16-2
- correct SPEC file

* Tue Mar 01 2016 Toshiaki Ara <ara_t@384.jp> 0.8.16-1
- new package
