File makewhat.spec of Package makewhat

# spec file for package makewhat
# Copyright (c) 2019 SUSE LINUX 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

Name:           makewhat
Version:        2009.6.17
Release:        0
Summary:        Utilities to create a whatis database
License:        GPL-2.0-or-later
Group:          System/Base
BuildRequires:  update-alternatives
Requires:       man
Requires(post): update-alternatives
Requires(preun): update-alternatives
Source:         makewhat.tar.gz
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
BuildArch:      noarch

The man system in SUSE Linux (package man) does not need a whatis
database. Nevertheless, some manual browsers, such as tkman, still need
such a database.

%setup -n makewhat

echo Build section is empty

mkdir -p %{buildroot}%{_sbindir}
mkdir -p %{buildroot}%{_sysconfdir}/alternatives
install -m755 makewhatis %{buildroot}%{_sbindir}/
ln -sf %{_sbindir}/ %{buildroot}%{_sysconfdir}/alternatives/makewhatis
ln -sf %{_sysconfdir}/alternatives/makewhatis %{buildroot}%{_sbindir}/makewhatis

%{_sbindir}/update-alternatives --quiet --force \
        --install %{_sbindir}/makewhatis makewhatis %{_sbindir}/ 900

if test $1 -eq 0
	%{_sbindir}/update-alternatives --quiet --remove makewhatis %{_sbindir}/makewhatis

%ghost %config %{_sysconfdir}/alternatives/makewhatis