e32eaa2
%{!?_pkgdocdir: %global _pkgdocdir %{_docdir}/%{name}-%{version}}
e32eaa2
2c7775d
Name:             ledger
0ca6145
Version:          3.1.1
0ca6145
Release:          1%{?dist}
2c7775d
Summary:          A powerful command-line double-entry accounting system
2c7775d
License:          BSD
2c7775d
URL:              http://ledger-cli.org/
0ca6145
Source0:          https://github.com/ledger/ledger/archive/v%{version}.tar.gz#/%{name}-%{version}.tar.gz
2c7775d
2c7775d
BuildRequires:    boost-devel
2c7775d
BuildRequires:    cmake
2c7775d
BuildRequires:    emacs(bin)
2c7775d
BuildRequires:    gettext-devel
2c7775d
BuildRequires:    gmp-devel
2c7775d
BuildRequires:    libedit-devel
2c7775d
BuildRequires:    mpfr-devel
b2b33bd
BuildRequires:    python-devel
2c7775d
BuildRequires:    utf8cpp-devel
2c7775d
2c7775d
# For building documentation.
1baa610
BuildRequires:    doxygen
2c7775d
BuildRequires:    graphviz
2c7775d
BuildRequires:    man2html
2c7775d
BuildRequires:    texinfo
2c7775d
BuildRequires:    texlive-cm-super
2c7775d
BuildRequires:    texlive-ec
2c7775d
BuildRequires:    texlive-eurosym
2c7775d
BuildRequires:    texinfo-tex
2c7775d
2c7775d
Requires(post):   /sbin/ldconfig
4d0ed74
Requires(postun): /sbin/ldconfig
2c7775d
Requires(post):   info
2c7775d
Requires(preun):  info
4d0ed74
4d0ed74
%description
4d0ed74
Ledger is a powerful, double-entry accounting system that is accessed
4d0ed74
from the UNIX command-line. This may put off some users — as there is
4d0ed74
no flashy UI — but for those who want unparalleled reporting access to
4d0ed74
their data, there really is no alternative.
4d0ed74
b2b33bd
%package python
b2b33bd
Summary: Python bindings for %{name}
b2b33bd
Requires: %{name} = %{version}-%{release}
b2b33bd
%description python
b2b33bd
Python bindings for ledger.
b2b33bd
4d0ed74
%package devel
4d0ed74
Summary: Libraries and header files for %{name} development
4d0ed74
Requires: %{name} = %{version}-%{release}
4d0ed74
%description devel
b2b33bd
Libraries and header files for %{name} development.
4d0ed74
4d0ed74
%package -n emacs-%{name}
4d0ed74
Summary: Emacs mode for %{name}
4d0ed74
Requires: %{name} = %{version}-%{release}
4d0ed74
Requires: emacs(bin) >= %{_emacs_version}
4d0ed74
%description -n emacs-%{name}
4d0ed74
Emacs mode for %{name}.
4d0ed74
4d0ed74
%package -n emacs-%{name}-el
4d0ed74
Summary: Emacs elisp source for %{name}
4d0ed74
BuildArch: noarch
4d0ed74
Requires: %{name} = %{version}-%{release}
4d0ed74
Requires: emacs-%{name} = %{version}-%{release}
4d0ed74
%description -n emacs-%{name}-el
4d0ed74
This package contains the elisp source files for using %{name} under
4d0ed74
emacs. You do not need to install this package; use
4d0ed74
emacs-%{name} instead.
4d0ed74
2c7775d
4d0ed74
%prep
0ca6145
%setup -qn %{name}-%{version}
0ca6145
# Avoid texinfo errors on EL7.
0ca6145
%if 0%{?rhel} == 7
0ca6145
sed -i -e 's#FIXME:UNDOCUMENTED#FIXMEUNDOCUMENTED#g' doc/ledger3.texi
0ca6145
%endif
2c7775d
4d0ed74
4d0ed74
%build
2c7775d
./acprep --prefix=%{_prefix} update
2c7775d
%cmake . \
2c7775d
    -DCMAKE_INSTALL_PREFIX=%{_prefix} \
b2b33bd
    -DCMAKE_SKIP_RPATH:BOOL=ON \
0ca6145
    -DUSE_PYTHON:BOOL=ON \
0ca6145
    -DUSE_DOXYGEN:BOOL=ON \
0ca6145
    -DBUILD_WEB_DOCS:BOOL=ON \
0ca6145
    -DBUILD_EMACSLISP:BOOL=ON
0ca6145
#make %%{?_smp_mflags}
0ca6145
make
2c7775d
make doc
2c7775d
2c7775d
# Build info files.
2c7775d
pushd doc
2c7775d
makeinfo ledger3.texi
2c7775d
makeinfo ledger-mode.texi
2c7775d
popd
2c7775d
4d0ed74
4d0ed74
%install
4d0ed74
make install DESTDIR=%{buildroot}
0ca6145
chmod +x %{buildroot}%{python2_sitearch}/ledger.so
4d0ed74
c3ae7b0
# Bash completion
c3ae7b0
mkdir -p %{buildroot}%{_sysconfdir}/bash_completion.d
c3ae7b0
install -p -m0644 contrib/ledger-completion.bash \
c3ae7b0
    %{buildroot}%{_sysconfdir}/bash_completion.d/ledger
c3ae7b0
306ec1e
# Install documentation manually to a convenient directory layout
2c7775d
rm -rf %{buildroot}%{_docdir}
2c7775d
rm -rf %{buildroot}%{_infodir}/*
2c7775d
c3ae7b0
# Info files
2c7775d
cp -p doc/ledger3.info* %{buildroot}%{_infodir}
2c7775d
cp -p doc/ledger-mode.info %{buildroot}%{_infodir}
2c7775d
c3ae7b0
# Contrib scripts
e32eaa2
mkdir -p %{buildroot}%{_pkgdocdir}/contrib
0ca6145
for i in bal bal-huquq entry getquote.pl getquote-uk.py ledger-du ParseCcStmt.cs README repl.sh report tc ti to trend; do
e32eaa2
    install -p -m0644 contrib/${i} %{buildroot}%{_pkgdocdir}/contrib/${i}
c3ae7b0
done
c3ae7b0
c3ae7b0
# Python example
e32eaa2
mkdir -p %{buildroot}%{_pkgdocdir}/python
e32eaa2
install -p -m0644 python/demo.py %{buildroot}%{_pkgdocdir}/python/demo.py
c3ae7b0
c3ae7b0
# Input samples
e32eaa2
mkdir -p %{buildroot}%{_pkgdocdir}/samples
c3ae7b0
for i in demo.ledger drewr3.dat drewr.dat sample.dat wow.dat; do
e32eaa2
    install -p -m0644 test/input/${i} %{buildroot}%{_pkgdocdir}/samples/${i}
c3ae7b0
done
c3ae7b0
2c7775d
2c7775d
%check
2c7775d
# Tests all fail when removing rpath.
2c7775d
# make check
4d0ed74
4d0ed74
4d0ed74
%postun -p /sbin/ldconfig
4d0ed74
%post
2c7775d
/sbin/ldconfig
2c7775d
install-info %{_infodir}/ledger3.info %{_infodir}/dir || :
2c7775d
install-info %{_infodir}/ledger-mode.info %{_infodir}/dir || :
4d0ed74
%preun
4d0ed74
if [ $1 = 0 ]; then
2c7775d
  install-info --delete %{_infodir}/ledger3.info %{_infodir}/dir || :
2c7775d
  install-info --delete %{_infodir}/ledger-mode.info %{_infodir}/dir || :
4d0ed74
fi
4d0ed74
2c7775d
4d0ed74
%files
0ca6145
%doc README.md doc/GLOSSARY.md doc/NEWS
2c7775d
%doc doc/ledger3.html doc/ledger-mode.html
2c7775d
%doc doc/ledger3.pdf  doc/ledger-mode.pdf
306ec1e
# https://bugzilla.redhat.com/show_bug.cgi?id=728959
306ec1e
# These must be explicitly listed.
306ec1e
%doc %{_pkgdocdir}/contrib
306ec1e
%doc %{_pkgdocdir}/python
306ec1e
%doc %{_pkgdocdir}/samples
2c7775d
%{_bindir}/ledger
2c7775d
%{_infodir}/ledger3.info*
2c7775d
%{_infodir}/ledger-mode.info*
2c7775d
%{_libdir}/libledger.so.3
2c7775d
%{_mandir}/man1/ledger.1*
c3ae7b0
%config(noreplace) %{_sysconfdir}/bash_completion.d/ledger
0ca6145
%license LICENSE.md
4d0ed74
4d0ed74
%files -n emacs-%{name}
2c7775d
%dir %{_emacs_sitelispdir}/ledger-mode
2c7775d
%{_emacs_sitelispdir}/ledger-mode/*.elc
4d0ed74
4d0ed74
%files -n emacs-%{name}-el
2c7775d
%dir %{_emacs_sitelispdir}/ledger-mode
2c7775d
%{_emacs_sitelispdir}/ledger-mode/*.el
4d0ed74
b2b33bd
%files python
b2b33bd
%{python2_sitearch}/ledger.so
b2b33bd
4d0ed74
%files devel
2c7775d
%{_includedir}/ledger
2c7775d
%{_libdir}/libledger.so
2c7775d
4d0ed74
4d0ed74
%changelog
0ca6145
* Sun Jan 24 2016 Jamie Nguyen <jamielinux@fedoraproject.org> - 3.1.1-1
0ca6145
- update to upstream release 3.1.1
0ca6145
8a1b763
* Mon Jan 18 2016 Jonathan Wakely <jwakely@redhat.com> - 3.1-10
8a1b763
- Rebuilt for Boost 1.60
8a1b763
0b5696a
* Wed Oct 28 2015 David Tardon <dtardon@redhat.com> - 3.1-9
0b5696a
- rebuild for ICU 56.1
0b5696a
ba12bc3
* Thu Aug 27 2015 Jonathan Wakely <jwakely@redhat.com> - 3.1-8
ba12bc3
- Rebuilt for Boost 1.59
ba12bc3
a054d30
* Mon Jul 27 2015 Adam Williamson <awilliam@redhat.com> - 3.1-7
306ec1e
- add patches from jwakely to fix build with Boost 1.58
306ec1e
- fix pkgdocdir usage
a054d30
a054d30
* Wed Jul 22 2015 David Tardon <dtardon@redhat.com>
32917d7
- rebuild for Boost 1.58
32917d7
94bba9b
* Wed Jun 17 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 3.1-6
94bba9b
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild
94bba9b
0b83dee
* Sat May 02 2015 Kalev Lember <kalevlember@gmail.com> - 3.1-5
0b83dee
- Rebuilt for GCC 5 C++11 ABI change
0b83dee
Petr Machata 4164e88
* Mon Jan 26 2015 Petr Machata <pmachata@redhat.com> - 3.1-4
Petr Machata 4164e88
- Rebuild for boost 1.57.0
Petr Machata 4164e88
af450e8
* Mon Jan 26 2015 David Tardon <dtardon@redhat.com> - 3.1-3
af450e8
- rebuild for ICU 54.1
af450e8
e32eaa2
* Tue Dec 23 2014 Jamie Nguyen <jamielinux@fedoraproject.org> - 3.1-2
e32eaa2
- add conditional macro for _pkgdocdir
e32eaa2
1baa610
* Tue Nov 04 2014 Jamie Nguyen <jamielinux@fedoraproject.org> - 3.1-1
1baa610
- update to upstream release 3.1
1baa610
1ba0632
* Tue Aug 26 2014 David Tardon <dtardon@redhat.com> - 3.0.2-10
1ba0632
- rebuild for ICU 53.1
1ba0632
4ab64fd
* Sun Aug 17 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 3.0.2-9
4ab64fd
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild
4ab64fd
cefbb5c
* Sat Jun 07 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 3.0.2-8
cefbb5c
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild
cefbb5c
Petr Machata 62ac991
* Fri May 23 2014 Petr Machata <pmachata@redhat.com> - 3.0.2-7
Petr Machata 62ac991
- Rebuild for boost 1.55.0
Petr Machata 62ac991
6101d49
* Fri May 23 2014 David Tardon <dtardon@redhat.com> - 3.0.2-6
6101d49
- rebuild for boost 1.55.0
6101d49
c3ae7b0
* Sun May 04 2014 Jamie Nguyen <jamielinux@fedoraproject.org> - 3.0.2-5
c3ae7b0
- include useful scripts from contrib/
c3ae7b0
- include more sample files
c3ae7b0
- include example python script (demo.py)
c3ae7b0
- add bash completion
c3ae7b0
b2b33bd
* Sun May 04 2014 Jamie Nguyen <jamielinux@fedoraproject.org> - 3.0.2-4
b2b33bd
- add ledger-python subpackage with Python bindings
b2b33bd
- remove BR: doxygen for now (until jQuery is packaged)
b2b33bd
34cc2b8
* Sun May 04 2014 Jamie Nguyen <jamielinux@fedoraproject.org> - 3.0.2-3
34cc2b8
- revert upstream commit aa2ff2b5 which caused a regression
34cc2b8
9385e21
* Sun Apr 27 2014 Jamie Nguyen <jamielinux@fedoraproject.org> - 3.0.2-2
9385e21
- fix @node pointer errors in Info files resulting in broken navigation
9385e21
2c7775d
* Sun Apr 27 2014 Jamie Nguyen <jamielinux@fedoraproject.org> - 3.0.2-1
2c7775d
- update to upstream release 3.0.2
2c7775d
- remove EL6 related macros
2c7775d
- update URL
2c7775d
- use specific commit hash to obtain sources from GitHub
2c7775d
- update BuildRequires and build using CMake
2c7775d
- build HTML/PDF documentation
2c7775d
- revert a patch from upstream that requires boost 1.55 (not yet available
2c7775d
  on Fedora)
2c7775d
- libamounts now known as libledger
2c7775d
- use man page that is now built by upstream
2c7775d
f487e8b
* Sat Aug 03 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.6.3-9.2
f487e8b
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild
f487e8b
db30e08
* Thu Feb 14 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.6.3-8.2
db30e08
- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild
db30e08
944b6c4
* Thu Jul 19 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.6.3-7.2
944b6c4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild
944b6c4
a32524c
* Fri Feb 10 2012 Petr Pisar <ppisar@redhat.com> - 2.6.3-6.2
a32524c
- Rebuild against PCRE 8.30
a32524c
1ea3295
* Fri Jan 13 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.6.3-5.2
1ea3295
- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild
1ea3295
3e10428
* Fri Oct 21 2011 Marcela Mašláňová <mmaslano@redhat.com> - 2.6.3-4.2
3e10428
- rebuild with new gmp without compat lib
3e10428
29ec214
* Wed Oct 12 2011 Peter Schiffer <pschiffe@redhat.com> - 2.6.3-4.1
29ec214
- rebuild with new gmp
29ec214
6735f4d
* Mon Feb 07 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.6.3-4
6735f4d
- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild
6735f4d
Jesse Keating c5afc8e
* Wed Sep 29 2010 jkeating - 2.6.3-3
Jesse Keating c5afc8e
- Rebuilt for gcc bug 634757
Jesse Keating c5afc8e
4d0ed74
* Tue Jul  6 2010 Jim Radford <radford@blackbean.org> - 2.6.3-2
4d0ed74
- Only support emacs until someone tests xemacs
4d0ed74
4d0ed74
* Tue Jul  6 2010 Jim Radford <radford@blackbean.org> - 2.6.3-1
4d0ed74
- Upgrade to 2.6.2
4d0ed74
4d0ed74
* Thu Jan  1 2009 Jim Radford <radford@blackbean.org> - 2.6.1-1
4d0ed74
- Initial release