2 # Available build options:
3 %bcond_with checkpath # enable check if php execution is within DOCUMENT_ROOT of the vhost
6 %define apxs /usr/sbin/apxs
7 Summary: Apache module: suPHP - execute PHP scripts with the permissions of their owners
8 Summary(pl): Modu³ do apache: suPHP - uruchamianie skryptów PHP z uprawnieniami ich w³a¶cicieli
9 Name: apache-mod_%{mod_name}
13 Group: Networking/Daemons
14 Source0: http://www.suphp.org/download/%{mod_name}-%{version}.tar.gz
15 # Source0-md5: 7eb8ae29404392d9eb07c69d5242d716
16 Source1: %{name}.logrotate
18 Source3: %{name}-suphp.conf
19 Patch0: %{name}-apr.patch
20 Patch1: %{name}-compiler-flags.patch
21 Patch2: %{name}-apache_version.patch
22 URL: http://www.suphp.org/
23 BuildRequires: %{apxs}
24 BuildRequires: apache-devel >= 2.0.52-2
25 BuildRequires: autoconf
26 BuildRequires: automake
27 BuildRequires: libstdc++-devel
28 BuildRequires: rpmbuild(macros) >= 1.268
29 Requires: apache(modules-api) = %apache_modules_api
31 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
33 %define _pkglibdir %(%{apxs} -q LIBEXECDIR 2>/dev/null)
34 %define _sysconfdir %(%{apxs} -q SYSCONFDIR 2>/dev/null)
37 suPHP is a tool for executing PHP scripts with the permissions of
38 their owners. It consists of an Apache module (mod_suphp) and a setuid
39 root binary (suphp) that is called by the Apache module to change the
40 uid of the process executing the PHP interpreter.
43 suPHP jest narzêdziem pozwalaj±cym na wykonywanie skryptów w PHP z
44 uprawnieniami ich w³a¶cicieli. Sk³ada siê z modu³u (mod_suphp) oraz
45 programu (suphp) z ustawionym bitem suid, który uruchamiany jest przez
46 modu³ w celu zmiany uid procesu uruchamiaj±cego interpreter PHP.
49 %setup -q -n %{mod_name}-%{version}
59 export APACHE_VERSION=$(rpm -q --qf '%%{version}' apache-apxs)
61 %{?with_checkpath: --enable-checkpath} \
62 %{!?with_checkpath: --disable-checkpath} \
63 --with-apache-user=http \
69 --with-setid-mode=owner \
70 --with-logfile=/var/log/httpd/suphp_log
75 rm -rf $RPM_BUILD_ROOT
76 install -d $RPM_BUILD_ROOT{%{_sbindir},%{_pkglibdir},%{_datadir}/suphp}
77 install -d $RPM_BUILD_ROOT%{_sysconfdir}/httpd.conf
79 install src/suphp $RPM_BUILD_ROOT%{_sbindir}
80 install src/apache2/.libs/mod_%{mod_name}.so $RPM_BUILD_ROOT%{_pkglibdir}
81 install %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/httpd.conf/70_mod_%{mod_name}.conf
82 install %{SOURCE3} $RPM_BUILD_ROOT%{_sysconfdir}/%{mod_name}.conf
84 install -d $RPM_BUILD_ROOT/etc/logrotate.d
85 install %{SOURCE1} $RPM_BUILD_ROOT/etc/logrotate.d/apache-mod_suphp
87 install doc/suphp.conf-example $RPM_BUILD_ROOT%{_datadir}/suphp
90 rm -rf $RPM_BUILD_ROOT
93 %service -q httpd restart
96 if [ "$1" = "0" ]; then
97 %service -q httpd restart
101 %defattr(644,root,root,755)
102 %doc README AUTHORS ChangeLog doc
103 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/httpd.conf/*_mod_%{mod_name}.conf
104 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{mod_name}.conf
105 %attr(755,root,root) %{_pkglibdir}/*.so
106 %attr(4755,root,root) %{_sbindir}/suphp
107 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/logrotate.d/*
108 %dir %{_datadir}/suphp