2 # Available build options:
3 %bcond_with checkpath # enable check if PHP execution is within
4 # DOCUMENT_ROOT of the vhost
7 %define apxs /usr/sbin/apxs
8 Summary: Apache module: suPHP - execute PHP scripts with the permissions of their owners
9 Summary(pl): Modu³ do apache: suPHP - uruchamianie skryptów PHP z uprawnieniami ich w³a¶cicieli
10 Name: apache-mod_%{mod_name}
14 Group: Networking/Daemons
15 Source0: http://www.suphp.org/download/%{mod_name}-%{version}.tar.gz
16 # Source0-md5: 337909e87027af124052baddddbd2994
17 Source1: %{name}.logrotate
19 Patch0: %{name}-apr.patch
20 URL: http://www.suphp.org/
21 BuildRequires: %{apxs}
22 BuildRequires: apache-devel >= 2.0.52-2
23 BuildRequires: autoconf
24 BuildRequires: automake
25 Requires(post,preun): %{apxs}
26 Requires: apache >= 2.0.52-2
28 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
30 %define _sysconfdir %(%{apxs} -q SYSCONFDIR)
31 %define _pkglibdir %(%{apxs} -q LIBEXECDIR)
34 suPHP is a tool for executing PHP scripts with the permissions of their
35 owners. It consists of an Apache module (mod_suphp) and a setuid root
36 binary (suphp) that is called by the Apache module to change the uid of
37 the process executing the PHP interpreter.
40 suPHP jest narzêdziem pozwalaj±cym na wykonywanie skryptów PHP z
41 uprawnieniami ich w³a¶cicieli. Sk³ada siê z modu³u (mod_suphp) oraz
42 programu (suphp) z ustawionym bitem suid, który uruchamiany jest przez
43 modu³ w celu zmiany uid procesu uruchamiaj±cego interpreter PHP.
46 %setup -q -n %{mod_name}-%{version}
55 %{?with_checkpath: --enable-checkpath} \
56 %{!?with_checkpath: --disable-checkpath} \
57 --with-apache-user=http \
67 rm -rf $RPM_BUILD_ROOT
68 install -d $RPM_BUILD_ROOT{%{_sbindir},%{_pkglibdir}}
69 install -d $RPM_BUILD_ROOT%{_sysconfdir}/httpd.conf
71 install src/suphp $RPM_BUILD_ROOT%{_sbindir}
72 install src/apache2/.libs/mod_%{mod_name}.so $RPM_BUILD_ROOT%{_pkglibdir}
73 install %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/httpd.conf/70_mod-suphp.conf
75 install -d $RPM_BUILD_ROOT/etc/logrotate.d
76 install %{SOURCE1} $RPM_BUILD_ROOT/etc/logrotate.d/apache-mod_suphp
79 rm -rf $RPM_BUILD_ROOT
82 %{apxs} -e -a -n %{mod_name} %{_pkglibdir}/mod_%{mod_name}.so 1>&2
83 if [ -f /var/lock/subsys/httpd ]; then
84 /etc/rc.d/init.d/httpd restart 1>&2
88 if [ "$1" = "0" ]; then
89 %{apxs} -e -A -n %{mod_name} %{_pkglibdir}/mod_%{mod_name}.so 1>&2
90 if [ -f /var/lock/subsys/httpd ]; then
91 /etc/rc.d/init.d/httpd restart 1>&2
96 %defattr(644,root,root,755)
97 %doc README AUTHORS ChangeLog doc
98 %attr(4755,root,root) %{_sbindir}/suphp
99 %attr(755,root,root) %{_pkglibdir}/*
100 %attr(640,root,root) %config(noreplace) %verify(not size mtime md5) /etc/logrotate.d/*
101 %attr(640,root,root) %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/httpd.conf/*