3 %bcond_with tests # build without tests
5 %define php_min_version 5.3.3
6 Summary: Handle HHVM/PHP environments
7 Name: php-sebastian-environment
11 Group: Development/Libraries
12 Source0: https://github.com/sebastianbergmann/environment/archive/%{version}/environment-%{version}.tar.gz
13 # Source0-md5: a14fe7826a2801de5151d23a065aad33
14 URL: https://github.com/sebastianbergmann/environment
15 BuildRequires: php(core) >= %{php_min_version}
18 BuildRequires: phpunit >= 4.8
20 Requires: php(core) >= %{php_min_version}
24 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
27 This component provides functionality that helps writing PHP code that
28 has runtime-specific (PHP / HHVM) execution paths.
31 %setup -q -n environment-%{version}
34 install -d SebastianBergmann
35 mv src SebastianBergmann/Environment
38 # Generate the Autoloader
40 --output SebastianBergmann/Environment/autoload.php \
41 SebastianBergmann/Environment
44 : Run tests - set include_path to ensure PHPUnit autoloader use it
45 phpunit --bootstrap SebastianBergmann/Environment/autoload.php
50 rm -rf $RPM_BUILD_ROOT
51 install -d $RPM_BUILD_ROOT%{php_pear_dir}/SebastianBergmann
52 cp -a SebastianBergmann/Environment $RPM_BUILD_ROOT%{php_pear_dir}/SebastianBergmann/Environment
55 rm -rf $RPM_BUILD_ROOT
58 %defattr(644,root,root,755)
59 %doc README.md LICENSE composer.json
60 %dir %{php_pear_dir}/SebastianBergmann
61 %{php_pear_dir}/SebastianBergmann/Environment