b618f08
# remirepo/fedora spec file for php-pear-CAS
cc50a07
#
1794eb6
# Copyright (c) 2010-2019 Remi Collet
cc50a07
# License: CC-BY-SA
b618f08
# http://creativecommons.org/licenses/by-sa/4.0/
cc50a07
#
cc50a07
# Please, preserve the changelog entries
cc50a07
#
5af455e
%global gh_commit    40c0769ce05a30c8172b36ceab11124375c8366e
f56249e
%global gh_short     %(c=%{gh_commit}; echo ${c:0:7})
493ff8b
%global gh_owner     apereo
f56249e
%global gh_project   phpCAS
f77068e
f77068e
f77068e
Name:           php-pear-CAS
5af455e
Version:        1.3.8
493ff8b
Release:        1%{?dist}
f77068e
Summary:        Central Authentication Service client library in php
f77068e
f77068e
Group:          Development/Libraries
cdf7385
License:        ASL 2.0
60ecb1e
URL:            https://wiki.jasig.org/display/CASC/phpCAS
cdf7385
f56249e
Source0:        https://github.com/%{gh_owner}/%{gh_project}/archive/%{gh_commit}/%{name}-%{version}-%{?gh_short}.tar.gz
f77068e
3b37a9e
# From phpcompatinfo report, session_status is 5.4 only
3b37a9e
Patch0:         %{name}-php53.patch
3b37a9e
f77068e
BuildArch:      noarch
f56249e
BuildRequires:  php-fedora-autoloader-devel
f56249e
# only for pear macros
cc50a07
BuildRequires:  php-pear
f56249e
# for %%check
f56249e
BuildRequires:  php-cli
f77068e
8059b7a
Requires:       php-curl
f56249e
Requires:       php-date
8059b7a
Requires:       php-dom
f56249e
Requires:       php-hash
8059b7a
Requires:       php-pcre
8059b7a
Requires:       php-pdo
8059b7a
Requires:       php-session
8059b7a
Requires:       php-spl
8059b7a
# Optional: php-imap (when use Proxied Imap)
f56249e
Requires:       php-composer(fedora/autoloader)
8059b7a
f56249e
Provides:       php-pear(__uri/CAS) = %{version}
b618f08
Provides:       php-composer(jasig/phpcas) = %{version}
493ff8b
Provides:       php-composer(apereo/phpcas) = %{version}
f77068e
# this library is mostly known as phpCAS
f77068e
Provides:       phpCAS = %{version}-%{release}
f77068e
f77068e
f77068e
%description
f77068e
This package is a PEAR library for using a Central Authentication Service.
f77068e
bfe5dc1
Autoloader '%{pear_phpdir}/CAS/Autoload.php';
b618f08
f77068e
f77068e
%prep
f56249e
%setup -q -n %{gh_project}-%{gh_commit}
f77068e
3b37a9e
%patch0 -p0 -b .php53
3b37a9e
find source -name \*.php53 -delete -print
f77068e
f77068e
f77068e
%build
bfe5dc1
# Rewrite a classmap autoloader (upstream is broken)
bfe5dc1
%{_bindir}/phpab \
f56249e
    --template fedora \
f56249e
    --output source/CAS/Autoload.php  \
f56249e
             source
bfe5dc1
f77068e
f56249e
%install
f56249e
mkdir -p %{buildroot}%{pear_phpdir}
f56249e
cp -pr source/* %{buildroot}%{pear_phpdir}/
f56249e
f56249e
f56249e
%check
f56249e
: Ensure our autoloader works
f56249e
php -r '
f56249e
require "%{buildroot}%{pear_phpdir}/CAS/Autoload.php";
f56249e
if (!class_exists("phpCAS")) {
f56249e
  echo "Class not found\n";
f56249e
  exit(1);
f56249e
}
f56249e
if (phpCAS::getVersion() != "%{version}") {
f56249e
  echo "Bad version (found=" . phpCAS::getVersion()  . ", expected=%{version})\n";
f56249e
  exit(1);
f56249e
}
f56249e
echo "Ok\n";
f56249e
'
f77068e
f77068e
f77068e
%files
f56249e
%{!?_licensedir:%global license %%doc}
f56249e
%license LICENSE
f56249e
%doc composer.json
f56249e
%doc NOTICE *.md
f77068e
%{pear_phpdir}/CAS
f77068e
%{pear_phpdir}/CAS.php
f77068e
f77068e
f77068e
%changelog
5af455e
* Thu Aug 22 2019 Remi Collet <remi@remirepo.net> - 1.3.8-1
5af455e
- update to 1.3.8
5af455e
1794eb6
* Tue Apr 23 2019 Remi Collet <remi@remirepo.net> - 1.3.7-1
1794eb6
- update to 1.3.7
1794eb6
493ff8b
* Fri Oct 26 2018 Remi Collet <remi@remirepo.net> - 1.3.6-1
493ff8b
- update to 1.3.6
493ff8b
- new github and packagist owner
493ff8b
3b37a9e
* Tue Apr 11 2017 Remi Collet <remi@remirepo.net> - 1.3.5-1.1
f56249e
- update to 1.3.5
f56249e
- sources from github
f56249e
- add minimal check for our autoloader
3b37a9e
- add patch to fix compatibility with PHP 5.3
f56249e
bfe5dc1
* Wed Oct 19 2016 Remi Collet <remi@fedoraproject.org> - 1.3.4-3
bfe5dc1
- fix broken autoloader
bfe5dc1
b618f08
* Tue Nov 17 2015 Remi Collet <remi@fedoraproject.org> - 1.3.4-1
b618f08
- update to Version 1.3.4
b618f08
- add provides php-composer(jasig/phpcas)
b618f08
cc50a07
* Mon Jul 28 2014 Remi Collet <remi@fedoraproject.org> - 1.3.4-1
cc50a07
- update to Version 1.3.3
cc50a07
8059b7a
* Sat Dec 29 2012 Remi Collet <remi@fedoraproject.org> - 1.3.2-1
8059b7a
- update to Version 1.3.2, security fix for
8059b7a
  CVE-2012-5583 Missing CN validation of CAS server certificate
8059b7a
- add requires for all needed php extensions
8059b7a
cdf7385
* Wed Mar 14 2012 Remi Collet <remi@fedoraproject.org> - 1.3.0-2
cdf7385
- License is ASL 2.0, https://github.com/Jasig/phpCAS/issues/32
cdf7385
- New sources,        https://github.com/Jasig/phpCAS/issues/31
cdf7385
- update to Version 1.3.0
cdf7385
60ecb1e
* Sat Jun 11 2011 Remi Collet <Fedora@FamilleCollet.com> - 1.2.2-1
60ecb1e
- update to Version 1.2.2 (stable) - API 1.2.2 (stable)
60ecb1e
- dont requires domxml-php4-to-php5 anymore
60ecb1e
- fix URL
60ecb1e
- link %%doc to pear_docdir
60ecb1e
c5de757
* Mon Oct 04 2010 Remi Collet <Fedora@FamilleCollet.com> - 1.1.3-1
c5de757
- update to 1.1.3
c5de757
- fix CVE-2010-3690, CVE-2010-3691, CVE-2010-3692
c5de757
- set timezone during build
c5de757
f7d9eee
* Tue Aug 03 2010 Remi Collet <Fedora@FamilleCollet.com> - 1.1.2-1
f7d9eee
- update to 1.1.2
f7d9eee
- fix  CVE-2010-2795, CVE-2010-2796, #620753
f7d9eee
c53a1de
* Thu May 20 2010 Remi Collet <Fedora@FamilleCollet.com> - 1.1.1-1
c53a1de
- update to 1.1.1
c53a1de
f77068e
* Thu May 20 2010 Remi Collet <Fedora@FamilleCollet.com> - 1.1.0-1
f77068e
- update to 1.1.0 finale
f77068e
f77068e
* Sun Mar 14 2010 Remi Collet <Fedora@FamilleCollet.com> - 1.1.0-0.1.RC7
f77068e
- initial packaging (using pear make-rpm-spec CAS-1.1.0RC7.tgz)
f77068e