diff options
authorRemi Collet <>2018-10-29 09:58:02 +0100
committerRemi Collet <>2018-10-29 09:58:02 +0100
commit88968a5d1e003ac1b20d39814303b72615111411 (patch)
parent467306a7fda5b711a2a882ce6b82caec28a2e7e0 (diff)
sync with FedoraHEADmaster
2 files changed, 74 insertions, 65 deletions
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..fc9aa8c
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,8 @@
diff --git a/php-Smarty2.spec b/php-Smarty2.spec
index 031fdc1..127fc29 100644
--- a/php-Smarty2.spec
+++ b/php-Smarty2.spec
@@ -8,96 +8,97 @@
# Please preserve changelog entries
-%global gh_commit c5c9d6514ceaf15fe35345886668726829560f93
-%global gh_short %(c=%{gh_commit}; echo ${c:0:7})
-%global gh_owner smarty-php
-%global gh_project smarty
-Name: php-Smarty2
-Summary: Template/Presentation Framework for PHP
-Version: 2.6.30
-Release: 1%{?dist}
-License: LGPLv2+
-Group: Development/Libraries
-BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
-BuildArch: noarch
-BuildRequires: %{_bindir}/phpab
-# For tests
-BuildRequires: php-cli
-# From composer.json
-Requires: php(language) >= 5.2
-# From phpcompatinfo report for 2.6.30
-Requires: php-date
-Requires: php-pcre
-Provides: php-composer(smarty/smarty) = %{version}
+%global github_owner smarty-php
+%global github_name smarty
+%global github_version 2.6.31
+%global github_commit 4ab9757b492f08a38f68123a6e7c1df7110bbc49
+%global composer_vendor smarty
+%global composer_project smarty
+# "php": ">=5.2"
+%global php_min_ver 5.2
+%{!?phpdir: %global phpdir %{_datadir}/php}
+Name: php-Smarty2
+Summary: Smarty - the compiling PHP template engine
+Version: %{github_version}
+Release: 2%{?dist}
+Group: Development/Libraries
+License: LGPLv3
+BuildArch: noarch
+# composer.json
+BuildRequires: php(language) >= %{php_min_ver}
+# Autoloader
+BuildRequires: php-fedora-autoloader-devel
+Requires: php(language) >= %{php_min_ver}
+# phpcompatinfo (computed from version 2.6.31)
+Requires: php-date
+Requires: php-pcre
+Requires: php-tokenizer
+Provides: php-%{github_name}2 = %{version}-%{release}
+Provides: php-%{composer_vendor}-%{composer_project} = %{version}-%{release}
+# Composer
+Provides: php-composer(%{composer_vendor}/%{composer_project}) = %{version}
-Although Smarty is known as a "Template Engine", it would be more accurately
-described as a "Template/Presentation Framework." That is, it provides the
-programmer and template designer with a wealth of tools to automate tasks
-commonly dealt with at the presentation layer of an application. I stress the
-word Framework because Smarty is not a simple tag-replacing template engine.
-Although it can be used for such a simple purpose, its focus is on quick and
-painless development and deployment of your application, while maintaining
-high-performance, scalability, security and future growth.
-Autoloader: %{_datadir}/php/Smarty2/autoload.php
+Smarty is a template engine for PHP, facilitating the separation of
+presentation (HTML/CSS) from application logic. This implies that PHP
+code is application logic, and is separated from the presentation.
-%setup -qn %{gh_project}-%{gh_commit}
-iconv -f iso8859-1 -t utf-8 NEWS > NEWS.conv && mv -f NEWS.conv NEWS
-iconv -f iso8859-1 -t utf-8 ChangeLog > ChangeLog.conv && mv -f ChangeLog.conv ChangeLog
-%{_bindir}/phpab \
- --output libs/autoload.php \
- libs/Smarty.class.php libs/Smarty_Compiler.class.php libs/Config_File.class.php
+%setup -qn %{github_name}-%{github_commit}
-# empty build section, nothing required
+: Create autoloader
+phpab -t fedora -o libs/autoload.php libs
-# install smarty libs
-install -d $RPM_BUILD_ROOT%{_datadir}/php/Smarty2
-cp -a libs/* $RPM_BUILD_ROOT%{_datadir}/php/Smarty2/
+mkdir -p %{buildroot}%{phpdir}
+cp -rp libs %{buildroot}%{phpdir}/Smarty2
-: Test autoloader and version
+: Check autoloader
php -r '
-require "%{buildroot}%{_datadir}/php/Smarty2/autoload.php";
-$s = new Smarty();
-printf("Smarty version \"%s\"\n", $s->_version);
-version_compare($s->_version, "%{version}", "=") or exit(1);
+require "%{buildroot}%{phpdir}/Smarty2/autoload.php";
+exit (class_exists("Smarty") ? 0 : 1);
%{!?_licensedir:%global license %%doc}
%license COPYING.lib
+%doc ChangeLog
%doc composer.json
+%doc FAQ
+* Sat Oct 27 2018 Shawn Iwinski <> - 2.6.31-2
+- Add composer provides
+* Sat Oct 27 2018 Shawn Iwinski <> - 2.6.31-1
+- Update to 2.6.31
+- Update license from LGPLv2+ to LGPLv3
+- Full spec update
+- Remove broken demo files
+- Add autoloader
+- Move license file from docs directory to shared licenses directory
* Mon Aug 8 2016 Remi Collet <> - 2.6.30-1
- update to 2.6.30
- sources from github