-
Notifications
You must be signed in to change notification settings - Fork 761
/
gnucash.spec.in
233 lines (193 loc) · 6.32 KB
/
gnucash.spec.in
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
#
# Spec file for Fedora and other RedHat distros and derivatives
#
# Check whether GnuCash should build optional modules.
# To modify parameters, edit the .spec file, 0 is off, 1 is on
%define _with_postgres 0
%define _with_ofx 0
%define _with_hbci 0
# The --whatprovides redhat-release lets us work on RHEL as well as FC
# Granted, it will look weird, but at least it wont fail outright.
%define fc_rel %(rpm -q --queryformat='%{VERSION}' --whatprovides redhat-release)
# Edit dist if not a Fedora release
%define dist FC%{fc_rel}
%define version @-VERSION-@
%define __libtoolize /bin/true
%define libgnomeui_version 2.8.0
%define libgnomeprintui_version 2.8.0
%define guile_version 1.6.0
%define gtkhtml3_version 3.1
%define libofx_version 0.8.0
%define aqbanking_version 1.3
%define postgresql_version 7.1.3
Name: gnucash
Summary: GnuCash is an application to keep track of your finances.
Version: %{version}
Release: 1.%{dist}
License: GPL
Group: Applications/Finance
URL: http://www.gnucash.org
Source: http://www.gnucash.org/pub/gnucash/sources/stable/gnucash-%{version}.tar.gz
BuildRoot: %{_tmppath}/%{name}-%{version}-root
Prereq: GConf2
Prereq: /usr/bin/gconftool-2
Prereq: /sbin/ldconfig
PreReq: /sbin/install-info
Requires: libgnomeui >= %{libgnomeui_version}
Requires: libgnomeprintui22 >= %{libgnomeprintui22_version}
Requires: guile >= %{guile_version}
Requires: gtkhtml3 >= %{gtkhtml3_version}
Requires: slib >= 3a1
BuildRequires: libgnomeui-devel >= %{libgnomeui_version}
BuildRequires: libgnomeprintui22-devel >= %{libgnomeprintui22_version}
BuildRequires: gtkhtml3-devel >= %{gtkhtml3_version}
BuildRequires: bzip2-devel, expat-devel, guile-devel
BuildRequires: libglade2-devel, libgsf-devel
BuildRequires: libjpeg-devel, openssl-devel
%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 devel
Summary: Header files for GnuCash development.
Group: Development/Libraries
Requires: gnucash = %{version}
%description devel
This package contains header files for GnuCash development.
Install this package if you want to use GnuCash libraries
in C programs.
%if %{_with_ofx}
%package ofx
Summary: Enables OFX importing in GnuCash
Group: Applications/Finance
Requires: gnucash = %{version}
Requires: libofx >= %{libofx_version}
BuildRequires: libofx
%description ofx
This package adds OFX file import support to the base
GnuCash package. Install this package if you want to
import OFX files.
%endif
%if %{_with_hbci}
%package hbci
Summary: Enables HBCI importing in GnuCash
Group: Applications/Finance
Requires: gnucash = %{version}
Requires: aqbanking >= %{aqbanking_version}
BuildRequires: aqbanking-devel
%description hbci
This package adds HBCI file import support to the base
GnuCash package. Install this package if you want to
import HBCI files.
%endif
%if %{_with_postgres}
%package backend-postgres
Summary: Backend for storing GnuCash data in a PostgreSQL database.
Group: Applications/Finance
Requires: gnucash = %{version}
Requires: postgresql >= %{postgresql_version}
BuildRequires: postgresql-devel
%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).
%endif
%prep
%setup -q
%build
%configure \
%if %{_with_ofx}
--enable-ofx \
%endif
%if %{_with_hbci}
--enable-hbci \
%endif
%if %{_with_postgres}
--enable-sql \
%endif
--enable-gui
make RPM_OPT_FLAGS="$RPM_OPT_FLAGS"
cp -p src/backend/postgres/README README.postgres
%install
[ "$RPM_BUILD_ROOT" != "/" ] && rm -rf $RPM_BUILD_ROOT
export GCONF_DISABLE_MAKEFILE_SCHEMA_INSTALL=1
LIBRARY_PATH=$RPM_BUILD_ROOT%{_libdir}:$RPM_BUILD_ROOT%{_libdir}/gnucash make DESTDIR=$RPM_BUILD_ROOT install
unset GCONF_DISABLE_MAKEFILE_SCHEMA_INSTALL
%find_lang %name
[ "$RPM_BUILD_ROOT" != "/" ] && rm -rf $RPM_BUILD_ROOT/%{_infodir}/dir
%clean
[ "$RPM_BUILD_ROOT" != "/" ] && rm -rf $RPM_BUILD_ROOT
%post
/sbin/ldconfig
/sbin/install-info %{_infodir}/gnucash-design.info.gz %{_infodir}/dir
export GCONF_CONFIG_SOURCE=`gconftool-2 --get-default-source`
SCHEMAS=%{_sysconfdir}/gconf/schemas/apps_gnucash*.schemas
for S in $SCHEMAS; do
gconftool-2 --makefile-install-rule $S > /dev/null
done
%preun
if [ "$1" -eq 0 ]; then
#deleting the schema on package removal
export GCONF_CONFIG_SOURCE=`gconftool-2 --get-default-source`
SCHEMAS=%{_sysconfdir}/gconf/schemas/apps_gnucash*.schemas
for S in $SCHEMAS; do
gconftool-2 --makefile-uninstall-rule $S > /dev/null
done
fi
%postun
/sbin/ldconfig
if [ $1 = 0 ]; then
/sbin/install-info --delete %{_infodir}/gnucash-design.info.gz %{_infodir}/dir
fi
%files -f %{name}.lang
%defattr(444,root,root,755)
%attr(555,root,root) %{_bindir}/*
%attr(555,root,root) %{_libexecdir}/gnucash
%{_mandir}/man*/*
%{_infodir}/gnucash*info*
%{_libdir}/*
%{_datadir}/gnucash
%{_datadir}/applications/*
%{_datadir}/xml/gnucash/xsl/*
%{_datadir}/pixmaps/*
%{_sysconfdir}/gconf/schemas/apps_gnucash*
%if %{_with_ofx}
%exclude %{_libdir}/gnucash/libgncmod-ofx*
%endif
%if %{_with_hbci}
%exclude %{_libdir}/gnucash/libgncmod-hbci*
%exclude %{_datadir}/gnucash/glade/hbci*
%exclude %{_sysconfdir}/gconf/schemas/apps_gnucash_dialog_hbci.schemas
%endif
%if %{_with_postgres}
%exclude %{_libdir}/libgnc-backend-postgres*
%endif
%config %{_sysconfdir}/gnucash
%doc AUTHORS COPYING ChangeLog* DOCUMENTERS HACKING LICENSE NEWS README README.patches
%doc doc/README.german doc/README.francais doc/guile-hackers.txt
%files devel
%defattr(444,root,root,755)
%{_includedir}/gnucash
%if %{_with_ofx}
%files ofx
%defattr(444,root,root,755)
%{_libdir}/gnucash/libgncmod-ofx*
%doc doc/README.OFX
%endif
%if %{_with_hbci}
%files hbci
%defattr(444,root,root,755)
%{_libdir}/gnucash/libgncmod-hbci*
%{_datadir}/gnucash/glade/hbci*
%{_sysconfdir}/gconf/schemas/apps_gnucash_dialog_hbci.schemas
%doc doc/README.HBCI
%endif
%if %{_with_postgres}
%files backend-postgres
%defattr(444,root,root,755)
%{_libdir}/libgnc-backend-postgres*
%doc README.postgres
%endif