Compare commits

...

No commits in common. "c8" and "c9s" have entirely different histories.
c8 ... c9s

8 changed files with 95 additions and 21 deletions

View File

@ -1 +0,0 @@
b4475c6d66590a5911d30f9747361db47231640a SOURCES/bc-1.07.1.tar.gz

4
.gitignore vendored
View File

@ -1 +1,3 @@
SOURCES/bc-1.07.1.tar.gz bc-1.06.95.tar.bz2
/bc-1.07.tar.gz
/bc-1.07.1.tar.gz

View File

@ -1,15 +1,15 @@
Summary: GNU's bc (a numeric processing language) and dc (a calculator) Summary: GNU's bc (a numeric processing language) and dc (a calculator)
Name: bc Name: bc
Version: 1.07.1 Version: 1.07.1
Release: 5%{?dist} Release: 14%{?dist}
License: GPLv2+ License: GPLv2+
URL: http://www.gnu.org/software/bc/ URL: http://www.gnu.org/software/bc/
Source: http://ftp.gnu.org/gnu/bc/bc-%{version}.tar.gz Source: http://ftp.gnu.org/gnu/bc/bc-%{version}.tar.gz
Patch1: bc-1.06-dc_ibase.patch Patch1: bc-1.06-dc_ibase.patch
Patch2: bc-1.06.95-doc.patch Patch2: bc-1.06.95-doc.patch
Requires(post): /sbin/install-info BuildRequires: gcc
Requires(preun): /sbin/install-info
BuildRequires: readline-devel, flex, bison, texinfo, ed BuildRequires: readline-devel, flex, bison, texinfo, ed
BuildRequires: make
%description %description
The bc package includes bc and dc. Bc is an arbitrary precision The bc package includes bc and dc. Bc is an arbitrary precision
@ -31,22 +31,6 @@ if you would like to use its text mode calculator.
%make_install %make_install
rm -f $RPM_BUILD_ROOT/%{_infodir}/dir rm -f $RPM_BUILD_ROOT/%{_infodir}/dir
%post
if [ -e %{_infodir}/bc.info.gz -a -e %{_infodir}/dc.info.gz ]; then
/sbin/install-info %{_infodir}/bc.info.gz %{_infodir}/dir \
--entry="* bc: (bc). The GNU calculator language." || :
/sbin/install-info %{_infodir}/dc.info.gz %{_infodir}/dir \
--entry="* dc: (dc). The GNU RPN calculator." || :
fi
%preun
if [ $1 = 0 -a -e %{_infodir}/bc.info.gz -a -e %{_infodir}/dc.info.gz ]; then
/sbin/install-info --delete %{_infodir}/bc.info.gz %{_infodir}/dir \
--entry="* bc: (bc). The GNU calculator language." || :
/sbin/install-info --delete %{_infodir}/dc.info.gz %{_infodir}/dir \
--entry="* dc: (dc). The GNU RPN calculator." || :
fi
%files %files
%license COPYING COPYING.LIB %license COPYING COPYING.LIB
%doc FAQ AUTHORS NEWS README Examples/ %doc FAQ AUTHORS NEWS README Examples/
@ -56,6 +40,34 @@ fi
%{_infodir}/* %{_infodir}/*
%changelog %changelog
* Mon Aug 09 2021 Mohan Boddu <mboddu@redhat.com> - 1.07.1-14
- Rebuilt for IMA sigs, glibc 2.34, aarch64 flags
Related: rhbz#1991688
* Thu Apr 15 2021 Mohan Boddu <mboddu@redhat.com> - 1.07.1-13
- Rebuilt for RHEL 9 BETA on Apr 15th 2021. Related: rhbz#1947937
* Tue Jan 26 2021 Fedora Release Engineering <releng@fedoraproject.org> - 1.07.1-12
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
* Mon Jul 27 2020 Fedora Release Engineering <releng@fedoraproject.org> - 1.07.1-11
- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
* Tue Jan 28 2020 Fedora Release Engineering <releng@fedoraproject.org> - 1.07.1-10
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
* Wed Jul 24 2019 Fedora Release Engineering <releng@fedoraproject.org> - 1.07.1-9
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
* Sun Feb 17 2019 Igor Gnatenko <ignatenkobrain@fedoraproject.org> - 1.07.1-8
- Rebuild for readline 8.0
* Thu Jan 31 2019 Fedora Release Engineering <releng@fedoraproject.org> - 1.07.1-7
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
* Thu Jul 12 2018 Fedora Release Engineering <releng@fedoraproject.org> - 1.07.1-6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
* Wed Feb 07 2018 Fedora Release Engineering <releng@fedoraproject.org> - 1.07.1-5 * Wed Feb 07 2018 Fedora Release Engineering <releng@fedoraproject.org> - 1.07.1-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild - Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild

1
sources Normal file
View File

@ -0,0 +1 @@
SHA512 (bc-1.07.1.tar.gz) = 02126d0db6b6ed06d56cfc292d6f5475ff1e574779d7e69c7809bbb1e13f946f57ea07da2a7666baa092507a951a822044b0970075f75eefe65a5c1999b75d34

45
tests/sanity/runtests.py Normal file
View File

@ -0,0 +1,45 @@
import unittest
import os
import subprocess
def call_command(command_to_call):
result = subprocess.check_output(command_to_call, shell=True)
return result[:-1].decode("utf-8")
class TestBC(unittest.TestCase):
def test_divide(self):
result = call_command("echo '6.5 / 2.7' | bc")
self.assertEqual( result, '2')
def test_sum(self):
result = call_command("echo '2 + 5' | bc")
self.assertEqual( result, '7')
def test_difference(self):
result = call_command("echo '10 - 4' | bc")
self.assertEqual( result, '6')
def test_multiplying(self):
result = call_command("echo '3 * 8' | bc")
self.assertEqual( result, '24')
def test_scale(self):
result = call_command("echo 'scale = 2; 2 / 3' | bc")
self.assertEqual( result, '.66')
def test_remainder(self):
result = call_command("echo '6 % 4' | bc")
self.assertEqual( result, '2')
def test_exponent(self):
result = call_command("echo '10^2' | bc")
self.assertEqual( result, '100')
if __name__ == '__main__':
unittest.main()

15
tests/tests.yml Normal file
View File

@ -0,0 +1,15 @@
---
# This first play always runs on the local staging system
- hosts: localhost
roles:
- role: standard-test-basic
tags:
- classic
- container
- atomic
tests:
- sanity.test:
dir: sanity
run: python3 runtests.py -v
required_packages:
- bc # Required to run initscript