A new user interface for you! Read more...

File hostinfo.spec of Package hostinfo

#
# spec file for package hostinfo (Version 0.55.1)
#
# Copyright (C) 2005-2007 Novell, Inc.
# This file and all modifications and additions to the pristine
# package are under the same license as the package itself.
#
# Please submit bugfixes or comments via http://www.suse.de/feedback/
#

# norootforbuild
# neededforbuild  

Name:         hostinfo
URL:          https://build.opensuse.org/project/show?project=Novell:NTS
License:      GPLv2
Group:        Documentation/SuSE
Autoreqprov:  on
Version:      0.55
Release:      2
Source:       %{name}-%{version}.tar.gz
Summary:      Gathers basic server information
BuildRoot:    %{_tmppath}/%{name}-%{version}-build
BuildArch:    noarch
Distribution: Novell NTS
Vendor:       Novell Technical Services

%description
A script that displays current system information to help 
identify a host and it's resources.

Authors:
--------
    Jason Record <jrecord@novell.com>
 
 
%prep
%setup -q
%build
gzip -9f hostinfo.1

%install
pwd;ls -la
rm -rf $RPM_BUILD_ROOT
install -d $RPM_BUILD_ROOT/usr/bin
install -d $RPM_BUILD_ROOT/usr/share/man/man1
install -m 755 hostinfo $RPM_BUILD_ROOT/usr/bin
install -m 644 hostinfo.1.gz $RPM_BUILD_ROOT/usr/share/man/man1/hostinfo.1.gz

%files
%defattr(-,root,root)
/usr/bin/hostinfo
/usr/share/man/man1/hostinfo.1.gz

%post
DATEADDED=`date +%D\ %T`
TMPFILE='/tmp/hostinfo.tmp.cijAkjd283l13'
STMP=`basename $TMPFILE`

test -e /etc/profile.local && sed -i -e "/$STMP/d" -e '/hostinfo.txt/d' -e '/^# Added by hostinfo/d' /etc/profile.local
echo "# Added by hostinfo RPM on $DATEADDED" >> /etc/profile.local
echo "/usr/bin/hostinfo > $TMPFILE; cat $TMPFILE; rm -f $TMPFILE" >> /etc/profile.local

SHELLS="/root/.bashrc"
for THISHELL in $SHELLS
do
  test -e $THISHELL && sed -i -e '/^alias hi=/d' -e '/^# Added by hostinfo/d' $THISHELL
  echo "# Added by hostinfo RPM on $DATEADDED" >> $THISHELL
  echo "alias hi='clear; hostinfo'" >> $THISHELL
done

%changelog -n hostinfo