%global guile_sitedir %{_datadir}/guile/site/2.2

Name:           gnucash
Summary:        GnuCash is an application to keep track of your finances.
Summary(ja):    個人用財務管理アプリケーション
Version:        5.4
Release:        1%{?_dist_release}
Group:          office
Vendor:         Project Vine
Distribution:   Vine Linux
Packager:       kenta, inagaki

License:        GPL/LGPL/GFDL
URL:            https://www.gnucash.org/
Source:         https://downloads.sourceforge.net/sourceforge/gnucash/gnucash-%{version}.tar.bz2

Patch0:         rpath.patch

BuildRoot:     %{_tmppath}/%{name}-%{version}-root
BuildRequires: libappstream-glib-devel
BuildRequires: aqbanking-devel >= 3.7.2
BuildRequires: bzip2-devel
BuildRequires: cmake
BuildRequires: desktop-file-utils
BuildRequires: expat-devel
BuildRequires: gwenhywfar-devel
BuildRequires: gettext
BuildRequires: gmock-devel
BuildRequires: gtest-devel
BuildRequires: gtk3-devel
BuildRequires: guile30-devel
BuildRequires: libappstream-glib
BuildRequires: libboost-date-time
BuildRequires: libboost-devel
BuildRequires: libboost-locale
BuildRequires: libboost-regex
BuildRequires: libboost-filesystem
BuildRequires: libboost-program-options
BuildRequires: libicu-devel
BuildRequires: libofx-devel
BuildRequires: libdbi-devel
BuildRequires: libjpeg-devel
BuildRequires: libsecret-devel
BuildRequires: libtool-ltdl-devel
BuildRequires: libxslt-devel
BuildRequires: pcre-devel
BuildRequires: popt-devel
BuildRequires: python3-devel
BuildRequires: swig
BuildRequires: webkitgtk4-devel
#BuildRequires: slib

BuildRequires: libdbi-dbd-pgsql
BuildRequires: libdbi-dbd-mysql
BuildRequires: libdbi-dbd-sqlite

Requires:      aqbanking
Requires:      perl-DateManip
Requires:      yelp
Requires(post,postun): gtk3
Requires(postun,posttrans): glib2
Obsoletes:     gnucash-backend-postgres


%description
GnuCash is a personal finance manager. A check-book like
register GUI allows you to enter and track bank accounts,
stocks, income and even currency trades. The interface is
designed to be simple and easy to use, but is backed with
double-entry accounting principles to ensure balanced books.

%description -l ja
GnuCashは 個人用財務管理をするアプリケーションです．
預金, 株式, 所得そして通貨取引さえ入力し、追跡することができる
グラフィカルな小切手帖です．インターフェスはシンプルかつ簡単に
使用できるようにデザインされています．


%debug_package


%prep
%autosetup -p1


%build
%global optflags %{optflags} -Wno-parentheses

%cmake \
       -DCMAKE_INSTALL_DOCDIR=%{_datadir}/doc/gnucash-%{version} \
       -DWITH_SQL=OFF

%cmake_build


%install
[ -n "$RPM_BUILD_ROOT" -a "$RPM_BUILD_ROOT" != / ] && rm -rf $RPM_BUILD_ROOT

%cmake_install

%find_lang %name

rm -rf $RPM_BUILD_ROOT%{_infodir} \
   $RPM_BUILD_ROOT%{_includedir} \
   $RPM_BUILD_ROOT%{_datadir}/aclocal \
   $RPM_BUILD_ROOT%{_libdir}/lib*.a \
   $RPM_BUILD_ROOT%{_libdir}/gnucash/lib*.a \
   $RPM_BUILD_ROOT%{_bindir}/gnc-test-env \
   $RPM_BUILD_ROOT%{_bindir}/gnc-fq-update

find $RPM_BUILD_ROOT%{_libdir} -name *.la -exec rm -f {} \;


%clean
[ -n "$RPM_BUILD_ROOT" -a "$RPM_BUILD_ROOT" != / ] && rm -rf $RPM_BUILD_ROOT


%files -f %{name}.lang
%defattr(-,root,root,755)
%doc %{_docdir}/gnucash-%{version}/*
%license LICENSE
%dir %{_sysconfdir}/%{name}
%{_bindir}/*
%{_libdir}/*
%{_datadir}/glib-2.0/schemas/*
%{_datadir}/%{name}
%{_datadir}/metainfo/*
%{_datadir}/applications/*
%{_datadir}/icons/hicolor/*/apps/*
%{_datadir}/guile/site/3.0/gnucash
%{_mandir}/man*/*
%config %{_sysconfdir}/%{name}/*


%changelog
* Wed Nov 01 2023 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 5.4-1
- new upstream release.
- built with icu74 and boost-1.83.0.

* Sat Nov 05 2022 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 4.12-1
- new upstream release.
- built with icu72 and boost-1.80.0.

* Fri Apr 09 2021 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 4.5-1
- new upstream release.
- built with icu69.
- dropped scriptlets.

* Sat Feb 20 2021 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 4.4-1
- new upstream release.
- built with boost-1.75.0.

* Sat Apr 25 2020 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 3.10-1
- new upstream release.
- built with icu-67 and boost-1.72.0.

* Fri Mar 20 2020 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 3.8b-1
- new upstream release.
- built with icu-66.

* Sun Oct 13 2019 Toshiaki Ara <ara_t@384.jp> 3.7-2
- rebuild with libicu-65

* Wed Sep 11 2019 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 3.7-1
- new upstream release.

* Thu Mar 31 2016 Yoji TOYODA <bsyamato@sea.plala.or.jp> 2.6.12-1
- new upstream release

* Mon Nov 09 2015 Yoji TOYODA <bsyamato@sea.plala.or.jp> 2.6.9-1
- new upstream release

* Sun May 10 2015 Yoji TOYODA <bsyamato@sea.plala.or.jp> 2.6.6-2
- remove *.la files

* Sun Apr 05 2015 Yoji TOYODA <bsyamato@sea.plala.or.jp> 2.6.6-1
- new upstream release
- add BuildRequires: libtool-ltdl-devel

* Mon Mar  9 2015 Ryoichi INAGAKI <ryo1@toki.waseda.jp> 2.6.5-2
- rebuilt with libofx 0.9.10
- added Vendor and Distribution tag

* Sun Jan 25 2015 Yoji TOYODA <bsyamato@sea.plala.or.jp> 2.6.5-1
- update to 2.6.5
- remove old patches
- add BuildRequires: libdbi-devel
- change BuildRequires: goffice08-devel instead of goffice-devel

* Tue Sep 14 2010 Ryoichi INAGAKI <ryo1@bc.wakwak.com> 2.2.9-3
- rebuilt with new toolchain, aqbanking-4.2.4, goffice-0.8.10
- added Patch1 for building with aqbanking-4.2.4
- added Patch2 for building with goffice-0.8.10

* Fri Jul 24 2009 NAKAMURA Kenta <kenta@vinelinux.org> 2.2.9-2
- added slib to BuildRequires: and Requires:

* Sat May 30 2009 NAKAMURA Kenta <kenta@vinelinux.org> 2.2.9-1
- new upstream release

* Wed Jan 14 2009 NAKAMURA Kenta <kenta@vinelinux.org> 2.2.8-1
- new upstream release

* Mon Jan 12 2009 Kazutaka HARADA <kazutaka@dc4.so-net.ne.jp> 2.2.7-2
- rebuild with guile-1.8.6
- add BuildRequires: gwenhywfar-devel

* Sun Oct 12 2008 Ryoichi INAGAKI <ryo1@bc.wakwak.com> 2.2.7-1
- new upstream release
- applied new versioning policy
- built with aqbanking-3.7.2, gwenheyfar-3.4.1, libofx-0.9.0 

* Tue Mar 11 2008 Ryoichi INAGAKI <ryo1@bc.wakwak.com> 2.2.4-0vl1
- new upstream release
- rebuilt with goffice-0.6.0

* Tue Jan 22 2008 NAKAMURA Kenta <kenta@vinelinux.org> 2.2.3-0vl1
- new upstream release

* Sun Jan 20 2008 NAKAMURA Kenta <kenta@vinelinux.org> 2.2.2-0vl1
- new upstream release
- enable HBCI (Home Banking Computer Interface)

* Tue Jan 08 2008 NAKAMURA Kenta <kenta@vinelinux.org> 2.2.0-0vl2
- rebuild with libofx-0.8.3 (libofx.so.3)

* Sun Dec 30 2007 NAKAMURA Kenta <kenta@vinelinux.org> 2.2.0-0vl1
- new upstream release
- disable postgresql backend, as it is unmaintained upstream
- added Patch0: gnucash-2.2.0-quiet.patch

* Sun Oct 23 2005 Ryoichi INAGAKI <ryo1@bc.wakwak.com> 1.8.12-0vl1
- new upstream release
- remove BuildRequiers: autoconf213
- update ja.po

* Fri Jan  2 2004 Ryoichi INAGAKI <ryo1@bc.wakwak.com> 1.8.8-0vl2
- new upstream release
- added BuildPrereq: libtool-ltdl-devel

* Fri Jan  2 2004 Ryoichi INAGAKI <ryo1@bc.wakwak.com> 1.8.8-0vl2
- rebuild with new toolchains
- update ja.po

* Sun Nov 23 2003 Ryoichi INAGAKI <ryo1@bc.wakwak.com> 1.8.8-0vl1
- new upstream release

* Sun Oct 19 2003 Ryoichi INAGAKI <ryo1@bc.wakwak.com> 1.8.7-1vl1
- merged gnucash-docs-1.8.3
- added patch from Redhat Rawhide 1.8.7-1
- changed Group, License

* Mon Oct  6 2003 Ryoichi INAGAKI <ryo1@bc.wakwak.com> 1.8.7-0vl1
- updated to 1.8.7
- updated print.patch
- overwrite prefs.scm
- s/Copyright/License/

* Tue May 13 2003 Ryoichi INAGAKI <ryo1@bc.wakwak.com> 1.8.3-0vl1
- updated to 1.8.3
- added datelength.patch
- separated devel packages
  (and ofx, hbci, backend-postgres. But default is off)

* Wed Jan 16 2002 Akira TAGOH <tagoh@gnome.gr.jp> 1.6.5-0vl3
- Build against with new gal.

* Fri Dec 28 2001 Akira TAGOH <tagoh@gnome.gr.jp> 1.6.5-0vl2
- Fixed printing issue.

* Tue Dec 25 2001 Akira TAGOH <tagoh@gnome.gr.jp> 1.6.5-0vl1
- New upstream release.

* Thu Jul 26 2001 <sagami@vinelinux.org>
- 1.6.0-0vl3: fix to not to own mandir itself, use %%{find_lang}

* Tue Jun 12 2001 MATSUBAYASHI 'Shaolin' Kohji <shaolin@vinelinux.org>
- %%make line is now commented out (bash2 complains it)
  (BTW, what the hell is the macro %%make anyway? I don't even know...)

* Tue Jun 12 2001 Daisuke SUZUKI <daisuke@linux.or.jp> 1.6.0-0vl1
- update to 1.6.0 (stable release version)

* Thu May 24 2001 Daisuke SUZUKI <daisuke@linux.or.jp> 1.5.96-0vl1
- update to 1.5.96 ( pre beta for 1.6.0 )

* Mon Apr 23 2001 Daisuke SUZUKI <daisuke@linux.or.jp> 1.5.6-1vl2
- added japanese patch for reporting and printing (thanx tagoh-san)

* Mon Apr 23 2001 Daisuke SUZUKI <daisuke@linux.or.jp> 1.5.6-1vl1
- updated to 1.5.6

* Thu Apr 05 2001 Daisuke SUZUKI <daisuke@linux.or.jp> 1.5.4-1vl2
- added translation messages to ja.po
- enable guppi

* Mon Apr  2 2001 Kazuhisa TAKEI <takei@vinelinux.org> 1.5.4-1vl1
- upstream update
- fixed broken ja.po 

* Wed Mar 28 2001 Kazuhisa TAKEI <takei@vinelinux.org> 1.5.2-1vl2
- fixed registor window cursor position problem(gnucash-cursor_pos.patch) 

* Mon Mar 26 2001 Kazuhisa TAKEI <takei@vinelinux.org> 1.5.2-1vl1
- initial relese package
