]>
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: 2.01 | |
7 | Release: 2 | |
8 | License: Apache v2.0 | |
9 | Group: Networking/Daemons/HTTP | |
10 | Source0: http://emptyhammock.com/downloads/wku_bt-%{version}.zip | |
11 | # Source0-md5: 32bbe148f6cb2b8714166388f94d9129 | |
12 | Source1: http://mirrors.ludost.net/gentoo-portage/www-apache/mod_whatkilledus/files/gen_test_char.c | |
13 | # Source1-md5: 7c4e734d1afc695a5be53581998f3700 | |
14 | URL: http://emptyhammock.com/projects/httpd/diag/ | |
15 | BuildRequires: %{apxs} | |
16 | BuildRequires: apache-devel >= 2.0 | |
17 | BuildRequires: rpmbuild(macros) >= 1.268 | |
18 | Requires: apache(modules-api) = %apache_modules_api | |
19 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
20 | ||
21 | %define _sysconfdir %(%{apxs} -q SYSCONFDIR 2>/dev/null)/conf.d | |
22 | %define _pkglibdir %(%{apxs} -q LIBEXECDIR 2>/dev/null) | |
23 | ||
24 | %description | |
25 | Keeps a little bit of state on each active connection, which allows it | |
26 | to know what a thread was handling in case the thread segfaults. | |
27 | ||
28 | %description -l pl.UTF-8 | |
29 | Moduł przechowujący wybrane informacje o stanie każdego aktywnego | |
30 | połączenia, pozwalające dowiedzieć się, co obsługiwał wątek w | |
31 | sytuacji, kiedy spowodował naruszenie ochrony pamięci. | |
32 | ||
33 | %prep | |
34 | %setup -q -n wku_bt-%{version} | |
35 | ||
36 | %build | |
37 | %{apxs} -c mod_%{mod_name}.c diag.c \ | |
38 | -DDIAG_HAVE_LIBUNWIND_BACKTRACE=1 \ | |
39 | %if "%{__lib}" == "lib64" | |
40 | -DDIAG_BITS_64=1 \ | |
41 | %endif | |
42 | -o mod_%{mod_name}.la | |
43 | ||
44 | %install | |
45 | rm -rf $RPM_BUILD_ROOT | |
46 | install -d $RPM_BUILD_ROOT{%{_pkglibdir},%{_sysconfdir},/var/log/httpd} | |
47 | install .libs/mod_%{mod_name}.so $RPM_BUILD_ROOT%{_pkglibdir} | |
48 | ||
49 | touch $RPM_BUILD_ROOT/var/log/httpd/whatkilledus_log | |
50 | ||
51 | cat > $RPM_BUILD_ROOT%{_sysconfdir}/68_mod_%{mod_name}.conf << 'EOF' | |
52 | LoadModule %{mod_name}_module modules/mod_%{mod_name}.so | |
53 | EnableExceptionHook On | |
54 | # WKUObscureInRequest On | |
55 | EOF | |
56 | ||
57 | %clean | |
58 | rm -rf $RPM_BUILD_ROOT | |
59 | ||
60 | %post | |
61 | %service -q httpd restart | |
62 | touch /var/log/httpd/whatkilledus_log && chown root:http /var/log/httpd/whatkilledus_log && chmod 620 /var/log/httpd/whatkilledus_log | |
63 | ||
64 | %postun | |
65 | if [ "$1" = "0" ]; then | |
66 | %service -q httpd restart | |
67 | fi | |
68 | ||
69 | %triggerpostun -- %{name} < 2.00 | |
70 | sed -i -e 's#^WhatKilledUsLog.*##g' %{_sysconfdir}/68_mod_%{mod_name}.conf | |
71 | ||
72 | %files | |
73 | %defattr(644,root,root,755) | |
74 | %doc CHANGES.txt NOTICE.txt | |
75 | %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/*_mod_%{mod_name}.conf | |
76 | %attr(755,root,root) %{_pkglibdir}/*.so | |
77 | # append by webserver | |
78 | %attr(620,root,http) %ghost /var/log/httpd/whatkilledus_log |