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