%define _modname ssh2 %define _status beta %define _sysconfdir /etc/php %define extensionsdir %(php-config --extension-dir 2>/dev/null) Summary: %{_modname} - bindings for the libssh2 library Summary(pl): %{_modname} - dowiązania do biblioteki libssh2 Name: php-pecl-%{_modname} Version: 0.9 Release: 3 License: PHP Group: Development/Languages/PHP Source0: http://pecl.php.net/get/%{_modname}-%{version}.tgz # Source0-md5: 440ef155d58821df44c643a44d21e312 URL: http://pecl.php.net/package/ssh2/ BuildRequires: libssh2-devel >= 0.5 BuildRequires: openssl-devel >= 0.9.7d BuildRequires: php-devel >= 3:5.0.0 BuildRequires: rpmbuild(macros) >= 1.254 %{?requires_php_extension} Requires: %{_sysconfdir}/conf.d Obsoletes: php-pear-%{_modname} BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) %description Provides bindings to the functions of libssh2 which implements the SSH2 protocol. In PECL status of this extension is: %{_status}. %description -l pl Dostarcza dowiązań do różnych funkcji biblioteki libssh2 implementującej protokół SSH2. To rozszerzenie ma w PECL status: %{_status}. %prep %setup -q -c %build cd %{_modname}-%{version} phpize %configure %{__make} %install rm -rf $RPM_BUILD_ROOT install -d $RPM_BUILD_ROOT{%{_sysconfdir}/conf.d,%{extensionsdir}} install %{_modname}-%{version}/modules/%{_modname}.so $RPM_BUILD_ROOT%{extensionsdir} cat <<'EOF' > $RPM_BUILD_ROOT%{_sysconfdir}/conf.d/%{_modname}.ini ; Enable %{_modname} extension module extension=%{_modname}.so EOF %clean rm -rf $RPM_BUILD_ROOT %post [ ! -f /etc/apache/conf.d/??_mod_php.conf ] || %service -q apache restart [ ! -f /etc/httpd/httpd.conf/??_mod_php.conf ] || %service -q httpd restart %postun if [ "$1" = 0 ]; then [ ! -f /etc/apache/conf.d/??_mod_php.conf ] || %service -q apache restart [ ! -f /etc/httpd/httpd.conf/??_mod_php.conf ] || %service -q httpd restart fi %files %defattr(644,root,root,755) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/conf.d/%{_modname}.ini %attr(755,root,root) %{extensionsdir}/%{_modname}.so