1 %define mod_name mpm_itk
2 %define apxs /usr/sbin/apxs
5 Summary: mod_mpm_itk - allows you to run each of your vhost under a separate uid and gid
6 Name: apache-mod_mpm_itk
7 Version: %{ver}.%{subver}
10 Group: Networking/Daemons/HTTP
11 Source0: http://mpm-itk.sesse.net/mpm-itk-%{ver}-%{subver}.tar.gz
12 # Source0-md5: 316860d975916aeb63185e5bebb14fe1
14 Source2: %{name}-php.conf
15 Source3: %{name}.tmpfiles
16 URL: http://mpm-itk.sesse.net/
17 BuildRequires: %{apxs}
18 BuildRequires: apache-devel >= 2.4.7
19 BuildRequires: apr-devel >= 1:1.0
20 BuildRequires: apr-util-devel >= 1:1.0
21 BuildRequires: libcap-devel
22 Requires: apache(modules-api) = %{apache_modules_api}
23 Requires: apache-base >= 2.4.7
24 Requires: php-dirs >= 1.5-2
25 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
27 %define _pkglibdir %(%{apxs} -q LIBEXECDIR 2>/dev/null)
28 %define _sysconfdir %(%{apxs} -q SYSCONFDIR 2>/dev/null)
31 apache2-mpm-itk (just mpm-itk for short) is an MPM (Multi-Processing
32 Module) for the Apache web server. mpm-itk allows you to run each of
33 your vhost under a separate uid and gid - in short, the scripts and
34 configuration files for one vhost no longer have to be readable for
37 mpm-itk is based on the traditional prefork MPM, which means it's
38 non-threaded; in short, this means you can run non-thread-aware code
39 (like many PHP extensions) without problems. On the other hand, you
40 lose out to any performance benefit you'd get with threads, of course;
41 you'd have to decide for yourself if that's worth it or not. You will
42 also take an additional performance hit over prefork, since there's an
43 extra fork per request.
46 %setup -q -n mpm-itk-%{ver}-%{subver}
54 rm -rf $RPM_BUILD_ROOT
55 install -d $RPM_BUILD_ROOT{%{_sbindir},%{_pkglibdir},%{_sysconfdir}/conf.d}
56 install -d $RPM_BUILD_ROOT{/var/run/php-ug,%{systemdtmpfilesdir}}
58 install -p .libs/mpm_itk.so $RPM_BUILD_ROOT%{_pkglibdir}
59 cp -p %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/conf.d/10_mod_%{mod_name}.conf
60 cp -p %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/conf.d/99_mod_%{mod_name}-php.conf
61 cp -p %{SOURCE3} $RPM_BUILD_ROOT%{systemdtmpfilesdir}/php-itk-dirs.conf
64 rm -rf $RPM_BUILD_ROOT
67 %service -q httpd restart
70 if [ "$1" = "0" ]; then
71 %service -q httpd restart
75 %defattr(644,root,root,755)
77 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/conf.d/*_mod_%{mod_name}.conf
78 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/conf.d/*_mod_%{mod_name}-php.conf
79 %attr(755,root,root) %{_pkglibdir}/mpm_itk.so
80 %{systemdtmpfilesdir}/php-itk-dirs.conf
81 # multiple uid/gids in use
82 %dir %attr(1773,root,root) /var/run/php-ug