1 %define pkgname libphutil
2 %define php_min_version 5.2.3
3 Summary: Collection of utility classes and functions for PHP
8 Group: Applications/WWW
9 Source0: https://github.com/facebook/libphutil/archive/master/libphutil.tar.gz
10 # Source0-md5: 276ec0faafabc48ca08ecab54e504b19
11 URL: http://www.phabricator.com/docs/libphutil/
12 BuildRequires: rpmbuild(macros) >= 1.268
13 BuildRequires: sed >= 4.0
14 Requires: php(core) >= %{php_min_version}
18 Requires: php(mbstring)
23 Suggests: php(openssl)
24 Suggests: php(simplexml)
28 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
31 libphutil (pronounced as "lib-futile", like the English word futile)
32 is a collection of PHP utility classes and functions which provide
33 powerful extensions to the standard library.
35 This code was originally developed at Facebook and parts of it appear
36 in the core libraries for <http://www.facebook.com/>.
38 libphutil is principally the shared library for Arcanist and
39 Phabricator (see http://www.phabricator.org/), but is suitable for
40 inclusion in other projects. In particular, some of the classes
41 provided in this library vastly improve the state of common operations
42 in PHP, like executing system commands.
45 %setup -qc -n %{pkgname}-%{version}
46 mv libphutil-*/{.??*,*} .
48 grep -rlE '/usr/local/bin|bin/env' . | xargs sed -i -e ' 1 {
49 s,/usr/local/bin/php,/usr/bin/php,
50 s,/usr/bin/env .*php,/usr/bin/php,
53 # cleanup backups after patching
54 find '(' -name '*~' -o -name '*.orig' ')' -print0 | xargs -0 -r -l512 rm -f
57 rm -rf $RPM_BUILD_ROOT
58 install -d $RPM_BUILD_ROOT%{php_data_dir}/%{pkgname}
59 cp -a resources scripts src support $RPM_BUILD_ROOT%{php_data_dir}/%{pkgname}
62 rm -rf $RPM_BUILD_ROOT
65 %defattr(644,root,root,755)
67 %{php_data_dir}/libphutil