]>
Commit | Line | Data |
---|---|---|
070fd57c AM |
1 | %define mod_name whatkilledus |
2 | %define apxs /usr/sbin/apxs | |
3 | Summary: Knows what a thread was handling in case the thread segfaults | |
4 | Name: apache-mod_%{mod_name} | |
5 | Version: 1.0 | |
6 | Release: 1 | |
7 | License: Apache | |
8 | Group: Networking/Daemons | |
9 | Source0: http://people.apache.org/~trawick/mod_whatkilledus.c | |
10 | # Source0-md5: e59c5d56e294a31e5b158ad5e4553001 | |
11 | URL: http://people.apache.org/~trawick/exception_hook.html | |
12 | BuildRequires: %{apxs} | |
13 | BuildRequires: apache-devel >= 2.0.43 | |
14 | BuildRequires: rpm-perlprov | |
15 | Requires(post,preun): %{apxs} | |
16 | Requires: apache >= 2.0.43 | |
17 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
18 | ||
19 | %define _pkglibdir %(%{apxs} -q LIBEXECDIR) | |
20 | %define _sysconfdir %(%{apxs} -q SYSCONFDIR) | |
21 | ||
22 | %description | |
23 | Keeps a little bit of state on each active connection, which allows it | |
24 | to know what a thread was handling in case the thread segfaults. | |
25 | ||
26 | %prep | |
27 | %setup -q -c -T | |
28 | ||
29 | %build | |
30 | %{apxs} -c %{SOURCE0} | |
31 | ||
32 | %install | |
33 | rm -rf $RPM_BUILD_ROOT | |
34 | install -d $RPM_BUILD_ROOT/etc/httpd/httpd.conf | |
35 | ||
36 | libtool --mode=install install -D mod_%{mod_name}.la $RPM_BUILD_ROOT%{_pkglibdir}/mod_%{mod_name}.so | |
37 | ||
38 | echo 'LoadModule %{mod_name}_module modules/mod_%{mod_name}.so' > $RPM_BUILD_ROOT/etc/httpd/httpd.conf/68_mod_%{mod_name}.conf | |
39 | ||
40 | %clean | |
41 | rm -rf $RPM_BUILD_ROOT | |
42 | ||
43 | %post | |
44 | if [ -f /var/lock/subsys/httpd ]; then | |
45 | /etc/rc.d/init.d/httpd restart 1>&2 | |
46 | else | |
47 | echo "Run \"/etc/rc.d/init.d/httpd start\" to start apache HTTP daemon." | |
48 | fi | |
49 | ||
50 | %preun | |
51 | if [ "$1" = "0" ]; then | |
52 | if [ -f /var/lock/subsys/httpd ]; then | |
53 | /etc/rc.d/init.d/httpd restart 1>&2 | |
54 | fi | |
55 | fi | |
56 | ||
57 | %files | |
58 | %defattr(644,root,root,755) | |
59 | %attr(755,root,root) %{_pkglibdir}/*.so | |
60 | %config %{_sysconfdir}/httpd.conf/*.conf |