1 %define mod_name whatkilledus
2 %define apxs /usr/sbin/apxs
3 Summary: Apache module: knows what a thread was handling in case the thread segfaults
4 Summary(pl.UTF-8): Moduł apache wiedzący, co obsługiwał wątek w przypadku naruszenia ochrony pamięci
5 Name: apache-mod_%{mod_name}
9 Group: Networking/Daemons
10 Source0: http://people.apache.org/~trawick/mod_whatkilledus.c
11 # Source0-md5: e59c5d56e294a31e5b158ad5e4553001
12 Source1: http://mirrors.ludost.net/gentoo-portage/www-apache/mod_whatkilledus/files/gen_test_char.c
13 # Source1-md5: 7c4e734d1afc695a5be53581998f3700
14 BuildRequires: %{apxs}
15 BuildRequires: apache-devel >= 2.0
16 BuildRequires: rpmbuild(macros) >= 1.268
17 Requires: apache(modules-api) = %apache_modules_api
18 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
20 %define _sysconfdir %(%{apxs} -q SYSCONFDIR 2>/dev/null)/conf.d
21 %define _pkglibdir %(%{apxs} -q LIBEXECDIR 2>/dev/null)
24 Keeps a little bit of state on each active connection, which allows it
25 to know what a thread was handling in case the thread segfaults.
27 %description -l pl.UTF-8
28 Moduł przechowujący wybrane informacje o stanie każdego aktywnego
29 połączenia, pozwalające dowiedzieć się, co obsługiwał wątek w
30 sytuacji, kiedy spowodował naruszenie ochrony pamięci.
37 %{__cc} $(%{_bindir}/apr-1-config --includes --cppflags) %{SOURCE1} -o gen_test_char
38 ./gen_test_char > test_char.h
39 %{apxs} -c mod_%{mod_name}.c -o mod_%{mod_name}.la
42 rm -rf $RPM_BUILD_ROOT
43 install -d $RPM_BUILD_ROOT{%{_pkglibdir},%{_sysconfdir},/var/log/httpd}
44 install .libs/mod_%{mod_name}.so $RPM_BUILD_ROOT%{_pkglibdir}
46 touch $RPM_BUILD_ROOT/var/log/httpd/whatkilledus_log
48 cat > $RPM_BUILD_ROOT%{_sysconfdir}/68_mod_%{mod_name}.conf << 'EOF'
49 LoadModule %{mod_name}_module modules/mod_%{mod_name}.so
50 EnableExceptionHook On
51 WhatKilledUsLog /var/log/httpd/whatkilledus_log
55 rm -rf $RPM_BUILD_ROOT
58 %service -q httpd restart
59 touch /var/log/httpd/whatkilledus_log && chown root:http /var/log/httpd/whatkilledus_log && chmod 620 /var/log/httpd/whatkilledus_log
62 if [ "$1" = "0" ]; then
63 %service -q httpd restart
67 %defattr(644,root,root,755)
68 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/*_mod_%{mod_name}.conf
69 %attr(755,root,root) %{_pkglibdir}/*.so
71 %attr(620,root,http) %ghost /var/log/httpd/whatkilledus_log