# # Conditional build: %bcond_without tests # do not perform "make test" # %define pdir Math %define pnam Fractal-Curve Summary: Math::Fractal::Curve - generate fractal curves Summary(pl.UTF-8): Math::Fractal::Curve - generowanie krzywych fraktalnych Name: perl-Math-Fractal-Curve Version: 1.03 Release: 1 # same as perl License: GPL v1+ or Artistic Group: Development/Languages/Perl Source0: http://www.cpan.org/modules/by-module/Math/%{pdir}-%{pnam}-%{version}.tar.gz # Source0-md5: 083a95b926fc0c8fd156300df11ef3e5 URL: http://search.cpan.org/dist/Math-Fractal-Curve/ %if %{with tests} BuildRequires: perl(Test::More) %endif BuildRequires: perl-devel >= 1:5.8.0 BuildRequires: rpm-perlprov >= 4.1-13 BuildArch: noarch BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) %description This module is intended to generate 2-dimensional fractal curves such as the von Koch curve from simple generator functions. The fractals are generated by recursively replacing a distance with the generator. Hence, the starting distance and the generator define such a fractal curve. Generators describe what a given distance is going to be replaced with in terms of lengths of the distance. For example, a generator of ([0, 0, 1/3, 0], [2/3, 0, 1, 0]) describes a Mid-third Cantor Set which means the the middle third of every distance in the set is deleted. Syntax for generator data structures in the context of this module is [[x1, y1, x2, y2], [X1, Y1, X2, Y2]] (array ref of array refs of edge coordinates) where xn,yn are the two coordinate pairs specifying the first edge a distance is to be replaced with and Xn,Yn are the second edge. There may be any number of edges. %description -l pl.UTF-8 Ten moduł służy do generowania 2-wymiarowych krzywych fraktalnych takich jak krzywa von Kocha z prostszych funkcji generujących. Fraktale są generowane przez rekurencyjne zastępowanie odcinka generatorem. W ten sposób początkowy odcinek i generator definiują taką krzywą fraktalną. Generatory opisują, czym zostanie zastąpiony dany odcinek w zależności od długości odcinka. Na przykład generator ([0, 0, 1/3, 0], [2/3, 0, 1, 0]) opisuje zbiór Kantora (ze środkową trzecią częścią) i oznacza, że środkowa trzecia część każdego odcinka ze zbioru jest usuwana. Składnia struktur danych generatora w kontekście tego modułu to [[x1, y1, x2, y2], [X1, Y1, X2, Y2]] (referencja do tablicy referencji do współrzędnych końca), gdzie xn,yn to pary współrzędnych określających pierwszy koniec odcinka do zastąpienia, a Xn,Yn to drugi koniec. Może być dowolna liczba końców. %prep %setup -q -n %{pdir}-%{pnam}-%{version} %build %{__perl} Makefile.PL \ INSTALLDIRS=vendor %{__make} %{?with_tests:%{__make} test} %install rm -rf $RPM_BUILD_ROOT install -d $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version} %{__make} install \ DESTDIR=$RPM_BUILD_ROOT install examples/*.pl $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version} %clean rm -rf $RPM_BUILD_ROOT %files %defattr(644,root,root,755) %doc Changes README %{perl_vendorlib}/Math/Fractal/Curve.pm %{_mandir}/man3/* %{_examplesdir}/%{name}-%{version}