File hostinfo.spec of Package hostinfo

# spec file for package hostinfo
# Copyright (c) 2018 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:           hostinfo
Version:        1.0
Release:        0
Summary:        Gathers basic server information
License:        GPL-2.0
Group:          System/Monitoring
Source:         %{name}-%{version}.tar.gz
Requires:       iproute2
Requires:       issue-generator
Requires:       sed
BuildArch:      noarch

A script that displays current system information to help 
identify a host and its resources.
%setup -q

gzip -9f man/*8

pwd;ls -la
mkdir -p %{buildroot}%{_sbindir}
mkdir -p %{buildroot}%{_sysconfdir}
mkdir -p %{buildroot}%{_unitdir}
mkdir -p %{buildroot}%{_udevrulesdir}
install -d %{buildroot}%{_mandir}/man8
install -d %{buildroot}%{_docdir}/%{name}
install -m 644 conf/hostinfo.conf %{buildroot}%{_sysconfdir}
install -m 644 conf/91-hostinfo.rules %{buildroot}%{_udevrulesdir}/91-hostinfo.rules
install -D -m 644 conf/hostinfo.service %{buildroot}%{_unitdir}/hostinfo.service
install -D -m 644 conf/hostinfo.timer %{buildroot}%{_unitdir}/hostinfo.timer
install -m 755 bin/hostinfo %{buildroot}%{_sbindir}
install -m 444 man/COPYING.GPLv2 %{buildroot}%{_docdir}/%{name}
install -m 644 man/*.8.gz %{buildroot}%{_mandir}/man8
ln -sf service %{buildroot}%{_sbindir}/rchostinfo

%config %{_sysconfdir}/hostinfo.conf
%dir %{_docdir}/%{name}
%doc %{_docdir}/%{name}/*

%service_add_pre hostinfo.service hosinfo.timer

%service_add_post hostinfo.service hostinfo.timer

%service_del_preun hostinfo.service hostinfo.timer
/usr/sbin/hostinfo Uninstalled

%service_del_postun hostinfo.service hostinfo.timer