]>
Commit | Line | Data |
---|---|---|
f86a03d8 SP |
1 | %define doc_version 2.6.14 |
2 | %define php_min_version 5.0.0 | |
8e2cfc78 | 3 | %include /usr/lib/rpm/macros.php |
0a03539f | 4 | Summary: Template engine for PHP |
554e6959 | 5 | Summary(pl.UTF-8): System szablonów dla PHP |
0a03539f | 6 | Name: Smarty |
1426c850 ER |
7 | Version: 2.6.27 |
8 | Release: 1 | |
7ebfab9b | 9 | License: LGPL v2.1+ |
0a03539f | 10 | Group: Development/Languages/PHP |
1426c850 ER |
11 | Source0: http://www.smarty.net/files/%{name}-%{version}.tar.gz |
12 | # Source0-md5: da7b37c8d4c2f35570b3a9710547b22d | |
f86a03d8 SP |
13 | # Source1Download: http://www.smarty.net/download-docs.php |
14 | Source1: http://www.smarty.net/distributions/manual/en/%{name}-%{doc_version}-docs.tar.gz | |
15 | # Source1-md5: 5123152dd248898a84b96b806f551e78 | |
ceb8190f | 16 | Source2: %{name}-function.html_input_image.php |
7ebfab9b | 17 | Patch0: path.patch |
0cfc86c6 | 18 | Patch1: modifier.mb_truncate.patch |
0b2b51c3 | 19 | URL: http://www.smarty.net/ |
45b3a75d | 20 | BuildRequires: rpm-php-pearprov >= 4.4.2-11 |
f722690c | 21 | Requires: php(core) >= %{php_min_version} |
1426c850 | 22 | Requires: php(date) |
a3f6cbf1 ER |
23 | Requires: php(pcre) |
24 | Requires: php(tokenizer) | |
0a03539f ŁJM |
25 | BuildArch: noarch |
26 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
0a03539f | 27 | |
45b3a75d | 28 | %define appdir %{php_data_dir}/Smarty |
88a9ca9a | 29 | |
0a03539f ŁJM |
30 | %description |
31 | Smarty is a template engine for PHP. Smarty provides your basic | |
32 | variable substitution and dynamic block functionality, and also takes | |
33 | a step further to be a "smart" template engine, adding features such | |
34 | as configuration files, template functions, variable modifiers, and | |
35 | making all of this functionality as easy as possible to use for both | |
36 | programmers and template designers. | |
37 | ||
b2a044db JR |
38 | %description -l pl.UTF-8 |
39 | Smarty jest systemem szablonów dla PHP. Pozwala na podstawowe | |
40 | podstawianie wartości zmiennych oraz dynamiczne operacje na blokach; | |
41 | idzie o krok dalej, aby być "mądrym" silnikiem szablonów, dodając | |
42 | takie możliwości jak pliki konfiguracyjne, funkcje, zmienne | |
43 | modyfikatory oraz czyniąc całą funkcjonalność jak najłatwiejszą w | |
44 | użyciu jednocześnie dla programistów i projektantów szablonów. | |
0a03539f | 45 | |
39e0217d | 46 | %package doc |
0a03539f | 47 | Summary: Template engine for PHP - documentation |
554e6959 | 48 | Summary(pl.UTF-8): System szablonów dla PHP - dokumentacja |
c8ccde9a | 49 | Version: %{doc_version} |
0a03539f ŁJM |
50 | Group: Development/Languages/PHP |
51 | ||
39e0217d | 52 | %description doc |
0a03539f ŁJM |
53 | Documentation for Smarty template engine. |
54 | ||
b2a044db JR |
55 | %description doc -l pl.UTF-8 |
56 | Dokumentacja do systemu szablonów Smarty. | |
0a03539f ŁJM |
57 | |
58 | %prep | |
45b3a75d | 59 | %setup -q -a1 |
7ebfab9b | 60 | %patch0 -p1 |
0cfc86c6 | 61 | cp -a libs/plugins/modifier.{,mb_}truncate.php |
f86a03d8 | 62 | %patch1 -p1 |
0a03539f ŁJM |
63 | |
64 | %install | |
65 | rm -rf $RPM_BUILD_ROOT | |
f86a03d8 | 66 | install -d $RPM_BUILD_ROOT{%{appdir}/{internals,plugins},%{php_pear_dir}} |
88a9ca9a | 67 | |
7ebfab9b | 68 | cp -a libs/Smarty.class.php $RPM_BUILD_ROOT%{php_data_dir} |
f86a03d8 | 69 | cp -a libs/{Config_File,Smarty_Compiler}.class.php $RPM_BUILD_ROOT%{appdir} |
45b3a75d | 70 | cp -a libs/debug.tpl $RPM_BUILD_ROOT%{appdir} |
f86a03d8 | 71 | cp -a libs/internals/*.php $RPM_BUILD_ROOT%{appdir}/internals |
45b3a75d ER |
72 | cp -a libs/plugins/*.php $RPM_BUILD_ROOT%{appdir}/plugins |
73 | cp -a %{SOURCE2} $RPM_BUILD_ROOT%{appdir}/plugins/function.html_input_image.php | |
0a03539f | 74 | |
7ebfab9b | 75 | # backards compatible with pear dir |
45b3a75d | 76 | ln -s %{appdir} $RPM_BUILD_ROOT%{php_pear_dir}/%{name} |
0a03539f | 77 | |
7ebfab9b ER |
78 | # backards compatible with entry point in subdir |
79 | ln -s ../Smarty.class.php $RPM_BUILD_ROOT%{appdir} | |
80 | ||
0a03539f ŁJM |
81 | %clean |
82 | rm -rf $RPM_BUILD_ROOT | |
83 | ||
88a9ca9a | 84 | # make compat symlink, the symlink is discarded using %ghost on package uninstall |
3e1a4945 | 85 | %triggerpostun -- Smarty < 2.6.10-4 |
88a9ca9a | 86 | if [ -d %{php_pear_dir}/%{name}/plugins ]; then |
45b3a75d | 87 | mv %{php_pear_dir}/%{name}/plugins/* %{appdir}/plugins |
88a9ca9a ER |
88 | rmdir %{php_pear_dir}/%{name}/plugins 2>/dev/null |
89 | fi | |
90 | rmdir %{php_pear_dir}/%{name} 2>/dev/null || mv -v %{php_pear_dir}/%{name}{,.rpmsave} | |
45b3a75d | 91 | ln -s %{appdir} %{php_pear_dir}/%{name} |
88a9ca9a | 92 | |
63fec699 | 93 | %post |
45b3a75d | 94 | [ -e %{php_pear_dir}/%{name} ] || ln -s %{appdir} %{php_pear_dir}/%{name} |
63fec699 | 95 | |
0a03539f ŁJM |
96 | %files |
97 | %defattr(644,root,root,755) | |
f86a03d8 | 98 | %doc BUGS ChangeLog FAQ INSTALL NEWS README RELEASE_NOTES TODO |
7ebfab9b ER |
99 | # entry point in include_path |
100 | %{php_data_dir}/Smarty.class.php | |
101 | ||
102 | # app itself | |
45b3a75d | 103 | %dir %{appdir} |
f86a03d8 | 104 | %dir %{appdir}/internals |
45b3a75d | 105 | %dir %{appdir}/plugins |
45b3a75d | 106 | %{appdir}/Smarty.class.php |
f86a03d8 SP |
107 | %{appdir}/Config_File.class.php |
108 | %{appdir}/Smarty_Compiler.class.php | |
45b3a75d | 109 | %{appdir}/debug.tpl |
f86a03d8 | 110 | %{appdir}/internals/*.php |
45b3a75d ER |
111 | %{appdir}/plugins/*.php |
112 | ||
113 | # for the sake of bc when installed to pear dir | |
88a9ca9a | 114 | %ghost %{php_pear_dir}/%{name} |
0a03539f | 115 | |
39e0217d | 116 | %files doc |
0a03539f | 117 | %defattr(644,root,root,755) |
f86a03d8 | 118 | %doc manual/* |