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