File lsvpd.spec of Package lsvpd

#
# spec file for package lsvpd (Version 1.6.5)
#
# Copyright (c) 2010 SUSE LINUX Products 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 http://bugs.opensuse.org/
#

# norootforbuild


Name:           lsvpd
BuildRequires:  gcc-c++
BuildRequires:  libvpd2-devel
BuildRequires:  sg3_utils-devel
BuildRequires:  zlib-devel
%ifarch ppc ppc64
BuildRequires:  librtas
%endif
Url:            http://sourceforge.net/projects/linux-diag/
Summary:        VPD Hardware Inventory Utilities for Linux
Version:        1.6.5
Release:        42
License:        GPLv2+
Group:          System/Monitoring
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
PreReq:         %insserv_prereq %fillup_prereq
Requires:       /bin/sed
Source0:        %{name}-%{version}.tar.bz2
Patch2:         sgutils.patch
Patch3:         lsvpd.cxx-includes.patch	

%description
The lsvpd package contains both the lsvpd, lscfg and lsmcode commands.
These commands, along with a boot-time scanning script called
update-device-tree, constitute a simple hardware inventory system. The
lsvpd command provides Vital Product Data (VPD) about hardware
components to higher-level serviceability tools. The lscfg command
provides a more human-readable format of the VPD, as well as some
system-specific information.  lsmcode lists microcode and firmware
levels.



Authors:
--------
    Martin Schwenke @ IBM

%prep
%setup -q
%patch2 -p0
%patch3 -p1

%build
autoreconf -fi
export CFLAGS="$RPM_OPT_FLAGS -UPCI_IDS -DPCI_IDS='\"/usr/share/pci.ids\"' -UUSB_IDS -DUSB_IDS='\"/usr/share/usb.ids\"'"
export CXXFLAGS="$RPM_OPT_FLAGS -UPCI_IDS -DPCI_IDS='\"/usr/share/pci.ids\"' -UUSB_IDS -DUSB_IDS='\"/usr/share/usb.ids\"'"
%configure
make %{?_smp_mflags}
chmod 644 README* COPYING NEWS 

%clean 
rm -rf $RPM_BUILD_ROOT

%install
make DESTDIR=$RPM_BUILD_ROOT install
mkdir $RPM_BUILD_ROOT/sbin
for i in lscfg lsmcode lsvio lsvpd update-lsvpd-db
do
 if test -f $RPM_BUILD_ROOT/usr/sbin/$i
 then
   ln -sfvbn ../usr/sbin/$i $RPM_BUILD_ROOT/sbin/$i
 fi
done
if [ -e /etc/udev/rules.d/99-lsvpd.rules ] ; then
	%{__rm} /etc/udev/rules.d/99-lsvpd.rules
fi
if [ -e /etc/udev/rules.d/99-lsvpd.disabled ] ; then
	%{__rm} /etc/udev/rules.d/99-lsvpd.disabled
fi

%post
if [ -d /var/lib/lsvpd ] ; then
  rm -rf /var/lib/lsvpd
fi
/usr/sbin/vpdupdate
exit 0

%files 
%defattr(-,root,root)
%doc README COPYING NEWS 
%dir /etc/lsvpd
%attr (644,root,root) %config /etc/lsvpd/*
/sbin/*
%attr (755,root,root) /usr/sbin/*
%{_mandir}/*/*

%changelog