diff options
Diffstat (limited to 'php-kukulich-fshl.spec')
-rw-r--r-- | php-kukulich-fshl.spec | 103 |
1 files changed, 103 insertions, 0 deletions
diff --git a/php-kukulich-fshl.spec b/php-kukulich-fshl.spec new file mode 100644 index 0000000..be18be9 --- /dev/null +++ b/php-kukulich-fshl.spec @@ -0,0 +1,103 @@ +# remirepo spec/Fedora file for php-kukulich-fshl +# +# Copyright (c) 2015 Remi Collet +# License: CC-BY-SA +# http://creativecommons.org/licenses/by-sa/4.0/ +# +# Please, preserve the changelog entries +# +%global gh_commit 974c294ade5d76c0c16b6fe3fd3a584ba999b24f +%global gh_short %(c=%{gh_commit}; echo ${c:0:7}) +%global gh_owner kukulich +%global gh_project fshl +%global php_home %{_datadir}/php +%global ns_project FSHL +%global with_tests 0%{!?_without_tests:1} + +Name: php-%{gh_owner}-%{gh_project} +Version: 2.1.0 +Release: 1%{?dist} +Summary: FSHL: fast syntax highlighter + +Group: Development/Libraries +License: MIT +URL: https://github.com/%{gh_owner}/%{gh_project} +# git snashop to get upstream test suite +Source0: %{name}-%{version}-%{gh_short}.tgz +Source1: makesrc.sh + +BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) +BuildArch: noarch +BuildRequires: php-composer(theseer/autoload) +%if %{with_tests} +# For tests +BuildRequires: php(language) >= 5.3 +BuildRequires: php-pcre +BuildRequires: php-spl +BuildRequires: php-composer(phpunit/phpunit) +%endif + +# From composer.json, "require": { +# "php": ">=5.3" +Requires: php(language) >= 5.3 +# From phpcompatinfo report for version 2.1.0 +Requires: php-pcre +Requires: php-spl + +Provides: php-composer(%{gh_owner}/%{gh_project}) = %{version} + + +%description +FSHL is a free, open source, universal, fast syntax highlighter written in PHP. +A very fast parser performs syntax highlighting for few languages and produces +a HTML output. + +To use this library, you just have to add, in your project: + require_once '%{php_home}/%{ns_project}/autoload.php'; + + +%prep +%setup -q -n %{gh_project}-%{gh_commit} + + +%build +: Generate a simple classmap autoloader +phpab --output %{ns_project}/autoload.php %{ns_project} + + +%install +rm -rf %{buildroot} + +: Library +mkdir -p %{buildroot}%{php_home} +cp -pr %{ns_project} %{buildroot}%{php_home}/%{ns_project} + + +%check +%if %{with_tests} +: Switch to our autoloader +sed -e '/bootstrap/s:^.*$:require_once "%{buildroot}%{php_home}/%{ns_project}/autoload.php";:' \ + -i tests/%{ns_project}/*Test.php + +%{_bindir}/phpunit --verbose tests +%else +: Test suite disabled +%endif + + +%clean +rm -rf %{buildroot} + + +%files +%defattr(-,root,root,-) +%{!?_licensedir:%global license %%doc} +%license LICENSE +%doc composer.json +%doc README.md +%{php_home}/%{ns_project} + + +%changelog +* Tue Oct 20 2015 Remi Collet <remi@fedoraproject.org> - 2.1.0-1 +- initial package, version 2.1.0
\ No newline at end of file |