File apache2-debugging-modules.spec of Package apache2-debugging-modules
#
# spec file for package apache2-debugging-modules
#
# Copyright (c) 2020 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via https://bugs.opensuse.org/
#
%define wku_name wku_bt
%define wku_version 2.01
Name: apache2-debugging-modules
Version: 2.4
Release: 0
Summary: A bunch of modules useful for debugging
License: Apache-2.0
Group: Productivity/Networking/Web/Servers
URL: https://emptyhammock.com/projects/httpd/diag/
Source0: https://emptyhammock.com/downloads/%{wku_name}-%{wku_version}.zip
Source1: http://apache.webthing.com/mod_diagnostics/mod_diagnostics.c
Source2: http://people.apache.org/~trawick/mod_backdoor.c
Source3: http://people.apache.org/~trawick/mod_backdoor.txt
Source4: wku.conf
BuildRequires: apache-rpm-macros
BuildRequires: apache2-devel
BuildRequires: apache2-prefork
BuildRequires: apache2-worker
BuildRequires: curl
BuildRequires: unzip
Requires: %{apache_mmn}
Requires: %{apache_suse_maintenance_mmn}
Requires: apache2
#
%description
This package contains
mod_crash
mod_backtrace
mod_whatkilledus
mod_backdoor
mod_diagnostic_filter
To enable any of the modules, use a2enmod, e.g.
"a2enmod whatkilledus"
See the source files in %{_docdir}/apache2-debugging-modules
for usage info.
Other useful debugging modules, NOT included here, but worth mentioning, are:
mod_bucketeer (ships with apache2 package)
mod_dumpio (ships with apache2 package)
mod_coredumper (needs CoreDumper library)
%prep
%setup -q -c -T -a0
cp -p %{SOURCE1} %{SOURCE2} %{SOURCE3} .
sed -i "s:\(^.*ap_my_generation.*$\): int ap_my_generation = 0;\n ap_mpm_query(AP_MPMQ_GENERATION, \&ap_my_generation);\n\1:" mod_backdoor.c
%build
export CFLAGS="-O0 -Wall"
cd %{wku_name}-%{wku_version}
BITS=%{__isa_bits} make clean all APXS=%{apache_apxs} [LIBUNWIND=yes]
cd ..
%{apache_apxs} -c mod_diagnostics.c
%{apache_apxs} -c mod_backdoor.c
%install
cd %{wku_name}-%{wku_version}
rm -rf %{buildroot}%{apache_libexecdir}
mkdir -p %{buildroot}%{apache_libexecdir}
cp -p .libs/mod_backtrace.so %{buildroot}%{apache_libexecdir}
cp -p .libs/mod_crash.so %{buildroot}%{apache_libexecdir}
cp -p .libs/mod_whatkilledus.so %{buildroot}%{apache_libexecdir}
mkdir -p %{buildroot}%{_docdir}/%{name}/%{wku_name}
cp -p CHANGES.txt LICENSE.txt NOTICE.txt README.txt %{buildroot}%{_docdir}/%{name}/%{wku_name}
cd ..
cp -p .libs/mod_diagnostics.so %{buildroot}%{apache_libexecdir}/mod_diagnostic_filter.so
cp -p .libs/mod_backdoor.so %{buildroot}%{apache_libexecdir}/mod_backdoor.so
mkdir -p %{buildroot}%{apache_sysconfdir}/conf.d/
install -m 644 %{SOURCE4} %{buildroot}%{apache_sysconfdir}/conf.d/
%files
%dir %{apache_libexecdir}
%doc %{_docdir}/%{name}
%doc %{_docdir}/%{name}/%{wku_name}
%{apache_libexecdir}/*.so
%dir %{apache_sysconfdir}/conf.d/
%config %{apache_sysconfdir}/conf.d/wku.conf
%changelog