]> git.pld-linux.org Git - packages/Smarty.git/blob - Smarty.spec
Up to 2.6.33 (2021-10-23)
[packages/Smarty.git] / Smarty.spec
1 %define         main_version    2.6.33
2 %define         doc_version     2.6.14
3 %define         php_min_version 5.0.0
4 Summary:        Template engine for PHP
5 Summary(pl.UTF-8):      System szablonów dla PHP
6 Name:           Smarty
7 Version:        %{main_version}
8 Release:        1
9 License:        LGPL v2.1+
10 Group:          Development/Languages/PHP
11 Source0:        https://github.com/smarty-php/smarty/archive/v%{version}/smarty-%{version}.tar.gz
12 # Source0-md5:  15210afa84dc2f20c1b3b0baf95ef3f1
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
16 Source2:        %{name}-function.html_input_image.php
17 Patch0:         path.patch
18 Patch1:         modifier.mb_truncate.patch
19 URL:            https://www.smarty.net/
20 BuildRequires:  rpm-php-pearprov >= 4.4.2-11
21 Requires:       php(core) >= %{php_min_version}
22 Requires:       php(date)
23 Requires:       php(pcre)
24 Requires:       php(tokenizer)
25 BuildArch:      noarch
26 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
27
28 %define         appdir  %{php_data_dir}/Smarty
29
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
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.
45
46 %package doc
47 Summary:        Template engine for PHP - documentation
48 Summary(pl.UTF-8):      System szablonów dla PHP - dokumentacja
49 Version:        %{doc_version}
50 Group:          Development/Languages/PHP
51
52 %description doc
53 Documentation for Smarty template engine.
54
55 %description doc -l pl.UTF-8
56 Dokumentacja do systemu szablonów Smarty.
57
58 %prep
59 %setup -qn smarty-%{main_version} -a1
60 %patch0 -p1
61 cp -a libs/plugins/modifier.{,mb_}truncate.php
62 %patch1 -p1
63
64 %install
65 rm -rf $RPM_BUILD_ROOT
66 install -d $RPM_BUILD_ROOT{%{appdir}/{internals,plugins},%{php_pear_dir}}
67
68 cp -a libs/Smarty.class.php $RPM_BUILD_ROOT%{php_data_dir}
69 cp -a libs/{Config_File,Smarty_Compiler}.class.php $RPM_BUILD_ROOT%{appdir}
70 cp -a libs/debug.tpl $RPM_BUILD_ROOT%{appdir}
71 cp -a libs/internals/*.php $RPM_BUILD_ROOT%{appdir}/internals
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
74
75 # backards compatible with pear dir
76 ln -s %{appdir} $RPM_BUILD_ROOT%{php_pear_dir}/%{name}
77
78 # backards compatible with entry point in subdir
79 ln -s ../Smarty.class.php $RPM_BUILD_ROOT%{appdir}
80
81 %clean
82 rm -rf $RPM_BUILD_ROOT
83
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
89 fi
90 rmdir %{php_pear_dir}/%{name} 2>/dev/null || mv -v %{php_pear_dir}/%{name}{,.rpmsave}
91 ln -s %{appdir} %{php_pear_dir}/%{name}
92
93 %post
94 [ -e %{php_pear_dir}/%{name} ] || ln -s %{appdir} %{php_pear_dir}/%{name}
95
96 %files
97 %defattr(644,root,root,755)
98 %doc BUGS ChangeLog FAQ INSTALL NEWS README RELEASE_NOTES TODO
99 # entry point in include_path
100 %{php_data_dir}/Smarty.class.php
101
102 # app itself
103 %dir %{appdir}
104 %dir %{appdir}/internals
105 %dir %{appdir}/plugins
106 %{appdir}/Smarty.class.php
107 %{appdir}/Config_File.class.php
108 %{appdir}/Smarty_Compiler.class.php
109 %{appdir}/debug.tpl
110 %{appdir}/internals/*.php
111 %{appdir}/plugins/*.php
112
113 # for the sake of bc when installed to pear dir
114 %ghost %{php_pear_dir}/%{name}
115
116 %files doc
117 %defattr(644,root,root,755)
118 %doc manual/*
This page took 0.0805 seconds and 4 git commands to generate.