# Enabling this option invokes section 3 of the LGPL, applying the terms of # the ordinary GNU General Public License version 2 instead of the LGPL. # See the included "calc-converted-to-gpl.txt" source file for details. %define with_readline 1 %if %{with_readline} License: GPLv2 %else License: LGPLv2 %endif Name: calc Version: 2.12.2 Release: 0.5%{?dist}.%( echo %{license}|tr A-Z a-z|sed s/v2// ) Summary: Arbitrary precision arithmetic system and calculator Group: Applications/Engineering URL: http://isthe.com/chongo/tech/comp/calc/ Source0: http://www.isthe.com/chongo/src/calc/calc-%{version}.tar.gz Source1: calc-converted-to-gpl.txt Source2: COPYING-GPL BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildRequires: sed %if %{with_readline} BuildRequires: ncurses-devel >= 5.2-26, readline-devel >= 4.2 %endif Requires: less >= 358 %description Calc is an arbitrary precision C-like arithmetic system that is a calculator, an algorithm-prototyper, and a mathematical research tool. Calc comes with a rich set of built-in mathematical and programmatic functions. %package libs Summary: Libraries for the Calc arithmetic system Group: System Environment/Libraries Requires: %{name} = %{version}-%{release} %description libs Shared libraries used by the Calc command line calculator and other programs using its arbitrary precision arithmetic routines. %package devel Summary: Development files for the Calc arithmetic system Group: Development/Libraries Requires: %{name} = %{version}-%{release} %description devel This package contains files necessary to build applications which use the Calc arbitrary precision arithmetic system. %prep %setup -q %if %{with_readline} for f in help.c version.c calc.man cal/* $( ls help/*|grep '^help/credit$' ) ; do sed -i -e's/version 2.1 \(.*GNU\)/version 2 \1/;s/COPYING.LGPL/COPYING-GPL/;s/copying.lgpl/copying-gpl/;s/GNU LGPL/GNU GPL/;s/GNU Lesser General/GNU General/' $f done cp %{SOURCE1} COPYING cp %{SOURCE2} COPYING-GPL %endif %build make DEBUG="%{optflags}" \ ALLOW_CUSTOM="" \ LD_SHARE="" \ %if %{with_readline} USE_READLINE="-DUSE_READLINE" \ READLINE_LIB="-lreadline -lhistory -lncurses" \ %else USE_READLINE="" \ %endif T=%{buildroot} \ BINDIR=%{_bindir} \ LIBDIR=%{_libdir} \ CALC_SHAREDIR=%{_datadir}/%{name} \ CALC_INCDIR=%{_includedir}/calc \ SCRIPTDIR=%{_datadir}/%{name}/cscript \ MANDIR=%{_mandir}/man1 \ all %install rm -rf %{buildroot} make T=%{buildroot} \ BINDIR=%{_bindir} \ LIBDIR=%{_libdir} \ CALC_SHAREDIR=%{_datadir}/%{name} \ CALC_INCDIR=%{_includedir}/calc \ SCRIPTDIR=%{_datadir}/%{name}/cscript \ MANDIR=%{_mandir}/man1 \ install %if %{with_readline} rm -f %{buildroot}/%{_datadir}/%{name}/help/COPYING-LGPL install -m 444 COPYING-GPL %{buildroot}/%{_datadir}/%{name}/help/ %endif # Changing permissions of executables to 755 to shut up rpmlint. chmod 755 %{buildroot}%{_datadir}/%{name}/cscript/* chmod 755 %{buildroot}%{_bindir}/calc %check make chk %clean rm -rf %{buildroot} %post libs -p /sbin/ldconfig %postun libs -p /sbin/ldconfig %files %defattr(-, root, root) %doc BUGS CHANGES COPYING COPYING-%( echo %{license}|sed s/v2// ) %{_bindir}/calc %{_mandir}/man1/calc.1* %dir %{_datadir}/%{name} %dir %{_datadir}/%{name}/help %{_datadir}/%{name}/help/* %dir %{_datadir}/%{name}/custhelp %{_datadir}/%{name}/custhelp/* %dir %{_datadir}/%{name}/cscript %{_datadir}/%{name}/cscript/* %dir %{_datadir}/%{name}/custom %{_datadir}/%{name}/custom/* %{_datadir}/%{name}/bindings %{_datadir}/%{name}/README %{_datadir}/%{name}/*.cal %{_datadir}/%{name}/*.line %files libs %{_libdir}/libcalc.so.* %{_libdir}/libcustcalc.so.* %files devel %{_libdir}/libcalc.so %{_libdir}/libcustcalc.so %dir %{_includedir}/calc %{_includedir}/calc/*.h %changelog * Wed Sep 5 2007 Matthew Miller - 2.12.2-0.5 - minor spec file cleanup for package review * Wed Sep 5 2007 Matthew Miller - 2.12.2-0.4 - fix (i.e., remove) rpath by setting LD_SHARE to "". * Tue Sep 4 2007 Matthew Miller - 2.12.2-0.3 - minor correction to LGPL-GPL conversion * Mon Sep 3 2007 Matthew Miller - 2.12.2-0.2 - LGPL/GPL -> explicit LGPLv2/GPLv2 - make the LGPL->GPL conversion via spec file script, not a patch - now that we're building dynamic libraries, make libs and devel subpackages * Sun Sep 2 2007 Matthew Miller - 2.12.2-0.1 - update to 2.12.2 - yay -- patches to build dynamically are now upstream. so build dynamically. * Thu Jul 12 2007 Matthew Miller - 2.12.1.13-1 - Update to 2.12.1.13 - Remove calc-2.12.1.6_remove-bad-snprintf-replacement.patch, which is now now upstream. - Added calc-2.12.1.13-removemd5.patch due to licensing issues (md5 code is distributable, but not lgpl compatible). - Added switch to enable readline and convert to gpl, or to not. see comment in Feb 8 2007 changelog entry for more. * Thu Feb 8 2007 Matthew Miller - 2.12.1.8-2 - disable linking against readline to avoid converting from LGPL to GPL. This is insignificant for this release of the package which doesn't actually include any libraries, but is something I want to preserve for the future when we're building dynamic libs. I'm working with upstream in getting this resolved -- ideally, the library remains LGPL but the command-line tool is separated to the point where it alone links with readline and can be relicensed as GPL without affecting the rest. If the outcome isn't positive, I'm probably going to bite the bullet and make a GPL-fork patch. * Wed Feb 7 2007 Matthew Miller - 2.12.1.8-1 - update to 2.12.1.8 - invalid comments problem now fixed upstream -- drop that patch. - patching out custom completely isn't really necessary -- just unsetting the config variable and removing the built library is sufficient. - make sure to set the "DEBUG" variable correctly (not -O3 -g3) - actually use the system readline library - don't need to pass so many variables into make chk. - chmod executables to 755 instead of 555 to placate rpmlint * Tue Feb 6 2007 Matthew Miller - 2.12.1.6-3 - include fix for invalid sample files (# is not a comment character). * Mon Feb 5 2007 Matthew Miller - 2.12.1.6-2 - create Fedora package from existing BU Linux package (clearing BU Linux changelog). - add patch to use the system snprintf -- sheesh. - move the "cscript" stuff to be under datadir instead of bin. - list calc binary and man page explicitly in the files section.