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
35 their owners. It consists of an Apache module (mod_suphp) and a setuid
36 root binary (suphp) that is called by the Apache module to change the
37 uid of the process executing the PHP interpreter.
40 suPHP jest narzêdziem pozwalaj±cym na wykonywanie skryptów 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 \
61 --with-php=%{_bindir}/php.cgi \
68 rm -rf $RPM_BUILD_ROOT
69 install -d $RPM_BUILD_ROOT{%{_sbindir},%{_pkglibdir}}
70 install -d $RPM_BUILD_ROOT%{_sysconfdir}/httpd.conf
72 install src/suphp $RPM_BUILD_ROOT%{_sbindir}
73 install src/apache2/.libs/mod_%{mod_name}.so $RPM_BUILD_ROOT%{_pkglibdir}
74 install %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/httpd.conf/70_mod-suphp.conf
76 install -d $RPM_BUILD_ROOT/etc/logrotate.d
77 install %{SOURCE1} $RPM_BUILD_ROOT/etc/logrotate.d/apache-mod_suphp
80 rm -rf $RPM_BUILD_ROOT
83 %{apxs} -e -a -n %{mod_name} %{_pkglibdir}/mod_%{mod_name}.so 1>&2
84 if [ -f /var/lock/subsys/httpd ]; then
85 /etc/rc.d/init.d/httpd restart 1>&2
89 if [ "$1" = "0" ]; then
90 %{apxs} -e -A -n %{mod_name} %{_pkglibdir}/mod_%{mod_name}.so 1>&2
91 if [ -f /var/lock/subsys/httpd ]; then
92 /etc/rc.d/init.d/httpd restart 1>&2
97 %defattr(644,root,root,755)
98 %doc README AUTHORS ChangeLog doc
99 %attr(4755,root,root) %{_sbindir}/suphp
100 %attr(755,root,root) %{_pkglibdir}/*
101 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/logrotate.d/*
102 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/httpd.conf/*