name: perl-Math-Calc-Units summary: Math-Calc-Units - Human-readable unit-aware calculator version: 1.06 release: 1 license: GPL or Artistic group: Development/Libraries URL: http://search.cpan.org/dist/Math-Calc-Units buildroot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) buildarch: noarch buildrequires: perl(ExtUtils::MakeMaker) source: Math-Calc-Units-1.06.tar.gz %description C is a simple calculator that keeps track of units. It currently handles combinations of byte sizes and duration only, although adding any other multiplicative types is easy. Any unknown type is treated as a unique user type (with some effort to map English plurals to their singular forms). The primary intended use is via the C script that prints out all of the "readable" variants of a value. For example, C<"3 bytes"> will only produce C<"3 byte">, but C<"3 byte / sec"> produces the original along with C<"180 byte / minute">, C<"10.55 kilobyte / hour">, etc. The C interface only provides for string-based computations, which could result in a large loss of precision for some applications. If you need the exact result, you may pass in an extra parameter C<'exact'> to C or C, causing them to return a 2-element list containing the numerical result and a string describing the units of that result: my ($value, $units) = convert("10MB/sec", "GB/day"); (In scalar context, they just return the numeric value.) %prep %setup -q -n Math-Calc-Units-%{version} %build %{__perl} Makefile.PL INSTALLDIRS=vendor make %{?_smp_mflags} %install rm -rf $RPM_BUILD_ROOT make pure_install PERL_INSTALL_ROOT=$RPM_BUILD_ROOT find $RPM_BUILD_ROOT -type f -name .packlist -exec rm -f {} ';' find $RPM_BUILD_ROOT -depth -type d -exec rmdir {} 2>/dev/null ';' chmod -R u+w $RPM_BUILD_ROOT/* %check make test %clean rm -rf $RPM_BUILD_ROOT %files %defattr(-,root,root) %doc Changes README Artistic.html COPYING LICENSE %{perl_vendorlib}/* %{_bindir}/ucalc %{_mandir}/man?/* %changelog * Fri Sep 19 2008 amorsen@terpsichore.ipvision.dk - Initial build.