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 %define _apache1 %(rpm -q apache-devel 2> /dev/null | grep -Eq '\\-2\\.[0-9]+\\.' && echo 0 || echo 1)
9 Summary: Apache module: suPHP - execute PHP scripts with the permissions of their owners
10 Summary(pl): Modu³ do apache: suPHP - uruchamianie skryptów PHP z uprawnieniami ich w³a¶cicieli
11 Name: apache-mod_%{mod_name}
15 Group: Networking/Daemons
16 Source0: http://www.suphp.org/download/%{mod_name}-%{version}.tar.gz
17 # Source0-md5: 6898ccd801ec93cb7c6a69a9ac8f3703
18 Source1: apache-mod_suphp.logrotate
19 Source2: apache-mod_suphp.conf
20 URL: http://www.suphp.org/
21 BuildRequires: %{apxs}
22 BuildRequires: apache-devel
23 BuildRequires: autoconf
24 BuildRequires: automake
25 Requires(post,preun): %{apxs}
28 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
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 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}/httpd/httpd.conf
69 install src/suphp $RPM_BUILD_ROOT%{_sbindir}
71 install src/apache/mod_%{mod_name}.so $RPM_BUILD_ROOT%{_pkglibdir}
73 install src/apache2/.libs/mod_%{mod_name}.so $RPM_BUILD_ROOT%{_pkglibdir}
74 install %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/httpd/httpd.conf/70_mod-suphp.conf
77 install -d $RPM_BUILD_ROOT/etc/logrotate.d
78 install %{SOURCE1} $RPM_BUILD_ROOT/etc/logrotate.d/apache-mod_suphp
81 rm -rf $RPM_BUILD_ROOT
85 %{apxs} -e -a -n %{mod_name} %{_pkglibdir}/mod_%{mod_name}.so 1>&2
86 if [ -f /var/lock/subsys/httpd ]; then
87 /etc/rc.d/init.d/httpd restart 1>&2
91 if [ "$1" = "0" ]; then
92 %{apxs} -e -A -n %{mod_name} %{_pkglibdir}/mod_%{mod_name}.so 1>&2
93 if [ -f /var/lock/subsys/httpd ]; then
94 /etc/rc.d/init.d/httpd restart 1>&2
100 %defattr(644,root,root,755)
101 %doc README AUTHORS ChangeLog doc
102 %attr(4755,root,root) %{_sbindir}/suphp
103 %attr(755,root,root) %{_pkglibdir}/*
104 %attr(640,root,root) %config(noreplace) %verify(not size mtime md5) /etc/logrotate.d/*
105 %attr(640,root,root) %config(noreplace) %verify(not size mtime md5) /etc/httpd/httpd.conf/*