File gtkhash.spec of Package gtkhash

#
# spec file for package gtkhash
#
# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via https://bugs.opensuse.org/
#


Name:           gtkhash
Version:        1.2
Release:        0
Summary:        GTK+ utility for computing message digests or checksums
License:        GPL-2.0-or-later
Group:          Productivity/File utilities
URL:            https://gtkhash.sourceforge.net/
Source0:        https://downloads.sourceforge.net/%{name}/%{name}-%{version}.tar.xz
BuildRequires:  hicolor-icon-theme
BuildRequires:  intltool
# 13.2 and Leap 42.1/2 have too old versions
%if 0%{?suse_version} > 1320
BuildRequires:  libgcrypt-devel >= 1.7
%endif
BuildRequires:  pkgconfig
BuildRequires:  update-desktop-files
BuildRequires:  pkgconfig(glib-2.0)
BuildRequires:  pkgconfig(gtk+-3.0)
BuildRequires:  pkgconfig(nettle)
### not pkgconfig(thunarx-[23]), because we don't know in advance
BuildRequires:  thunar-devel
%glib2_gsettings_schema_requires
%lang_package

%description
GtkHash is a GTK+ utility for computing message digests or checksums.
Currently supported hash functions include:

* MD2, MD4, MD5, MD6-224, MD6-256, MD6-384, MD6-512
* SHA1, SHA224, SHA256, SHA384, SHA512
* SHA3-224, SHA3-256, SHA3-384, SHA3-512
* RIPEMD128, RIPEMD160, RIPEMD256, RIPEMD320
* TIGER192, WHIRLPOOL, GOST, CRC32, ADLER32

This package contains the GTK+3 version of the program.

%package -n thunar-plugin-gtkhash
Summary:        GtkHash extension for Thunar
Group:          System/GUI/XFCE
Requires:       %{name} = %{version}
Requires:       thunar

%description -n thunar-plugin-gtkhash
GtkHash extension for the Thunar file manger. It adds an additional tab
called "Digests" to the file properties dialog.

%prep
%setup -q

%build
%configure \
%if 0%{?suse_version} >= 1500
    --with-thunarx=3 \
%else
    --with-thunarx=2 \
%endif
    --with-gtk=3.0 \
    --disable-blake2 \
%if 0%{?suse_version} && 0%{?suse_version} < 1330
    --disable-gcrypt \
%endif
    --enable-glib-checksums \
    --enable-linux-crypto \
    --enable-nettle \
    --enable-thunar \
    --disable-schemas-compile
make %{?_smp_mflags} V=1

%install
%make_install
rm %{buildroot}%{_libdir}/thunarx-?/libgtkhash-properties-thunar.la

%find_lang %{name} %{?no_lang_C}
%suse_update_desktop_file %{name}

%if 0%{?suse_version} && 0%{?suse_version} < 1330
%post
%glib2_gsettings_schema_post
%icon_theme_cache_post

%postun
%glib2_gsettings_schema_postun
%icon_theme_cache_postun

%post -n thunar-plugin-gtkhash
%glib2_gsettings_schema_post

%postun -n thunar-plugin-gtkhash
%glib2_gsettings_schema_postun
%endif

%files
%license COPYING
%doc AUTHORS NEWS README.md
%{_bindir}/%{name}
%{_datadir}/applications/%{name}.desktop
%{_datadir}/glib-2.0/schemas/org.gtkhash.gschema.xml
%{_datadir}/icons/hicolor/*/*/%{name}.*
%if 0%{?suse_version} && 0%{?suse_version} < 1500
%dir %{_datadir}/metainfo/
%endif
%{_datadir}/metainfo/gtkhash.appdata.xml

%files -n thunar-plugin-gtkhash
%{_datadir}/glib-2.0/schemas/org.gtkhash.plugin.gschema.xml
%{_libdir}/thunarx-?/libgtkhash-properties-thunar.so
%{_datadir}/metainfo/thunar-gtkhash.metainfo.xml

%files lang -f %{name}.lang

%changelog
openSUSE Build Service is sponsored by