File bc.spec of Package bc

#
# spec file for package bc (Version 1.06)
#
# Copyright (c) 2009 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via http://bugs.opensuse.org/
#

# norootforbuild


Name:           bc
BuildRequires:  bison ed flex readline-devel
Url:            ftp://ftp.gnu.org/pub/gnu/bc/
License:        GPL v2 or later
Group:          Productivity/Scientific/Math
AutoReqProv:    on
PreReq:         %{install_info_prereq}
Version:        1.06
Release:        894
Summary:        GNU Command Line Calculator
Source:         %{name}-%{version}.tar.bz2
Patch:          %{name}-%{version}.dif
Patch1:         %{name}-%{version}-flex.diff
Patch2:         %name-1.06-decl.diff
Patch3:         %name-1.06-strict-aliasing.diff
Patch4:         %{name}-%{version}_getopt.patch
Patch5:         %{name}-%{version}-opt-expression.diff
BuildRoot:      %{_tmppath}/%{name}-%{version}-build

%description
bc is an interpreter that supports numbers of arbitrary precision and
the interactive execution of statements. The syntax has some
similarities to the C programming language. A standard math library is
available through command line options. When used, the math library is
read in before any other input files. bc then reads in all other files
from the command line, evaluating their contents. Then bc reads from
standard input (usually the keyboard).

The dc program is also included. dc is a calculator that supports
reverse-polish notation and allows unlimited precision arithmetic.
Macros can also be defined. Normally, dc reads from standard input but
can also read in files specified on the command line. A calculator with
reverse-polish notation saves numbers to a stack. Arguments to
mathematical operations (operands) are "pushed" onto the stack until
the next operator is read in, which "pops" its arguments off the stack
and "pushes" its results back onto the stack.



Authors:
--------
    Philip A. Nelson <phil@cs.wwu.edu>

%prep
%setup -q
%patch
%patch1
%patch2 -p1
%patch3 -p1
%patch4
%patch5

%build
autoreconf -fi
./configure CFLAGS="$RPM_OPT_FLAGS" \
            --with-readline \
            --prefix=/usr \
	    --infodir=%{_infodir} \
            --mandir=%{_mandir} \
            --build=%{_target_cpu}-suse-linux
rm bc/libmath.h
make

%install
make install DESTDIR=$RPM_BUILD_ROOT

%clean
rm -rf $RPM_BUILD_ROOT

%post
%install_info --info-dir=%{_infodir} %{_infodir}/bc.info.gz
%install_info --info-dir=%{_infodir} %{_infodir}/dc.info.gz

%postun
%install_info_delete --info-dir=%{_infodir} %{_infodir}/bc.info.gz
%install_info_delete --info-dir=%{_infodir} %{_infodir}/dc.info.gz

%files
%defattr(-,root,root)
%doc AUTHORS COPYING ChangeLog NEWS README COPYING.LIB FAQ
/usr/bin/bc
/usr/bin/dc
%{_infodir}/*.info*
%{_mandir}/man1/*

%changelog
* Thu Dec 27 2007 schwab@suse.de
- Fix last change.
- Fix detection of empty opt_expression in the parser.
* Tue Jun 12 2007 pgajdos@suse.cz
- repared acceptance of some long commandline options
  [#282747]
* Thu Mar 29 2007 rguenther@suse.de
- add flex BuildRequires
* Wed Jan 25 2006 mls@suse.de
- converted neededforbuild to BuildRequires
* Mon Sep 19 2005 mmj@suse.de
- fix strict aliasing issues
* Thu Jul 07 2005 mmj@suse.de
- add missing decls
* Mon Aug 30 2004 postadal@suse.cz
- fixed for new flex
* Sun Jan 11 2004 adrian@suse.de
- build as user
* Tue Jul 22 2003 schwab@suse.de
- Fix unbalanced identifier tree.
* Thu Apr 24 2003 ro@suse.de
- fix install_info --delete call and move from preun to postun
* Thu Feb 06 2003 kukuk@suse.de
- Use install-info macros
- Fix bc.info (add dir entry)
* Wed Nov 20 2002 postadal@suse.cz
- returned the recompilation of libmath.h and fixed the problematic
  part which caused segmentation fault on 64bit archs [#21697]
* Mon Oct 07 2002 postadal@suse.cz
- removed recompilation of libmath.h [#20241]
* Wed Aug 07 2002 uli@suse.de
- build with -O0 on x86-64 (bug #17231)
* Thu Apr 12 2001 cihlar@suse.cz
- fixed to compile
* Fri Feb 23 2001 ro@suse.de
- added readline/readline-devel to neededforbuild (split from bash)
* Tue Dec 05 2000 cihlar@suse.cz
- added ed to neededforbuild
- fixed to recompile libmath.h
* Mon Oct 30 2000 cihlar@suse.cz
- update to version 1.6
- added BuildRoot
- bzipped sources
* Tue Sep 26 2000 schwab@suse.de
- Fix overflow bug in bc scanner.
* Fri Mar 10 2000 kasal@suse.de
- specfile cleanup
* Fri Feb 25 2000 kukuk@suse.de
- Use _infodir/_mandir, add group tag
* Thu Nov 25 1999 kukuk@suse.de
- Remove termcap from needforbuild
* Fri Nov 12 1999 kukuk@suse.de
- Fix Include paths
* Mon Sep 13 1999 bs@suse.de
- ran old prepare_spec on spec file to switch to new prepare_spec.
* Fri Aug 27 1999 fehr@suse.de
- chaged to new version 1.05a
* Wed Jul 21 1999 garloff@suse.de
- added -d to YFLAGS to prevent problem when bison changes
* Tue Sep 22 1998 ro@suse.de
- dont try to include posix_lim2.h for glibc
* Fri Dec 12 1997 florian@suse.de
- add many bug-fixes from gnu.utils.bug
* Fri Oct 10 1997 florian@suse.de
- update to 1.04 and fix rpm spec file
* Thu Jan 02 1997 florian@suse.de
- add some bug-fixes