[packages/php-stumblecache] new, version 1.0.0-dev
glen
glen at pld-linux.org
Fri Jul 11 08:35:01 CEST 2014
commit 3d99b1255bc60c78fd1bfe88bd8e81c4e859de90
Author: Elan Ruusamäe <glen at delfi.ee>
Date: Fri Jul 11 09:34:05 2014 +0300
new, version 1.0.0-dev
requires unreleased igbinary 1.1.2 to build
php-stumblecache.spec | 107 ++++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 107 insertions(+)
---
diff --git a/php-stumblecache.spec b/php-stumblecache.spec
new file mode 100644
index 0000000..f055cf6
--- /dev/null
+++ b/php-stumblecache.spec
@@ -0,0 +1,107 @@
+# TODO
+# - add php55 support
+
+# Conditional build:
+%bcond_without tests # build without tests
+
+%define php_name php%{?php_suffix}
+%define modname stumblecache
+Summary: StumbleCache is a mmap backed caching extension for PHP
+Name: %{php_name}-%{modname}
+Version: 1.0.0
+Release: 0.1
+License: PHP 3.01
+Group: Development/Languages/PHP
+Source0: https://github.com/stumbleupon/stumblecache/archive/master/%{modname}-%{version}.tar.gz
+# Source0-md5: 9dc64c217d4e0ae0bd6da7aece246ea4
+URL: https://github.com/stumbleupon/stumblecache
+BuildRequires: %{php_name}-devel
+BuildRequires: %{php_name}-pecl-igbinary-devel >= 1.1.2
+BuildRequires: rpmbuild(macros) >= 1.666
+%if %{with tests}
+BuildRequires: %{php_name}-cli
+BuildRequires: %{php_name}-pcre
+BuildRequires: %{php_name}-pecl-igbinary
+BuildRequires: %{php_name}-session
+BuildRequires: %{php_name}-spl
+%endif
+%{?requires_php_extension}
+Provides: php(%{modname}) = %{version}
+BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
+
+%description
+Stumblecache is a high performance shared memory cache that scales to
+tens of gigabytes of cache, thousands of requests per second, and high
+update rates. It was created to allow Stumbleupon to cache large
+amounts of short ttl url data on our webserver and worker tiers.
+
+You can think of it as a replacement for the user caching portion of
+apc, though different tradeoffs have been made and stumblecache will
+be less space efficient in most cases.
+
+- MMAP based
+- Fixed allocations ie. 500k 2k cache blocks
+
+%prep
+%setup -qc
+mv %{modname}-*/* .
+
+%build
+phpize
+%configure
+%{__make}
+
+%if %{with tests}
+# simple module load test
+%{__php} -n -q \
+ -d extension_dir=modules \
+ -d extension=%{php_extensiondir}/spl.so \
+ -d extension=%{php_extensiondir}/session.so \
+ -d extension=%{php_extensiondir}/igbinary.so \
+ -d extension=%{php_extensiondir}/pcre.so \
+ -d extension=%{modname}.so \
+ -m > modules.log
+grep %{modname} modules.log
+
+cat <<'EOF' > run-tests.sh
+#!/bin/sh
+export NO_INTERACTION=1 REPORT_EXIT_STATUS=1 MALLOC_CHECK_=2
+%{__make} test \
+ PHP_EXECUTABLE=%{__php} \
+ PHP_TEST_SHARED_SYSTEM_EXTENSIONS="spl session pcre" \
+ RUN_TESTS_SETTINGS="-q $*"
+EOF
+
+chmod +x run-tests.sh
+./run-tests.sh -w failed.log
+test -f failed.log -a ! -s failed.log
+%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 CREDITS EXPERIMENTAL
+%config(noreplace) %verify(not md5 mtime size) %{php_sysconfdir}/conf.d/%{modname}.ini
+%attr(755,root,root) %{php_extensiondir}/%{modname}.so
================================================================
---- gitweb:
http://git.pld-linux.org/gitweb.cgi/packages/php-stumblecache.git/commitdiff/3d99b1255bc60c78fd1bfe88bd8e81c4e859de90
More information about the pld-cvs-commit
mailing list