]>
Commit | Line | Data |
---|---|---|
070fd57c AM |
1 | %define mod_name whatkilledus |
2 | %define apxs /usr/sbin/apxs | |
4cd44d87 AM |
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 | |
070fd57c | 5 | Name: apache-mod_%{mod_name} |
4cd44d87 AM |
6 | Version: 1.0 |
7 | Release: 1.20040323.1 | |
9bb3fada | 8 | License: Apache v2.0 |
070fd57c AM |
9 | Group: Networking/Daemons |
10 | Source0: http://people.apache.org/~trawick/mod_whatkilledus.c | |
11 | # Source0-md5: e59c5d56e294a31e5b158ad5e4553001 | |
9bb3fada AM |
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 | |
c3404fb0 ER |
16 | BuildRequires: rpmbuild(macros) >= 1.268 |
17 | Requires: apache(modules-api) = %apache_modules_api | |
070fd57c AM |
18 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
19 | ||
c3404fb0 ER |
20 | %define _pkglibdir %(%{apxs} -q LIBEXECDIR 2>/dev/null) |
21 | %define _sysconfdir %(%{apxs} -q SYSCONFDIR 2>/dev/null) | |
070fd57c AM |
22 | |
23 | %description | |
4cd44d87 AM |
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 | ||
070fd57c AM |
32 | %prep |
33 | %setup -q -c -T | |
9bb3fada | 34 | install %{SOURCE0} . |
070fd57c AM |
35 | |
36 | %build | |
9bb3fada AM |
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 | |
070fd57c AM |
40 | |
41 | %install | |
42 | rm -rf $RPM_BUILD_ROOT | |
9bb3fada AM |
43 | install -d $RPM_BUILD_ROOT{%{_pkglibdir},%{_sysconfdir}/httpd.conf,/var/log/httpd} |
44 | install .libs/mod_%{mod_name}.so $RPM_BUILD_ROOT%{_pkglibdir} | |
070fd57c | 45 | |
9bb3fada | 46 | touch $RPM_BUILD_ROOT/var/log/httpd/whatkilledus_log |
070fd57c | 47 | |
4cd44d87 | 48 | cat > $RPM_BUILD_ROOT%{_sysconfdir}/httpd.conf/68_mod_%{mod_name}.conf << 'EOF' |
9bb3fada | 49 | LoadModule %{mod_name}_module modules/mod_%{mod_name}.so |
9bb3fada | 50 | EnableExceptionHook On |
0d364973 | 51 | WhatKilledUsLog /var/log/httpd/whatkilledus_log |
9bb3fada | 52 | EOF |
070fd57c AM |
53 | |
54 | %clean | |
55 | rm -rf $RPM_BUILD_ROOT | |
56 | ||
57 | %post | |
c3404fb0 | 58 | %service -q httpd restart |
7c7c4482 | 59 | touch /var/log/httpd/whatkilledus_log && chown root:http /var/log/httpd/whatkilledus_log && chmod 620 /var/log/httpd/whatkilledus_log |
070fd57c | 60 | |
4a55a9b1 | 61 | %postun |
070fd57c | 62 | if [ "$1" = "0" ]; then |
c3404fb0 | 63 | %service -q httpd restart |
070fd57c AM |
64 | fi |
65 | ||
66 | %files | |
67 | %defattr(644,root,root,755) | |
9bb3fada | 68 | %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/httpd.conf/*_mod_%{mod_name}.conf |
070fd57c | 69 | %attr(755,root,root) %{_pkglibdir}/*.so |
06d6b39e AM |
70 | # append by webserver |
71 | %attr(620,root,http) %ghost /var/log/httpd/whatkilledus_log |