Blob Blame History Raw
Name:       gnome-shell-extension-freon
Summary:    GNOME Shell extension to display system temperature, voltage, and fan speed
Version:    23
Release:    4%{?dist}
URL:        https://extensions.gnome.org/extension/841/freon/
License:    GPLv2
BuildArch:  noarch

# You can see the latest source releases here:
# https://github.com/UshakovVasilii/gnome-shell-extension-freon/releases
Source0: https://github.com/UshakovVasilii/gnome-shell-extension-freon/archive/EGO-%{version}.tar.gz

# Dependencies described here:
# https://github.com/UshakovVasilii/gnome-shell-extension-freon/wiki/Dependency
Requires: gnome-shell >= 3.12
Requires: gnome-shell-extension-common
Requires: lm_sensors
Requires: udisks2

# CentOS 7 build environment doesn't support Recommends tag.
%if 0%{?fedora}
Recommends: gnome-tweak-tool
%endif


%description
Freon is a GNOME Shell extension for displaying the temperature of your CPU,
hard disk, solid state, and video card (NVIDIA, Catalyst, and Bumblebee
supported), as well as power supply voltage, and fan speed. You can choose which
HDD/SSD or other devices to include, what temperature units to use, and how
often to refresh the sensors readout, and they will appear in the GNOME Shell
top bar. For the GPU temperature, you may need to install the vendor's driver
for best results.

**NOTE:** Freon relies on lm_sensors. You must run `sensors-detect` before Freon
will be able to detect and display hardware temperatures. The default options
for sensors-detect are safe for most systems; however, there is a small, but
non-zero chance of causing hardware damage or a kernel panic. See the discussion
on GitHub -- https://github.com/groeck/lm-sensors/issues/17

**NOTE:** After installing, each user that wants it must still manually enable
Freon before it will take effect. You can do so a few different ways:

* If you've already installed the GNOME Shell integration web browser plugin,
  go to <https://extensions.gnome.org/local/>, find the extension, and click
  the switch to "ON."
* Open GNOME Tweak Tool, go to the Extensions tab, find the extension, and click
  the switch to "ON."
* Open a terminal or the desktop's command dialog, and (as your normal user
  account) run:
  gnome-shell-extension-tool --enable freon@UshakovVasilii_Github.yahoo.com

You may also need to restart GNOME Shell (Open the command dialog with Alt-F2,
type `r`, and hit enter), or log out and log back in.



# UUID is defined in extension's metadata.json and used as directory name.
%global  UUID                  freon@UshakovVasilii_Github.yahoo.com
%global  gnome_extensions_dir  %{_datadir}/gnome-shell/extensions/
%global  final_install_dir     %{buildroot}/%{gnome_extensions_dir}/%{UUID}

%prep
%autosetup -n %{name}-EGO-%{version}

%build
# No compilation necessary.

%install
mkdir -p %{final_install_dir}
cp --recursive --preserve=mode,timestamps  %{UUID}/*  %{final_install_dir}

# RPM will take care of gschemas, we don't need to include a precompiled copy.
mkdir -p %{buildroot}/%{_datadir}/glib-2.0/schemas/
mv  %{final_install_dir}/schemas/org.gnome.shell.extensions.sensors.gschema.xml  \
	%{buildroot}/%{_datadir}/glib-2.0/schemas/
rm --recursive %{final_install_dir}/schemas/

# Remove source .po localization files, move binary .mo to system directory.
rm --recursive %{final_install_dir}/po/
mv  %{final_install_dir}/locale  %{buildroot}/%{_datadir}/
%find_lang freon


%posttrans
# The latest versions of Fedora compile gschemas automatically, but CentOS 7
# does not.
%if 0%{?rhel}
	%{_bindir}/glib-compile-schemas %{_datadir}/glib-2.0/schemas/  &> /dev/null || :
%endif



%files -f freon.lang
%doc README.md
%license LICENSE
%{gnome_extensions_dir}/%{UUID}/
%{_datadir}/glib-2.0/schemas/org.gnome.shell.extensions.sensors.gschema.xml



%changelog
* Wed Mar 29 2017 Andrew Toskin <andrew@tosk.in> - 23-4
- Remove the sensors-detect scriptlet.

* Mon Mar 27 2017 Andrew Toskin <andrew@tosk.in> - 23-3
- Explicitly compile gschemas on EPEL 7.
- Add extra warning to package description about using lm_sensors.

* Tue Mar 21 2017 Andrew Toskin <andrew@tosk.in> - 23-2
- Revised package description.
- Added EPEL 7 branch.

* Tue Mar 14 2017 Andrew Toskin <andrew@tosk.in> - 23-1
- First build accepted into Fedora repos.