LogoopenSUSE Build Service > Projects
Sign Up | Log In

View File munin-plugin-sensors_amd.spec of Package munin-plugin-sensors_amd (Project home:Ximi1970:openSUSE:Extra)

# 
# spec file for package munin-plugins-xxxx
#

%define plugin_name  sensors_amd

Summary: Wildcard-plugin for AMD GFX cards temperature and fan sensors
Name: munin-plugin-%{plugin_name}
Version: 1.0
Release: 0.1
License: GPL-2.0
Vendor: Maxime Rijnders
Group: System/Kernel
BuildArch: noarch
Requires: munin
Requires: munin-node
URL: https://build.opensuse.org/project/show/home:Ximi1970:munin-plugins
Source0: %{plugin_name}_
Source1: default.config
Source100: %{name}.changes
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}


%description
Wildcard-plugin for AMD graphics cards temperature and fan sensors.
Needs the proprietary AMD aticonfig command line utility.


%prep
cp %{SOURCE1} .


%install
install -d -m 755 %{buildroot}/usr/lib/munin/plugins
install -m 755 %{SOURCE0} %{buildroot}/usr/lib/munin/plugins


%post
if [ -f /etc/munin/plugin-conf.d/munin-node ] ; then
    #
    # Check config
    #
    grep -q "\[%{plugin_name}" /etc/munin/plugin-conf.d/munin-node
    if [ "$?" == "1" ] ; then
        #
        # Add default config
        #
        echo >> /etc/munin/plugin-conf.d/munin-node
        cat /usr/share/doc/packages/%{name}/default.config >> /etc/munin/plugin-conf.d/munin-node
    fi
fi


%postun


%clean
rm -rf $RPM_BUILD_ROOT


%files
%defattr(-,root,root)
%doc default.config
%dir /usr/lib/munin
%dir /usr/lib/munin/plugins
/usr/lib/munin/plugins/%{plugin_name}_


%changelog