Summary: %{_pearname} - a flexible caching template engine based on SimpleTemplate
Summary(pl): %{_pearname} - elastyczny buforuj±cy silnik szablonów oparty na SimpleTemplate
Name: php-pear-%{_pearname}
-Version: 1.1.1
+Version: 1.2.4
Release: 1
+Epoch: 0
License: PHP 2.02
Group: Development/Languages/PHP
Source0: http://pear.php.net/get/%{_pearname}-%{version}.tgz
-# Source0-md5: 325a6993dd88c2fc99badf2170043e53
+# Source0-md5: 093e8a45095db78a9fc36f4ff1ed64d7
Patch0: %{name}-case_fix.patch
Patch1: %{name}-path_fix.patch
URL: http://pear.php.net/package/HTML_Template_Flexy/
-BuildRequires: rpm-php-pearprov >= 4.0.2-98
+BuildRequires: php-pear-PEAR
+BuildRequires: rpm-php-pearprov >= 4.4.2-11
+BuildRequires: rpmbuild(macros) >= 1.300
+Requires: php-common >= 3:4.3
Requires: php-pear
BuildArch: noarch
BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
+# exclude optional dependencies
+%define _noautoreq 'pear(HTML/Javascript.*)' 'pear(File/Gettext.*)' 'pear(Translation2.*)'
+
%description
-HTML_Template_Flexy started it's life as a simplification of HTML_Template_Xipe,
-however in Version 0.2, It became one of the first template engine to use a real Lexer,
-rather than regex'es, making it possible to do things like ASP.net or Cold Fusion tags.
-However, it still has a very simple set of goals.
+HTML_Template_Flexy started its life as a simplification of
+HTML_Template_Xipe, however in version 0.2, it became one of the first
+template engine to use a real Lexer, rather than regexes, making it
+possible to do things like ASP.net or Cold Fusion tags. However, it
+still has a very simple set of goals.
- Very Simple API,
- easy to learn...
- prevents to much logic going in templates
-- Easy to write document'able code
- - By using object vars for a template rather than 'assign', you
- can use PHPDoc comments to list what variable you use.
+- Easy to write documentable code
+ - By using object vars for a template rather than 'assign',
+ you can use PHPDoc comments to list what variable you use.
- Editable in WYSIWYG editors
- - you can create full featured templates, that doesnt get broken every time you edit with
- Dreamweaver(tm) or Mozzila editor
+ - you can create full featured templates, that don't get
+ broken every time you edit with Dreamweaver(tm) or Mozilla
+ editor
- Uses namespaced attributes to add looping/conditionals
-- Extremely Fast,
- - runtime is at least 4 time smaller than most other template engines (eg. Smarty)
- - uses compiled templates, as a result it is many times faster on blocks and loops than
- than Regex templates (eg. IT/phplib)
-- Safer (for cross site scripting attacks)
- - All variables default to be output as HTML escaped (overridden with the :h modifier)
+- Extremely Fast
+ - runtime is at least 4 time smaller than most other template
+ engines (eg. Smarty)
+ - uses compiled templates, as a result it is many times faster
+ on blocks and loops than than Regex templates (eg.
+ IT/phplib)
+- Safer (for cross-site scripting attacks)
+ - All variables default to be output as HTML escaped
+ (overridden with the :h modifier)
- Multilanguage support
- - Parses strings out of template, so you can build translation tools
- - Compiles language specific templates (so translation is only done once, not on every request)
-- Full dynamic element support (like ASP.NET), so you can pick elements to replace at runtime
-
-Features:
-- {variable} to echo $object->variable
-- {method()} to echo $object->method();
-- {foreach:var,key,value} to PHP foreach loops
-- tag attributes FLEXY:FOREACH, FLEXY:IF for looping and conditional HTML inclusion
-- {if:variable} to PHP If statement
-- {if:method()} to PHP If statement
-- {else:} and {end:} to close or alternate If statements
-- FORM to HTML_Template_Flexy_Element's
-- replacement of INPUT, TEXTAREA and SELECT tags with HTML_Template_Flexy_Element code
- use FLEXY:IGNORE (inherited) and FLEXY:IGNOREONLY (single) to prevent replacements
-- FLEXY:START/FLEXY:STARTCHILDREN tags to define where template starts/finishes
-- support for urlencoded braces {} in HTML attributes.
-- documentation in the pear manual
-
-- examples at http://cvs.php.net/cvs.php/pear/HTML_Template_Flexy/tests/
-
-The long term plan for Flexy is to be integrated as a backend for the Future
-Template Package (A BC wrapper will be made available - as I need to use it
-too!)
+ - Parses strings out of template, so you can build translation
+ tools
+ - Compiles language specific templates (so translation is only
+ done once, not on every request)
+- Full dynamic element support (like ASP.NET), so you can pick
+ elements to replace at runtime
+
+The long term plan for Flexy is to be integrated as a backend for the
+Future Template Package (A BC wrapper will be made available - as the
+author needs to use it too).
In PEAR status of this package is: %{_status}.
%description -l pl
-Flexy Template to silnik szablonów do konwertera kodu PHP, oparty na
-Simple Template i podobny do Smarty. Powinien byæ bardzo szybki, jest
-³atwy w rozszerzaniu, rozwijaniu i u¿ywaniu dowolnej sk³adni
-szablonów. Domy¶lny filtr (SimpleTags) zawiera: zmienne, pêtle
-foreach, warunki, wywo³ania metod, w³±czanie kodu, obs³uguje znaczniki
-zakodowane w URL-ach - wiêc mo¿e modyfikowaæ szablony w Mozilli itp.
-Inne filtry to:
-- RtfSimpletags - do tworzenia dokumentów RTF dla Worda,
-- BodyOnly - wycinaj±cy nag³ówek i stopkê z szablonu,
-- Php - wycinaj±cy kod PHP z szablonu,
-- Email - do przetwarzania szablonów e-mail.
+HTML_Template_Flexy pocz±tkowo by³ uproszczeniem HTML_Template_Xipe,
+jednak od wersji 0.2 sta³ siê jednym z pierwszych silników szablonów
+u¿ywaj±cych prawdziwego analizatora leksykalnego zamiast wyra¿eñ
+regularnych, co umo¿liwia robienie rzeczy w stylu ASP.net czy
+znaczników Cold Fusion. Jednak nadal ma bardzo prosty zbiór
+zastosowañ. Cechy silnika:
+- bardzo proste API - ³atwe do nauczenia, zapobiega umieszczaniu zbyt
+ du¿ej ilo¶ci logiki w szablonach
+- ³atwe pisanie dokumentowalnego kodu - poprzez u¿ycie zmiennych
+ obiektowych dla szablonu zamiast przypisywania mo¿na u¿ywaæ
+ komentarzy phpDoc do wypisywania u¿ywanych zmiennych
+- edytowalny w edytorach WYSIWYG - mo¿na tworzyæ w pe³ni funkcjonalne
+ szablony, które nie psuj± siê po ka¿dym u¿yciu Dreamweavera(tm) czy
+ edytora Mozilli; przy dodawaniu pêtli i warunków u¿ywane s± atrybuty
+ z przestrzeniami nazw
+- ekstremalnie szybki - kod uruchomieniowy jest przynajmniej 4 razy
+ mniejszy ni¿ wiêkszo¶æ innych silników szablonów (np. Smarty); u¿ywa
+ skompilowanych szablonów, dziêki czemu jest wiele razy szybszy na
+ blokach i pêtlach ni¿ szablony oparte na wyra¿eniach regularnych
+ (np. IT/phplib)
+- bezpieczniejszy (pod k±tem ataków cross-site scripting) - wszystkie
+ zmienne domy¶lnie s± wypisywane z u¿yciem sekwencji kontrolnych HTML
+ (mo¿na to zmieniæ modyfikatorem :h)
+- wspiera wielojêzyczno¶æ - przetwarza ³añcuchy z szablonu, co pozwala
+ na zbudowanie narzêdzi do t³umaczenia; kompiluje specyficzne dla
+ jêzyka szablony, dziêki czemu t³umaczenie jest robione tylko raz, a
+ nie przy ka¿dym ¿±daniu
+- w pe³ni obs³uguje dynamiczne elementy (jak ASP.NET), dziêki czemu
+ mo¿na pobieraæ elementy do zast±pienia w czasie dzia³ania.
+
+D³ugoterminowym planem rozwoju Flexy jest zintegrowanie jako backend
+dla Future Template Package (dostêpny bêdzie wrapper BC, jako ¿e autor
+te¿ musi tego u¿ywaæ).
Ta klasa ma w PEAR status: %{_status}.
+%package tests
+Summary: Tests for PEAR::%{_pearname}
+Summary(pl): Testy dla PEAR::%{_pearname}
+Group: Development/Languages/PHP
+Requires: %{name} = %{epoch}:%{version}-%{release}
+AutoReq: no
+AutoProv: no
+
+%description tests
+Tests for PEAR::%{_pearname}.
+
+%description tests -l pl
+Testy dla PEAR::%{_pearname}.
+
%prep
-%setup -q -c
-cd %{_pearname}-%{version}
+%pear_package_setup
+install -d docs/%{_pearname}
+mv ./%{php_pear_dir}/%{_class}/%{_subclass}/Flexy/example.ini docs/%{_pearname}
+cd ./%{php_pear_dir}/%{_class}/%{_subclass}
%patch0 -p1
%patch1 -p1
%install
rm -rf $RPM_BUILD_ROOT
-install -d $RPM_BUILD_ROOT%{php_pear_dir}/%{_class}/%{_subclass}/Flexy/{Compiler/{Flexy,Standard,Regex},Token}
-
-install %{_pearname}-%{version}/*.php $RPM_BUILD_ROOT%{php_pear_dir}/%{_class}/%{_subclass}
-install %{_pearname}-%{version}/Flexy/*.php $RPM_BUILD_ROOT%{php_pear_dir}/%{_class}/%{_subclass}/Flexy
-install %{_pearname}-%{version}/Flexy/Compiler/*.php $RPM_BUILD_ROOT%{php_pear_dir}/%{_class}/%{_subclass}/Flexy/Compiler
-install %{_pearname}-%{version}/Flexy/Compiler/Flexy/*.php $RPM_BUILD_ROOT%{php_pear_dir}/%{_class}/%{_subclass}/Flexy/Compiler/Flexy
-install %{_pearname}-%{version}/Flexy/Compiler/Standard/*.php $RPM_BUILD_ROOT%{php_pear_dir}/%{_class}/%{_subclass}/Flexy/Compiler/Standard
-install %{_pearname}-%{version}/Flexy/Compiler/Regex/*.php $RPM_BUILD_ROOT%{php_pear_dir}/%{_class}/%{_subclass}/Flexy/Compiler/Regex
-install %{_pearname}-%{version}/Flexy/Token/*.php $RPM_BUILD_ROOT%{php_pear_dir}/%{_class}/%{_subclass}/Flexy/Token
+install -d $RPM_BUILD_ROOT%{php_pear_dir}
+%pear_package_install
%clean
rm -rf $RPM_BUILD_ROOT
+%post
+if [ -f %{_docdir}/%{name}-%{version}/optional-packages.txt ]; then
+ cat %{_docdir}/%{name}-%{version}/optional-packages.txt
+fi
+
%files
%defattr(644,root,root,755)
-%doc %{_pearname}-%{version}/{Flexy/example.ini,tests}
+%doc install.log optional-packages.txt
+%doc docs/%{_pearname}/example.ini
+%{php_pear_dir}/.registry/*.reg
%{php_pear_dir}/%{_class}/%{_subclass}/Flexy
%{php_pear_dir}/%{_class}/%{_subclass}/Flexy.php
+
+%files tests
+%defattr(644,root,root,755)
+%{php_pear_dir}/tests/*