File pandoc.spec of Package pandoc

#
# spec file for package pandoc
#
# Copyright (c) 2014 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 pandoc

Name:           pandoc
Version:        1.12.3.3
Release:        0
Summary:        Conversion between markup formats
License:        GPL-2.0
Group:          Productivity/Publishing/Other

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

BuildRequires:  ghc-Cabal-devel
BuildRequires:  ghc-rpm-macros
# Begin cabal-rpm deps:
BuildRequires:  alex
BuildRequires:  chrpath
BuildRequires:  ghc-HTTP-devel
BuildRequires:  ghc-aeson-devel
BuildRequires:  ghc-array-devel
BuildRequires:  ghc-attoparsec-devel
BuildRequires:  ghc-base64-bytestring-devel
BuildRequires:  ghc-blaze-html-devel
BuildRequires:  ghc-blaze-markup-devel
BuildRequires:  ghc-bytestring-devel
BuildRequires:  ghc-containers-devel
BuildRequires:  ghc-data-default-devel
BuildRequires:  ghc-directory-devel
BuildRequires:  ghc-extensible-exceptions-devel
BuildRequires:  ghc-filepath-devel
BuildRequires:  ghc-highlighting-kate-devel
BuildRequires:  ghc-hslua-devel
#BuildRequires:  ghc-http-conduit-devel
#BuildRequires:  ghc-http-types-devel
BuildRequires:  ghc-mtl-devel
BuildRequires:  ghc-network-devel
BuildRequires:  ghc-old-locale-devel
BuildRequires:  ghc-old-time-devel
BuildRequires:  ghc-pandoc-types-devel
BuildRequires:  ghc-parsec-devel
BuildRequires:  ghc-process-devel
BuildRequires:  ghc-random-devel
BuildRequires:  ghc-syb-devel
BuildRequires:  ghc-tagsoup-devel
BuildRequires:  ghc-temporary-devel
BuildRequires:  ghc-texmath-devel
BuildRequires:  ghc-text-devel
BuildRequires:  ghc-time-devel
BuildRequires:  ghc-unordered-containers-devel
BuildRequires:  ghc-vector-devel
BuildRequires:  ghc-xml-devel
BuildRequires:  ghc-yaml-devel
BuildRequires:  ghc-zip-archive-devel
BuildRequires:  ghc-zlib-devel
BuildRequires:  happy
# End cabal-rpm deps
BuildRequires:  fdupes

%description
Pandoc is a Haskell library for converting from one markup format to another,
and a command-line tool that uses this library. It can read markdown and
(subsets of) HTML, reStructuredText, LaTeX, DocBook, MediaWiki markup, Haddock
markup, OPML, and Textile, and it can write markdown, reStructuredText, HTML,
LaTeX, ConTeXt, Docbook, OPML, OpenDocument, ODT, Word docx, RTF, MediaWiki,
Textile, groff man pages, plain text, Emacs Org-Mode, AsciiDoc, EPUB (v2 and
v3), FictionBook2, and several kinds of HTML/javascript slide shows (S5, Slidy,
Slideous, DZSlides, reveal.js).

Pandoc extends standard markdown syntax with footnotes, embedded LaTeX,
definition lists, tables, and other features. A compatibility mode is provided
for those who need a drop-in replacement for Markdown.pl.

In contrast to existing tools for converting markdown to HTML, which use regex
substitutions, pandoc has a modular design: it consists of a set of readers,
which parse text in a given format and produce a native representation of the
document, and a set of writers, which convert this native representation into a
target format. Thus, adding an input or output format requires only adding a
reader or writer.


%package -n ghc-%{name}
Summary:        Haskell %{name} library
Group:          System/Libraries

%description -n ghc-%{name}
This package provides the Haskell %{name} shared library.


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

%description -n ghc-%{name}-devel
This package provides the Haskell %{name} library development files.


%prep
%setup -q

%build
%define cabal_configure_options -f -http-conduit 
%ghc_lib_build

%install
%ghc_lib_install
%ghc_fix_dynamic_rpath %{name}

# These files will be installed in the standard _docdir
rm %{buildroot}%{_datadir}/%{pkg_name}-%{version}/BUGS
rm %{buildroot}%{_datadir}/%{pkg_name}-%{version}/CONTRIBUTING.md
rm %{buildroot}%{_datadir}/%{pkg_name}-%{version}/COPYRIGHT
rm %{buildroot}%{_datadir}/%{pkg_name}-%{version}/INSTALL
rm %{buildroot}%{_datadir}/%{pkg_name}-%{version}/README
rm %{buildroot}%{_datadir}/%{pkg_name}-%{version}/changelog

# Link duplicate template files
%fdupes %{buildroot}%{_datadir}/%{pkg_name}-%{version}/data/templates/

%post -n ghc-%{name}-devel
%ghc_pkg_recache

%postun -n ghc-%{name}-devel
%ghc_pkg_recache

%files
%defattr(-,root,root)
%doc COPYING BUGS CONTRIBUTING.md COPYRIGHT README changelog
%{_bindir}/%{name}
%{_datadir}/%{name}-%{version}
%{_mandir}/man1/pandoc.1*
%{_mandir}/man5/pandoc_markdown.5*

%files -n ghc-%{name} -f ghc-%{name}.files
%defattr(-,root,root)
%doc COPYING

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

%changelog
openSUSE Build Service is sponsored by