File php7-ZendFramework.spec of Package php7-ZendFramework
#
# spec file for package php7-ZendFramework
#
# 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 pkg_name ZendFramework
%if 0%{?suse_version}
%define _phpdir %{_datadir}/php7
%else
%define _phpdir %{_datadir}/php
%endif
Name: php7-ZendFramework
Version: 1.12.20
Release: 0
Summary: Object-oriented web application framework in PHP
License: BSD-3-Clause
Group: Development/Libraries/Other
URL: http://framework.zend.com/
Source0: https://packages.zendframework.com/releases/%{pkg_name}-%{version}/%{pkg_name}-%{version}.tar.gz
Source100: https://packages.zendframework.com/releases/%{pkg_name}-%{version}/%{pkg_name}-%{version}-apidoc.tar.gz
Source101: https://packages.zendframework.com/releases/%{pkg_name}-%{version}/%{pkg_name}-%{version}-manual-de.tar.gz
Source102: https://packages.zendframework.com/releases/%{pkg_name}-%{version}/%{pkg_name}-%{version}-manual-en.tar.gz
Source103: https://packages.zendframework.com/releases/%{pkg_name}-%{version}/%{pkg_name}-%{version}-manual-fr.tar.gz
Source104: https://packages.zendframework.com/releases/%{pkg_name}-%{version}/%{pkg_name}-%{version}-manual-ja.tar.gz
Source105: https://packages.zendframework.com/releases/%{pkg_name}-%{version}/%{pkg_name}-%{version}-manual-ru.tar.gz
Source106: https://packages.zendframework.com/releases/%{pkg_name}-%{version}/%{pkg_name}-%{version}-manual-zh.tar.gz
Source150: https://github.com/zendframework/zf1-extras/archive/release-%{version}.tar.gz#/zf1-extras-release-%{version}.tar.gz
BuildRequires: dos2unix
BuildRequires: php7
Requires: pcre
Requires: php-hash
Requires: php7
Requires: php7-ctype
Requires: php7-curl
Requires: php7-dom
Requires: php7-iconv
Requires: php7-pdo
Provides: php-ZendFramework = %{version}
Obsoletes: php5-ZendFramework
BuildArch: noarch
%if 0%{?suse_version}
# Documentation & dojo requirements
BuildRequires: fdupes
Requires: php7-mbstring
# Suggested modules for improved performance/functionality
Suggests: php7-bcmath
Suggests: php7-bitset
Suggests: php7-json
Suggests: php7-posix
%endif
%description
Zend Framework is an object-oriented web application framework for
PHP. It is often called a "component library", because it has many
loosely coupled components that can be used more or less
independently. ZF also provides a Model-View-Controller (MVC)
implementation that can be used to establish a basic structure for ZF
applications.
%package demos
Summary: Demos for the Zend Framework
Group: Development/Libraries/Other
Requires: %{name} = %{version}-%{release}
%description demos
This package includes Zend Framework demos for the Feeds, Gdata, Mail, OpenId,
Pdf, Search-Lucene and Services subpackages.
%package extras
Summary: Zend Framework Extras (ZendX)
Group: Development/Libraries/Other
Requires: %{name} = %{version}-%{release}
Provides: %{name}-ZendX = %{version}-%{release}
%description extras
This package includes the ZendX libraries.
%package cache-backend-memcached
Summary: Zend Framework memcache cache backend
Group: Development/Libraries/Other
Requires: %{name} = %{version}-%{release}
Requires: php7-memcached
%description cache-backend-memcached
This package contains the back end for Zend_Cache to store and retrieve data
via memcache.
%package cache-backend-sqlite
Summary: Zend Framework sqlite back end
Group: Development/Libraries/Other
Requires: %{name} = %{version}-%{release}
Requires: php7-sqlite
%description cache-backend-sqlite
This package contains the back end for Zend_Cache to store and retrieve data
via sqlite databases.
%package captcha
Summary: Zend Framework CAPTCHA component
Group: Development/Libraries/Other
Requires: %{name} = %{version}-%{release}
Requires: php7-gd
%description captcha
This package contains the Zend Framework CAPTCHA extension.
%package dojo
Summary: Dojo javascript toolkit
Group: Development/Libraries/Other
Requires: %{name} = %{version}-%{release}
Requires: unzip
%description dojo
This package contains a full copy of the Dojo Javascript toolkit from
Zend Framework externals. You may wish to install this as a reference or
to build custom Dojo layers for deployment with your site.
# %%package Db-Adapter-Db2
# Summary: Zend Framework database adapter for DB2
# Group: Development/Libraries/Other
# Requires: %%{name} = %%{version}-%%{release}
# Requires: php-ibm_db2 # Not available on openSUSE
# %%description Db-Adapter-Db2
# This package contains the files for Zend Framework necessary to connect to an
# IBM DB2 database.
%package Db-Adapter-Firebird
Summary: Zend Framework database adapter for InterBase/Firebird
Group: Development/Libraries/Other
Requires: %{name} = %{version}-%{release}
Requires: %{name}-extras = %{version}-%{release}
Requires: php7-firebird
%description Db-Adapter-Firebird
This package contains the files for Zend Framework necessary to connect to a
Firebird/InterBase database.
%package pdf
Summary: PDF document creation and manipulation
Group: Development/Libraries/Other
Requires: %{name} = %{version}-%{release}
Requires: php7-gd
%description pdf
Portable Document Format (PDF) from Adobe is the de facto standard for
cross-platform rich documents. Now, PHP applications can create or read PDF
documents on the fly, without the need to call utilities from the shell, depend
on PHP extensions, or pay licensing fees. Zend_Pdf can even modify existing PDF
documents.
* supports Adobe PDF file format
* parses PDF structure and provides access to elements
* creates or modifies PDF documents
* utilizes memory efficiently
%package manual-de
Summary: Zend Framework German programmers reference guide
Group: Documentation/HTML
Requires: %{name} = %{version}-%{release}
%description manual-de
Programmer's reference guide for Zend Framework in German.
%package manual-en
Summary: Zend Framework English programmers reference guide
Group: Documentation/HTML
Requires: %{name} = %{version}-%{release}
%description manual-en
Programmer's reference guide for Zend Framework in English.
%package manual-fr
Summary: Zend Framework French programmers reference guide
Group: Documentation/HTML
Requires: %{name} = %{version}-%{release}
%description manual-fr
Programmer's reference guide for Zend Framework in French.
%package manual-ja
Summary: Zend Framework Japanese programmers reference guide
Group: Documentation/HTML
Requires: %{name} = %{version}-%{release}
%description manual-ja
Programmer's reference guide for Zend Framework in Japanese.
%package manual-ru
Summary: Zend Framework Russian programmers reference guide
Group: Documentation/HTML
Requires: %{name} = %{version}-%{release}
%description manual-ru
Programmer's reference guide for Zend Framework in Russian.
%package manual-zh
Summary: Zend Framework simplified Chinese programmers reference guide
Group: Documentation/HTML
Requires: %{name} = %{version}-%{release}
%description manual-zh
Programmer's reference guide for Zend Framework in simplified Chinese.
%package apidoc
Summary: Zend Framework API reference guide
Group: Documentation/HTML
Requires: %{name} = %{version}-%{release}
%description apidoc
API reference guide for Zend Framework.
%prep
%setup -q -n %{pkg_name}-%{version} -a 100 -a 101 -a 102 -a 103 -a 104 -a 105 -a 106
mv %{pkg_name}-%{version}/* ./ && rm -r %{pkg_name}-%{version}
# handle "extras" subpackage
tar -xzf %{SOURCE150} --strip-components=1 --directory=extras
# remove cruft (gitignore, placeholder)
find . -name '.gitignore' -delete
find . -name '.placeholder' -delete
# This part has been removed because of licensing issues
rm -r library/Zend/Cloud/DocumentService/Adapter/WindowsAzure
rm -r library/Zend/Service/WindowsAzure
rm -r tests/Zend/Service/WindowsAzure
rm library/Zend/Cloud/*/Adapter/WindowsAzure.php
rm tests/Zend/Cloud/*/Adapter/WindowsAzure*.php
# Add shebang
sed -i -e '1i#!%{_bindir}/sh' tests/runtests.sh
sed -i -e '1i#!%{_bindir}/php' bin/zf.php
%build
find . -type f -perm /111 \
-fprint executables -exec chmod -x '{}' + >/dev/null
find . -type f -name \*.sh \
-fprint valid_executables -exec chmod +x '{}' + >/dev/null
cat executables valid_executables|sort|uniq -u > invalid_executables
chmod +x bin/zf.php
%install
# Zend Core
mkdir -p %{buildroot}/%{_phpdir}
cp -pr library/Zend %{buildroot}/%{_phpdir}
cp -pr tests %{buildroot}/%{_phpdir}/Zend
# ZendX
cp -pr extras/library/ZendX %{buildroot}/%{_phpdir}
cp -pr extras/tests %{buildroot}/%{_phpdir}/ZendX
# Manual
for lang in {de,en,fr,ja,ru,zh}; do
mkdir -p %{buildroot}/%{_datadir}/doc/ZendFramework/${lang}
cp -pr documentation/manual/core/${lang}/* %{buildroot}/%{_datadir}/doc/ZendFramework/${lang}
done
# API manual
mkdir -p %{buildroot}/%{_datadir}/doc/ZendFramework/api
cp -pr documentation/api/core/* %{buildroot}/%{_datadir}/doc/ZendFramework/api
# Zend_Tool
mkdir -p %{buildroot}%{_bindir}
cp -pr bin/zf.{php,sh} %{buildroot}%{_bindir}
ln -s -f %{_bindir}/zf.sh %{buildroot}%{_bindir}/zf
#docs
find demos/Zend -name '*.phtml' -exec dos2unix {} \;
find demos/Zend -name '*.php' -exec dos2unix {} \;
mkdir -p %{buildroot}%{_docdir}/%{name}-demos
mv demos/Zend %{buildroot}%{_docdir}/%{name}-demos
# create symlinks
%fdupes %{buildroot}
%check
# test can only be run with phpunit < 5
#cd tests
#./runtests.sh
%files
%dir %{_phpdir}/
%{_phpdir}/Zend
%exclude %{_phpdir}/Zend/Dojo
%exclude %{_phpdir}/Zend/tests
%exclude %{_phpdir}/Zend/Cache/Backend/Apc.php
%exclude %{_phpdir}/Zend/Cache/Backend/Memcached.php
%exclude %{_phpdir}/Zend/Captcha
%exclude %{_phpdir}/Zend/Pdf.php
%exclude %{_phpdir}/Zend/Pdf
%{_phpdir}/Zend/tests
%{_bindir}/zf.sh
%{_bindir}/zf.php
%{_bindir}/zf
%doc LICENSE.txt INSTALL.md README.md
%files demos
%doc %{_docdir}/%{name}-demos
%doc LICENSE.txt
%files extras
%{_phpdir}/ZendX
%exclude %{_phpdir}/ZendX/Db/Adapter/Firebird*
%exclude %{_phpdir}/ZendX/Db/Statement/Firebird*
%doc LICENSE.txt extras/documentation/manual/en/*
%files cache-backend-memcached
%{_phpdir}/Zend/Cache/Backend/Memcached.php
%doc LICENSE.txt
%files captcha
%{_phpdir}/Zend/Captcha
%doc LICENSE.txt
%files dojo
%dir %{_phpdir}/Zend/Dojo
%{_phpdir}/Zend/Dojo
%doc LICENSE.txt
%files Db-Adapter-Firebird
%{_phpdir}/ZendX/Db/Adapter/Firebird/
%{_phpdir}/ZendX/Db/Adapter/Firebird.php
%{_phpdir}/ZendX/Db/Statement/Firebird/
%{_phpdir}/ZendX/Db/Statement/Firebird.php
%doc LICENSE.txt
%files pdf
%{_phpdir}/Zend/Pdf.php
%{_phpdir}/Zend/Pdf
%doc LICENSE.txt
%files manual-de
%dir %{_datadir}/doc/ZendFramework/
%dir %{_datadir}/doc/ZendFramework/de/
%{_datadir}/doc/ZendFramework/de/*
%doc LICENSE.txt
%files manual-en
%dir %{_datadir}/doc/ZendFramework/
%dir %{_datadir}/doc/ZendFramework/en/
%{_datadir}/doc/ZendFramework/en/*
%doc LICENSE.txt
%files manual-fr
%dir %{_datadir}/doc/ZendFramework/
%dir %{_datadir}/doc/ZendFramework/fr/
%{_datadir}/doc/ZendFramework/fr/*
%doc LICENSE.txt
%files manual-ja
%dir %{_datadir}/doc/ZendFramework/
%dir %{_datadir}/doc/ZendFramework/ja/
%{_datadir}/doc/ZendFramework/ja/*
%doc LICENSE.txt
%files manual-ru
%dir %{_datadir}/doc/ZendFramework/
%dir %{_datadir}/doc/ZendFramework/ru/
%{_datadir}/doc/ZendFramework/ru/*
%doc LICENSE.txt
%files manual-zh
%dir %{_datadir}/doc/ZendFramework/
%dir %{_datadir}/doc/ZendFramework/zh/
%{_datadir}/doc/ZendFramework/zh/*
%doc LICENSE.txt
%files apidoc
%dir %{_datadir}/doc/ZendFramework/
%dir %{_datadir}/doc/ZendFramework/api/
%{_datadir}/doc/ZendFramework/api/*
%doc LICENSE.txt
%changelog