988bf4b
# remirepo/fedora spec file for php-sabre-vobject4
988bf4b
#
988bf4b
# Copyright (c) 2013-2017 Remi Collet
988bf4b
# License: CC-BY-SA
988bf4b
# http://creativecommons.org/licenses/by-sa/4.0/
988bf4b
#
988bf4b
# Please, preserve the changelog entries
988bf4b
#
fedb856
%global gh_commit    6484b9d660822c5e221c76122ce8ea658ecc9c5b
988bf4b
%global gh_short     %(c=%{gh_commit}; echo ${c:0:7})
098df77
%global gh_owner     sabre-io
098df77
%global gh_project   vobject
988bf4b
%global with_tests   %{?_without_tests:0}%{!?_without_tests:1}
988bf4b
988bf4b
%if 0%{?fedora} > 25
988bf4b
%global with_cmd 1
988bf4b
%else
988bf4b
%global with_cmd 0
988bf4b
%endif
988bf4b
098df77
Name:           php-sabre-vobject4
988bf4b
Summary:        Library to parse and manipulate iCalendar and vCard objects
fedb856
Version:        4.1.4
fedb856
Release:        1%{?dist}
988bf4b
988bf4b
URL:            http://sabre.io/vobject/
988bf4b
License:        BSD
988bf4b
Group:          Development/Libraries
988bf4b
Source0:        https://github.com/%{gh_owner}/%{gh_project}/archive/%{gh_commit}/%{name}-%{version}-%{gh_short}.tar.gz
988bf4b
Source1:        %{name}-autoload.php
988bf4b
988bf4b
# replace composer autloader
098df77
Patch0:         %{name}-bin.patch
988bf4b
988bf4b
BuildArch:      noarch
988bf4b
%if %{with_tests}
988bf4b
BuildRequires:  php(language) >= 5.5
988bf4b
BuildRequires:  php-mbstring
988bf4b
BuildRequires:  php-composer(sabre/xml)     <  3
988bf4b
BuildRequires:  php-composer(sabre/xml)     >= 1.5
988bf4b
BuildRequires:  php-date
988bf4b
BuildRequires:  php-json
988bf4b
BuildRequires:  php-pcre
988bf4b
BuildRequires:  php-spl
988bf4b
BuildRequires:  php-xml
988bf4b
# From composer.json, "require-dev"
fedb856
#        "phpunit/phpunit" : "> 4.8.35, <6.0.0",
988bf4b
#        "squizlabs/php_codesniffer": "*"
988bf4b
#        "sabre/cs"        : "^1.0.0"
fedb856
BuildRequires:  php-composer(phpunit/phpunit) > 4.8.35
988bf4b
# Autoloader
988bf4b
BuildRequires:  php-composer(fedora/autoloader)
988bf4b
%endif
988bf4b
988bf4b
# From composer.json, "require"
988bf4b
#        "php"          : ">=5.5",
988bf4b
#        "ext-mbstring" : "*",
988bf4b
#        "sabre/xml"    : ">=1.5 <3.0"
988bf4b
Requires:       php(language) >= 5.5
988bf4b
Requires:       php-mbstring
988bf4b
Requires:       php-composer(sabre/xml)     >= 1.5
988bf4b
Requires:       php-composer(sabre/xml)     <  3
988bf4b
# From phpcompatinfo report for version 4.1.2
988bf4b
%if %{with_cmd}
988bf4b
Requires:       php-cli
988bf4b
%endif
988bf4b
Requires:       php-date
988bf4b
Requires:       php-json
988bf4b
Requires:       php-pcre
988bf4b
Requires:       php-spl
988bf4b
Requires:       php-xml
988bf4b
# Autoloader
988bf4b
Requires:       php-composer(fedora/autoloader)
988bf4b
988bf4b
Provides:       php-composer(sabre/vobject) = %{version}
988bf4b
988bf4b
988bf4b
%description
988bf4b
The VObject library allows you to easily parse and manipulate iCalendar
988bf4b
and vCard objects using PHP. The goal of the VObject library is to create
988bf4b
a very complete library, with an easy to use API.
988bf4b
988bf4b
This project is a spin-off from SabreDAV, where it has been used for several
988bf4b
years. The VObject library has 100% unittest coverage.
988bf4b
988bf4b
Autoloader: %{_datadir}/php/Sabre/VObject4/autoload.php
988bf4b
988bf4b
988bf4b
%prep
988bf4b
%setup -q -n %{gh_project}-%{gh_commit}
988bf4b
988bf4b
%patch0 -p1 -b .rpm
9c5b9af
988bf4b
cp %{SOURCE1} lib/autoload.php
988bf4b
988bf4b
988bf4b
%build
988bf4b
# nothing to build
988bf4b
988bf4b
988bf4b
%install
988bf4b
# Install as a PSR-0 library
988bf4b
mkdir -p %{buildroot}%{_datadir}/php/Sabre
988bf4b
cp -pr lib %{buildroot}%{_datadir}/php/Sabre/VObject4
988bf4b
988bf4b
%if %{with_cmd}
988bf4b
# Install the commands
988bf4b
install -Dpm 0755 bin/vobject \
988bf4b
         %{buildroot}/%{_bindir}/vobject
988bf4b
install -Dpm 0755 bin/generate_vcards \
988bf4b
         %{buildroot}/%{_bindir}/generate_vcards
988bf4b
%endif
988bf4b
988bf4b
988bf4b
%check
988bf4b
%if %{with_tests}
988bf4b
: Fix bootstrap
988bf4b
cd tests
988bf4b
sed -e 's:@BUILDROOT@:%{buildroot}:' -i bootstrap.php
988bf4b
988bf4b
: Run upstream test suite against installed library
098df77
ret=0
098df77
for cmd in php php56 php70 php71 php72; do
098df77
  if which $cmd; then
098df77
   $cmd %{_bindir}/phpunit --verbose || ret=1
098df77
  fi
098df77
done
098df77
exit $ret
988bf4b
%else
988bf4b
: Skip upstream test suite
988bf4b
%endif
988bf4b
988bf4b
988bf4b
%files
988bf4b
%{!?_licensedir:%global license %%doc}
988bf4b
%license LICENSE
988bf4b
%doc *md
988bf4b
%doc composer.json
988bf4b
%{_datadir}/php/Sabre/VObject4
988bf4b
%if %{with_cmd}
988bf4b
%{_bindir}/vobject
988bf4b
%{_bindir}/generate_vcards
988bf4b
%endif
988bf4b
988bf4b
%changelog
fedb856
* Sat Dec 23 2017 Remi Collet <remi@remirepo.net> - 4.1.4-1
fedb856
- Update to 4.1.4
fedb856
9c5b9af
* Mon Oct 30 2017 Remi Collet <remi@remirepo.net> - 4.1.3-2
9c5b9af
- fix FTBFS fro mKoschei, add patch for test from
9c5b9af
  https://github.com/sabre-io/vobject/pull/395
9c5b9af
098df77
* Thu Oct 19 2017 Remi Collet <remi@remirepo.net> - 4.1.3-1
098df77
- Update to 4.1.3
098df77
- sources from https://github.com/sabre-io/vobject
098df77
b319082
* Thu Jul 27 2017 Fedora Release Engineering <releng@fedoraproject.org> - 4.1.2-2
b319082
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
b319082
988bf4b
* Tue Jan 17 2017 Remi Collet <remi@fedoraproject.org> - 4.1.2-1
988bf4b
- rename to php-sabre-vobject4
988bf4b
- raise dependency on PHP version 5.5
988bf4b
- add dependency on sabre/xml
988bf4b
988bf4b
* Sat Oct 29 2016 Remi Collet <remi@fedoraproject.org> - 3.5.3-3
988bf4b
- switch from symfony/class-loader to fedora/autoloader
988bf4b
988bf4b
* Fri Oct  7 2016 Remi Collet <remi@fedoraproject.org> - 3.5.3-1
988bf4b
- update to 3.5.3
988bf4b
988bf4b
* Tue Apr 26 2016 Remi Collet <remi@fedoraproject.org> - 3.5.2-1
988bf4b
- update to 3.5.2
988bf4b
988bf4b
* Thu Apr  7 2016 Remi Collet <remi@fedoraproject.org> - 3.5.1-1
988bf4b
- update to 3.5.1
988bf4b
988bf4b
* Fri Mar 11 2016 Remi Collet <remi@fedoraproject.org> - 3.5.0-1
988bf4b
- update to 3.5.0
988bf4b
988bf4b
* Wed Feb 24 2016 Remi Collet <remi@fedoraproject.org> - 3.4.6-1
988bf4b
- update to 3.4.6
988bf4b
988bf4b
* Wed Jul 16 2014 Remi Collet <remi@fedoraproject.org> - 3.2.4-1
988bf4b
- update to 3.2.4
988bf4b
988bf4b
* Wed Jun 18 2014 Remi Collet <remi@fedoraproject.org> - 3.2.3-1
988bf4b
- update to 3.2.3
988bf4b
- add provides php-composer(sabre/vobject)
988bf4b
- url is now http://sabre.io/vobject/
988bf4b
988bf4b
* Fri May  9 2014 Remi Collet <remi@fedoraproject.org> - 3.2.2-1
988bf4b
- update to 3.2.2
988bf4b
988bf4b
* Tue May  6 2014 Remi Collet <remi@fedoraproject.org> - 3.2.1-1
988bf4b
- update to 3.2.1
988bf4b
988bf4b
* Sun Apr  6 2014 Remi Collet <remi@fedoraproject.org> - 3.2.0-1
988bf4b
- update to 3.2.0
988bf4b
988bf4b
* Thu Feb 20 2014 Remi Collet <remi@fedoraproject.org> - 3.1.3-1
988bf4b
- update to 3.1.3
988bf4b
988bf4b
* Tue Dec 31 2013 Remi Collet <remi@fedoraproject.org> - 2.1.3-1
988bf4b
- Initial packaging