summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Makefile4
-rw-r--r--apcu-panel.conf17
-rw-r--r--apcu.conf.php23
-rw-r--r--apcu.ini72
-rw-r--r--php-pecl-apcu.spec206
5 files changed, 322 insertions, 0 deletions
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..91b0fd5
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,4 @@
+SRCDIR := $(shell pwd)
+NAME := $(shell basename $(SRCDIR))
+include ../../common/Makefile
+
diff --git a/apcu-panel.conf b/apcu-panel.conf
new file mode 100644
index 0000000..e51a40f
--- /dev/null
+++ b/apcu-panel.conf
@@ -0,0 +1,17 @@
+# APC Control Panel
+Alias /apcu-panel /usr/share/apcu-panel
+
+<Directory /usr/share/apcu-panel>
+ <IfModule mod_authz_core.c>
+ # Apache 2.4
+ Require local
+ </IfModule>
+ <IfModule !mod_authz_core.c>
+ # Apache 2.2
+ Order Deny,Allow
+ Deny from All
+ Allow from 127.0.0.1
+ Allow from ::1
+ </IfModule>
+</Directory>
+
diff --git a/apcu.conf.php b/apcu.conf.php
new file mode 100644
index 0000000..8ed5320
--- /dev/null
+++ b/apcu.conf.php
@@ -0,0 +1,23 @@
+<?php
+define('USE_AUTHENTICATION',1); // Use (internal) authentication - best choice if
+ // no other authentication is available
+ // If set to 0:
+ // There will be no further authentication. You
+ // will have to handle this by yourself!
+ // If set to 1:
+ // You need to change ADMIN_PASSWORD to make
+ // this work!
+define('ADMIN_USERNAME','apc'); // Admin Username
+define('ADMIN_PASSWORD','password'); // Admin Password - CHANGE THIS TO ENABLE!!!
+
+// (beckerr) I'm using a clear text password here, because I've no good idea how to let
+// users generate a md5 or crypt password in a easy way to fill it in above
+
+//define('DATE_FORMAT', "d.m.Y H:i:s"); // German
+//define('DATE_FORMAT', "d/m/Y H:i:s"); // French
+define('DATE_FORMAT', 'Y/m/d H:i:s'); // US
+
+define('GRAPH_SIZE',200); // Image size
+
+//define('PROXY', 'tcp://127.0.0.1:8080');
+
diff --git a/apcu.ini b/apcu.ini
new file mode 100644
index 0000000..4a7484a
--- /dev/null
+++ b/apcu.ini
@@ -0,0 +1,72 @@
+; Enable APCu extension module
+extension = apcu.so
+
+; This can be set to 0 to disable APCu
+apc.enabled=1
+
+; Setting this enables APCu for the CLI version of PHP
+; (Mostly for testing and debugging).
+;apc.enable_cli=0
+
+; Sets the path to text files containing caches to load from disk upon
+; initialization of APCu. preload_path should be a directory where each
+; file follows $key.data where $key should be used as the entry name
+; and the contents of the file contains serialized data to use as the value
+; of the entry.
+;apc.preload_path=
+
+; The size of each shared memory segment, with M/G suffixe
+;apc.shm_size=32M
+
+; The number of seconds a cache entry is allowed to idle in a slot in case
+; this cache entry slot is needed by another entry.
+;apc.ttl=0
+
+; The number of seconds that a cache entry may remain on the
+; garbage-collection list.
+;apc.gc_ttl=3600
+
+; If you begin to get low on resources, an expunge of the cache
+; is performed if it is less than half full. This is not always
+; a suitable way of determining if an expunge of the cache
+; should be per apc.smart allows you to set a runtime configuration
+; value which is used to determine if an expunge should be run
+; if (available_size < apc.smart * requested_size)
+;apc.smart=0
+
+; A "hint" about the number variables expected in the cache.
+; Set to zero or omit if you are not sure;
+;apc.entries_hint=4096
+
+; The mktemp-style file_mask to pass to the mmap module
+apc.mmap_file_mask=/tmp/apc.XXXXXX
+
+; On very busy servers whenever you start the server or
+; modify files you can create a race of many processes
+; all trying to cache the same data at the same time.
+; By default, APCu attempts to prevent "slamming" of a key.
+; A key is considered "slammed" if it was the last key set,
+; and a context other than the current one set it ( ie. it
+; was set by another process or thread )
+;apc.slam_defense=1
+
+; Defines which serializer should be used
+; Default is the standard PHP serializer.
+;apc.serializer='default'
+
+; use the SAPI request start time for TTL
+;apc.use_request_time=1
+
+; Enables APCu handling of signals, such as SIGSEGV, that write core files
+; when signaled. APCu will attempt to unmap the shared memory segment in
+; order to exclude it from the core file
+;apc.coredump_unmap=0
+
+
+; RFC1867 File Upload Progress hook handler
+;apc.rfc1867=0
+;apc.rfc1867_prefix =upload_
+;apc.rfc1867_name=APC_UPLOAD_PROGRESS
+;apc.rfc1867_freq=0
+;apc.rfc1867_ttl=3600
+
diff --git a/php-pecl-apcu.spec b/php-pecl-apcu.spec
new file mode 100644
index 0000000..f5acc91
--- /dev/null
+++ b/php-pecl-apcu.spec
@@ -0,0 +1,206 @@
+%{!?php_inidir: %{expand: %%global php_inidir %{_sysconfdir}/php.d}}
+%{!?php_incldir: %{expand: %%global php_incldir %{_includedir}/php}}
+%global pecl_name apcu
+%global commit 4322fad60f018f10f533ac4946799ef4e3dbd0fd
+%global gitver %(c=%{commit}; echo ${c:0:7})
+%global with_zts 0%{?__ztsphp:1}
+
+Name: php-apcu
+Summary: Shared memory user data cache for PHP
+Version: 4.0.0
+Release: 0.4%{?gitver:.git%{gitver}}%{?dist}
+Source0: https://github.com/krakjoe/%{pecl_name}/archive/%{commit}/%{pecl_name}-%{version}-%{gitver}.tar.gz
+Source1: %{pecl_name}.ini
+Source2: %{pecl_name}-panel.conf
+Source3: %{pecl_name}.conf.php
+
+License: PHP
+Group: Development/Languages
+URL: https://github.com/krakjoe/yac
+
+BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
+BuildRequires: php-devel
+
+# Should be a drop in replacement for APC, will Obsolete it in the future
+Conflicts: php-pecl-apc
+# Same provides than APC, this is a drop in replacement
+Provides: php-apc = %{version}
+Provides: php-apc%{?_isa} = %{version}
+Provides: php-pecl-apc = %{version}
+Provides: php-pecl-apc%{?_isa} = %{version}
+Provides: php-pecl(APC) = %{version}
+Provides: php-pecl(APC)%{?_isa} = %{version}
+
+# Filter private shared
+%{?filter_provides_in: %filter_provides_in %{_libdir}/.*\.so$}
+%{?filter_setup}
+
+
+%description
+APCu is userland caching: APC stripped of opcode caching in preparation
+for the deployment of Zend Optimizer+ as the primary solution to opcode
+caching in future versions of PHP.
+
+APCu has a revised and simplified codebase, by the time the PECL release
+is available, every part of APCu being used will have received review and
+where necessary or appropriate, changes.
+
+Simplifying and documenting the API of APCu completely removes the barrier
+to maintenance and development of APCu in the future, and additionally allows
+us to make optimizations not possible previously because of APC's inherent
+complexity.
+
+APCu only supports userland caching (and dumping) of variables, providing an
+upgrade path for the future. When O+ takes over, many will be tempted to use
+3rd party solutions to userland caching, possibly even distributed solutions;
+this would be a grave error. The tried and tested APC codebase provides far
+superior support for local storage of PHP variables.
+
+
+%package devel
+Summary: APCu developer files (header)
+Group: Development/Libraries
+Requires: %{name}%{?_isa} = %{version}-%{release}
+Requires: php-devel%{?_isa}
+
+%description devel
+These are the files needed to compile programs using APCu.
+
+
+%package -n apcu-panel
+Summary: APCu control panel
+Group: Applications/Internet
+%if 0%{?fedora} >= 12 || 0%{?rhel} >= 6
+BuildArch: noarch
+%endif
+Requires: %{name} = %{version}-%{release}
+Requires: mod_php, httpd, php-gd
+
+%description -n apcu-panel
+This package provides the APCu control panel, with Apache
+configuration, available on http://localhost/apcu-panel/
+
+
+%prep
+%setup -qc
+mv %{pecl_name}-%{commit} NTS
+
+%if %{with_zts}
+# duplicate for ZTS build
+cp -pr NTS ZTS
+%endif
+
+
+%build
+cd NTS
+%{_bindir}/phpize
+%configure --with-php-config=%{_bindir}/php-config
+make %{?_smp_mflags}
+
+%if %{with_zts}
+cd ../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 NTS install INSTALL_ROOT=%{buildroot}
+install -D -m 644 %{SOURCE1} %{buildroot}%{php_inidir}/%{pecl_name}.ini
+
+# Install the ZTS stuff
+%if %{with_zts}
+make -C ZTS install INSTALL_ROOT=%{buildroot}
+install -D -m 644 %{SOURCE1} %{buildroot}%{php_ztsinidir}/%{pecl_name}.ini
+%endif
+
+# Install the Control Panel
+# Pages
+install -d -m 755 %{buildroot}%{_datadir}/apcu-panel
+sed -e s:apc.conf.php:%{_sysconfdir}/apcu-panel/conf.php:g \
+ NTS/apc.php >%{buildroot}%{_datadir}/apcu-panel/index.php
+# Apache config
+install -D -m 644 -p %{SOURCE2} \
+ %{buildroot}%{_sysconfdir}/httpd/conf.d/apcu-panel.conf
+# Panel config
+install -D -m 644 -p %{SOURCE3} \
+ %{buildroot}%{_sysconfdir}/apcu-panel/conf.php
+
+
+%check
+cd NTS
+
+# Check than both extensions are reported (BC mode)
+%{_bindir}/php -n -d extension_dir=modules -d extension=apcu.so -m | grep 'apcu'
+%{_bindir}/php -n -d extension_dir=modules -d extension=apcu.so -m | grep 'apc$'
+
+# Upstream test suite
+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 %{with_zts}
+cd ../ZTS
+
+%{__ztsphp} -n -d extension_dir=modules -d extension=apcu.so -m | grep 'apcu'
+%{__ztsphp} -n -d extension_dir=modules -d extension=apcu.so -m | grep 'apc$'
+
+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
+
+
+%clean
+rm -rf %{buildroot}
+
+
+%files
+%defattr(-, root, root, 0755)
+%doc NTS/{NOTICE,LICENSE,README.md}
+
+%config(noreplace) %{php_inidir}/%{pecl_name}.ini
+%{php_extdir}/%{pecl_name}.so
+
+%if %{with_zts}
+%{php_ztsextdir}/%{pecl_name}.so
+%config(noreplace) %{php_ztsinidir}/%{pecl_name}.ini
+%endif
+
+%files devel
+%defattr(-,root,root,-)
+%{php_incldir}/ext/%{pecl_name}
+%if %{with_zts}
+%{php_ztsincldir}/ext/%{pecl_name}
+%endif
+
+%files -n apcu-panel
+%defattr(-,root,root,-)
+# Need to restrict access, as it contains a clear password
+%attr(750,apache,root) %dir %{_sysconfdir}/apcu-panel
+%config(noreplace) %{_sysconfdir}/apcu-panel/conf.php
+%config(noreplace) %{_sysconfdir}/httpd/conf.d/apcu-panel.conf
+%{_datadir}/apcu-panel
+
+
+%changelog
+* Tue Mar 26 2013 Remi Collet <remi@fedoraproject.org> - 4.0.0-0.4.git4322fad
+- new snapshot (test before release)
+
+* Mon Mar 25 2013 Remi Collet <remi@fedoraproject.org> - 4.0.0-0.3.git647cb2b
+- new snapshot with our pull request
+- allow to run test suite simultaneously on 32/64 arch
+- build warning free
+
+* Mon Mar 25 2013 Remi Collet <remi@fedoraproject.org> - 4.0.0-0.2.git6d20302
+- new snapshot with full APC compatibility
+
+* Sat Mar 23 2013 Remi Collet <remi@fedoraproject.org> - 4.0.0-0.1.git44e8dd4
+- initial package, version 4.0.0