summaryrefslogtreecommitdiff
path: root/perl-Math-Calc-Units.spec
blob: 104947e814d11e8e3e3a3c9a83cfe7c2ae796591 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
#
# Conditional build:
# _without_tests - do not perform "make test"
#
%include	/usr/lib/rpm/macros.perl
%define		pdir	Math
%define		pnam	Calc-Units
Summary:	Math::Calc::Units - Human-readable unit-aware calculator
Summary(pl):	Math::Calc::Units - kalkulator obsługujący jednostki
Name:		perl-Math-Calc-Units
Version:	1.02
Release:	2
License:	GPL v2 or Artistic
Group:		Development/Languages/Perl
Source0:	http://www.cpan.org/modules/by-module/%{pdir}/%{pdir}-%{pnam}-%{version}.tar.gz
# Source0-md5:	96051781e405492b2065b8113e5b5b9f
BuildRequires:	perl-devel >= 5.6
BuildRequires:	rpm-perlprov >= 4.1-13
BuildArch:	noarch
BuildRoot:	%{tmpdir}/%{name}-%{version}-root-%(id -u -n)

%description
Math::Calc::Units 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 ucalc script that prints out all
of the "readable" variants of a value. For example, "3 bytes" will
only produce "3 byte", but "3 byte / sec" produces the original along
with "180 byte / minute", "10.55 kilobyte / hour", etc.

%description -l pl
Math::Calc::Units to prosty kalkulator zachowujący jednostki.
Aktualnie obsługuje tylko kombinacje rozmiaru w bajtach i czasu, ale
dodanie dowolnych typów multiplikatywnych jest proste. Każdy nieznany
typ jest traktowany jako unikalny typ użytkownika (z próbą zamiany
angielskich form mnogich na pojedyncze).

Podstawowy sposób użycia to skrypt ucalc, wypisujący wszystkie
"czytelne" warianty wartości. Na przykład "3 bytes" daje tylko "3
byte", ale "3 byte / sec" daje wartość oryginalną oraz "180 byte /
minute", "10.55 kilobyte / hour" itd.

%prep
%setup -q -n %{pdir}-%{pnam}-%{version}

%build
%{__perl} Makefile.PL \
	INSTALLDIRS=vendor
%{__make}

%{!?_without_tests:%{__make} test}

%install
rm -rf $RPM_BUILD_ROOT

%{__make} install \
	DESTDIR=$RPM_BUILD_ROOT

%clean
rm -rf $RPM_BUILD_ROOT

%files
%defattr(644,root,root,755)
%doc Changes LICENSE README
%attr(755,root,root) %{_bindir}/*
%{perl_vendorlib}/Math/Calc/Units.pm
%{perl_vendorlib}/Math/Calc/Units
%{_mandir}/man3/*