Blob Blame History Raw
# Review at https://bugzilla.redhat.com/show_bug.cgi?id=540328
#
# by default build nautilus extension
# use with to change the default
%bcond_without nautilus

Name:           gtkhash
Version:        0.3.0
Release:        6%{?dist}
Summary:        GTK+ utility for computing message digests or checksums

Group:          Applications/File
License:        GPLv2+
URL:            http://gtkhash.sourceforge.net/
Source0:        http://downloads.sourceforge.net/%{name}/%{name}-%{version}.tar.gz
Source1:        %{name}.desktop
BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)

BuildRequires:  gtk2-devel mhash-devel
BuildRequires:  desktop-file-utils gettext intltool
%if %{with nautilus}
BuildRequires:  GConf2-devel nautilus-devel
%endif

%description
GtkHash is a GTK+ utility for computing message digests or checksums using the
mhash library. Currently supported hash functions include MD5, SHA1, SHA256, 
SHA512, RIPEMD, HAVAL, TIGER and WHIRLPOOL.


%if %{with nautilus}
%package        nautilus
Summary:        GtkHash extension for nautilus
Group:          User Interface/Desktops
Requires:       %{name} = %{version}
Requires:       nautilus
Requires(pre):  GConf2
Requires(post): GConf2
Requires(preun): GConf2

%description    nautilus
GtkHash extension for the nautilus file manger. It adds adds an additional tab
called "Digests" to the file properties dialog.
%endif


%prep
%setup -q


%build
%configure \
%if %{with nautilus}
  --enable-nautilus --disable-schemas-install
%else
  --disable-nautilus
%endif
make %{?_smp_mflags}


%install
rm -rf %{buildroot}
make install DESTDIR=%{buildroot} INSTALL='install -p'
%find_lang %{name}
find $RPM_BUILD_ROOT -name '*.la' -exec rm -f {} ';'
desktop-file-install                               \
  --dir=%{buildroot}%{_datadir}/applications       \
  %{SOURCE1}


%clean
rm -rf %{buildroot}


%if %{with nautilus}
%pre nautilus
%gconf_schema_prepare %{name}


%post nautilus
%gconf_schema_upgrade %{name}


%preun nautilus
%gconf_schema_remove %{name}
%endif


%files -f %{name}.lang
%defattr(-,root,root,-)
%doc AUTHORS COPYING NEWS README TODO
%{_bindir}/%{name}
%{_datadir}/%{name}/
%{_datadir}/applications/%{name}.desktop


%if %{with nautilus}
%files nautilus
%defattr(-,root,root,-)
%{_sysconfdir}/gconf/schemas/gtkhash.schemas
%{_libdir}/nautilus/extensions-*/libgtkhash-properties.so
%endif


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

* Tue Dec 06 2011 Adam Jackson <ajax@redhat.com> - 0.3.0-5
- Rebuild for new libpng

* Thu Feb 24 2011 Christoph Wickert <cwickert@fedoraproject.org> - 0.3.0-4
- Rebuild for GTK+ 3.

* Wed Feb 09 2011 Christoph Wickert <cwickert@fedoraproject.org> - 0.3.0-3
- Rebuild for nautilus 3.0.

* Mon Nov 23 2009 Christoph Wickert <cwickert@fedoraproject.org> - 0.3.0-2
- Rework conditionals

* Sun Nov 22 2009 Christoph Wickert <cwickert@fedoraproject.org> - 0.3.0-1
- Update to 0.3.0
- Build nautilus extension as additional package

* Wed Dec 31 2008 Christoph Wickert <cwickert@fedoraproject.org> - 0.2.1-1
- Initial package