# Conditional build:
%bcond_without tests # build without tests
+%define php_name php%{?php_suffix}
%define modname bytekit
Summary: An extension to represent the opcodes generated by Zend Engine
-Name: php-%{modname}
+Name: %{php_name}-%{modname}
Version: 0.1.1
-Release: 2
+Release: 3
License: Bytekit 1.0 (based on PHP 3.0)
Group: Development/Languages/PHP
Source0: http://www.bytekit.org/download/%{modname}-%{version}.tgz
# Source0-md5: 83d0a325713201947aec441f30be58d8
URL: http://www.bytekit.org/
-BuildRequires: php-devel >= 4:5.0.4
-BuildRequires: rpmbuild(macros) >= 1.519
+BuildRequires: %{php_name}-devel
+BuildRequires: rpmbuild(macros) >= 1.666
%{?requires_php_extension}
+Obsoletes: php-bytekit < 0.1.1-3
BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
%description
%install
rm -rf $RPM_BUILD_ROOT
-install -d $RPM_BUILD_ROOT%{php_sysconfdir}/conf.d
-install -d $RPM_BUILD_ROOT{%{php_sysconfdir}/conf.d,%{php_extensiondir}}
-install -d $RPM_BUILD_ROOT{%{php_sysconfdir}/conf.d,%{php_extensiondir},%{_examplesdir}/%{name}-%{version}}
-
%{__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
+install -d $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
cp -a examples/* $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
%clean