#
# Available build options:
-# with_checkpath - enable check if php execution is within DOCUMENT_ROOT
-# of the vhost
+%bcond_with checkpath # enable check if php execution is within
+ # DOCUMENT_ROOT of the vhost
#
%define mod_name suphp
%define apxs /usr/sbin/apxs
Summary: Apache module: suPHP - execute PHP scripts with the permissions of their owners
Summary(pl): Modu³ do apache: suPHP - uruchamianie skryptów PHP z uprawnieniami ich w³a¶cicieli
Name: apache-mod_%{mod_name}
-Version: 0.5
-Release: 0.2
+Version: 0.5.2
+Release: 1
License: GPL
Group: Networking/Daemons
Source0: http://www.suphp.org/download/%{mod_name}-%{version}.tar.gz
-# Source0-md5: a17b2f7bec0db326ee10d28460f34fe4
+# Source0-md5: 337909e87027af124052baddddbd2994
Source1: apache-mod_suphp.logrotate
+Source2: apache-mod_suphp.conf
URL: http://www.suphp.org/
BuildRequires: %{apxs}
BuildRequires: apache-devel
BuildRequires: automake
Requires(post,preun): %{apxs}
Requires: apache
+Requires: php-cgi
BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
%define _pkglibdir %(%{apxs} -q LIBEXECDIR)
%install
rm -rf $RPM_BUILD_ROOT
install -d $RPM_BUILD_ROOT{%{_sbindir},%{_pkglibdir}}
+install -d $RPM_BUILD_ROOT%{_sysconfdir}/httpd/httpd.conf
install src/suphp $RPM_BUILD_ROOT%{_sbindir}
%if %{_apache1}
install src/apache/mod_%{mod_name}.so $RPM_BUILD_ROOT%{_pkglibdir}
%else
install src/apache2/.libs/mod_%{mod_name}.so $RPM_BUILD_ROOT%{_pkglibdir}
+install %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/httpd/httpd.conf/70_mod-suphp.conf
%endif
install -d $RPM_BUILD_ROOT/etc/logrotate.d
%files
%defattr(644,root,root,755)
%doc README AUTHORS ChangeLog doc
-%attr(4755,root,root) %{_sbindir}/*
+%attr(4755,root,root) %{_sbindir}/suphp
%attr(755,root,root) %{_pkglibdir}/*
%attr(640,root,root) %config(noreplace) %verify(not size mtime md5) /etc/logrotate.d/*
+%if ! %{_apache1}
+%attr(640,root,root) %config(noreplace) %verify(not size mtime md5) /etc/httpd/httpd.conf/*
+%endif