]>
Commit | Line | Data |
---|---|---|
72ff36db PG |
1 | %include /usr/lib/rpm/macros.php |
2 | %define _class HTML | |
3 | %define _subclass Template | |
aa70ea67 | 4 | %define _status stable |
72ff36db | 5 | %define _pearname %{_class}_%{_subclass}_Flexy |
d2cc4436 | 6 | Summary: %{_pearname} - a flexible caching template engine based on SimpleTemplate |
3728ec2f | 7 | Summary(pl.UTF-8): %{_pearname} - elastyczny buforujący silnik szablonów oparty na SimpleTemplate |
72ff36db | 8 | Name: php-pear-%{_pearname} |
64b88781 | 9 | Version: 1.3.10 |
be928e96 | 10 | Release: 2 |
72ff36db PG |
11 | License: PHP 2.02 |
12 | Group: Development/Languages/PHP | |
13 | Source0: http://pear.php.net/get/%{_pearname}-%{version}.tgz | |
64b88781 | 14 | # Source0-md5: 5bbc01bcfabbdeeeb79aeffc448be06e |
d51222b0 | 15 | Patch0: %{name}-case_fix.patch |
91ebd2ba | 16 | Patch1: %{name}-path_fix.patch |
9f24944a | 17 | Patch2: %{name}-no_gtk.patch |
ae9f522f | 18 | URL: http://pear.php.net/package/HTML_Template_Flexy/ |
57aaf9c0 | 19 | BuildRequires: php-pear-PEAR |
ceba87b1 | 20 | BuildRequires: rpm-php-pearprov >= 4.4.2-11 |
bf6498e5 | 21 | BuildRequires: rpmbuild(macros) >= 1.300 |
b97a0cc9 | 22 | Requires: php-common >= 3:4.3 |
72ff36db | 23 | Requires: php-pear |
be928e96 ER |
24 | Suggests: php-pear-File_Gettext |
25 | Suggests: php-pear-HTML_Javascript | |
26 | Suggests: php-pear-Translation2 | |
72ff36db PG |
27 | BuildArch: noarch |
28 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
29 | ||
ceba87b1 | 30 | # exclude optional dependencies |
8959c07f | 31 | %define _noautoreq 'pear(HTML/Javascript.*)' 'pear(File/Gettext.*)' 'pear(Translation2.*)' 'pear(Services/JSON.php)' |
ceba87b1 | 32 | |
72ff36db | 33 | %description |
e2e95832 | 34 | HTML_Template_Flexy started its life as a simplification of |
022e35a7 JB |
35 | HTML_Template_Xipe, however in version 0.2, it became one of the first |
36 | template engine to use a real Lexer, rather than regexes, making it | |
37 | possible to do things like ASP.net or Cold Fusion tags. However, it | |
38 | still has a very simple set of goals. | |
312dc2b8 | 39 | - Very Simple API, |
64b88781 ER |
40 | - easy to learn... |
41 | - prevents to much logic going in templates | |
022e35a7 | 42 | - Easy to write documentable code |
64b88781 ER |
43 | - By using object vars for a template rather than 'assign', you can |
44 | use PHPDoc comments to list what variable you use. | |
312dc2b8 | 45 | - Editable in WYSIWYG editors |
64b88781 ER |
46 | - you can create full featured templates, that don't get broken every |
47 | time you edit with Dreamweaver(tm) or Mozilla editor | |
48 | - Uses namespaced attributes to add looping/conditionals | |
022e35a7 | 49 | - Extremely Fast |
64b88781 ER |
50 | - runtime is at least 4 time smaller than most other template engines |
51 | (eg. Smarty) | |
52 | - uses compiled templates, as a result it is many times faster on | |
53 | blocks and loops than than Regex templates (eg. IT/phplib) | |
e85a85ed | 54 | - Safer (for cross-site scripting attacks) |
64b88781 ER |
55 | - All variables default to be output as HTML escaped (overridden with |
56 | the :h modifier) | |
312dc2b8 | 57 | - Multilanguage support |
64b88781 ER |
58 | - Parses strings out of template, so you can build translation tools |
59 | - Compiles language specific templates (so translation is only done | |
60 | once, not on every request) | |
022e35a7 | 61 | - Full dynamic element support (like ASP.NET), so you can pick |
64b88781 | 62 | elements to replace at runtime |
312dc2b8 | 63 | |
022e35a7 | 64 | The long term plan for Flexy is to be integrated as a backend for the |
e2e95832 | 65 | Future Template Package (A BC wrapper will be made available - as the |
e85a85ed | 66 | author needs to use it too). |
72ff36db | 67 | |
062dc3ce | 68 | In PEAR status of this package is: %{_status}. |
4915c12c | 69 | |
4d155650 JR |
70 | %description -l pl.UTF-8 |
71 | HTML_Template_Flexy początkowo był uproszczeniem HTML_Template_Xipe, | |
72 | jednak od wersji 0.2 stał się jednym z pierwszych silników szablonów | |
73 | używających prawdziwego analizatora leksykalnego zamiast wyrażeń | |
74 | regularnych, co umożliwia robienie rzeczy w stylu ASP.net czy | |
75 | znaczników Cold Fusion. Jednak nadal ma bardzo prosty zbiór | |
76 | zastosowań. Cechy silnika: | |
77 | - bardzo proste API - łatwe do nauczenia, zapobiega umieszczaniu zbyt | |
78 | dużej ilości logiki w szablonach | |
79 | - łatwe pisanie dokumentowalnego kodu - poprzez użycie zmiennych | |
64b88781 ER |
80 | obiektowych dla szablonu zamiast przypisywania można używać komentarzy |
81 | phpDoc do wypisywania używanych zmiennych | |
4d155650 JR |
82 | - edytowalny w edytorach WYSIWYG - można tworzyć w pełni funkcjonalne |
83 | szablony, które nie psują się po każdym użyciu Dreamweavera(tm) czy | |
64b88781 ER |
84 | edytora Mozilli; przy dodawaniu pętli i warunków używane są atrybuty z |
85 | przestrzeniami nazw | |
e85a85ed | 86 | - ekstremalnie szybki - kod uruchomieniowy jest przynajmniej 4 razy |
4d155650 JR |
87 | mniejszy niż większość innych silników szablonów (np. Smarty); używa |
88 | skompilowanych szablonów, dzięki czemu jest wiele razy szybszy na | |
64b88781 ER |
89 | blokach i pętlach niż szablony oparte na wyrażeniach regularnych (np. |
90 | IT/phplib) | |
4d155650 JR |
91 | - bezpieczniejszy (pod kątem ataków cross-site scripting) - wszystkie |
92 | zmienne domyślnie są wypisywane z użyciem sekwencji kontrolnych HTML | |
93 | (można to zmienić modyfikatorem :h) | |
94 | - wspiera wielojęzyczność - przetwarza łańcuchy z szablonu, co pozwala | |
95 | na zbudowanie narzędzi do tłumaczenia; kompiluje specyficzne dla | |
96 | języka szablony, dzięki czemu tłumaczenie jest robione tylko raz, a | |
97 | nie przy każdym żądaniu | |
98 | - w pełni obsługuje dynamiczne elementy (jak ASP.NET), dzięki czemu | |
99 | można pobierać elementy do zastąpienia w czasie działania. | |
100 | ||
101 | Długoterminowym planem rozwoju Flexy jest zintegrowanie jako backend | |
102 | dla Future Template Package (dostępny będzie wrapper BC, jako że autor | |
103 | też musi tego używać). | |
7c703af3 | 104 | |
4915c12c PG |
105 | Ta klasa ma w PEAR status: %{_status}. |
106 | ||
ceba87b1 ER |
107 | %package tests |
108 | Summary: Tests for PEAR::%{_pearname} | |
3728ec2f | 109 | Summary(pl.UTF-8): Testy dla PEAR::%{_pearname} |
aa47ae47 | 110 | Group: Development/Languages/PHP |
be928e96 | 111 | Requires: %{name} = %{version}-%{release} |
6cfd118f | 112 | AutoProv: no |
64b88781 | 113 | AutoReq: no |
ceba87b1 ER |
114 | |
115 | %description tests | |
116 | Tests for PEAR::%{_pearname}. | |
117 | ||
4d155650 | 118 | %description tests -l pl.UTF-8 |
ceba87b1 ER |
119 | Testy dla PEAR::%{_pearname}. |
120 | ||
72ff36db | 121 | %prep |
ceba87b1 | 122 | %pear_package_setup |
ceba87b1 | 123 | cd ./%{php_pear_dir}/%{_class}/%{_subclass} |
d51222b0 | 124 | %patch0 -p1 |
91ebd2ba | 125 | %patch1 -p1 |
9f24944a | 126 | %patch2 -p6 |
64b88781 ER |
127 | cd - |
128 | ||
129 | mv .%{php_pear_dir}/data/HTML_Template_Flexy/TODO . | |
130 | mv .%{php_pear_dir}/data/HTML_Template_Flexy/ChangeLog . | |
72ff36db PG |
131 | |
132 | %install | |
133 | rm -rf $RPM_BUILD_ROOT | |
ceba87b1 ER |
134 | install -d $RPM_BUILD_ROOT%{php_pear_dir} |
135 | %pear_package_install | |
72ff36db | 136 | |
64b88781 | 137 | |
72ff36db PG |
138 | %clean |
139 | rm -rf $RPM_BUILD_ROOT | |
140 | ||
ceba87b1 ER |
141 | %post |
142 | if [ -f %{_docdir}/%{name}-%{version}/optional-packages.txt ]; then | |
143 | cat %{_docdir}/%{name}-%{version}/optional-packages.txt | |
144 | fi | |
145 | ||
72ff36db PG |
146 | %files |
147 | %defattr(644,root,root,755) | |
ceba87b1 | 148 | %doc install.log optional-packages.txt |
64b88781 | 149 | %doc TODO ChangeLog |
ceba87b1 | 150 | %{php_pear_dir}/.registry/*.reg |
312dc2b8 AG |
151 | %{php_pear_dir}/%{_class}/%{_subclass}/Flexy |
152 | %{php_pear_dir}/%{_class}/%{_subclass}/Flexy.php | |
ceba87b1 | 153 | |
64b88781 ER |
154 | %{php_pear_dir}/data/%{_pearname} |
155 | ||
ceba87b1 ER |
156 | %files tests |
157 | %defattr(644,root,root,755) | |
158 | %{php_pear_dir}/tests/* |