File selflinux.spec of Package selflinux

#
# spec file for package selflinux
#
# 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/
#


Name:           selflinux
Version:        0.13.0
Release:        3
License:        LGPL-2.1+
Summary:        Linux tutorial
Url:            http://www.selflinux.org/
Group:          Documentation/Other
BuildArch:      noarch
Autoreq:        on
%if 0%{?suse_version}
BuildRequires:  apache2-devel
BuildRequires:  update-desktop-files
# Provides:       locale(susehelp:de)
%define         apache_sysconfdir %(/usr/sbin/apxs2 -q SYSCONFDIR)
%endif
%if 0%{?fedora_version} || 0%{?rhel_version} || 0%{?centos_version}
BuildRequires:  desktop-file-utils
BuildRequires:  httpd-devel
%define         apache_sysconfdir %(/usr/sbin/apxs -q SYSCONFDIR)
%endif
%if 0%{?mandriva_version}
BuildRequires:  apache2-devel
Requires(post): desktop-file-utils
Requires(postun): desktop-file-utils
%define         apache_sysconfdir %(/usr/sbin/apxs2 -q SYSCONFDIR)
%endif
Source:         SelfLinux-%{version}-html.tar.bz2
Source1:        %{name}.desktop
Source2:        %{name}.xpm
Source3:        %{name}.conf
Source4:        selflinux-susehelp-0.13.0.tar.bz2
BuildRoot:      %{_tmppath}/%{name}-%{version}-build

%description
Linux reference and tutorial. Unfortunately, this document is only
available in German.

You can find the tutorial under /usr/share/doc/selflinux/ - or use
the SuSE helpcenter.

%prep
%setup -n SelfLinux-%{version} -b4

%build

%install
%{__install} -d -m 755 %{buildroot}%{_datadir}/doc/%{name}
cp -r $RPM_BUILD_DIR/SelfLinux-%version/* %{buildroot}%{_datadir}/doc/%{name}

# create desktop entries
%{__mkdir_p} %{buildroot}%{_datadir}/{applications,pixmaps}
%{__install} -m 644 %{SOURCE2} %{buildroot}%{_datadir}/pixmaps/
%if 0%{?suse_version}
%suse_update_desktop_file -i selflinux
# entry for susehelp
mkdir -p %{buildroot}%{_datadir}/susehelp/meta/SelfLinux
cp -r $RPM_BUILD_DIR/SelfLinux-susehelp-%version/* %{buildroot}%{_datadir}/susehelp/meta/SelfLinux
%endif
%if 0%{?fedora_version}
# install desktop file
desktop-file-install --vendor="%{vendor}" \
  --dir=%{buildroot}%{_datadir}/applications \
  %{SOURCE1}
%endif
%if 0%{?mandriva_version}
desktop-file-install --vendor="%{vendor}" \
  --dir=%{buildroot}%{_datadir}/applications \
  %{SOURCE1}
%endif
# create apache configuration
%{__mkdir_p} %{buildroot}%{apache_sysconfdir}/conf.d
%{__install} -m 644 %{SOURCE3} %{buildroot}%{apache_sysconfdir}/conf.d/%{name}.conf

%clean
rm -rf %{buildroot}

%if 0%{?mandriva_version}
%post
%{update_menus}

%postun
%{clean_menus}
%endif

%files
%defattr(-,root,root)
%if 0%{?suse_version}
%dir %{_datadir}/susehelp/
%dir %{_datadir}/susehelp/meta
%{_datadir}/susehelp/meta/SelfLinux
%endif
%{_datadir}/doc/%{name}
%{_datadir}/applications/*%{name}.desktop
%{_datadir}/pixmaps/%{name}.xpm
%config (noreplace) %{apache_sysconfdir}/conf.d/%{name}.conf

%changelog
openSUSE Build Service is sponsored by