Permalink
Browse files

Added spec-file to build rpm

  • Loading branch information...
1 parent 1d6133d commit 848873f437d40ed2db000ede78be884099b7987e @unicast unicast committed Jul 28, 2011
Showing with 49 additions and 0 deletions.
  1. +48 −0 rpm/php-redis.spec
  2. +1 −0 rpm/redis.ini
View
48 rpm/php-redis.spec
@@ -0,0 +1,48 @@
+%global php_apiver %((echo 0; php -i 2>/dev/null | sed -n 's/^PHP API => //p') | tail -1)
+%global php_extdir %(php-config --extension-dir 2>/dev/null || echo "undefined")
+%global php_version %(php-config --version 2>/dev/null || echo 0)
+
+Name: php-redis
+Version: 2.1.3
+Release: 1%{?dist}
+Summary: The phpredis extension provides an API for communicating with the Redis key-value store.
+
+Group: Development/Languages
+License: PHP
+URL: https://github.com/nicolasff/phpredis
+Source0: https://download.github.com/nicolasff-phpredis-2.1.3-0-g43bc590.tar.gz
+Source1: redis.ini
+BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
+
+BuildRequires: php-devel
+Requires: php(zend-abi) = %{php_zend_api}
+Requires: php(api) = %{php_apiver}
+
+%description
+The phpredis extension provides an API for communicating with the Redis key-value store.
+
+%prep
+%setup -q -n nicolasff-phpredis-43bc590
+
+%build
+%{_bindir}/phpize
+%configure
+make %{?_smp_mflags}
+
+%install
+rm -rf $RPM_BUILD_ROOT
+make install INSTALL_ROOT=$RPM_BUILD_ROOT
+
+# install configuration
+%{__mkdir} -p $RPM_BUILD_ROOT%{_sysconfdir}/php.d
+%{__cp} %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/php.d/redis.ini
+
+%clean
+rm -rf $RPM_BUILD_ROOT
+
+%files
+%defattr(-,root,root,-)
+%doc CREDITS
+%config(noreplace) %{_sysconfdir}/php.d/redis.ini
+%{php_extdir}/redis.so
+
View
1 rpm/redis.ini
@@ -0,0 +1 @@
+extension=redis.so

0 comments on commit 848873f

Please sign in to comment.