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