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

# this is the same as %%configure, but in the toplevel direcory
%global dconfigure %(printf %%s '%configure' | sed 's!\./configure!../configure!g')

Name:           gtkhash
Version:        0.6.0
Release:        15%{?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
Patch0:         gtkhash-0.6.0-aarch64.patch

BuildRequires:  gcc
BuildRequires:  pkgconfig(gtk+-2.0) >= 2.24
BuildRequires:  pkgconfig(gtk+-3.0)
BuildRequires:  mhash-devel
BuildRequires:  libgcrypt-devel
BuildRequires:  desktop-file-utils gettext intltool

%if %{with nautilus}
BuildRequires:  pkgconfig(libnautilus-extension) >= 3.0.0
%endif

%if %{with thunar}
BuildRequires:  pkgconfig(thunarx-2)
%endif

%description
GtkHash is a GTK+ utility for computing message digests or checksums. Currently
supported hash functions include
* MD2, MD4 and MD5
* SHA1, SHA224, SHA256, SHA384 and SHA512,
* RIPEMD128, RIPEMD160, RIPEMD256 and RIPEMD320
* TIGER128, TIGER160 and TIGER192
* HAVAL128-3, HAVAL160-3, HAVAL192-3, HAVAL224-3 and HAVAL256-3
* SNEFRU128 and SNEFRU256
* ADLER32, CRC32, GOST and WHIRLPOOL

This package contains the GTK+2 version of the program. For the GTK+3 version,
install the %{name}3 package.


%package -n     %{name}3
Summary:        GTK+ utility for computing message digests or checksums
Group:          Applications/File

%description -n %{name}3
GtkHash is a GTK+ utility for computing message digests or checksums. Currently
supported hash functions include
* MD2, MD4 and MD5
* SHA1, SHA224, SHA256, SHA384 and SHA512,
* RIPEMD128, RIPEMD160, RIPEMD256 and RIPEMD320
* TIGER128, TIGER160 and TIGER192
* HAVAL128-3, HAVAL160-3, HAVAL192-3, HAVAL224-3 and HAVAL256-3
* SNEFRU128 and SNEFRU256
* ADLER32, CRC32, GOST and WHIRLPOOL

This package contains the GTK+3 version of the program. For the GTK+2 version,
install the %{name} package.


%if %{with nautilus}
%package        nautilus
Summary:        GtkHash extension for nautilus
Group:          User Interface/Desktops
Requires:       nautilus
Requires:       %{name}3 = %{version}
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


%if %{with thunar}
%package        thunar
Summary:        GtkHash extension for Thunar
Group:          User Interface/Desktops
Requires:       Thunar
Requires:       %{name} = %{version}

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


%prep
%setup -q
%patch0 -p1 -b .aarch64


%build
# We need to build this package twice, once for gtk2 and once for gtk3.
mkdir gtk2 gtk3

# build gtk2 (with Thunar)
cd gtk2

%dconfigure --with-gtk=2.0 \
  --enable-linux-crypto \
  --enable-gcrypt \
  --enable-glib-checksums \
  --enable-mhash \
%if %{with thunar}
  --enable-thunar \
  --disable-nautilus \
  --disable-schemas-compile \
%else
  --disable-thunar \
  --disable-nautilus \
  --disable-schemas-compile \
%endif

make %{?_smp_mflags} V=1

# build gtk3 (with nautilus)
cd ../gtk3

%dconfigure --with-gtk=3.0 \
  --program-suffix=3 \
  --enable-linux-crypto \
  --enable-gcrypt \
  --enable-glib-checksums \
  --enable-mhash \
%if %{with nautilus}
  --enable-nautilus \
  --disable-thunar \
  --disable-schemas-compile \
%else
  --disable-nautilus \
  --disable-thunar \
  --disable-schemas-compile \
%endif

make %{?_smp_mflags} V=1


%install
rm -rf %{buildroot}

# install gtk2 part
cd gtk2

make install DESTDIR=%{buildroot} INSTALL='install -p'
%find_lang %{name}
desktop-file-install                               \
  --dir=%{buildroot}%{_datadir}/applications       \
  %{SOURCE1}

# install gtk3 part
cd ../gtk3

make install DESTDIR=%{buildroot} INSTALL='install -p'
%find_lang %{name}

cp %{SOURCE1} gtkhash3.desktop
sed -i 's|^Exec=gtkhash|Exec=gtkhash3|g' gtkhash3.desktop
desktop-file-install                               \
  --dir=%{buildroot}%{_datadir}/applications       \
  gtkhash3.desktop

# generic
find %{buildroot} -name '*.la' -exec rm -f {} ';'



%postun -n %{name}3
if [ $1 -eq 0 ] ; then
    /usr/bin/glib-compile-schemas %{_datadir}/glib-2.0/schemas &> /dev/null || :
fi


%if %{with nautilus}
%postun nautilus
if [ $1 -eq 0 ] ; then
    /usr/bin/glib-compile-schemas %{_datadir}/glib-2.0/schemas &> /dev/null || :
fi
%endif

%posttrans
/usr/bin/glib-compile-schemas %{_datadir}/glib-2.0/schemas &> /dev/null || :


%files -f gtk2/%{name}.lang
%doc AUTHORS COPYING NEWS README TODO
%{_bindir}/%{name}
%{_datadir}/%{name}/
%{_datadir}/applications/%{name}.desktop
%{_datadir}/glib-2.0/schemas/app.gtkhash.gschema.xml

%files -n %{name}3 -f gtk3/%{name}.lang
%doc AUTHORS COPYING NEWS README TODO
%{_bindir}/%{name}3
%{_datadir}/%{name}/
%{_datadir}/applications/%{name}3.desktop


%if %{with nautilus}
%files nautilus
%{_libdir}/nautilus/extensions-*/libgtkhash-properties.so
%{_datadir}/gtkhash/nautilus
%{_datadir}/glib-2.0/schemas/app.gtkhash-properties.gschema.xml
%endif


%if %{with thunar}
%files thunar
%{_libdir}/thunarx-2/libgtkhash-properties.so
%endif


%changelog
* Fri Jul 13 2018 Fedora Release Engineering <releng@fedoraproject.org> - 0.6.0-15
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild

* Wed Feb 07 2018 Fedora Release Engineering <releng@fedoraproject.org> - 0.6.0-14
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild

* Wed Aug 02 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.6.0-13
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild

* Wed Jul 26 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.6.0-12
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild

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

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

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

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

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

* Wed Apr 23 2014 Tomáš Mráz <tmraz@redhat.com> - 0.6.0-6
- Rebuild for new libgcrypt

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

* Sun May 19 2013 Christoph Wickert <cwickert@fedoraproject.org> - 0.6.0-4
- Support for aarch64 (#925514)

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

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

* Sat Feb 25 2012 Christoph Wickert <cwickert@fedoraproject.org> - 0.6.0-1
- Update to 0.6.0
- Switch to gsettings

* Sat Feb 25 2012 Christoph Wickert <cwickert@fedoraproject.org> - 0.5.0-1
- Update to 0.5.0
- Make extensions require gtkhash(3) base package

* Tue Jan 31 2012 Christoph Wickert <cwickert@fedoraproject.org> - 0.4.0-1
- Update to 0.4.0
- Build GTK+3 version and thunar extension
- Enable gcrypt, glib-checksums and linux-crypto

* 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