File hledger.spec of Package hledger

#
# spec file for package hledger
#
# 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 hledger
%bcond_with tests
Name:           %{pkg_name}
Version:        1.2
Release:        0
Summary:        Command-line interface for the hledger accounting tool
License:        GPL-3.0+
Group:          Development/Languages/Other
Url:            https://hackage.haskell.org/package/%{name}
Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
Source1:        https://hackage.haskell.org/package/%{name}-%{version}/revision/1.cabal#/%{name}.cabal
BuildRequires:  chrpath
BuildRequires:  ghc-Cabal-devel
BuildRequires:  ghc-HUnit-devel
BuildRequires:  ghc-base-compat-devel
BuildRequires:  ghc-bytestring-devel
BuildRequires:  ghc-cmdargs-devel
BuildRequires:  ghc-containers-devel
BuildRequires:  ghc-csv-devel
BuildRequires:  ghc-data-default-devel
BuildRequires:  ghc-directory-devel
BuildRequires:  ghc-file-embed-devel
BuildRequires:  ghc-filepath-devel
BuildRequires:  ghc-hashable-devel
BuildRequires:  ghc-haskeline-devel
BuildRequires:  ghc-here-devel
BuildRequires:  ghc-hledger-lib-devel
BuildRequires:  ghc-megaparsec-devel
BuildRequires:  ghc-mtl-compat-devel
BuildRequires:  ghc-mtl-devel
BuildRequires:  ghc-old-time-devel
BuildRequires:  ghc-parsec-devel
BuildRequires:  ghc-pretty-show-devel
BuildRequires:  ghc-process-devel
BuildRequires:  ghc-regex-tdfa-devel
BuildRequires:  ghc-rpm-macros
BuildRequires:  ghc-safe-devel
BuildRequires:  ghc-shakespeare-devel
BuildRequires:  ghc-split-devel
BuildRequires:  ghc-tabular-devel
BuildRequires:  ghc-temporary-devel
BuildRequires:  ghc-terminfo-devel
BuildRequires:  ghc-text-devel
BuildRequires:  ghc-time-devel
BuildRequires:  ghc-transformers-devel
BuildRequires:  ghc-unordered-containers-devel
BuildRequires:  ghc-utf8-string-devel
BuildRequires:  ghc-wizards-devel
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
%if %{with tests}
BuildRequires:  ghc-test-framework-devel
BuildRequires:  ghc-test-framework-hunit-devel
%endif

%description
This is hledger's command-line interface. Its basic function is to read a plain
text file describing financial transactions and produce useful reports.

hledger is a cross-platform program for tracking money, time, or any other
commodity, using double-entry accounting and a simple, editable file format.
It is inspired by and largely compatible with ledger(1). hledger provides
command-line, curses and web interfaces, and aims to be a reliable, practical
tool for daily use.

%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
Requires:       ghc-%{name} = %{version}-%{release}
Requires:       ghc-compiler = %{ghc_version}
Requires(post): ghc-compiler = %{ghc_version}
Requires(postun): ghc-compiler = %{ghc_version}

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

%prep
%setup -q
cp -p %{SOURCE1} %{name}.cabal

%build
%ghc_lib_build

%install
%ghc_lib_install
%ghc_fix_rpath %{pkg_name}-%{version}

%check
%cabal_test

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

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

%files
%defattr(-,root,root,-)
%doc LICENSE
%doc CHANGES README.md doc
%{_bindir}/%{name}
%dir %{_datadir}/%{name}-%{version}
%dir %{_datadir}/%{name}-%{version}/doc
%dir %{_datadir}/%{name}-%{version}/doc/other
%{_datadir}/%{name}-%{version}/doc/hledger.1
%{_datadir}/%{name}-%{version}/doc/hledger.1.info
%{_datadir}/%{name}-%{version}/doc/hledger.1.txt
%{_datadir}/%{name}-%{version}/doc/other/hledger-api.1
%{_datadir}/%{name}-%{version}/doc/other/hledger-api.1.info
%{_datadir}/%{name}-%{version}/doc/other/hledger-api.1.txt
%{_datadir}/%{name}-%{version}/doc/other/hledger-ui.1
%{_datadir}/%{name}-%{version}/doc/other/hledger-ui.1.info
%{_datadir}/%{name}-%{version}/doc/other/hledger-ui.1.txt
%{_datadir}/%{name}-%{version}/doc/other/hledger-web.1
%{_datadir}/%{name}-%{version}/doc/other/hledger-web.1.info
%{_datadir}/%{name}-%{version}/doc/other/hledger-web.1.txt
%{_datadir}/%{name}-%{version}/doc/other/hledger_csv.5
%{_datadir}/%{name}-%{version}/doc/other/hledger_csv.5.info
%{_datadir}/%{name}-%{version}/doc/other/hledger_csv.5.txt
%{_datadir}/%{name}-%{version}/doc/other/hledger_journal.5
%{_datadir}/%{name}-%{version}/doc/other/hledger_journal.5.info
%{_datadir}/%{name}-%{version}/doc/other/hledger_journal.5.txt
%{_datadir}/%{name}-%{version}/doc/other/hledger_timeclock.5
%{_datadir}/%{name}-%{version}/doc/other/hledger_timeclock.5.info
%{_datadir}/%{name}-%{version}/doc/other/hledger_timeclock.5.txt
%{_datadir}/%{name}-%{version}/doc/other/hledger_timedot.5
%{_datadir}/%{name}-%{version}/doc/other/hledger_timedot.5.info
%{_datadir}/%{name}-%{version}/doc/other/hledger_timedot.5.txt

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

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

%changelog
openSUSE Build Service is sponsored by