diff options
author | Elan Ruusamäe | 2015-05-24 17:52:39 (GMT) |
---|---|---|
committer | Elan Ruusamäe | 2015-05-24 17:52:43 (GMT) |
commit | a4c23b9a5de4260e6657d83f1e16b35d817415c7 (patch) | |
tree | 9e29f9405005728897206ca5922624fc60ae126f | |
download | php-pecl-mysql-a4c23b9a5de4260e6657d83f1e16b35d817415c7.zip php-pecl-mysql-a4c23b9a5de4260e6657d83f1e16b35d817415c7.tar.gz |
new, version 1.0.0
to be used with php 7.0
-rw-r--r-- | php-pecl-mysql.spec | 100 |
1 files changed, 100 insertions, 0 deletions
diff --git a/php-pecl-mysql.spec b/php-pecl-mysql.spec new file mode 100644 index 0000000..c8ff1b8 --- /dev/null +++ b/php-pecl-mysql.spec @@ -0,0 +1,100 @@ +# +# Conditional build: +%bcond_without tests # build without tests +%bcond_without mysqlnd # without mysqlnd support in mysql related extensions + +%define php_name php%{?php_suffix} +%define modname mysql +Summary: MySQL database module for PHP +Summary(pl.UTF-8): Moduł bazy danych MySQL dla PHP +Summary(pt_BR.UTF-8): Um módulo para aplicações PHP que usam bancos de dados MySQL +Name: %{php_name}-pecl-%{modname} +Version: 1.0.0 +Release: 1 +License: PHP 3.01 +Group: Development/Languages/PHP +Source0: http://git.php.net/?p=pecl/database/mysql.git;a=snapshot;h=01751ce1a8881ffaa111b5bda2139cc87aa9091b;sf=tgz;/php-pecl-%{modname}-%{version}.tar.gz +# Source0-md5: f010c5f2d56727196ec93991dd42261e +URL: http://php.net/manual/en/book.mysql.php +%{?with_tests:BuildRequires: %{php_name}-cli} +BuildRequires: %{php_name}-devel >= 4:7.0.0 +BuildRequires: rpmbuild(macros) >= 1.666 +%if %{with tests} +BuildRequires: %{php_name}-cli +BuildRequires: %{php_name}-pcre +%{?with_mysqlnd:BuildRequires: %{php_name}-mysqlnd} +%endif +%{?requires_php_extension} +Provides: php(mysql) = %{version} +BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) + +%description +This is a dynamic shared object (DSO) for PHP that will add MySQL +database support. + +This extension provides the mysql family of functions that were +provided with PHP 3-5. These functions have been superseded by MySQLi +and PDO_MySQL, which continue to be bundled with PHP 7. + +You are strongly encouraged to port your code to use either MySQLi or +PDO_MySQL, as this extension is not maintained and is available for +historical reasons only. + +%prep +%setup -qc +mv %{modname}-*/* . + +%build +phpize +%configure \ + --with-mysql=shared,%{!?with_mysqlnd:/usr}%{?with_mysqlnd:mysqlnd} \ + --with-mysql-sock=/var/lib/mysql/mysql.sock \ + --with-zlib-dir=shared,/usr \ + +%{__make} + +%if %{with tests} +# simple module load test +%{__php} -n -q \ + -d extension_dir=modules \ +%if %{with mysqlnd} + -d extension=%{php_extensiondir}/mysqlnd.so \ +%endif + -d extension=%{modname}.so \ + -m > modules.log +grep %{modname} modules.log + +export NO_INTERACTION=1 REPORT_EXIT_STATUS=1 MALLOC_CHECK_=2 +%{__make} test \ + PHP_EXECUTABLE=%{__php} \ + PHP_TEST_SHARED_SYSTEM_EXTENSIONS="%{?with_mysqlnd:mysqlnd}" \ +%endif + +%install +rm -rf $RPM_BUILD_ROOT +%{__make} install \ + EXTENSION_DIR=%{php_extensiondir} \ + INSTALL_ROOT=$RPM_BUILD_ROOT + +install -d $RPM_BUILD_ROOT%{php_sysconfdir}/conf.d +cat <<'EOF' > $RPM_BUILD_ROOT%{php_sysconfdir}/conf.d/%{modname}.ini +; Enable %{modname} extension module +extension=%{modname}.so +EOF + +%clean +rm -rf $RPM_BUILD_ROOT + +%post +%php_webserver_restart + +%postun +if [ "$1" = 0 ]; then + %php_webserver_restart +fi + +%files +%defattr(644,root,root,755) +%doc README.md CREDITS LICENSE +%config(noreplace) %verify(not md5 mtime size) %{php_sysconfdir}/conf.d/%{modname}.ini +%attr(755,root,root) %{php_extensiondir}/%{modname}.so |