Files
php7-pear/php7-pear.spec
Arjen de Korte 3b36b68044 Accepting request 751141 from home:adkorte
- Only use the GPG keys of Chuck Burgess. Extracted from the 
  Release Manager public keys.
- Add release versions of PEAR modules

OBS-URL: https://build.opensuse.org/request/show/751141
OBS-URL: https://build.opensuse.org/package/show/devel:languages:php/php7-pear?expand=0&rev=4
2019-11-26 20:26:13 +00:00

163 lines
5.3 KiB
RPMSpec

#
# spec file for package php7-pear
#
# Copyright (c) 2019 SUSE LLC
#
# 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 https://bugs.opensuse.org/
#
%define v_Archive_Tar 1.4.8
%define v_Console_Getopt 1.4.3
%define v_PEAR 1.10.10
%define v_Structures_Graph 1.1.1
%define v_XML_Util 1.4.3
%global peardir %{_datadir}/php7/PEAR
%global metadir %{_localstatedir}/lib/pear
Name: php7-pear
Version: 1.10.17
Release: 0
Summary: PHP Extension and Application Repository
License: BSD-2-Clause
Group: Development/Libraries/PHP
URL: https://pear.php.net/package/pearweb_phars
Source0: https://github.com/pear/pearweb_phars/raw/v%{version}/install-pear-nozlib.phar
Source1: https://github.com/pear/pearweb_phars/raw/v%{version}/install-pear-nozlib.sig#/install-pear-nozlib.phar.sig
Source2: %{name}.keyring
Source3: %{name}.rpmlintrc
BuildRequires: php7
BuildRequires: php7-phar
Requires: php7
Provides: php-pear(Archive_Tar) = %{v_Archive_Tar}
Provides: php-pear(Console_Getopt) = %{v_Console_Getopt}
Provides: php-pear(PEAR) = %{v_PEAR}
Provides: php-pear(Structures_Graph) = %{v_Structures_Graph}
Provides: php-pear(XML_Util) = %{v_XML_Util}
Provides: php-pear = %{version}
Obsoletes: php-pear < %{version}
BuildArch: noarch
%description
PEAR is a code repository for PHP extensions and PHP library code
similar to TeX's CTAN and Perl's CPAN. This package provides an access
to the repository.
See https://pear.php.net/manual for more details.
%package -n php7-pecl
Summary: PHP Extension Community Library
Requires: autoconf
Requires: automake
Requires: gcc-c++
Requires: libtool
Requires: php7-pear
Provides: php-pecl = %{version}
Obsoletes: php-pecl < %{version}
BuildArch: noarch
%description -n php7-pecl
PECL is a repository for PHP Extensions, providing a directory of
all known extensions and hosting facilities for downloading and
development of PHP extensions.
See https://pecl.php.net for more details.
%prep
v=$(sed -n 's/.*=>.*Archive_Tar-\(.*\)\.tar.*/\1/p' %{SOURCE0})
if test "x${v}" != "x%{v_Archive_Tar}"; then
: ERROR: Upstream Archive_Tar version is now ${v}, expecting %{v_Archive_Tar}.
exit 1
fi
v=$(sed -n 's/.*=>.*Console_Getopt-\(.*\)\.tar.*/\1/p' %{SOURCE0})
if test "x${v}" != "x%{v_Console_Getopt}"; then
: ERROR: Upstream Console_Getopt version is now ${v}, expecting %{v_Console_Getopt}.
exit 1
fi
v=$(sed -n 's/.*=>.*PEAR-\(.*\)\.tar.*/\1/p' %{SOURCE0})
if test "x${v}" != "x%{v_PEAR}"; then
: ERROR: Upstream PEAR version is now ${v}, expecting %{v_PEAR}.
exit 1
fi
v=$(sed -n 's/.*=>.*Structures_Graph-\(.*\)\.tar.*/\1/p' %{SOURCE0})
if test "x${v}" != "x%{v_Structures_Graph}"; then
: ERROR: Upstream Structures_Graph version is now ${v}, expecting %{v_Structures_Graph}.
exit 1
fi
v=$(sed -n 's/.*=>.*XML_Util-\(.*\)\.tar.*/\1/p' %{SOURCE0})
if test "x${v}" != "x%{v_XML_Util}"; then
: ERROR: Upstream XML_Util version is now ${v}, expecting %{v_XML_Util}.
exit 1
fi
%build
# Empty build section, nothing to build
%install
export PHP_PEAR_SIG_BIN=%{_bindir}/gpg
export PHP_PEAR_SYSCONF_DIR=%{_sysconfdir}/php7/cli
export INSTALL_ROOT=%{buildroot}
install -d %{buildroot}%{_localstatedir}/cache/pear
php -d date.timezone=UTC -d memory_limit=64M -d short_open_tag=0 -d safe_mode=0 \
-d 'error_reporting=E_ALL&~E_DEPRECATED' -d detect_unicode=0 %{SOURCE0} \
--force \
--bin %{_bindir} \
--cache %{_localstatedir}/cache/pear \
--dir %{peardir} \
--doc %{_docdir}/pear \
--man %{_mandir} \
--metadata %{metadir} \
--www %{peardir}/htdocs
rm -rf %{buildroot}/{.depdb,.depdblock}
%pre
if [ -d %{peardir}/.registry -a ! -d %{metadir}/.registry ]; then
mkdir -p %{metadir}
cp -af %{peardir}/.??* %{metadir}
fi
%posttrans
mdir=$(%{_bindir}/pear config-get metadata_dir system)
if [ "${mdir}" != "%{metadir}" -a -d %{metadir}/.registry ]; then
%{_bindir}/pear config-set metadata_dir %{metadir} system
%{_bindir}/pear config-set metadata_dir %{metadir}
rm -rf %{peardir}/.??*
fi
%files
%doc %{_docdir}/*
%{_bindir}/pear
%config(noreplace) %{_sysconfdir}/php7/cli/pear.conf
%dir %{peardir}
%{peardir}/*
%dir %{metadir}
%{metadir}/.??*
%dir %{_localstatedir}/cache/pear
%exclude %{_bindir}/peardev
%exclude %{_docdir}/pear/PEAR/INSTALL
%exclude %{metadir}/{.depdblock,.lock}
%exclude %{metadir}/.channels/.alias/pecl.txt
%exclude %{metadir}/.channels/pecl.php.net.reg
%exclude %{metadir}/.registry/.channel.pecl.php.net
%exclude %{peardir}/test
%files -n php7-pecl
%{_bindir}/pecl
%{metadir}/.channels/.alias/pecl.txt
%{metadir}/.channels/pecl.php.net.reg
%{metadir}/.registry/.channel.pecl.php.net
%changelog