960271d
%{!?__pear: %{expand: %%global __pear %{_bindir}/pear}}
960271d
%define pear_name Crypt_Blowfish
960271d
960271d
Name:           php-pear-Crypt-Blowfish
ce23636
Version:        1.0.1
ce23636
Release:        1%{?dist}
960271d
Summary:        Quick two-way blowfish encryption
960271d
960271d
Group:          Development/Libraries
960271d
License:        BSD
960271d
URL:            http://pear.php.net/package/Crypt_Blowfish
ce23636
Source0:        http://pear.php.net/get/%{pear_name}-%{version}.tgz
960271d
BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
960271d
960271d
BuildArch:      noarch
960271d
BuildRequires:  php-pear >= 1:1.4.9-1.2
960271d
Requires:       php-pear(PEAR)
960271d
Requires(post): %{__pear}
960271d
Requires(postun): %{__pear}
960271d
Provides:       php-pear(%{pear_name}) = %{version}
960271d
960271d
960271d
%description
960271d
This package allows you to perform two-way blowfish encryption on the fly using
960271d
only PHP. This package does not require the MCrypt PHP extension to work,
960271d
although it can make use of it if available.
960271d
960271d
960271d
%prep
960271d
%setup -q -c
960271d
[ -f package2.xml ] || mv package.xml package2.xml
ce23636
mv package2.xml %{pear_name}-%{version}/%{name}.xml
ce23636
cd %{pear_name}-%{version}
960271d
960271d
960271d
%build
ce23636
cd %{pear_name}-%{version}
960271d
# Empty build section, most likely nothing required.
960271d
960271d
960271d
%install
ce23636
cd %{pear_name}-%{version}
960271d
rm -rf $RPM_BUILD_ROOT docdir
960271d
%{__pear} install --nodeps --packagingroot $RPM_BUILD_ROOT %{name}.xml
960271d
960271d
960271d
# Clean up unnecessary files
960271d
rm -rf $RPM_BUILD_ROOT%{pear_phpdir}/.??*
960271d
960271d
# Install XML package description
960271d
mkdir -p $RPM_BUILD_ROOT%{pear_xmldir}
960271d
install -pm 644 %{name}.xml $RPM_BUILD_ROOT%{pear_xmldir}
960271d
960271d
%check
960271d
# For documentation purpose only
960271d
# After install, as root :
960271d
# cd /usr/share/pear/test/Crypt_Blowfish/tests
960271d
# pear run-tests -p Crypt_Blowfish
960271d
# Should return 
960271d
# 2 PASSED TESTS
960271d
# 0 SKIPPED TESTS
960271d
960271d
960271d
%clean
960271d
rm -rf $RPM_BUILD_ROOT
960271d
960271d
960271d
%post
960271d
%{__pear} install --nodeps --soft --force --register-only \
960271d
    %{pear_xmldir}/%{name}.xml >/dev/null || :
960271d
960271d
%postun
960271d
if [ $1 -eq 0 ] ; then
960271d
    %{__pear} uninstall --nodeps --ignore-errors --register-only \
960271d
        %{pear_name} >/dev/null || :
960271d
fi
960271d
960271d
960271d
%files
960271d
%defattr(-,root,root,-)
960271d
%{pear_xmldir}/%{name}.xml
960271d
%{pear_testdir}/%{pear_name}
960271d
%{pear_phpdir}/Crypt
960271d
960271d
960271d
%changelog
ce23636
* Wed Apr 15 2009 Xavier Bachelot <xavier@bachelot.org> 1.0.1-1
ce23636
- Use 1.0.1 to be able to satisfy BR:s. First build for F-9/EL-5, thus no
ce23636
  update issue.
ce23636
960271d
* Mon Feb 23 2009 Xavier Bachelot <xavier@bachelot.org> 1.1.0-0.3.rc2
960271d
- Remove cut and paste leftover.
960271d
960271d
* Sun Feb 22 2009 Xavier Bachelot <xavier@bachelot.org> 1.1.0-0.2.rc2
960271d
- Spec file clean up, follows new guidelines more closely.
960271d
960271d
* Mon Jan 26 2009 Xavier Bachelot <xavier@bachelot.org> 1.1.0-0.1.rc2
960271d
- Initial build.