1 %define doc_version 3.0
2 %define php_min_version 5.2.0
3 %include /usr/lib/rpm/macros.php
4 Summary: Template engine for PHP
5 Summary(pl.UTF-8): System szablonów dla PHP
10 Group: Development/Languages/PHP
11 Source0: http://www.smarty.net/files/%{name}-%{version}.tar.gz
12 # Source0-md5: f7483eaa36ec72337827060076296478
13 # Source1Download: http://www.smarty.net/documentation
14 Source1: http://www.smarty.net/files/docs/manual-en-%{doc_version}.zip
15 # Source1-md5: 8db376266f1313927cc8e112f2526e21
16 Source2: %{name}-function.html_input_image.php
18 Patch1: modifier.mb_truncate.patch
19 URL: http://www.smarty.net/
20 BuildRequires: rpm-php-pearprov >= 4.4.2-11
22 Requires: php-common >= 4:%{php_min_version}
25 Requires: php-tokenizer
27 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
29 %define appdir %{php_data_dir}/Smarty
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.
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.
48 Summary: Template engine for PHP - documentation
49 Summary(pl.UTF-8): System szablonów dla PHP - dokumentacja
50 Version: %{doc_version}
51 Group: Development/Languages/PHP
54 Documentation for Smarty template engine.
56 %description doc -l pl.UTF-8
57 Dokumentacja do systemu szablonów Smarty.
62 cp -a libs/plugins/modifier.{,mb_}truncate.php
66 rm -rf $RPM_BUILD_ROOT
67 install -d $RPM_BUILD_ROOT{%{appdir}/{plugins,sysplugins},%{php_pear_dir}}
69 cp -a libs/Smarty.class.php $RPM_BUILD_ROOT%{php_data_dir}
70 cp -a libs/debug.tpl $RPM_BUILD_ROOT%{appdir}
71 cp -a libs/plugins/*.php $RPM_BUILD_ROOT%{appdir}/plugins
72 cp -a libs/sysplugins/*.php $RPM_BUILD_ROOT%{appdir}/sysplugins
73 cp -a %{SOURCE2} $RPM_BUILD_ROOT%{appdir}/plugins/function.html_input_image.php
75 # backards compatible with pear dir
76 ln -s %{appdir} $RPM_BUILD_ROOT%{php_pear_dir}/%{name}
78 # backards compatible with entry point in subdir
79 ln -s ../Smarty.class.php $RPM_BUILD_ROOT%{appdir}
82 rm -rf $RPM_BUILD_ROOT
84 # make compat symlink, the symlink is discarded using %ghost on package uninstall
85 %triggerpostun -- Smarty < 2.6.10-4
86 if [ -d %{php_pear_dir}/%{name}/plugins ]; then
87 mv %{php_pear_dir}/%{name}/plugins/* %{appdir}/plugins
88 rmdir %{php_pear_dir}/%{name}/plugins 2>/dev/null
90 rmdir %{php_pear_dir}/%{name} 2>/dev/null || mv -v %{php_pear_dir}/%{name}{,.rpmsave}
91 ln -s %{appdir} %{php_pear_dir}/%{name}
94 [ -e %{php_pear_dir}/%{name} ] || ln -s %{appdir} %{php_pear_dir}/%{name}
97 %defattr(644,root,root,755)
98 %doc README SMARTY2_BC_NOTES
99 # entry point in include_path
100 %{php_data_dir}/Smarty.class.php
104 %dir %{appdir}/plugins
105 %dir %{appdir}/sysplugins
106 %{appdir}/Smarty.class.php
108 %{appdir}/plugins/*.php
109 %{appdir}/sysplugins/*.php
111 # for the sake of bc when installed to pear dir
112 %ghost %{php_pear_dir}/%{name}
115 %defattr(644,root,root,755)