Blob Blame History Raw
%{!?_pkgdocdir: %global _pkgdocdir %{_docdir}/%{name}-%{version}}

Name:       gsmartcontrol
Version:    1.0.1
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:    https://downloads.sourceforge.net/project/%{name}/%{version}/%{name}-%{version}.tar.bz2
Requires:   smartmontools
Requires:   hicolor-icon-theme
Requires:   usermode-gtk

# 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
# Avoid bundled pcrecpp
Patch1:     gsmartcontrol-0.8.7-system-pcrecpp.patch

BuildRequires:  autoconf
BuildRequires:  automake
BuildRequires:  gtkmm30-devel
BuildRequires:  pcre-devel
BuildRequires:  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
rm -f src/pcrecpp/*
%patch -P 0 -p1 -b .console-helper
%patch1 -p2 -b .system-pcrecpp
autoreconf -fiv

%build
%configure --docdir=%{_pkgdocdir}
%make_build

%install
%make_install
install -pm 644 COPYING %{buildroot}%{_pkgdocdir}

# 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

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

%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.*
%{_pkgdocdir}
%config(noreplace) %{_sysconfdir}/pam.d/%{name}
%config(noreplace) %{_sysconfdir}/security/console.apps/%{name}
%{_datadir}/metainfo/gsmartcontrol.appdata.xml

%changelog
* Mon Jun 19 2017 Vasiliy N. Glazov <vascom2@gmail.com> - 1.0.1-1
- Update to 1.0.1

* Sat Jun 17 2017 Vasiliy N. Glazov <vascom2@gmail.com> - 1.0.0-1
- Update to 1.0.0

* Thu May 11 2017 Vasiliy N. Glazov <vascom2@gmail.com> - 0.9.0-1
- Update to 0.9.0
- Update source url

* Fri Feb 10 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.8.7-11
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild

* Wed Sep 28 2016 Vasiliy N. Glazov <vascom2@gmail.com> - 0.8.7-10
- Use system pcrecpp (#1119134)
- Require usermode-gtk (#1368430)

* Wed Feb 03 2016 Fedora Release Engineering <releng@fedoraproject.org> - 0.8.7-9
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild

* Wed Jun 17 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.8.7-8
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild

* Sat May 02 2015 Kalev Lember <kalevlember@gmail.com> - 0.8.7-7
- Rebuilt for GCC 5 C++11 ABI change

* Sat Aug 16 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.8.7-6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild

* Sat Jun 07 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.8.7-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild

* Wed Nov 13 2013 Ville Skyttä <ville.skytta@iki.fi> - 0.8.7-4
- Install docs to %%{_pkgdocdir} where available (#993808).

* Sat Aug 03 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.8.7-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild

* Thu Feb 14 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.8.7-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild

* 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

* 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