]> git.pld-linux.org Git - packages/apache-mod_whatkilledus.git/blob - apache-mod_whatkilledus.spec
- create file in post
[packages/apache-mod_whatkilledus.git] / apache-mod_whatkilledus.spec
1 %define         mod_name        whatkilledus
2 %define         apxs            /usr/sbin/apxs
3 Summary:        Apache module: logs request when child process crashes
4 Name:           apache-mod_%{mod_name}
5 Version:        0.1
6 Release:        0.20040323.1
7 License:        Apache v2.0
8 Group:          Networking/Daemons
9 Source0:        http://people.apache.org/~trawick/mod_whatkilledus.c
10 # Source0-md5:  e59c5d56e294a31e5b158ad5e4553001
11 Source1:        http://mirrors.ludost.net/gentoo-portage/www-apache/mod_whatkilledus/files/gen_test_char.c
12 # Source1-md5:  7c4e734d1afc695a5be53581998f3700
13 BuildRequires:  %{apxs}
14 BuildRequires:  apache-devel >= 2.0
15 BuildRequires:  rpmbuild(macros) >= 1.268
16 Requires:       apache(modules-api) = %apache_modules_api
17 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
18
19 %define         _pkglibdir      %(%{apxs} -q LIBEXECDIR 2>/dev/null)
20 %define         _sysconfdir     %(%{apxs} -q SYSCONFDIR 2>/dev/null)
21 %define         _pkglogdir      %(%{apxs} -q PREFIX 2>/dev/null)/logs
22
23 %description
24 mod_whatkilledus is an experimental module for Apache httpd 2.x which
25 tracks the current request and logs a report of the active request
26 when a child process crashes. You should verify that it works
27 reasonably on your system before putting it in production.
28
29 %prep
30 %setup -q -c -T
31 install %{SOURCE0} .
32
33 %build
34 %{__cc} `%{_bindir}/apr-1-config --includes --cppflags` %{SOURCE1} -o gen_test_char
35 ./gen_test_char > test_char.h
36 %{apxs} -c mod_%{mod_name}.c -o mod_%{mod_name}.la
37
38 %install
39 rm -rf $RPM_BUILD_ROOT
40 install -d $RPM_BUILD_ROOT{%{_pkglibdir},%{_sysconfdir}/httpd.conf,/var/log/httpd}
41 install .libs/mod_%{mod_name}.so $RPM_BUILD_ROOT%{_pkglibdir}
42
43 touch $RPM_BUILD_ROOT/var/log/httpd/whatkilledus_log
44
45 cat > $RPM_BUILD_ROOT%{_sysconfdir}/httpd.conf/90_mod_%{mod_name}.conf << 'EOF'
46 LoadModule %{mod_name}_module modules/mod_%{mod_name}.so
47 EnableExceptionHook On
48 WhatKilledUsLog /var/log/httpd/whatkilledus_log
49 EOF
50
51 %clean
52 rm -rf $RPM_BUILD_ROOT
53
54 %post
55 %service -q httpd restart
56 touch /var/log/httpd/whatkilledus_log && chown root:http /var/log/httpd/whatkilledus_log && chmod 620 /var/log/httpd/whatkilledus_log
57
58 %postun
59 if [ "$1" = "0" ]; then
60         %service -q httpd restart
61 fi
62
63 %files
64 %defattr(644,root,root,755)
65 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/httpd.conf/*_mod_%{mod_name}.conf
66 %attr(755,root,root) %{_pkglibdir}/*.so
67 # append by webserver
68 %attr(620,root,http) %ghost /var/log/httpd/whatkilledus_log
This page took 0.103965 seconds and 3 git commands to generate.