File xsensors.spec of Package xsensors

Name:           xsensors
Version:        0.80
Release:        2%{?dist}
Summary:        An X11 interface to lm_sensors

License:        GPLv2+
Url:            https://github.com/Mystro256/xsensors
Source:         https://github.com/Mystro256/%{name}/archive/%{version}.tar.gz

%if 0%{?rhel} >= 7 || 0%{?fedora}
BuildRequires:  gtk3-devel
BuildRequires:  libappstream-glib
%else
BuildRequires:  gtk2-devel
%endif
BuildRequires:  libsensors4-devel
BuildRequires:  cairo-devel
BuildRequires:  glib2-devel
BuildRequires:  desktop-file-utils

%description
Xsensors is a simple GUI program that allows you to read useful data from the
lm_sensors library in a digital read-out like fashion, such as the temperature,
voltage ratings and fan speeds of the running computer.

%prep
%setup -q

%build
%configure
make %{?_smp_mflags}

%install
make install DESTDIR=%{buildroot}
desktop-file-validate \
  %{buildroot}%{_datadir}/applications/%{name}.desktop
%if 0%{?rhel} >= 7 || 0%{?fedora}
appstream-util validate-relax --nonet %{buildroot}/%{_datadir}/appdata/%{name}.appdata.xml
%endif

%files
%doc AUTHORS COPYING README ChangeLog
/usr/share/xsensors
%{_datadir}/%{name}/theme.tiff
%{_datadir}/icons/hicolor/*/apps/%{name}.png
%{_bindir}/%{name}
%{_datadir}/applications/%{name}.desktop
%{_mandir}/man1/%{name}.1*
%if 0%{?rhel} >= 7 || 0%{?fedora}
%{_datadir}/appdata/%{name}.appdata.xml
%else
%exclude %{_datadir}/appdata/%{name}.appdata.xml
%endif

%post
/bin/touch --no-create %{_datadir}/icons/hicolor &>/dev/null || :

%postun
if [ $1 -eq 0 ] ; then
    /bin/touch --no-create %{_datadir}/icons/hicolor &>/dev/null
    /usr/bin/gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || :
fi

%posttrans
/usr/bin/gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || :

%changelog
* Wed Nov 16 2016 Jeremy Newton <alexjnewt AT hotmail DOT com> - 0.80-2
- Added missing scriplet to update iconcache

openSUSE Build Service is sponsored by