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/apxs1
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: apache1-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 URL: http://www.suphp.org/
20 BuildRequires: %{apxs}
21 BuildRequires: apache1-devel
22 BuildRequires: autoconf
23 BuildRequires: automake
24 Requires(post,preun): %{apxs}
27 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
29 %define _sysconfdir %(%{apxs} -q SYSCONFDIR)
30 %define _pkglibdir %(%{apxs} -q LIBEXECDIR)
33 suPHP is a tool for executing PHP scripts with the permissions of their
34 owners. It consists of an Apache module (mod_suphp) and a setuid root
35 binary (suphp) that is called by the Apache module to change the uid of
36 the process executing the PHP interpreter.
39 suPHP jest narzêdziem pozwalaj±cym na wykonywanie skryptów w PHP z
40 uprawnieniami ich w³a¶cicieli. Sk³ada siê z modu³u (mod_suphp) oraz
41 programu (suphp) z ustawionym bitem suid, który uruchamiany jest przez
42 modu³ w celu zmiany uid procesu uruchamiaj±cego interpreter PHP.
45 %setup -q -n %{mod_name}-%{version}
53 %{?with_checkpath: --enable-checkpath} \
54 %{!?with_checkpath: --disable-checkpath} \
55 --with-apache-user=http \
65 rm -rf $RPM_BUILD_ROOT
66 install -d $RPM_BUILD_ROOT{%{_sbindir},%{_pkglibdir}}
67 install -d $RPM_BUILD_ROOT%{_sysconfdir}/conf.d
69 install src/suphp $RPM_BUILD_ROOT%{_sbindir}
70 install src/apache/mod_%{mod_name}.so $RPM_BUILD_ROOT%{_pkglibdir}
71 install %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/conf.d/90_mod-suphp.conf
73 install -d $RPM_BUILD_ROOT/etc/logrotate.d
74 install %{SOURCE1} $RPM_BUILD_ROOT/etc/logrotate.d/apache-mod_suphp
77 rm -rf $RPM_BUILD_ROOT
80 %{apxs} -e -a -n %{mod_name} %{_pkglibdir}/mod_%{mod_name}.so 1>&2
81 if [ -f /var/lock/subsys/apache ]; then
82 /etc/rc.d/init.d/apache restart 1>&2
86 if [ "$1" = "0" ]; then
87 %{apxs} -e -A -n %{mod_name} %{_pkglibdir}/mod_%{mod_name}.so 1>&2
88 if [ -f /var/lock/subsys/apache ]; then
89 /etc/rc.d/init.d/apache restart 1>&2
94 %defattr(644,root,root,755)
95 %doc README AUTHORS ChangeLog doc
96 %attr(4755,root,root) %{_sbindir}/suphp
97 %attr(755,root,root) %{_pkglibdir}/*
98 %attr(640,root,root) %config(noreplace) %verify(not size mtime md5) /etc/logrotate.d/*
99 %attr(640,root,root) %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/conf.d/*