File apache2-mod_bmx.spec of Package apache2-mod_bmx

#
# spec file for package apache2-mod_bmx
#
# Copyright (c) 2014 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# 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 http://bugs.opensuse.org/
#

%if %{defined suse_version}
BuildRequires:  apache2-devel
BuildRequires:  apache-rpm-macros
BuildRequires:  apache2-prefork
BuildRequires:  apache2-worker
%else
%define apache_apxs %{_sbindir}/apxs
BuildRequires:  httpd-devel
%endif
Name:           apache2-mod_bmx
Version:        0.9.6
Release:        1
Summary:        Internal Apache Runtime Statistics Module
License:        Apache-2.0
Group:          Productivity/Networking/Web/Servers
Url:            https://github.com/hyperic/mod_bmx
# https://github.com/hyperic/mod_bmx/tarball/%%{version}
Source:         https://github.com/hyperic/mod_bmx/archive/%{version}.tar.gz
Source1:        apache2-mod_bmx.conf
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
%if %{defined suse_version}
Requires:       %{apache_mmn}
Requires:       %{apache_suse_maintenance_mmn}
Requires:       apache2
%else
Requires:       httpd
%endif

%description
BMX is a framework for Apache to provide internal runtime statistics
and configuration information to interested remote agents. It can
be used to report on the internal workings and status of Apache at
runtime, such as performance metrics and current capacity.

%package doc
Summary:        Module Documentation
Group:          Documentation/Other
%if 0%{?suse_version} >= 1120
BuildArch:      noarch
%endif

%description doc
Provides manual for bmx module inside Apache documentation directory.

%prep
%setup -q -n mod_bmx-%{version}

%build
APXS="%{apache_apxs}" \
./configure.apxs
make %{?_smp_mflags}

%install
make DESTDIR=%{buildroot} install %{?_smp_mflags}
rm "%{buildroot}%{apache_libexecdir}/mod_bmx_example.so"
install -D -m0644 "%{SOURCE1}" "%{buildroot}%{_sysconfdir}/apache2/conf.d/mod_bmx.conf"

%postun
# request restart apache instanaces (which loaded bmx) after apache2-mod_bmx package update
if [ $1 -eq 1 ]; then
  %apache_request_restart -m bmx
fi

%posttrans
# restart apache instances which have this module after zypper or rpm transaction, if not
# have restarted already in other posttrans
%apache_restart_if_needed

%files
%defattr(-,root,root)
%doc *.txt
%config(noreplace) %{_sysconfdir}/apache2/conf.d/mod_bmx.conf
%{apache_libexecdir}/mod_bmx.so
%{apache_libexecdir}/mod_bmx_status.so
%{apache_libexecdir}/mod_bmx_vhost.so

%files doc
%defattr(-,root,root)
%dir %{_datadir}/%{apache_pname}
%dir %{_datadir}/%{apache_pname}/manual
%dir %{_datadir}/%{apache_pname}/manual/mod
%{_datadir}/%{apache_pname}/manual/mod/mod_bmx*

%changelog
openSUSE Build Service is sponsored by