Blob Blame History Raw
Name:		gsmartcontrol
Version:	0.8.7
Release:	1%{?dist}
Summary:	Graphical user interface for smartctl
Group:		Applications/System

# Note that the "Whatever" license is effectively the MIT license.  See email
# from Tom Callaway to Fedora-legal-list on 18-APR-2011.
License:	(GPLv2 or GPLv3) and BSD and zlib and Boost and MIT

URL:		http://%{name}.berlios.de/home/index.php/en/Home
Source0:	http://download.berlios.de/%{name}/%{name}-%{version}.tar.bz2
Requires:	smartmontools
Requires:	hicolor-icon-theme
Requires:	usermode

# Patch man page and .desktop file to drop references to gsmartcontrol-root,
# as Fedora uses console-helper instead.
Patch0:		gsmartcontrol-0.8.7-console-helper.patch

BuildRequires:	gtkmm24-devel pcre-devel desktop-file-utils

%description
GSmartControl is a graphical user interface for smartctl (from
smartmontools package), which is a tool for querying and controlling
SMART (Self-Monitoring, Analysis, and Reporting Technology) data on
modern hard disk drives. It allows you to inspect the drive's SMART
data to determine its health, as well as run various tests on it.

%prep
%setup -q
%patch -P 0 -p1 -b .console-helper

%build
%configure
make %{?_smp_mflags}

%install
make install DESTDIR=%{buildroot}

# make install puts the docs into an unversioned doc directory,
# move them to a versioned doc directory to prevent having both
# a versioned and an unversioned doc directory
mv %{buildroot}%{_defaultdocdir}/%{name}{,-%{version}}
install -m 644 COPYING %{buildroot}%{_defaultdocdir}/%{name}-%{version}

desktop-file-validate %{buildroot}%{_datadir}/applications/%{name}.desktop

# Fedora uses console-helper to run privileged programs, so we don't
# need the gsmartcontrol-root executable
rm %{buildroot}%{_bindir}/%{name}-root

# Set up for console-helper
mkdir -p %{buildroot}%{_sbindir}
mv %{buildroot}%{_bindir}/%{name} %{buildroot}%{_sbindir}/%{name}
ln -s consolehelper %{buildroot}%{_bindir}/%{name}

mkdir -p %{buildroot}%{_sysconfdir}/pam.d
cat <<EOF >%{buildroot}%{_sysconfdir}/pam.d/%{name}
#%%PAM-1.0
auth		include		config-util
account		include		config-util
session		include		config-util
EOF

mkdir -p %{buildroot}%{_sysconfdir}/security/console.apps
cat <<EOF >%{buildroot}%{_sysconfdir}/security/console.apps/%{name}
USER=root
PROGRAM=/usr/sbin/gsmartcontrol
SESSION=true
EOF


%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 || :


%files
%{_bindir}/%{name}
%{_sbindir}/%{name}
%{_datadir}/applications/%{name}.desktop
%{_datadir}/%{name}
%{_datadir}/pixmaps/%{name}.png
%{_datadir}/pixmaps/%{name}.xpm
%{_datadir}/icons/hicolor/*x*/apps/%{name}.png
%{_mandir}/man1/%{name}.1.*
%{_mandir}/man1/%{name}-root.1.*
%{_docdir}/%{name}-%{version}
%config(noreplace) %{_sysconfdir}/pam.d/%{name}
%config(noreplace) %{_sysconfdir}/security/console.apps/%{name}

%changelog
* Fri Oct 26 2012 Eric Smith <eric@brouhaha.com>  0.8.7-1
- Update to latest upstream.
- Dropped patches 1 and 2.

* Thu Jul 19 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.8.6-7
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild

* Tue Feb 28 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.8.6-6
- Rebuilt for c++ ABI breakage

* Fri Feb 10 2012 Petr Pisar <ppisar@redhat.com> - 0.8.6-6
- Rebuild against PCRE 8.30

* Mon Jan 16 2012 Eric Smith <eric@brouhaha.com>  0.8.6-5
- Patch to compile with GCC 4.7.

* Fri Jan 13 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.8.6-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild

* Mon Dec 12 2011 Eric Smith <eric@brouhaha.com>  0.8.6-3
- Patch to work around deprecated g_static_mutex.

* Sat Dec 03 2011 Eric Smith <eric@brouhaha.com>  0.8.6-2
- Updated per package review comments.

* Sat Oct 08 2011 Eric Smith <eric@brouhaha.com>  0.8.6-1
- Updated to latest upstream release.
- Removed obsolte BuildRoot tag, clean section, defattr, etc.
- Added runtime requirements for smartmontools and hicolor-icon-theme,
  per the suggestions in the package review (bug 697247).

* Mon Apr 18 2011 Eric Smith <eric@brouhaha.com>  0.8.5-2
- Changed "Whatever" to "MIT" in license tag, based on Tom Callaway's
  post to Fedora-legal-list.

* Sun Apr 17 2011 Eric Smith <eric@brouhaha.com>  0.8.5-1
- Initial version