File php5-libphutil.spec of Package php5-libphutil

#
# spec file for package php5-libphutil
#
# Copyright (c) 2016 Aeneas Jaissle <aj@ajaissle.de>
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via http://bugs.opensuse.org/
#


Name:           php5-libphutil
%define lib_name libphutil
Version:        0.0~git.20161118T152307~b4f866b
Release:        0
Summary:        Phabrcator PHP utility classes
License:        Apache-2.0
Group:          Development/Libraries/PHP

Url:            https://secure.phabricator.com/diffusion/PHU/
Source0:        %{lib_name}-%{version}.tar.xz

BuildArch:      noarch
BuildRequires:  php-devel >= 5.0.0
BuildRequires:  xz
BuildRoot:      %{_tmppath}/%{name}-%{version}-build

Requires:       php >= 5.0.0

Provides:       php-%{lib_name}  = %{version}-%{release}
Provides:       php(%{lib_name}) = %{version}-%{release}
Obsoletes:      php-%{lib_name}  < %{version}-%{release}
Obsoletes:      php(%{lib_name}) < %{version}-%{release}

%description
libphutil is a collection of utility classes and functions for PHP. It is used by Phabricator and Arcanist.

Some of the major components of libphutil are:
* Core Utilities: a collection of useful functions like ipull() which simplify common data manipulation;
* Filesystem: classes like Filesystem which provide a strict API for filesystem access and throw exceptions on failure, making it easier to write robust code which interacts with files;
* Command Execution: libphutil provides a powerful system command primitive in ExecFuture which makes it far easier to write command-line scripts which execute system commands (see Command Execution);
* xsprintf(): allows you to define sprintf()-style functions which use custom conversions; and
* Library System: an introspectable, inventoried system for organizing PHP code and managing dependencies, supported by static analysis.


%prep
%setup -q -n %{lib_name}-%{version}

# remove tests
find . -name __tests__ -type d -print0 | xargs -0 rm -rf

%build

%install
install -d %{buildroot}%{_datadir}/phabricator/%{lib_name}
cp -r externals/ %{buildroot}%{_datadir}/phabricator/%{lib_name}/externals
cp -r resources/ %{buildroot}%{_datadir}/phabricator/%{lib_name}/resources
cp -r scripts/   %{buildroot}%{_datadir}/phabricator/%{lib_name}/scripts
cp -r src/       %{buildroot}%{_datadir}/phabricator/%{lib_name}/src
cp -r support/   %{buildroot}%{_datadir}/phabricator/%{lib_name}/support

%files
%defattr(-,root,root,-)
%doc LICENSE NOTICE README.md
%dir %{_datadir}/phabricator
%{_datadir}/phabricator/%{lib_name}

%changelog