+# TODO
+# - doesn't compile
+# - php-pecl-mono-0.7/mono-0.7/php_mono.c:33:37: mono/metadata/tabledefs.h: No such file or directory
+# - package examples into examplesdir
%define _modname mono
%define _status beta
Summary: Allows you to access .NET assemblies from PHP
-Summary(pl): Pozwala na dostêp do wstawek .NET w PHP
+Summary(pl.UTF-8): Pozwala na dostęp do wstawek .NET w PHP
Name: php-pecl-%{_modname}
Version: 0.7
-Release: 0.1
+Release: 0.2
License: PHP 2.02
Group: Development/Languages/PHP
Source0: http://pecl.php.net/get/%{_modname}-%{version}.tgz
# Source0-md5: 23639443898018a743250a62b1873a89
URL: http://pecl.php.net/package/mono/
-BuildRequires: php-devel
BuildRequires: mono-devel
-Requires: php-common
+BuildRequires: php-devel >= 3:5.0.0
+BuildRequires: rpmbuild(macros) >= 1.344
+%{?requires_php_extension}
+Requires: php-common >= 4:5.0.4
Obsoletes: php-mono
BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
-%define _sysconfdir /etc/php
-%define extensionsdir %{_libdir}/php
-
%description
A C extension that interfaces with the mono library to allow access to
.NET assemblies.
In PECL status of this package is: %{_status}.
-%description -l pl
-Rozszerzenie w C, które jest interfejsem do biblioteki mono,
-pozwalaj±cym na dostêp do wstawek w .NET.
+%description -l pl.UTF-8
+Rozszerzenie w C, które jest interfejsem do biblioteki mono,
+pozwalającym na dostęp do wstawek w .NET.
To rozszerzenie ma w PECL status: %{_status}.
--with-%{_modname}
%{__make} \
-CPPFLAGS="-DHAVE_CONFIG_H -I%{_prefix}/X11R6/include/X11/" \
+CPPFLAGS="-DHAVE_CONFIG_H -I/usr/X11R6/include/X11/" \
CFLAGS_CLEAN="%{rpmcflags}"
%install
rm -rf $RPM_BUILD_ROOT
-install -d $RPM_BUILD_ROOT%{extensionsdir}
+install -d $RPM_BUILD_ROOT{%{php_sysconfdir}/conf.d,%{php_extensiondir}}
-install %{_modname}-%{version}/modules/%{_modname}.so $RPM_BUILD_ROOT%{extensionsdir}
+install %{_modname}-%{version}/modules/%{_modname}.so $RPM_BUILD_ROOT%{php_extensiondir}
+cat <<'EOF' > $RPM_BUILD_ROOT%{php_sysconfdir}/conf.d/%{_modname}.ini
+; Enable %{_modname} extension module
+extension=%{_modname}.so
+EOF
%clean
rm -rf $RPM_BUILD_ROOT
%post
-%{_sbindir}/php-module-install install %{_modname} %{_sysconfdir}/php.ini
+%php_webserver_restart
-%preun
-if [ "$1" = "0" ]; then
- %{_sbindir}/php-module-install remove %{_modname} %{_sysconfdir}/php.ini
+%postun
+if [ "$1" = 0 ]; then
+ %php_webserver_restart
fi
%files
%defattr(644,root,root,755)
%doc %{_modname}-%{version}/examples/{*.php,*.jpg,*.gif}
-%attr(755,root,root) %{extensionsdir}/%{_modname}.so
+%config(noreplace) %verify(not md5 mtime size) %{php_sysconfdir}/conf.d/%{_modname}.ini
+%attr(755,root,root) %{php_extensiondir}/%{_modname}.so