File abakus.spec of Package abakus
%define _prefix /opt/kde3
%define _docdir /opt/kde3/share/doc
Name: kde3-abakus
Summary: Simple KDE calculator
Version: 0.91
Release: 1%{?dist}
License: GPLv2+
Group: Productivity/Office/Other
Source0: http://purinchu.net/abakus/abakus-%{version}.tar.bz2
Source1: abakus.desktop
Patch0: abakus-0.91-norpath.patch
URL: http://purinchu.net/abakus/
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildRequires: kdelibs3-devel, qt3-devel, mpfr-devel, gmp-devel scons <= 3.0.1 bison flex
BuildRequires: update-desktop-files python python-autopep8
%description
Abakus is a simple calculator for KDE, based on a concept of Roberto
Alsina's. Think of it as bc (the command-line calculator) with a nice
GUI.
%prep
%setup -q -n abakus-%{version}
%patch0 -p1 -b .rpath
#2to3 bksys/generic.py -w -n
sed -i 's|print env.helpText()|print (env.helpText())|g' SConstruct
#sed -i 's|print "unknown genobj given: "+val|print ("unknown genobj given: "+val)|g' bksys/generic.py
#sed -i 's|print self.xml()|print (self.xml())|g' bksys/generic.py
#sed -i 's|print RED+"no source file given to object - self.src"+NORMAL|print (RED+"no source file given to object - self.src"+NORMAL)|g' bksys/generic.py
autopep8 bksys/generic.py --in-place
#sed -i "s|print CYAN + '\*\* Enabling DESTDIR for the project \*\* ' + NORMAL + env\['DESTDIR'\]|print (CYAN + '\*\* Enabling DESTDIR for the project \*\* ' + NORMAL + env\['DESTDIR'\])|g" bksys/generic.py
#sed -i "s|print CYAN + '\*\* Enabling debug for the project \*\*' + NORMAL|print (CYAN + '\*\* Enabling debug for the project \*\*' + NORMAL)|g" bksys/generic.py
%build
. /etc/opt/kde3/common_options
export QTDIR="/usr/lib/qt3"
sed -i 's|--as-needed|--as-needed -Wl,--add-needed -L/usr/lib/qt3/%_lib|g' src/SConscript
python2 /usr/bin/scons configure
python2 /usr/bin/scons
%install
#make DESTDIR=$RPM_BUILD_ROOT%{_prefix} install
DESTDIR=%{buildroot}%{_prefix} python2 /usr/bin/scons install
%suse_update_desktop_file abakus -r Utility Calculator
%post
%postun
%files
%defattr(-,root,root)
%doc AUTHORS COPYING README
%{_bindir}/abakus
%{_datadir}/apps/abakus/abakusui.rc
%{_datadir}/icons/hicolor/64x64/apps/abakus.png
%{_docdir}/HTML/en/abakus/
%{_datadir}/applications/kde/*.desktop
%dir %{_datadir}/apps/abakus
%changelog
* Sun Oct 21 2007 Tom "spot" Callaway <tcallawa@redhat.com> 0.91-1
- Initial package for Fedora