]>
Commit | Line | Data |
---|---|---|
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} | |
6 | Version: 1.0 | |
7 | Release: 1.20090203.2 | |
8 | License: Apache v2.0 | |
9 | Group: Networking/Daemons/HTTP | |
10 | Source0: http://people.apache.org/~trawick/mod_whatkilledus.c | |
11 | # Source0-md5: ac4150a2d8b41bfd087de8d237b24378 | |
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) | |
19 | ||
20 | %define _sysconfdir %(%{apxs} -q SYSCONFDIR 2>/dev/null)/conf.d | |
21 | %define _pkglibdir %(%{apxs} -q LIBEXECDIR 2>/dev/null) | |
22 | ||
23 | %description | |
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. | |
26 | ||
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. | |
31 | ||
32 | %prep | |
33 | %setup -q -c -T | |
34 | install %{SOURCE0} . | |
35 | ||
36 | %build | |
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 | |
40 | ||
41 | %install | |
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} | |
45 | ||
46 | touch $RPM_BUILD_ROOT/var/log/httpd/whatkilledus_log | |
47 | ||
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 | |
52 | EOF | |
53 | ||
54 | %clean | |
55 | rm -rf $RPM_BUILD_ROOT | |
56 | ||
57 | %post | |
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 | |
60 | ||
61 | %postun | |
62 | if [ "$1" = "0" ]; then | |
63 | %service -q httpd restart | |
64 | fi | |
65 | ||
66 | %files | |
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 | |
70 | # append by webserver | |
71 | %attr(620,root,http) %ghost /var/log/httpd/whatkilledus_log |