3 %bcond_with bc # build BC wrapper as default Smarty class
5 %define main_version 3.1.31
6 %define doc_version 3.1.14
8 %define php_min_version 5.2.0
9 Summary: Template engine for PHP
10 Summary(pl.UTF-8): System szablonów dla PHP
12 Version: %{main_version}
13 Release: %{rel}%{?with_bc:BC}
15 Group: Development/Languages/PHP
16 Source0: https://github.com/smarty-php/smarty/archive/v%{version}/smarty-%{version}.tar.gz
17 # Source0-md5: d13b9e826ea51d80ad65124c6ab4045a
18 # Source1Download: http://www.smarty.net/documentation
19 Source1: http://www.smarty.net/files/docs/manual-en.%{doc_version}.zip
20 # Source1-md5: f54b1dd458776e4b1ccfdbfbfda1f484
22 URL: http://www.smarty.net/
23 BuildRequires: rpm-php-pearprov >= 4.4.2-11
24 BuildRequires: rpmbuild(macros) >= 1.553
26 Requires: php(core) >= %{php_min_version}
28 Requires: php(mbstring)
30 Requires: php(tokenizer)
32 Provides: Smarty = %{version}
33 Obsoletes: Smarty < 3.0
36 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
38 %define appdir %{php_data_dir}/Smarty3
41 Smarty is a template engine for PHP. Smarty provides your basic
42 variable substitution and dynamic block functionality, and also takes
43 a step further to be a "smart" template engine, adding features such
44 as configuration files, template functions, variable modifiers, and
45 making all of this functionality as easy as possible to use for both
46 programmers and template designers.
48 %{?with_bc:This package is modified to have SmartyBC class as Smarty
51 %description -l pl.UTF-8
52 Smarty jest systemem szablonów dla PHP. Pozwala na podstawowe
53 podstawianie wartości zmiennych oraz dynamiczne operacje na blokach;
54 idzie o krok dalej, aby być "mądrym" silnikiem szablonów, dodając
55 takie możliwości jak pliki konfiguracyjne, funkcje, zmienne
56 modyfikatory oraz czyniąc całą funkcjonalność jak najłatwiejszą w
57 użyciu jednocześnie dla programistów i projektantów szablonów.
60 Summary: Template engine for PHP - documentation
61 Summary(pl.UTF-8): System szablonów dla PHP - dokumentacja
62 Version: %{doc_version}
63 Group: Development/Languages/PHP
66 Documentation for Smarty template engine.
68 %description doc -l pl.UTF-8
69 Dokumentacja do systemu szablonów Smarty.
72 %setup -q -n smarty-%{main_version} -a1
76 mv libs/Smarty.class.php libs/Smarty3.class.php
77 mv libs/SmartyBC.class.php libs/Smarty.class.php
81 # cleanup backups after patching
82 find '(' -name '*~' -o -name '*.orig' ')' -print0 | xargs -0 -r -l512 rm -f
85 rm -rf $RPM_BUILD_ROOT
86 install -d $RPM_BUILD_ROOT%{appdir}
87 cp -a libs/* $RPM_BUILD_ROOT%{appdir}
90 ln -s Smarty3/Smarty.class.php $RPM_BUILD_ROOT%{php_data_dir}
91 ln -s Smarty3 $RPM_BUILD_ROOT%{php_data_dir}/Smarty
95 rm -rf $RPM_BUILD_ROOT
98 # compat symlink, but need to mv dir first due rpm dir-symlink issue
100 test -L %{php_data_dir}/Smarty && exit 0
101 if [ -d %{php_data_dir}/Smarty/plugins ]; then
102 mv %{php_data_dir}/Smarty/plugins/* %{appdir}/plugins
103 rmdir %{php_data_dir}/Smarty/plugins 2>/dev/null
105 rmdir %{php_data_dir}/Smarty 2>/dev/null || mv -v %{php_data_dir}/Smarty{,.rpmsave}
106 ln -s Smarty3 %{php_data_dir}/Smarty
110 %defattr(644,root,root,755)
111 %doc README *.md *.txt
113 %dir %{appdir}/plugins
114 %dir %{appdir}/sysplugins
115 %{appdir}/Autoloader.php
116 %{appdir}/Smarty.class.php
117 %{appdir}/SmartyBC.class.php
118 %{appdir}/bootstrap.php
120 %{appdir}/plugins/*.php
121 %{appdir}/sysplugins/*.php
124 %{appdir}/Smarty3.class.php
125 %{php_data_dir}/Smarty.class.php
126 %{php_data_dir}/Smarty
130 %defattr(644,root,root,755)