A new user interface for you! Read more...

File php5-pear-phpexcel.spec of Package php5-pear-phpexcel

#
# spec file for package php5-pear-phpexcel
#
# Copyright (c) 2016 SUSE LINUX GmbH, Nuernberg, Germany.
# Copyright (c) 2011, 2013 Weberhofer GmbH, Austria
#
# 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/
#


%{!?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}}
%define pear_name  PHPExcel
%define pear_sname phpexcel
Name:           php5-pear-%{pear_sname}
Version:        1.8.1
Release:        0
Summary:        OpenXML Excel 2007 classes
License:        LGPL-2.1
Group:          Development/Libraries/Other
Url:            http://phpexcel.codeplex.com/
Source0:        %{pear_name}-%{version}.tar.gz
Source1:        package.xml
BuildRequires:  php-pear
BuildRequires:  php5-pear-channel-pearplex
Requires:       php >= 5.2.0
Requires:       php-gd
Requires:       php-pear
Requires:       php-zip
Requires:       php5-pear-channel-pearplex
Requires(post): php-pear
Requires(postun): php-pear
Provides:       %{pear_sname} = %{version}
Provides:       php-pear(%{pear_name}) = %{version}
Provides:       php-pear(%{pear_sname}) = %{version}
Provides:       php5-pear(%{pear_name}) = %{version}
Obsoletes:      %{pear_sname} < %{version}
Provides:       tine20-base-phpexcel = %{version}
Obsoletes:      tine20-base-phpexcel < %{version}
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
BuildArch:      noarch
%if 0%{?suse_version}
Requires:       php-xmlreader
Requires:       php-xmlwriter
%else
Requires:       php-xml
%endif

%description
Project providing a set of classes for the PHP programming language,
which allow you to write to and read from different file formats,
like Excel 2007, PDF, HTML, ... This project is built around
Microsoft's OpenXML standard and PHP.

Sources are available on http://www.codeplex.com/PHPExcel

Original PEAR Packages can be found at http://pear.pearplex.net

Tools for building fonts has been removed from the package. These tools
can be found at http://www.tcpdf.org/

%prep
%setup -q -n %{pear_name}-%{version}/Classes
cp %{SOURCE1} .

%build
# remove binary tools for building fonts from the package
sed -e 's/^.*PHPExcel\/Shared\/PDF\/fonts\/utils\/.*//' -i package.xml
# remove the baseinstalldir, as it is wrong
sed -e 's/baseinstalldir="PHPExcel"//' -i package.xml

%install
%{__pear} -d date.timezone=UTC 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}

%clean
rm -rf %{buildroot}

%post
if [ "$1" = "1" ]; then
  # install (rpm -i)
  %{__pear} install --nodeps --soft --force --register-only %{pear_xmldir}/%{pear_name}.xml ||:
fi
if [ "$1" = "2" ]; then
  # update (rpm -U)
  %{__pear} upgrade --offline --register-only %{pear_xmldir}/%{pear_name}.xml ||:
fi

%postun
if [ "$1" -eq "0" ] ; then
# uninstall (rpm -e)
%{__pear} uninstall --nodeps --ignore-errors --register-only %{pear_name} >/dev/null ||:
fi

%files
%defattr(0644,root,root,0755)
%{pear_phpdir}/*
%{pear_xmldir}/%{pear_name}.xml

%changelog