File pciutils-ids.spec of Package pciutils-ids.1090

#
# spec file for package pciutils-ids
#
# Copyright (c) 2015 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 http://bugs.opensuse.org/
#


Name:           pciutils-ids
Version:        2015.09.01
Release:        0
Summary:        PCI-utilities pci.ids database
License:        GPL-2.0+
Group:          Hardware/Other
Url:            http://atrey.karlin.mff.cuni.cz/~mj/pciutils.shtml
Source:         http://pciids.sourceforge.net/pci.ids.bz2
Source2:        merge-pciids
Source4:        merge-pciids.pl
Requires(post): %{_bindir}/perl coreutils
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
BuildArch:      noarch

%description
The database of PCI IDS for pciutils.

merge-pciids: This program merges several pci.ids files.

%prep
bzcat %{SOURCE0} >pci.ids.dist

%build

%install
install -d -m755 %{buildroot}%{_datadir}/pci.ids.d
install -m644 pci.ids.dist %{buildroot}%{_datadir}/pci.ids.d/
install -d -m755 %{buildroot}%{_prefix}/bin
install -m755 %{SOURCE4} %{buildroot}%{_bindir}/
install -m755 %{SOURCE2} %{buildroot}%{_bindir}/
install -m644 /dev/null %{buildroot}%{_datadir}/pci.ids

%files
%defattr(-, root, root)
%dir %{_datadir}/pci.ids.d
%{_datadir}/pci.ids.d/pci.ids.dist
%{_bindir}/merge-pciids
%{_bindir}/merge-pciids.pl
%ghost %{_datadir}/pci.ids

%post
if [ -x %{_bindir}/merge-pciids -a -x %{_bindir}/perl ]; then
  %{_bindir}/merge-pciids
else
  # This should only happen in autobuild
  echo "WARNING: merge-pciids or perl not found"
  cp -p %{_datadir}/pci.ids.d/pci.ids.dist %{_datadir}/pci.ids
fi

%changelog
openSUSE Build Service is sponsored by