Blob Blame History Raw
%define docver 1.8.0
%define hbciver 0.9.5
%define ofxver 0.6.2

Name: gnucash
Summary: GnuCash is an application to keep track of your finances.
Version: 1.8.1
Release: 3
License: GPL/LGPL/GFDL
Group: Applications/Productivity
Source: http://www.gnucash.org/pub/gnucash/sources/unstable/%{name}-%{version}.tar.gz
Source1: http://www.gnucash.org/pub/gnucash/sources/unstable/%{name}-docs-%{docver}.tar.gz
Source2: http://prdownloads.sourceforge.net/libofx/libofx-%{ofxver}.tar.gz
Source3: http://prdownloads.sourceforge.net/openhbci/openhbci-%{hbciver}.tar.bz2
Patch2: gnucash-1.6.0-info.patch
Patch3: gnucash-1.8.1-crash.patch
Patch10: openhbci-0.9.5-build.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-root
BuildPrereq: g-wrap-devel >= 1.3.2, gtkhtml-devel >= 1.1.4,
BuildPrereq: Guppi-devel, gal-devel, libxml-devel, db4-devel
BuildPrereq: libglade-devel, libghttp-devel, python-devel, libtermcap-devel
BuildPrereq: readline-devel postgresql-devel /usr/bin/autoconf-2.13
BuildPrereq: openssl-devel, openjade, docbook-style-xsl
BuildRequires: desktop-file-utils
Prereq: /sbin/ldconfig, /sbin/install-info, scrollkeeper >= 0.3.4
%define __perl_requires  %{nil}

%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.

%package backend-postgres
Summary: Backend for storing GnuCash data in a PostgreSQL database.
Group: Applications/Productivity
Requires: gnucash = %{version}

%description backend-postgres

This package contains a backend for storing your GnuCash accounts and
transactions in a PostgreSQL database.  Install this package if you
want to keep your financial data in a database instead of a flat file
(recommended for large volumes of data and commercial sites).

%prep
%setup -q -a 1 -a 2 -a 3
%patch2 -p1 -b .dir
%patch3 -p1 -b .crash
%patch10 -p0

%build

# libofx
cd libofx-%{ofxver}
%configure --with-opensp-libs=%{_libdir}
make %{?_smp_mflags}
rm -rf $RPM_BUILD_ROOT
%makeinstall
rm -rf $RPM_BUILD_ROOT/%{_datadir}/doc 

# openhbci
cd ../openhbci-%{hbciver}
%configure --with-openssl-libs=%{_libdir}
make %{?_smp_mflags}
%makeinstall chroot_dir=$RPM_BUILD_ROOT
perl -pi -e "s|dir=\"/usr\"|dir=\"$RPM_BUILD_ROOT/usr\"|g" \
   $RPM_BUILD_ROOT/usr/bin/openhbci-config
perl -pi -e 's|$dir/lib|$dir/%{_lib}|g' \
   $RPM_BUILD_ROOT/usr/bin/openhbci-config

cd ..


autoconf-2.13
export LIBOFX_LIBS=-L$RPM_BUILD_ROOT/%{_libdir}
export LIBOFX_CFLAGS=-I$RPM_BUILD_ROOT/%{_includedir}
%configure --enable-sql --enable-error-on-warning=no \
	--enable-ofx \
	--enable-hbci --with-openhbci-prefix=$RPM_BUILD_ROOT/usr \
	--disable-openhbcitest
unset LIBOFX_LIBS LIBOFX_CFLAGS

make LIBTOOL=/usr/bin/libtool

# Blah. Again.
cd src
for foo in `find . -name "*.la"` ; do
   sed "s|relink_command|#relink_command|g" $foo > $foo.new
   mv -f $foo.new $foo
done
cd ..

cd gnucash-docs-%{docver}
autoconf-2.13
%configure

%install
make install DESTDIR=$RPM_BUILD_ROOT LIBTOOL=/usr/bin/libtool

%find_lang %{name}

cd gnucash-docs-%{docver}
make install DESTDIR=$RPM_BUILD_ROOT || :

# vfolder desktop file install stuff
mkdir -p $RPM_BUILD_ROOT/%{_datadir}/applications/
desktop-file-install --vendor gnome --delete-original \
  --dir $RPM_BUILD_ROOT%{_datadir}/applications       \
  --add-category X-Red-Hat-Extra                      \
  --add-category Application                         \
  --add-category Office                               \
  $RPM_BUILD_ROOT%{_datadir}/gnome/apps/Applications/gnucash.desktop
echo "StartupWMClass=GnuCash" >> $RPM_BUILD_ROOT%{_datadir}/applications/gnome-gnucash.desktop

rm -rf $RPM_BUILD_ROOT/%{_infodir}/dir \
      $RPM_BUILD_ROOT/%{_includedir} \
      $RPM_BUILD_ROOT/%{_datadir}/aclocal \
      $RPM_BUILD_ROOT/var/scrollkeeper \
      $RPM_BUILD_ROOT/%{_datadir}/doc/libofx \
      $RPM_BUILD_ROOT/%{_libdir}/lib{ofx,openhbci}.{la,so} \
      $RPM_BUILD_ROOT/%{_libdir}/lib*.a \
      $RPM_BUILD_ROOT/%{_libdir}/gnucash/lib*.a \
      $RPM_BUILD_ROOT/%{_bindir}/openhbci-config
      
%clean
rm -rf $RPM_BUILD_ROOT

%post
/sbin/ldconfig
/usr/bin/scrollkeeper-update -o %{_datadir}/omf/gnucash-docs
/sbin/install-info %{_infodir}/gnucash-design.info.gz %{_infodir}/dir

%postun
/sbin/ldconfig
/usr/bin/scrollkeeper-update
if [ $1 = 0 ]; then
   /sbin/install-info --delete %{_infodir}/gnucash-design.info.gz %{_infodir}/dir
fi

%files -f %{name}.lang
%defattr(-,root,root,755)
%{_bindir}/*
%{_infodir}/gnucash*info*
%{_libexecdir}/gnucash
%{_libdir}/*
%exclude /usr/lib/debug
%exclude %{_libdir}/gnucash/libgncmod-backend-postgres*
%{_datadir}/gnucash
%{_datadir}/gnome/help/gnucash
%{_datadir}/mime-info/gnucash.*
%{_datadir}/libofx
%{_datadir}/omf/gnucash-docs
%{_datadir}/pixmaps/gnucash
%{_datadir}/applications/*
%{_mandir}/man*/*
%config %{_sysconfdir}/gnucash
%doc AUTHORS COPYING ChangeLog ChangeLog.1 HACKING NEWS README README.patches
%doc doc/README.german doc/README.francais doc/guile-hackers.txt

%files backend-postgres
%defattr(-,root,root)
%{_libdir}/gnucash/libgncmod-backend-postgres*

%changelog
* Mon Feb 24 2003 Elliot Lee <sopwith@redhat.com>
- debuginfo rebuild

* Sun Feb 23 2003 Bill Nottingham <notting@redhat.com> 1.8.1-2
- fix crash on hiding accounts (#84931, patch from upstream)

* Tue Feb 11 2003 Bill Nottingham <notting@redhat.com> 1.8.1-1
- update to 1.8.1

* Wed Feb  5 2003 Bill Nottingham <notting@redhat.com> 1.8.0-3
- fix desktop entry (#82804)
- add startup-notification

* Tue Feb  4 2003 Bill Nottingham <notting@redhat.com> 1.8.0-1
- 1.8.0

* Tue Jan 28 2003 Bill Nottingham <notting@redhat.com> 1.7.8-3
- rebuild everywhere

* Wed Jan 22 2003 Tim Powers <timp@redhat.com>
- rebuilt

* Tue Jan 21 2003 Bill Nottingham <notting@redhat.com> 1.7.8-1
- 1.7.8

* Tue Jan 14 2003 Bill Nottingham <notting@redhat.com> 1.7.7-1
- update to 1.7.7
- add libofx, openhbci support

* Fri Dec  6 2002 Tim Waugh <twaugh@redhat.com> 1.7.5-3
- Fix desktop file (bug #69422).

* Wed Dec  4 2002 Bill Nottingham <notting@redhat.com> 1.7.5-2
- fix omf file ref to buildroot

* Tue Dec  3 2002 Bill Nottingham <notting@redhat.com> 1.7.5-1
- update to 1.7.5-1, split off postgres backend

* Mon Nov 18 2002 Bill Nottingham <notting@redhat.com> 1.6.8-3
- guile is everywhere, build everywhere
- except hammer (postgres)

* Mon Nov 11 2002 Tim Powers <timp@redhat.com> 1.6.8-2
- rebuild against guile-1.4

* Thu Nov  7 2002 Bill Nottingham <notting@redhat.com> 1.6.8-1
- update to 1.6.8-1
- stop using db1

* Thu Oct 24 2002 Jeremy Katz <katzj@redhat.com>
- build against new gtkhtml

* Sat Aug 10 2002 Florian La Roche <Florian.LaRoche@redhat.de>
- bzip2 source

* Fri Jun 21 2002 Tim Powers <timp@redhat.com>
- automated rebuild

* Sun May 26 2002 Tim Powers <timp@redhat.com>
- automated rebuild

* Thu May 16 2002 Bill Nottingham <notting@redhat.com>
- autoconf fun

* Mon Apr  8 2002 Bill Nottingham <notting@redhat.com>
- rebuild in new environment against fixed guile, g-wrap

* Thu Mar 14 2002 Bill Nottingham <notting@redhat.com>
- rebuild in new environment

* Mon Mar 11 2002 Bill Nottingham <notting@redhat.com>
- update to 1.6.6

* Fri Feb 22 2002 Bill Nottingham <notting@redhat.com>
- rebuild

* Mon Dec 17 2001 Bill Nottingham <notting@redhat.com>
- update to 1.6.5

* Mon Oct  1 2001 Bill Nottingham <notting@redhat.com>
- update to 1.6.4

* Mon Sep 24 2001 Bill Nottingham <notting@redhat.com>
- update to 1.6.3

* Mon Aug 13 2001 Bill Nottingham <notting@redhat.com>
- update to 1.6.2

* Thu Aug  9 2001 Bill Nottingham <notting@redhat.com>
- add patch to fix triple imports of prices from 1.4 files
  (<dave@krondo.com>)

* Thu Jul 19 2001 Bill Nottingham <notting@redhat.com>
- tweak buildprereqs

* Sun Jul  8 2001 Bill Nottingham <notting@redhat.com>
- update to 1.6.1
- fix info dir (#47646)
- fix library dependencies

* Fri Jun 29 2001 Bill Nottingham <notting@redhat.com>
- don't own %%{_infodir}/dir

* Wed Jun 27 2001 Bill Nottingham <notting@redhat.com>
- add info dir entry

* Mon Jun 18 2001 Bill Nottingham <notting@redhat.com>
- update to 1.6.0, merge in stuff from included spec file

* Mon Feb  5 2001 Adrian Havill <havill@redhat.com>
- added Japanese locale

* Thu Jan 11 2001 Tim Powers <timp@redhat.com>
- exclude ia64

* Wed Dec  6 2000 Tim Powers <timp@redhat.com>
- updated to 1.4.9

* Mon Oct 23 2000 Tim Powers <timp@redhat.com>
- update to 1.4.8

* Wed Sep 13 2000 Tim Powers <timp@redhat.com>
- update to 1.4.6

* Wed Aug 2 2000 Tim Powers <timp@redhat.com>
- rebuilt against libpng-1.0.8

* Mon Jul 31 2000 Tim Powers <timp@redhat.com>
- updated to 1.4.3, bugfix release

* Tue Jul 25 2000 Tim Powers <timp@redhat.com>
- ExcludeArch alpha

* Mon Jul 24 2000 Prospector <prospector@redhat.com>
- rebuilt

* Mon Jul 17 2000 Tim Powers <timp@redhat.com>
- fixed defattr for the stuff in /usr/bin

* Wed Jul 12 2000 Tim Powers <timp@redhat.com>
- update to 1.4.2

* Tue Jul 11 2000 Tim Powers <timp@redhat.com>
- rebuilt 

* Wed Jul 05 2000 Preston Brown <pbrown@redhat.com>
- adopted for Powertools 7.0