From 55ca050c7b862c4238ae73b32650f0a1c2932102 Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Aug 31 2007 13:24:25 +0000 Subject: new package, initial import --- diff --git a/.cvsignore b/.cvsignore index e69de29..4cec671 100644 --- a/.cvsignore +++ b/.cvsignore @@ -0,0 +1 @@ +memcache-2.1.2.tgz diff --git a/php-pecl-memcache.spec b/php-pecl-memcache.spec new file mode 100644 index 0000000..f944d96 --- /dev/null +++ b/php-pecl-memcache.spec @@ -0,0 +1,120 @@ +%{!?__pecl: %{expand: %%global __pecl %{_bindir}/pecl}} +%{!?php_extdir: %{expand: %%global php_extdir %(php-config --extension-dir)}} + +%define pecl_name memcache + +Summary: Extension to work with the Memcached caching daemon +Name: php-pecl-memcache +Version: 2.1.2 +Release: 1%{?dist} +License: PHP +Group: Development/Languages +URL: http://pecl.php.net/package/%{pecl_name} + +Source: http://pecl.php.net/get/%{pecl_name}-%{version}.tgz + +Source2: xml2changelog + +BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) +BuildRequires: php-devel, php-pear, zlib-devel +Requires(post): %{__pecl} +Requires(postun): %{__pecl} +Provides: php-pecl(%{pecl_name}) = %{version}-%{release} +%if %{?php_zend_api}0 +Requires: php(zend-abi) = %{php_zend_api} +Requires: php(api) = %{php_core_api} +%else +Requires: php-api = %{php_apiver} +%endif + +%description +Memcached is a caching daemon designed especially for +dynamic web applications to decrease database load by +storing objects in memory. + +This extension allows you to work with memcached through +handy OO and procedural interfaces. + + +%prep +%setup -c -q +%{_bindir}/php -n %{SOURCE2} package.xml >CHANGELOG + + +%build +cd %{pecl_name}-%{version} +phpize +%configure +%{__make} %{?_smp_mflags} + + +%install +cd %{pecl_name}-%{version} +%{__rm} -rf %{buildroot} +%{__make} install INSTALL_ROOT=%{buildroot} + +# Drop in the bit of configuration +%{__mkdir_p} %{buildroot}%{_sysconfdir}/php.d +%{__cat} > %{buildroot}%{_sysconfdir}/php.d/%{pecl_name}.ini << 'EOF' +; Enable %{pecl_name} extension module +extension=%{pecl_name}.so + +; Options for the %{pecl_name} module + +; Whether to transparently failover to other servers on errors +;memcache.allow_failover=1 + +; Defines how many servers to try when setting and getting data. +;memcache.max_failover_attempts=20 + +; Data will be transferred in chunks of this size +;memcache.chunk_size=8192 + +; The default TCP port number to use when connecting to the memcached server +;memcache.default_port=11211 + +; Options to use the memcache session handler + +; Use memcache as a session handler +;session.save_handler=memcache + +; Defines a comma separated of server urls to use for session storage +;session.save_path="tcp://localhost:11211?persistent=1&weight=1&timeout=1&retry_interval=15" +EOF + +# Install XML package description +# use 'name' rather than 'pecl_name' to avoid conflict with pear extensions +%{__mkdir_p} %{buildroot}%{pecl_xmldir} +%{__install} -m 644 ../package.xml %{buildroot}%{pecl_xmldir}/%{name}.xml + + +%clean +%{__rm} -rf %{buildroot} + + +%if 0%{?pecl_install:1} +%post +%{pecl_install} %{pecl_xmldir}/%{name}.xml >/dev/null || : +%endif + + +%if 0%{?pecl_uninstall:1} +%postun +if [ $1 -eq 0 ] ; then + %{pecl_uninstall} %{pecl_name} >/dev/null || : +fi +%endif + + +%files +%defattr(-, root, root, -) +%doc CHANGELOG %{pecl_name}-%{version}/CREDITS %{pecl_name}-%{version}/README %{pecl_name}-%{version}/example.php +%config(noreplace) %{_sysconfdir}/php.d/%{pecl_name}.ini +%{php_extdir}/%{pecl_name}.so +%{pecl_xmldir}/%{name}.xml + + +%changelog +* Mon Aug 20 2007 Remi Collet 2.1.2-1 +- initial RPM + diff --git a/sources b/sources index e69de29..021c04e 100644 --- a/sources +++ b/sources @@ -0,0 +1 @@ +cfde0918360f3909a242c3211604ad46 memcache-2.1.2.tgz diff --git a/xml2changelog b/xml2changelog new file mode 100644 index 0000000..3f7b42d --- /dev/null +++ b/xml2changelog @@ -0,0 +1,28 @@ += "2"){ // Package.xml V 2.0 + printf("* Version %s (%s) - API %s (%s) - %s\n\n%s\n\n", + $xml->version->release, $xml->stability->release, + $xml->version->api, $xml->stability->api, + $xml->date, $xml->notes); + + if (is_array($xml->changelog->release)) foreach($xml->changelog->release as $rel) + printf("* Version %s (%s) - API %s (%s) - %s\n\n%s\n\n", + $rel->version->release, $rel->stability->release, + $rel->version->api, $rel->stability->api, + $rel->date, $rel->notes); +} else { // Package.xml V 1.0 + printf("* Version %s (%s) - %s\n\n%s\n\n", + $xml->release->version, $xml->release->state, $xml->release->date, $xml->release->notes); + + foreach($xml->changelog->release as $rel) + printf("* Version %s (%s) - %s\n\n%s\n\n", + $rel->version, $rel->state, $rel->date, $rel->notes); +} +?>