diff options
| -rw-r--r-- | .gitignore | 8 | ||||
| -rw-r--r-- | php-Smarty2.spec | 131 | 
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 @@ +clog +package-*.xml +*.tgz +*.tar.gz +*.tar.xz +*.tar.xz.asc +*.src.rpm +*/*rpm 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} - -URL:            http://www.smarty.net -License:        LGPLv2+ -Group:          Development/Libraries -Source0:        https://github.com/%{gh_owner}/%{gh_project}/archive/%{gh_commit}/%{gh_project}-%{version}-%{gh_short}.tar.gz - -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 +URL:           http://www.smarty.net +Source0:       https://github.com/%{github_owner}/%{github_name}/archive/%{github_commit}/%{name}-%{github_version}-%{github_commit}.tar.gz + +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} +# php-{COMPOSER_VENDOR}-{COMPOSER_PROJECT} +Provides:      php-%{composer_vendor}-%{composer_project} = %{version}-%{release} +# Composer +Provides:      php-composer(%{composer_vendor}/%{composer_project}) = %{version}  %description -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.  %prep -%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}  %build -# empty build section, nothing required +: Create autoloader +phpab -t fedora -o libs/autoload.php libs  %install -rm -rf $RPM_BUILD_ROOT - -# 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  %check -: 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);  ' -%clean -rm -rf $RPM_BUILD_ROOT - -  %files -%defattr(-,root,root,-)  %{!?_licensedir:%global license %%doc}  %license COPYING.lib -%doc BUGS ChangeLog demo FAQ NEWS QUICK_START README -%doc RELEASE_NOTES TODO +%doc ChangeLog  %doc composer.json -%{_datadir}/php/Smarty2 +%doc FAQ +%doc README.md +%{phpdir}/Smarty2  %changelog +* Sat Oct 27 2018 Shawn Iwinski <shawn@iwin.ski> - 2.6.31-2 +- Add composer provides + +* Sat Oct 27 2018 Shawn Iwinski <shawn@iwin.ski> - 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 <remi@remirepo.net> - 2.6.30-1  - update to 2.6.30  - sources from github  | 
