8159751
%{!?__pear: %{expand: %%global __pear %{_bindir}/pear}}
8159751
%global pear_name CAS
8159751
%global channel   __uri
8159751
#global prever    RC7
8159751
8159751
8159751
Name:           php-pear-CAS
8159751
Version:        1.1.0
8159751
Release:        %{?prever:0.}1%{?prever:.}%{?prever}%{?dist}
8159751
Summary:        Central Authentication Service client library in php
8159751
8159751
Group:          Development/Libraries
8159751
License:        BSD
8159751
URL:            http://www.ja-sig.org/wiki/display/CASC/phpCAS
8159751
Source0:        http://www.ja-sig.org/downloads/cas-clients/php/%{version}%{?prever}/%{pear_name}-%{version}%{?prever}.tgz
8159751
8159751
Patch0:         php-pear-CAS-systemlibs.patch
8159751
8159751
BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
8159751
BuildArch:      noarch
8159751
BuildRequires:  php-pear >= 1:1.4.9-1.2
8159751
8159751
Requires(post): %{__pear}
8159751
Requires(postun): %{__pear}
8159751
Requires:       php-pear(DB) >= 1.4.0
8159751
Requires:       php-pear(PEAR) >= 1.4.3
8159751
Requires:       php-domxml-php4-php5
8159751
Provides:       php-pear(%{channel}/%{pear_name}) = %{version}
8159751
# this library is mostly known as phpCAS
8159751
Provides:       phpCAS = %{version}-%{release}
8159751
8159751
8159751
%description
8159751
This package is a PEAR library for using a Central Authentication Service.
8159751
8159751
8159751
%prep
8159751
%setup -q -c
8159751
8159751
# Package is V2
8159751
mv package.xml %{pear_name}-%{version}%{?prever}/%{name}.xml
8159751
cd %{pear_name}-%{version}%{?prever}
8159751
8159751
%patch0 -p1 -b .systemlib
8159751
8159751
8159751
%build
8159751
cd %{pear_name}-%{version}%{?prever}
8159751
# Empty build section, most likely nothing required.
8159751
8159751
8159751
%install
8159751
rm -rf $RPM_BUILD_ROOT docdir
8159751
cd %{pear_name}-%{version}%{?prever}
8159751
%{__pear} install --nodeps --packagingroot $RPM_BUILD_ROOT %{name}.xml
8159751
8159751
8159751
# Move documentation
8159751
mv $RPM_BUILD_ROOT%{pear_docdir}/%{pear_name} ../docdir
8159751
for fic in ../docdir/docs/examples/example*.php; do
8159751
   sed -i -e 's/\r//' $fic
8159751
done
8159751
8159751
# Clean up unnecessary files
8159751
rm -rf $RPM_BUILD_ROOT%{pear_phpdir}/.??*
8159751
8159751
# Install XML package description
8159751
mkdir -p $RPM_BUILD_ROOT%{pear_xmldir}
8159751
install -pm 644 %{name}.xml $RPM_BUILD_ROOT%{pear_xmldir}
8159751
8159751
8159751
%clean
8159751
rm -rf $RPM_BUILD_ROOT
8159751
8159751
8159751
%post
8159751
%{__pear} install --nodeps --soft --force --register-only \
8159751
    %{pear_xmldir}/%{name}.xml >/dev/null || :
8159751
8159751
%postun
8159751
if [ $1 -eq 0 ] ; then
8159751
    %{__pear} uninstall --nodeps --ignore-errors --register-only \
8159751
        %{channel}/%{pear_name} >/dev/null || :
8159751
fi
8159751
8159751
8159751
%files
8159751
%defattr(-,root,root,-)
8159751
%doc docdir/docs/*
8159751
%{pear_xmldir}/%{name}.xml
8159751
%{pear_phpdir}/CAS
8159751
%{pear_phpdir}/CAS.php
8159751
8159751
8159751
%changelog
8159751
* Thu May 20 2010 Remi Collet <Fedora@FamilleCollet.com> - 1.1.0-1
8159751
- update to 1.1.0 finale
8159751
8159751
* Sun Mar 14 2010 Remi Collet <Fedora@FamilleCollet.com> - 1.1.0-0.1.RC7
8159751
- initial packaging (using pear make-rpm-spec CAS-1.1.0RC7.tgz)
8159751