File perl-Algorithm-Step.spec of Package perl-Algorithm-Step
#
# spec file for package perl-Algorithm-Step
#
# Copyright (c) 2016 SUSE LINUX 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/
#
Name: perl-Algorithm-Step
Version: 0.02
Release: 0
%define cpan_name Algorithm-Step
Summary: Trace execution steps of an algorithm
License: Artistic-1.0 or GPL-1.0+
Group: Development/Libraries/Perl
Url: http://search.cpan.org/dist/Algorithm-Step/
Source0: http://www.cpan.org/authors/id/L/LI/LITCHIE/%{cpan_name}-%{version}.tar.gz
BuildArch: noarch
BuildRoot: %{_tmppath}/%{name}-%{version}-build
BuildRequires: perl
BuildRequires: perl-macros
BuildRequires: perl(Module::Build)
%{perl_requires}
%description
This is for observing the behavior of algorithms on some algorithm
textbooks, such as `The Art of Computer Programming', `Introduction to
Algorithms'. I write it only for fun. I have been thinking of how to embed
documents in program in a helpful way.
The usage is well demonstrated by the example above.
* *algorithm*
Begins an algorithm. It takes two arguments. The first one is the name of
this algorithm, the second one is the short description.
* *end_algorithm*
Ends an algorithm.
* *step*
Increase count on this step by 1. It can be nested. A step can be divided
into sub steps, like:
step 1, "desc";
step 1,1, "desc";
step 1,2, "desc";
step 2, "desc";
* *statistics*
Print the execution information. If no argument is give, print to stdout.
If a filename is given, print to that file.
statistics("prime.stat");
The output looks like:
STATISTICS
Algorithm P: Print table of 500 primes
STEP 1. Start table, PRIME[1] <- 2, PRIME[2] <- 3 .... [1]
STEP 2. Advance n by 2 ............................... [1784]
STEP 3. k <- 1 ....................................... [1784]
STEP 4. Increase k ................................... [9538]
STEP 5. Divide n by PRIME[k] ......................... [9538]
STEP 6. Remainder zero? .............................. [9538]
STEP 7. PRIME[k] large? .............................. [8252]
STEP 8. n is prime ................................... [498]
STEP 9. Print result ................................. [1]
%prep
%setup -q -n %{cpan_name}-%{version}
%build
%{__perl} Build.PL installdirs=vendor
./Build build flags=%{?_smp_mflags}
%check
./Build test
%install
./Build install destdir=%{buildroot} create_packlist=0
%perl_gen_filelist
%files -f %{name}.files
%defattr(-,root,root,755)
%doc README
%changelog