File php7-pear-Auth_SASL.spec of Package php7-pear-Auth_SASL
#
# spec file for package php7-pear-Auth_SASL
#
# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via http://bugs.opensuse.org/
#
%define php_name php7
%define pear_name Auth_SASL
%define pear_sname auth_sasl
%{!?pear_phpdir: %{expand: %%global pear_phpdir %(pear config-get php_dir 2> /dev/null)}}
%{!?pear_xmldir: %{expand: %%global pear_xmldir %{_localstatedir}/lib/pear}}
%{!?__pear: %{expand: %%global __pear %{_bindir}/pear}}
Name: php7-pear-Auth_SASL
Version: 1.1.0
Release: 0
Summary: Abstraction of various SASL mechanism responses
License: BSD-3-Clause
Group: Productivity/Networking/Web/Servers
Url: http://pear.php.net/package/%{pear_name}
Source: http://pear.php.net/get/%{pear_name}-%{version}.tgz
BuildRequires: %{php_name}
BuildRequires: %{php_name}-pear >= 1.10.1
BuildRequires: php7-pear-Archive_Tar
Requires: %{php_name}
Requires: %{php_name}-pear >= 1.10.1
Requires: php7-pear-Archive_Tar
Provides: php-pear-%{pear_name} = %{version}
Provides: php-pear(%{pear_name}) = %{version}
Provides: php-pear(%{pear_sname}) = %{version}
Obsoletes: %{php_name}-pear-%{pear_sname} < %{version}
Obsoletes: php-pear-%{pear_sname} < %{version}
Obsoletes: pear-%{pear_sname} < %{version}
Obsoletes: php5-pear-Auth_SASL
BuildArch: noarch
%description
Provides code to generate responses to common SASL mechanisms, including:
- Digest-MD5
- CramMD5
- Plain
- Anonymous
- Login (Pseudo mechanism)
%prep
%setup -q %setup -q -n %{pear_name}-%{version}
mv ../package.xml .
%build
%install
%{__pear} install --nodeps --offline --packagingroot %{buildroot} package.xml
install -D -m 0644 package.xml %{buildroot}%{pear_xmldir}/%{pear_name}.xml
rm -rf %{buildroot}/{doc,tmp}
rm -rf %{buildroot}/%{pear_phpdir}/.{filemap,lock,registry,channels,depdb,depdblock}
%post
# on `rpm -ivh` PARAM is 1
# on `rpm -Uvh` PARAM is 2
if [ "$1" = "1" ]; then
%{__pear} install --nodeps --soft --force --register-only %{pear_xmldir}/%{pear_name}.xml
fi
if [ "$1" = "2" ]; then
%{__pear} upgrade --offline --register-only %{pear_xmldir}/%{pear_name}.xml
fi
%postun
# on `rpm -e` PARAM is 0
if [ "$1" = "0" ]; then
%{__pear} uninstall --nodeps --ignore-errors --register-only pear.php.net/%{pear_name}
fi
%files
%{pear_phpdir}/*
%{pear_xmldir}/%{pear_name}.xml
%changelog