File apache2-mod_apparmor.spec of Package apache2-mod_apparmor

#
# spec file for package apache2-mod_apparmor
#
# Copyright (c) 2014 SUSE LINUX Products GmbH, Nuernberg, Germany.
# Copyright (c) 2004, 2005 NOVELL (All rights reserved)
#
# 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/
#


# this is required to be underscore
%define module_name mod_apparmor
%if ! %{?distro:1}0
%if %{?suse_version:1}0
  %define distro "suse"
%endif
%if %{?fedora_version:1}0
  %define distro "redhat"
%endif
%endif
%if ! %{?distro:1}0
  %define distro "suse"
%endif
%if %{distro} == "suse"
BuildRequires:  apache2-devel
BuildRequires:  apache-rpm-macros
Requires:       %{apache_mmn}
Requires:       %{apache_suse_maintenance_mmn}
Requires:       apache2
# FIXME: use proper Requires(pre/post/preun/...)
PreReq:         apache2-prefork
PreReq:         apparmor-parser
%else
%if %{distro} == "redhat" || %{distro} == "rhel4"
%define apxs %{_sbindir}/apxs
%define apache_libexecdir	%(%{apxs} -q LIBEXECDIR)
%define apache_sysconfdir	%(%{apxs} -q SYSCONFDIR)
BuildRequires:  httpd-devel
# FIXME: use proper Requires(pre/post/preun/...)
PreReq:         httpd
%endif
%endif
Name:           apache2-mod_apparmor
Version:        2.0.2
Release:        0
Summary:        AppArmor Module for Apache
License:        LGPL-2.1
Group:          Applications/System
Url:            http://forge.novell.com/modules/xfmod/project/?apparmor
Source0:        %{name}-%{version}-896.tar.gz
Patch0:         apache2-mod_apparmor-2.0.2.libdir_compat.diff
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
BuildRequires:  libapparmor-devel

%description
apache2-mod_apparmor adds support to apache2 to provide AppArmor confinement
to individual cgi scripts handled by apache modules like mod_php and
mod_perl.
This package is part of a suite of tools that used to be named SubDomain.

%prep

%setup -q
%patch -P 0 -p1

%build
make %{?_smp_mflags} APXS=%{apache_apxs}

%install
make install DESTDIR=%{buildroot} DISTRO=%{distro} MANDIR=%{_mandir}

%if %{distro} == "suse"
       mkdir -p %{buildroot}%{_libdir}/apache2-prefork/
       ln -s %{apache_libexecdir}/%{module_name}.so %{buildroot}%{_libdir}/apache2-prefork/%{module_name}.so
%else
  %if %{distro} == "redhat" || %{distro} == "rhel4"
  	mkdir -p %{buildroot}/%{apache_sysconfdir}.d/
	install -m 644 %{module_name}.conf %{buildroot}/%{apache_sysconfdir}.d/
  %endif
%endif

%files
%defattr(-,root,root)
%{apache_libexecdir}
%if %{distro} == "suse"
%{_libdir}/apache2-prefork/%{module_name}.so
%else
  %if %{distro} == "redhat" || %{distro} == "rhel4"
    %{apache_sysconfdir}.d/%{module_name}.conf
  %endif
%endif
%doc COPYING.LGPL
%{_mandir}/man*/*
%doc *.[0-9].html
%doc common/apparmor.css

%triggerpostun -- mod_change_hat mod-change-hat

%if %{distro} == "suse"
  %{_sbindir}/a2enmod apparmor
%endif

%changelog

%check
openSUSE Build Service is sponsored by