diff options
-rw-r--r-- | Makefile | 4 | ||||
-rw-r--r-- | php-pecl-yaf.spec | 146 | ||||
-rw-r--r-- | yaf.ini | 51 |
3 files changed, 201 insertions, 0 deletions
diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..13af741 --- /dev/null +++ b/Makefile @@ -0,0 +1,4 @@ +SRCDIR := $(shell pwd) +NAME := $(shell basename $(SRCDIR)) +include ../../../common/Makefile + diff --git a/php-pecl-yaf.spec b/php-pecl-yaf.spec new file mode 100644 index 0000000..7895ec6 --- /dev/null +++ b/php-pecl-yaf.spec @@ -0,0 +1,146 @@ +%{!?__pecl: %{expand: %%global __pecl %{_bindir}/pecl}} + +%global pecl_name yaf + +Summary: Yet Another Framework +Name: php-pecl-yaf +Version: 2.2.4 +Release: 1%{?dist} +# https://bugs.php.net/63239 - Please Provides LICENSE file +License: PHP +Group: Development/Languages +URL: http://pecl.php.net/package/yaf +Source0: http://pecl.php.net/get/%{pecl_name}-%{version}.tgz +Source1: %{pecl_name}.ini + +BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root +BuildRequires: php-devel >= 5.2.0 +BuildRequires: php-pear + +Requires(post): %{__pecl} +Requires(postun): %{__pecl} +Requires: php(zend-abi) = %{php_zend_api} +Requires: php(api) = %{php_core_api} + +Provides: php-pecl(%{pecl_name}) = %{version} +Provides: php-pecl(%{pecl_name})%{?_isa} = %{version} + +# Other third party repo stuff +Obsoletes: php53-pecl-yaf +Obsoletes: php53u-pecl-yaf +%if "%{php_version}" > "5.4" +Obsoletes: php54-pecl-yaf +%endif + + +# Filter private shared +%{?filter_provides_in: %filter_provides_in %{_libdir}/.*\.so$} +%{?filter_setup} + + +%description +The Yet Another Framework (Yaf) extension is a PHP framework that is used +to develop web applications. + + +%prep +%setup -q -c + +# Sanity check, really often broken +extver=$(sed -n '/#define YAF_VERSION/{s/.*\t"//;s/".*$//;p}' %{pecl_name}-%{version}/php_yaf.h ) +if test "x${extver}" != "x%{version}"; then + : Error: Upstream extension version is ${extver}, expecting %{version}. + exit 1 +fi + +%if 0%{?__ztsphp:1} +# duplicate for ZTS build +cp -pr %{pecl_name}-%{version} %{pecl_name}-zts +%endif + + +%build +cd %{pecl_name}-%{version} +%{_bindir}/phpize +%configure --with-php-config=%{_bindir}/php-config +make %{?_smp_mflags} + +%if 0%{?__ztsphp:1} +cd ../%{pecl_name}-zts +%{_bindir}/zts-phpize +%configure --with-php-config=%{_bindir}/zts-php-config +make %{?_smp_mflags} +%endif + + +%install +rm -rf %{buildroot} +# Install the NTS stuff +make -C %{pecl_name}-%{version} \ + install INSTALL_ROOT=%{buildroot} +install -D -m 644 %{SOURCE1} %{buildroot}%{_sysconfdir}/php.d/%{pecl_name}.ini + +# Install the ZTS stuff +%if 0%{?__ztsphp:1} +make -C %{pecl_name}-zts \ + install INSTALL_ROOT=%{buildroot} +install -D -m 644 %{SOURCE1} %{buildroot}%{php_ztsinidir}/%{pecl_name}.ini +%endif + +# Install the package XML file +install -D -m 644 package2.xml %{buildroot}%{pecl_xmldir}/%{name}.xml + + +%check +cd %{pecl_name}-%{version} + +TEST_PHP_EXECUTABLE=%{_bindir}/php \ +TEST_PHP_ARGS="-n -d extension_dir=$PWD/modules -d extension=%{pecl_name}.so" \ +NO_INTERACTION=1 \ +REPORT_EXIT_STATUS=1 \ +%{_bindir}/php -n run-tests.php + +%if 0%{?__ztsphp:1} +cd ../%{pecl_name}-zts + +TEST_PHP_EXECUTABLE=%{__ztsphp} \ +TEST_PHP_ARGS="-n -d extension_dir=$PWD/modules -d extension=%{pecl_name}.so" \ +NO_INTERACTION=1 \ +REPORT_EXIT_STATUS=1 \ +%{__ztsphp} -n run-tests.php +%endif + + +%post +%{pecl_install} %{pecl_xmldir}/%{name}.xml >/dev/null || : + + +%postun +if [ $1 -eq 0 ] ; then + %{pecl_uninstall} %{pecl_name} >/dev/null || : +fi + + +%clean +rm -rf %{buildroot} + + +%files +%defattr(-,root,root,-) +%doc %{pecl_name}-%{version}/CREDITS + +%config(noreplace) %{_sysconfdir}/php.d/%{pecl_name}.ini +%{php_extdir}/%{pecl_name}.so +%{pecl_xmldir}/%{name}.xml + +%if 0%{?__ztsphp:1} +%{php_ztsextdir}/%{pecl_name}.so +%config(noreplace) %{php_ztsinidir}/%{pecl_name}.ini +%endif + + +%changelog +* Tue Sep 4 2012 Remi Collet <remi@fedoraproject.org> - 2.2.4-1 +- version 2.2.4 (beta) +- initial package + @@ -0,0 +1,51 @@ +; Enable "Yet Another Framework" extension module +extension = yaf.so + +; Runtime configuration +; http://www.php.net/manual/en/yaf.configuration.php + +; The global library path, Yaf_loader will search global library in this directory. +;yaf.library = "" + +; If there is only one part in PATH_INFO, should it consider as a controller or action. +;yaf.action_prefer = 0 + +; Whether lowercase all the path during the class autoloading. +;yaf.lowcase_path = 0 + +; When this value is On, if Yaf_Loader can not find a class, it will return FALSE, +; then give chance to other auto load function to be called. +; When this value is Off(default), Yaf_Loader::autoload() will always return TRUE. +;yaf.use_spl_autoload = 0 + + +; The max forward count, default is 5. +; That means you can have a max value of 5 in the forward stack. +; This is a protection for prevent recursive Yaf_Controller_Abstract::forward(). +;yaf.forward_limit = 5 + +; When this On, Yaf_Loader will identify a class by it's suffix to decide whether it is a MVC Class. +; When this Off, Yaf_Loader will look at the prefix of the class name. +;yaf.name_suffix = 1 + +; When this is not empty, Yaf_Loader will identify the class suffix and string value of this. +; For example, when this value is "_", Yaf_Loader will take Index_Controller as a Controller Class, +; IndexController as a normal class. +;yaf.name_separator = "" + + +; If this is On, and in the meantime you are using ini config file as the parameter of Yaf_Application(), +; the compiling result of the ini config file will be cached in the PHP process. +;yaf.cache_config = 0 + +; This value is "product" by default, used for Yaf to fetch the config section of a ini config file. +; That is, if this value is "product", Yaf will use the section named "product" in the ini config +; file (the first parameter of the Yaf_Application) as the final config of the Yaf_Application. +;yaf.environ = "product" + +; If this value is On, All class of Yaf will named in namespace style. +; For example, Yaf_Route_Rewrite => \Yaf\Route\Rewrite, +; Yaf_Controller_Abstract => \Yaf\Controller_Abstract +; (Abstract is the keyword, can not used as a class name) +;yaf.use_namespace = 0 + |