- Cleanup spec file with spec-cleaner

- Unconditionally build gui
- Use proper scriplets for desktop files/icons
- Update license information

OBS-URL: https://build.opensuse.org/package/show/hardware/lshw?expand=0&rev=6
This commit is contained in:
Martin Pluskal 2015-07-24 10:51:09 +00:00 committed by Git OBS Bridge
parent 102b83323d
commit 5e161765a2
2 changed files with 54 additions and 47 deletions

View File

@ -1,3 +1,11 @@
-------------------------------------------------------------------
Fri Jul 24 10:48:58 UTC 2015 - mpluskal@suse.com
- Cleanup spec file with spec-cleaner
- Unconditionally build gui
- Use proper scriplets for desktop files/icons
- Update license information
-------------------------------------------------------------------
Wed Oct 16 20:13:46 UTC 2013 - xrigou@otenet.gr

View File

@ -1,3 +1,7 @@
#
# spec file for package lshw
#
# Copyright (c) 2015 SUSE LINUX GmbH, Nuernberg, Germany.
# Copyright (c) 2013 Pascal Bleser <pascal.bleser@opensuse.org>
#
# All modifications and additions to the file contributed by third parties
@ -10,34 +14,32 @@
# published by the Open Source Initiative.
# Please submit bugfixes or comments via http://bugs.opensuse.org/
#
# vim: set ts=4 sw=4 et:
%if %{?!_without_gui:1}0
%define with_gui 1
%endif
Name: lshw
Version: B.02.17
Release: 0
Summary: HardWare LiSter
License: GPL-2.0
Group: Hardware/Other
Url: http://ezix.org/project/wiki/HardwareLiSter
Source: http://ezix.org/software/files/lshw-%{version}.tar.gz
Source1: %{name}.desktop.in
Source2: %{name}.png
Source1: lshw.desktop.in
Source2: lshw.png
Patch1: lshw-gcc43.patch
Patch2: lshw-stack-corruption.patch
URL: http://ezix.org/project/wiki/HardwareLiSter
Group: Hardware/Other
License: GNU General Public License (GPL)
BuildRoot: %{_tmppath}/build-%{name}-%{version}
BuildRequires: make gcc gcc-c++ update-desktop-files
BuildRequires: sqlite3-devel
BuildRequires: libstdc++-devel
%if %{?with_gui:1}0
BuildRequires: gcc-c++
BuildRequires: gtk2-devel >= 2.4.0
BuildRequires: hicolor-icon-theme
BuildRequires: libglade2-devel
BuildRequires: libpng-devel pango-devel zlib-devel
%endif
BuildRequires: libpng-devel
BuildRequires: libstdc++-devel
BuildRequires: pango-devel
BuildRequires: sqlite3-devel
BuildRequires: update-desktop-files
BuildRequires: zlib-devel
BuildRoot: %{_tmppath}/%{name}-%{version}-build
%description
lshw (Hardware Lister) is a small tool to provide detailed informaton on the
@ -52,11 +54,11 @@ For detailed information on lshw features and usage, please see the
included documentation or go to the lshw Web page,
http://www.ezix.org/software/lshw.html
%if %{?with_gui:1}0
%package gui
Summary: HardWare LiSter (GUI Frontend)
Group: Hardware/Other
Requires: %{name} = %{version}-%{release}
Requires: hicolor-icon-theme
%description gui
lshw (Hardware Lister) is a small tool to provide detailed informaton on the
@ -71,76 +73,75 @@ information.
For detailed information on lshw features and usage, please see the
included documentation or go to the lshw Web page,
http://www.ezix.org/software/lshw.html
%endif
%debug_package
%prep
%setup -q
%patch1
%patch2
%build
%__make %{?_smp_flags} \
make %{?_smp_mflags} \
PREFIX="%{_prefix}" \
SBINDIR="%{_sbindir}" \
MANDIR="%{_mandir}" \
DATADIR="%{_datadir}" \
CXX="%__cxx" \
CC="%__cc" \
CXX="g++" \
CC="gcc" \
RPM_OPT_FLAGS="%{optflags}" \
STRIP=touch \
all
%if %{?with_gui:1}0
%__make %{?_smp_flags} \
make %{?_smp_mflags} \
PREFIX="%{_prefix}" \
SBINDIR="%{_sbindir}" \
MANDIR="%{_mandir}" \
DATADIR="%{_datadir}" \
CXX="%__cxx" \
CC="%__cc" \
CXX="g++" \
CC="gcc" \
RPM_OPT_FLAGS="%{optflags}" \
STRIP=touch \
gui
%endif
%install
%__make %{?_smp_flags} \
DESTDIR="%{buildroot}" \
make %{?_smp_flags} \
DESTDIR=%{buildroot} \
PREFIX="%{_prefix}" \
SBINDIR="%{_sbindir}" \
MANDIR="%{_mandir}" \
DATADIR="%{_datadir}" \
CXX="%__cxx" \
CC="%__cc" \
CXX="g++" \
CC="gcc" \
OPTFLAGS="%{optflags}" \
install
%if %{?with_gui:1}0
%__make %{?_smp_flags} \
DESTDIR="%{buildroot}" \
make %{?_smp_flags} \
DESTDIR=%{buildroot} \
PREFIX="%{_prefix}" \
SBINDIR="%{_sbindir}" \
MANDIR="%{_mandir}" \
DATADIR="%{_datadir}" \
CXX="%__cxx" \
CC="%__cc" \
CXX="g++" \
CC="gcc" \
OPTFLAGS="%{optflags}" \
install-gui
%endif
%__install -d "%{buildroot}%{_datadir}/applications"
%__sed 's,@@EXEC@@,%{_sbindir}/gtk-lshw,g' < "%{SOURCE1}" \
install -d "%{buildroot}%{_datadir}/applications"
sed 's,@@EXEC@@,%{_sbindir}/gtk-lshw,g' < "%{SOURCE1}" \
> "%{buildroot}%{_datadir}/applications/%{name}.desktop"
%__chmod 0644 "%{buildroot}%{_datadir}/applications/%{name}.desktop"
%__install -D -m 0644 "%{SOURCE2}" "%{buildroot}%{_datadir}/pixmaps/%{name}.png"
chmod 0644 "%{buildroot}%{_datadir}/applications/%{name}.desktop"
install -D -m 0644 "%{SOURCE2}" "%{buildroot}%{_datadir}/pixmaps/%{name}.png"
%suse_update_desktop_file -r "%{name}" System HardwareSettings
%find_lang lshw
%clean
%{?buildroot:%__rm -rf "%{buildroot}"}
%post gui
%desktop_database_post
%icon_theme_cache_post
%postun gui
%desktop_database_postun
%icon_theme_cache_postun
%files -f lshw.lang
%defattr(-,root,root,0755)
@ -149,9 +150,8 @@ http://www.ezix.org/software/lshw.html
%dir %{_datadir}/lshw
%{_datadir}/lshw/*.txt
%{_datadir}/lshw/*.ids
%doc %{_mandir}/man1/lshw.1%{ext_man}
%{_mandir}/man1/lshw.1%{ext_man}
%if %{?with_gui:1}0
%files gui
%defattr(-,root,root,0755)
%doc COPYING
@ -160,6 +160,5 @@ http://www.ezix.org/software/lshw.html
%{_datadir}/lshw/ui
%{_datadir}/applications/%{name}.desktop
%{_datadir}/pixmaps/%{name}.png
%endif
%changelog