From f98ce9988100b6e3e147a184848380bf95816eed Mon Sep 17 00:00:00 2001 From: CentOS Sources Date: Oct 23 2019 00:25:08 +0000 Subject: import kcalc-4.10.5-4.el7 --- diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..8de5b99 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +SOURCES/kcalc-4.10.5.tar.xz diff --git a/.kcalc.metadata b/.kcalc.metadata new file mode 100644 index 0000000..a7a8b41 --- /dev/null +++ b/.kcalc.metadata @@ -0,0 +1 @@ +9c9f3219482d5a90e8c90d5fc0a3fa53c947d150 SOURCES/kcalc-4.10.5.tar.xz diff --git a/SOURCES/kcalc-4.10.5-bz#1058342.patch b/SOURCES/kcalc-4.10.5-bz#1058342.patch new file mode 100644 index 0000000..237246f --- /dev/null +++ b/SOURCES/kcalc-4.10.5-bz#1058342.patch @@ -0,0 +1,13 @@ +diff -up kcalc-4.10.5/kcalc_core.cpp.misc kcalc-4.10.5/kcalc_core.cpp +--- kcalc-4.10.5/kcalc_core.cpp.misc 2013-06-28 19:38:46.589913916 +0200 ++++ kcalc-4.10.5/kcalc_core.cpp 2014-01-28 17:38:32.734620194 +0100 +@@ -82,6 +82,9 @@ KNumber ExecAdd(const KNumber &left_op, + } + + KNumber ExecSubtract(const KNumber &left_op, const KNumber &right_op) { ++ if (left_op.toQString() == right_op.toQString()) { ++ return KNumber::Zero; ++ } + return left_op - right_op; + } + diff --git a/SOURCES/kcalc-4.9.90-misc.patch b/SOURCES/kcalc-4.9.90-misc.patch new file mode 100644 index 0000000..a529896 --- /dev/null +++ b/SOURCES/kcalc-4.9.90-misc.patch @@ -0,0 +1,32 @@ +diff -ur kcalc-4.9.90/kcalc_core.cpp kcalc-4.9.90-misc/kcalc_core.cpp +--- kcalc-4.9.90/kcalc_core.cpp 2012-11-14 17:46:47.000000000 +0100 ++++ kcalc-4.9.90-misc/kcalc_core.cpp 2012-12-08 20:05:58.000000000 +0100 +@@ -99,7 +99,13 @@ + } + + KNumber ExecMod(const KNumber &left_op, const KNumber &right_op) { +- return left_op % right_op; ++ KNumber tmp_result = left_op % right_op; ++ ++ if ( right_op < KNumber::Zero ) ++ return -(-left_op % -right_op); ++ if ( tmp_result < KNumber::Zero ) ++ tmp_result += right_op; ++ return tmp_result; + } + + KNumber ExecIntDiv(const KNumber &left_op, const KNumber &right_op) { +@@ -535,8 +541,11 @@ + + void CalcEngine::Factorial(const KNumber &input) + { +- if (input == KNumber::PosInfinity) return; +- if (input < KNumber::Zero || input.type() == KNumber::TYPE_ERROR) { ++ if (input == KNumber::PosInfinity || input > KNumber(999999)) { ++ last_number_ = KNumber::PosInfinity; ++ return; ++ } ++ if (input < KNumber::Zero || input.type() != KNumber::TYPE_INTEGER) { + error_ = true; + last_number_ = KNumber::NaN; + return; diff --git a/SPECS/kcalc.spec b/SPECS/kcalc.spec new file mode 100644 index 0000000..67f9b8e --- /dev/null +++ b/SPECS/kcalc.spec @@ -0,0 +1,178 @@ +Name: kcalc +Summary: Scientific Calculator +Version: 4.10.5 +Release: 4%{?dist} + +License: GPLv2+ +URL: https://projects.kde.org/projects/kde/kdeutils/kcalc +%global revision %(echo %{version} | cut -d. -f3) +%if %{revision} >= 50 +%global stable unstable +%else +%global stable stable +%endif +Source0: http://download.kde.org/%{stable}/%{version}/src/%{name}-%{version}.tar.xz + +# fix arithmetic fault in mod, factorial +Patch0: kcalc-4.9.90-misc.patch + +# fix e^1 - euler number constant does not return 0 +Patch1: kcalc-4.10.5-bz#1058342.patch + +BuildRequires: desktop-file-utils +BuildRequires: kdelibs4-devel >= %{version} +BuildRequires: gmp-devel + +# when split occured +Conflicts: kdeutils-common < 6:4.7.80 + +Obsoletes: kdeutils-kcalc < 6:4.7.80 +Provides: kdeutils-kcalc = 6:%{version}-%{release} + +%{?_kde4_version:Requires: kdelibs4%{?_isa} >= %{_kde4_version}} + + +%description +KCalc is a calculator which offers many more mathematical +functions than meet the eye on a first glance. + + +%prep +%setup -q -n %{name}-%{version} + +%patch0 -p1 -b .misc +%patch1 -p1 -b .euler + +%build +mkdir -p %{_target_platform} +pushd %{_target_platform} +%{cmake_kde4} .. +popd + +make %{?_smp_mflags} -C %{_target_platform} + + +%install +make install/fast DESTDIR=%{buildroot} -C %{_target_platform} + +%find_lang %{name} --with-kde --without-mo + + +%check +desktop-file-validate %{buildroot}%{_kde4_datadir}/applications/kde4/%{name}.desktop + + +%files -f %{name}.lang +%doc COPYING README +%{_kde4_bindir}/kcalc +%{_kde4_appsdir}/kcalc/ +%{_kde4_appsdir}/kconf_update/kcalcrc.upd +%{_kde4_datadir}/config.kcfg/kcalc.kcfg +%{_kde4_datadir}/applications/kde4/kcalc.desktop +%{_kde4_libdir}/libkdeinit4_kcalc.so + + + +%changelog +* Wed Jan 29 2014 Than Ngo - 4.10.5-4 +- fix, e^1 - euler number constant does not return 0 + +* Fri Jan 24 2014 Daniel Mach - 4.10.5-3 +- Mass rebuild 2014-01-24 + +* Fri Dec 27 2013 Daniel Mach - 4.10.5-2 +- Mass rebuild 2013-12-27 + +* Sun Jun 30 2013 Than Ngo - 4.10.5-1 +- 4.10.5 + +* Sat Jun 01 2013 Rex Dieter - 4.10.4-1 +- 4.10.4 + +* Mon May 06 2013 Than Ngo - 4.10.3-1 +- 4.10.3 + +* Sun Mar 31 2013 Rex Dieter - 4.10.2-1 +- 4.10.2 + +* Sat Mar 02 2013 Rex Dieter - 4.10.1-1 +- 4.10.1 + +* Fri Feb 01 2013 Rex Dieter - 4.10.0-1 +- 4.10.0 + +* Tue Jan 22 2013 Rex Dieter - 4.9.98-1 +- 4.9.98 + +* Fri Jan 04 2013 Rex Dieter - 4.9.97-1 +- 4.9.97 + +* Thu Dec 20 2012 Rex Dieter - 4.9.95-1 +- 4.9.95 + +* Sat Dec 08 2012 Kevin Kofler - 4.9.90-2 +- rebase the patch (mod, factorial parts still apply, binomial fixed upstream) + +* Tue Dec 04 2012 Rex Dieter - 4.9.90-1 +- 4.9.90 + +* Mon Dec 03 2012 Than Ngo - 4.9.4-1 +- 4.9.4 + +* Thu Nov 08 2012 Than Ngo - 4.9.3-2 +- fix arithmetic fault in binomial, factorial + +* Sat Nov 03 2012 Rex Dieter - 4.9.3-1 +- 4.9.3 + +* Sat Sep 29 2012 Rex Dieter - 4.9.2-1 +- 4.9.2 + +* Mon Sep 03 2012 Than Ngo - 4.9.1-1 +- 4.9.1 + +* Thu Jul 26 2012 Lukas Tinkl - 4.9.0-1 +- 4.9.0 + +* Thu Jul 19 2012 Fedora Release Engineering - 4.8.97-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild + +* Thu Jul 12 2012 Rex Dieter - 4.8.97-1 +- 4.8.97 + +* Wed Jun 27 2012 Jaroslav Reznik - 4.8.95-1 +- 4.8.95 + +* Sat Jun 09 2012 Rex Dieter - 4.8.90-1 +- 4.8.90 + +* Tue Jun 05 2012 Rex Dieter 4.8.80-2 +- fix %%_kde_version macro usage + +* Fri Jun 01 2012 Jaroslav Reznik - 4.8.80-1 +- 4.8.80 + +* Mon Apr 30 2012 Jaroslav Reznik - 4.8.3-1 +- 4.8.3 + +* Fri Mar 30 2012 Rex Dieter - 4.8.2-1 +- 4.8.2 + +* Mon Mar 05 2012 Jaroslav Reznik - 4.8.1-1 +- 4.8.1 + +* Sun Jan 22 2012 Rex Dieter - 4.8.0-1 +- 4.8.0 + +* Wed Jan 04 2012 Rex Dieter - 4.7.97-1 +- 4.7.97 + +* Thu Dec 22 2011 Radek Novacek - 4.7.95-1 +- 4.7.95 + +* Mon Dec 05 2011 Rex Dieter 4.7.90-1 +- 4.7.90 + +* Sat Nov 26 2011 Rex Dieter 4.7.80-1 +- first try +