d3ab838
# remirepo/fedora spec file for php-pear-CAS
7ec8afa
#
136947c
# Copyright (c) 2010-2021 Remi Collet
7ec8afa
# License: CC-BY-SA
d3ab838
# http://creativecommons.org/licenses/by-sa/4.0/
7ec8afa
#
7ec8afa
# Please, preserve the changelog entries
7ec8afa
#
136947c
%global gh_commit    7325865c4cfb5005ed4e4c5cf01823be1726a2a0
6d016d6
%global gh_short     %(c=%{gh_commit}; echo ${c:0:7})
cbbe4ec
%global gh_owner     apereo
6d016d6
%global gh_project   phpCAS
c379ba8
c379ba8
c379ba8
Name:           php-pear-CAS
136947c
Version:        1.3.9
6d016d6
Release:        1%{?dist}
c379ba8
Summary:        Central Authentication Service client library in php
c379ba8
b9fcbbd
License:        ASL 2.0
111100f
URL:            https://wiki.jasig.org/display/CASC/phpCAS
c65b6bf
6d016d6
Source0:        https://github.com/%{gh_owner}/%{gh_project}/archive/%{gh_commit}/%{name}-%{version}-%{?gh_short}.tar.gz
c379ba8
c379ba8
BuildArch:      noarch
6d016d6
BuildRequires:  php-fedora-autoloader-devel
136947c
%if 0%{?fedora} >= 27 || 0%{?rhel} >= 8
136947c
BuildRequires: (php-composer(psr/log) >= 1.0.0 with php-composer(psr/log) < 2)
136947c
%else
136947c
BuildRequires:  php-PsrLog
136947c
%endif
6d016d6
# only for pear macros
7ec8afa
BuildRequires:  php-pear
6d016d6
# for %%check
6d016d6
BuildRequires:  php-cli
c379ba8
136947c
%if 0%{?fedora} >= 27 || 0%{?rhel} >= 8
136947c
Requires:      (php-composer(psr/log) >= 1.0.0 with php-composer(psr/log) < 2)
136947c
%else
136947c
Requires:       php-PsrLog
136947c
%endif
a445f38
Requires:       php-curl
6d016d6
Requires:       php-date
a445f38
Requires:       php-dom
6d016d6
Requires:       php-hash
a445f38
Requires:       php-pcre
a445f38
Requires:       php-pdo
a445f38
Requires:       php-session
a445f38
Requires:       php-spl
a445f38
# Optional: php-imap (when use Proxied Imap)
6d016d6
Requires:       php-composer(fedora/autoloader)
a445f38
6d016d6
Provides:       php-pear(__uri/CAS) = %{version}
d3ab838
Provides:       php-composer(jasig/phpcas) = %{version}
cbbe4ec
Provides:       php-composer(apereo/phpcas) = %{version}
c379ba8
# this library is mostly known as phpCAS
c379ba8
Provides:       phpCAS = %{version}-%{release}
c379ba8
c379ba8
c379ba8
%description
c379ba8
This package is a PEAR library for using a Central Authentication Service.
c379ba8
136947c
Autoloader: %{pear_phpdir}/CAS/Autoload.php
d3ab838
c379ba8
c379ba8
%prep
6d016d6
%setup -q -n %{gh_project}-%{gh_commit}
c379ba8
c65b6bf
c379ba8
c379ba8
%build
8ae0586
# Rewrite a classmap autoloader (upstream is broken)
8ae0586
%{_bindir}/phpab \
6d016d6
    --template fedora \
6d016d6
    --output source/CAS/Autoload.php  \
6d016d6
             source
136947c
cat << 'EOF' | tee -a source/CAS/Autoload.php
136947c
\Fedora\Autoloader\Dependencies::required([
136947c
    '%{_datadir}/php/Psr/Log/autoload.php',
136947c
]);
136947c
EOF
8ae0586
c379ba8
6d016d6
%install
6d016d6
mkdir -p %{buildroot}%{pear_phpdir}
6d016d6
cp -pr source/* %{buildroot}%{pear_phpdir}/
6d016d6
6d016d6
6d016d6
%check
6d016d6
: Ensure our autoloader works
6d016d6
php -r '
6d016d6
require "%{buildroot}%{pear_phpdir}/CAS/Autoload.php";
6d016d6
if (!class_exists("phpCAS")) {
6d016d6
  echo "Class not found\n";
6d016d6
  exit(1);
6d016d6
}
6d016d6
if (phpCAS::getVersion() != "%{version}") {
6d016d6
  echo "Bad version (found=" . phpCAS::getVersion()  . ", expected=%{version})\n";
6d016d6
  exit(1);
6d016d6
}
6d016d6
echo "Ok\n";
6d016d6
'
c379ba8
c379ba8
c379ba8
%files
6d016d6
%{!?_licensedir:%global license %%doc}
6d016d6
%license LICENSE
6d016d6
%doc composer.json
6d016d6
%doc NOTICE *.md
c379ba8
%{pear_phpdir}/CAS
c379ba8
%{pear_phpdir}/CAS.php
c379ba8
c379ba8
c379ba8
%changelog
136947c
* Thu Feb  4 2021 Remi Collet <remi@remirepo.net> - 1.3.9-1
136947c
- update to 1.3.9
136947c
- add dependency on psr/log
136947c
111bc69
* Thu Aug 22 2019 Remi Collet <remi@remirepo.net> - 1.3.8-1
111bc69
- update to 1.3.8
111bc69
1d248c0
* Tue Apr 23 2019 Remi Collet <remi@remirepo.net> - 1.3.7-1
1d248c0
- update to 1.3.7
1d248c0
cbbe4ec
* Fri Oct 26 2018 Remi Collet <remi@remirepo.net> - 1.3.6-1
cbbe4ec
- update to 1.3.6
cbbe4ec
- new github and packagist owner
cbbe4ec
6d016d6
* Tue Apr 11 2017 Remi Collet <remi@remirepo.net> - 1.3.5-1
6d016d6
- update to 1.3.5
6d016d6
- sources from github
6d016d6
- add minimal check for our autoloader
6d016d6
8ae0586
* Wed Oct 19 2016 Remi Collet <remi@fedoraproject.org> - 1.3.4-3
8ae0586
- fix broken autoloader
8ae0586
d3ab838
* Tue Nov 17 2015 Remi Collet <remi@fedoraproject.org> - 1.3.4-1
d3ab838
- update to Version 1.3.4
d3ab838
- add provides php-composer(jasig/phpcas)
d3ab838
7ec8afa
* Mon Jul 28 2014 Remi Collet <remi@fedoraproject.org> - 1.3.4-1
7ec8afa
- update to Version 1.3.3
7ec8afa
02f74f5
* Thu Feb 14 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.3.2-2
02f74f5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild
02f74f5
a445f38
* Sat Dec 29 2012 Remi Collet <remi@fedoraproject.org> - 1.3.2-1
a445f38
- update to Version 1.3.2, security fix for
a445f38
  CVE-2012-5583 Missing CN validation of CAS server certificate
a445f38
- add requires for all needed php extensions
a445f38
61a07a4
* Fri Jul 20 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.3.1-2
61a07a4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild
61a07a4
70367a0
* Sun Apr 29 2012 Remi Collet <remi@fedoraproject.org> - 1.3.1-1
70367a0
- update to Version 1.3.1
70367a0
b9fcbbd
* Wed Mar 14 2012 Remi Collet <remi@fedoraproject.org> - 1.3.0-2
b9fcbbd
- License is ASL 2.0, https://github.com/Jasig/phpCAS/issues/32
b9fcbbd
- New sources,        https://github.com/Jasig/phpCAS/issues/31
b9fcbbd
c65b6bf
* Tue Mar 13 2012 Remi Collet <remi@fedoraproject.org> - 1.3.0-1
c65b6bf
- update to Version 1.3.0
c65b6bf
731c948
* Sat Jan 14 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.2.2-1.1
731c948
- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild
731c948
bdb9305
* Sat Jun 11 2011 Remi Collet <Fedora@FamilleCollet.com> - 1.2.2-1
bdb9305
- update to Version 1.2.2 (stable) - API 1.2.2 (stable)
bdb9305
2a78c0b
* Wed Mar 30 2011 Remi Collet <Fedora@FamilleCollet.com> - 1.2.1-1
bdb9305
- update to Version 1.2.1 (stable) - API 1.2.1 (stable)
2a78c0b
088bfa9
* Wed Feb 09 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.2.0-1.1
088bfa9
- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild
088bfa9
111100f
* Thu Jan 20 2011 Remi Collet <Fedora@FamilleCollet.com> - 1.2.0-1
111100f
- update to Version 1.2.0 (stable) - API 1.2.0 (stable)
111100f
- dont requires domxml-php4-to-php5 anymore
111100f
- fix URL
111100f
- link %%doc to pear_docdir
111100f
f94d151
* Mon Oct 04 2010 Remi Collet <Fedora@FamilleCollet.com> - 1.1.3-1
f94d151
- update to 1.1.3
f94d151
- fix CVE-2010-3690, CVE-2010-3691, CVE-2010-3692
f94d151
- set timezone during build
f94d151
b33e6ad
* Tue Aug 03 2010 Remi Collet <Fedora@FamilleCollet.com> - 1.1.2-1
b33e6ad
- update to 1.1.2
b33e6ad
- fix  CVE-2010-2795, CVE-2010-2796, #620753
b33e6ad
fe735b5
* Thu May 20 2010 Remi Collet <Fedora@FamilleCollet.com> - 1.1.1-1
fe735b5
- update to 1.1.1
fe735b5
c379ba8
* Thu May 20 2010 Remi Collet <Fedora@FamilleCollet.com> - 1.1.0-1
c379ba8
- update to 1.1.0 finale
c379ba8
c379ba8
* Sun Mar 14 2010 Remi Collet <Fedora@FamilleCollet.com> - 1.1.0-0.1.RC7
c379ba8
- initial packaging (using pear make-rpm-spec CAS-1.1.0RC7.tgz)
c379ba8