]> git.pld-linux.org Git - packages/php-Smarty.git/blob - php-Smarty.spec
93e40db03e7fd9792567e17e9b168156d68566f9
[packages/php-Smarty.git] / php-Smarty.spec
1 #
2 # Conditional build:
3 %bcond_with     bc              # build BC wrapper as default Smarty class
4
5 %define         main_version 3.1.31
6 %define         doc_version     3.1.14
7 %define         rel     2
8 %define         php_min_version 5.2.0
9 Summary:        Template engine for PHP
10 Summary(pl.UTF-8):      System szablonów dla PHP
11 Name:           php-Smarty
12 Version:        %{main_version}
13 Release:        %{rel}%{?with_bc:BC}
14 License:        LGPL v3
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
21 Patch0:         bc.patch
22 URL:            http://www.smarty.net/
23 BuildRequires:  rpm-php-pearprov >= 4.4.2-11
24 BuildRequires:  rpmbuild(macros) >= 1.553
25 BuildRequires:  unzip
26 Requires:       php(core) >= %{php_min_version}
27 Requires:       php(date)
28 Requires:       php(mbstring)
29 Requires:       php(pcre)
30 Requires:       php(tokenizer)
31 %if %{with bc}
32 Provides:       Smarty = %{version}
33 Obsoletes:      Smarty < 3.0
34 %endif
35 BuildArch:      noarch
36 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
37
38 %define         appdir          %{php_data_dir}/Smarty3
39
40 %description
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.
47
48 %{?with_bc:This package is modified to have SmartyBC class as Smarty
49 class name}
50
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.
58
59 %package doc
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
64
65 %description doc
66 Documentation for Smarty template engine.
67
68 %description doc -l pl.UTF-8
69 Dokumentacja do systemu szablonów Smarty.
70
71 %prep
72 %setup -q -n smarty-%{main_version} -a1
73 %undos -f php
74
75 %if %{with bc}
76 mv libs/Smarty.class.php libs/Smarty3.class.php
77 mv libs/SmartyBC.class.php libs/Smarty.class.php
78 %patch0 -p1
79 %endif
80
81 # cleanup backups after patching
82 find '(' -name '*~' -o -name '*.orig' ')' -print0 | xargs -0 -r -l512 rm -f
83
84 %install
85 rm -rf $RPM_BUILD_ROOT
86 install -d $RPM_BUILD_ROOT%{appdir}
87 cp -a libs/* $RPM_BUILD_ROOT%{appdir}
88
89 %if %{with bc}
90 ln -s Smarty3/Smarty.class.php $RPM_BUILD_ROOT%{php_data_dir}
91 ln -s Smarty3 $RPM_BUILD_ROOT%{php_data_dir}/Smarty
92 %endif
93
94 %clean
95 rm -rf $RPM_BUILD_ROOT
96
97 %if %{with bc}
98 # compat symlink, but need to mv dir first due rpm dir-symlink issue
99 %pretrans
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
104 fi
105 rmdir %{php_data_dir}/Smarty 2>/dev/null || mv -v %{php_data_dir}/Smarty{,.rpmsave}
106 ln -s Smarty3 %{php_data_dir}/Smarty
107 %endif
108
109 %files
110 %defattr(644,root,root,755)
111 %doc README *.md *.txt
112 %dir %{appdir}
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
119 %{appdir}/debug.tpl
120 %{appdir}/plugins/*.php
121 %{appdir}/sysplugins/*.php
122
123 %if %{with bc}
124 %{appdir}/Smarty3.class.php
125 %{php_data_dir}/Smarty.class.php
126 %{php_data_dir}/Smarty
127 %endif
128
129 %files doc
130 %defattr(644,root,root,755)
131 %doc demo manual-en
This page took 0.098267 seconds and 2 git commands to generate.