1
0
Alexei Sorokin 2017-10-31 10:47:18 +00:00 committed by Git OBS Bridge
parent 18a873a90a
commit cb15d8248b
6 changed files with 82 additions and 353 deletions

View File

@ -13,7 +13,7 @@
- python serializeimages.py $(PACKAGE_VERSION) $(datadir)/applications < dropbox.in > dropbox
- chmod +x dropbox
-
-dropbox.1: dropbox.txt.in dropbox docgen.py
-dropbox.1: dropbox dropbox.txt.in docgen.py
- python docgen.py $(PACKAGE_VERSION) < dropbox.txt.in > dropbox.txt
- $(RST2MAN) dropbox.txt > dropbox.1
-

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:68dadce98c17321c3c22e596452a1b7aa0842c5faa05688734430857e037b3f2
size 1164565

View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:593aaf206ef50a8185e1f71c9018ce6a8b4bcb82b4684494e069f9045ba11fd1
size 1033217

View File

@ -1,3 +1,40 @@
-------------------------------------------------------------------
Sat Oct 28 19:57:36 UTC 2017 - sor.alexei@meowr.ru
- Update to version 3.6.0 (changes since 3.4.0):
* nemo-preview: Don't ship another copy of format.js.
* nemo-dropbox: Fix an error in the Makefile.
* nemo-preview: Specify GObject Introspection versions.
* nemo-preview: Fix schema_name not defined and switch to xed.
* nemo-rabbitvcs: Specify nemo import version.
* Fix nemo-seahorse - update tool from upstream, rename files and
schemas to allow concurrent installation with seahorse-nautilus,
move gsettings schemas to org.nemo.plugins.seahorse.*
* nemo-share: Detect and fix samba and group membership problem
when attempting to modify file sharing properties.
* image: Add support for GIF animations.
* nemo-preview: port to xreader.
* nemo-compare, nemo-pastebin: Remove menu entry for config tool,
provide the launcher through Nemo.
* nemo-media-columns: Provide file info asynchronously.
* nemo-media-columns: Cache info and serve it synchronously when
possible.
* nemo-media-columns: Delete file info after 30 sec.
* Simplify nemo-media-columns to behave as expected by the fixed
nemo info provider apparatus.
* nemo-python: nemo-python-object.c: We must expect a return
value from PyObject_CallMethod() or else it silently fails
against the provider object and cancel_update never gets
called.
* media columns: Don't use the handle for idle id storage, use
the class.
* Fix the post-samba-install message for nemo-share - smbd will
not start on just a logout-in.
* nemo-gtkhash: Add mbed TLS 2.x support.
* Move translations to cinnamon-translations.
- Rebase nemo-dropbox_no-dropbox-bin.patch.
- Remove nemo-gtkhash_mbedtls-2.x.patch: merged upstream.
-------------------------------------------------------------------
Sun Sep 10 16:00:33 UTC 2017 - sor.alexei@meowr.ru

View File

@ -19,9 +19,9 @@
# Do not package nemo-extension-media-columns for now: slows Nemo down.
# nemo-extension-terminal 'requires' two versions, confusing typelib finder.
%define __requires_exclude typelib\\((Vte))\ =
%define _version 3.4.0
%define _version 3.6.0
Name: nemo-extensions
Version: 3.4.0
Version: 3.6.0
Release: 0
Summary: Set of extensions for Nemo, the Cinnamon file manager
License: GPL-2.0 AND GPL-3.0 AND GPL-3.0+
@ -32,10 +32,8 @@ Source: https://github.com/linuxmint/%{name}/archive/%{version}.tar.gz#/
Patch0: nemo-seahorse_no-nautilus-conflicts.patch
# PATCH-FIX-OPENSUSE nemo-dropbox_no-dropbox-bin.patch sor.alexei@meowr.ru -- Strip dropbox binary installation from nemo-dropbox.
Patch1: nemo-dropbox_no-dropbox-bin.patch
# PATCH-FIX-OPENSUSE nemo-gtkhash_mbedtls-2.x.patch sor.alexei@meowr.ru -- Add mbed TLS 2.x+ support to nemo-gtkhash.
Patch2: nemo-gtkhash_mbedtls-2.x.patch
# PATCH-FIX-OPENSUSE nemo-seahorse_gpg-2.2.patch sor.alexei@meowr.ru -- Add GPG 2.2 to accepted versions in nemo-seahorse.
Patch3: nemo-seahorse_gpg-2.2.patch
Patch2: nemo-seahorse_gpg-2.2.patch
BuildRequires: gettext-runtime
BuildRequires: gnome-common
BuildRequires: intltool
@ -53,6 +51,7 @@ BuildRequires: python-docutils
BuildRequires: python-gtk-devel
BuildRequires: python-setuptools
BuildRequires: update-desktop-files
BuildRequires: pkgconfig(cinnamon-desktop)
BuildRequires: pkgconfig(cjs-1.0)
BuildRequires: pkgconfig(clutter-gst-3.0)
BuildRequires: pkgconfig(clutter-gtk-1.0)
@ -71,6 +70,8 @@ BuildRequires: pkgconfig(nettle)
BuildRequires: pkgconfig(nss)
BuildRequires: pkgconfig(pygobject-3.0)
BuildRequires: pkgconfig(webkit2gtk-4.0)
BuildRequires: pkgconfig(xreader-document-1.5.0)
BuildRequires: pkgconfig(xreader-view-1.5.0)
%if 0%{?suse_version} > 1320 || (0%{?sle_version} >= 120100 && 0%{?is_opensuse})
BuildRequires: mbedtls-devel
%endif
@ -98,6 +99,7 @@ Group: System/GUI/Other
Requires: nemo >= %{_version}
Requires: python-mutagen
Requires: python-nemo = %{version}
Recommends: %{name}-lang
BuildArch: noarch
%description -n nemo-extension-audio-tab
@ -113,7 +115,7 @@ Requires: python-gobject
Requires: python-gtk
Requires: python-nemo = %{version}
Requires: python-xdg
Recommends: nemo-extension-compare-lang
Recommends: %{name}-lang
# nemo-compare was last used in openSUSE 13.2.
Provides: nemo-compare = %{version}
Obsoletes: nemo-compare < %{version}
@ -127,8 +129,6 @@ do the comparison and provides "Compare", "Compare to ~/foo/bar" and
you can choose your favourite compare tool for one-on-one,
three-way and multi-compare situations.
%lang_package -n nemo-extension-compare
%package -n nemo-extension-dropbox
Summary: DropBox support for the Nemo Filemanager
License: GPL-3.0+
@ -149,7 +149,7 @@ License: GPL-3.0
Group: System/GUI/Other
Requires: nemo >= %{_version}
Requires: python-gobject
Recommends: nemo-extension-emblems-lang
Recommends: %{name}-lang
# nemo-emblems was last used in openSUSE 13.2.
Provides: nemo-emblems = %{version}
Obsoletes: nemo-emblems < %{version}
@ -162,14 +162,13 @@ Requires: python-gobject-Gdk
Change a directory or a file emblem in Nemo, the Cinnamon desktop
file manager.
%lang_package -n nemo-extension-emblems
%package -n nemo-extension-fileroller
Summary: Fileroller support for the Nemo Filemanager
License: GPL-3.0+
Group: System/GUI/Other
Requires: file-roller
Requires: nemo >= %{_version}
Recommends: %{name}-lang
Supplements: packageand(nemo:file-roller)
# nemo-fileroller was last used in openSUSE 13.2.
Provides: nemo-fileroller = %{version}
@ -183,7 +182,7 @@ Summary: Nemo extension for computing checksums and more using gtkhash
License: GPL-2.0+
Group: System/GUI/Other
Requires: nemo >= %{_version}
Recommends: nemo-extension-gtkhash-lang
Recommends: %{name}-lang
# nemo-gtkhash was last used in openSUSE 13.2.
Obsoletes: nemo-gtkhash < %{version}
Provides: nemo-gtkhash = %{version}
@ -195,15 +194,13 @@ message digests or checksums using the mhash library.
Currently supported hash functions include MD5, MD6, SHA1, SHA256,
SHA512, RIPEMD, TIGER and WHIRLPOOL.
%lang_package -n nemo-extension-gtkhash
%package -n nemo-extension-image-converter
Summary: Nemo extension to mass resize or rotate images
License: GPL-2.0+
Group: System/GUI/Other
Requires: ImageMagick
Requires: nemo >= %{_version}
Recommends: nemo-extension-converter-lang
Recommends: %{name}-lang
# nemo-image-converter was last used in openSUSE 13.2.
Provides: nemo-image-converter = %{version}
Obsoletes: nemo-image-converter < %{version}
@ -214,8 +211,6 @@ menu of all images. This opens a dialog where you set the desired
image size and file name. A click on "Resize" finally resizes the
image(s) using ImageMagick's convert tool.
%lang_package -n nemo-extension-image-converter
%package -n nemo-extension-pastebin
Summary: Pastebin extension for Nemo file manager
License: GPL-2.0+
@ -223,7 +218,7 @@ Group: System/GUI/Other
Requires: nemo >= %{_version}
Requires: python-gobject
Requires: python-xdg
Recommends: nemo-extension-pastebin-lang
Recommends: %{name}-lang
# nemo-pastebin was last used in openSUSE 13.2.
Provides: nemo-pastebin = %{version}
Obsoletes: nemo-pastebin < %{version}
@ -237,26 +232,22 @@ Requires: python-gobject-Gdk
nemo-pastebin is an extension for the Nemo file manager, which
allows users to send files to pastebins just a right-click away.
%lang_package -n nemo-extension-pastebin
%package -n nemo-extension-preview
Summary: A quick previewer for Nemo file manager
License: GPL-2.0+
Group: System/GUI/Other
Requires: gstreamer-plugins-good
Requires: nemo >= %{_version}
Recommends: nemo-extension-preview-lang
Recommends: %{name}-lang
# nemo-preview was last used in openSUSE 13.2.
Obsoletes: nemo-preview < %{version}
Provides: nemo-extension-preview-devel = %{version}
Provides: nemo-preview = %{version}
Obsoletes: nemo-preview < %{version}
%description -n nemo-extension-preview
This is NemoPreview, a quick previewer for Nemo, the Cinnamon
desktop file manager.
%lang_package -n nemo-extension-preview
%package -n nemo-extension-rabbitvcs
Summary: RabbitVCS extension for Nemo file manager
License: GPL-3.0+
@ -278,7 +269,7 @@ Summary: Nemo extension for filename encoding repair
License: GPL-2.0+
Group: System/GUI/Other
Requires: nemo >= %{_version}
Recommends: nemo-extension-repairer-lang
Recommends: %{name}-lang
# nemo-repairer was last used in openSUSE 13.2.
Provides: nemo-repairer = %{version}
Obsoletes: nemo-repairer < %{version}
@ -289,8 +280,6 @@ encoding in Nemo. This extension provides the context menu for any
file whose filename uses wrong encoding, so that you cannot read the
filename in Nemo.
%lang_package -n nemo-extension-repairer
You can find a candidate for filename in context menu or submenu.
This extension also provides a decoded name for URL encoded filename.
@ -300,7 +289,7 @@ License: GPL-2.0+
Group: System/GUI/Other
Requires: nautilus-extension-seahorse >= 3.0
Requires: nemo >= %{_version}
Recommends: nemo-extension-seahorse-lang
Recommends: %{name}-lang
Supplements: packageand(nemo:seahorse)
# nemo-seahorse was last used in openSUSE 13.2.
Provides: nemo-seahorse = %{version}
@ -310,14 +299,12 @@ Obsoletes: nemo-seahorse < %{version}
seahorse nemo is an extension for nemo which allows encryption
and decryption of OpenPGP files using GnuPG.
%lang_package -n nemo-extension-seahorse
%package -n nemo-extension-share
Summary: Samba share extension for Nemo file manager
License: GPL-2.0+
Group: System/GUI/Other
Requires: nemo >= %{_version}
Recommends: nemo-extension-share-lang
Recommends: %{name}-lang
Recommends: samba
Supplements: packageand(nemo:samba)
# nemo-share was last used in openSUSE 13.2.
@ -328,8 +315,6 @@ Obsoletes: nemo-share < %{version}
Nemo Share allows you to quickly share a folder from the Cinnamon
Nemo file manager without requiring root access.
%lang_package -n nemo-extension-share
%package -n nemo-extension-terminal
Summary: Nemo extension to enable an embedded terminal
License: GPL-3.0+
@ -356,7 +341,6 @@ directory in Nemo.
%patch0
%patch1
%patch2
%patch3
# Remove spurious executable permission.
chmod a-x nemo-audio-tab/COPYING.GPL3 nemo-emblems/COPYING.GPL3
@ -404,6 +388,10 @@ find . -type d -maxdepth 1 -mindepth 1 | while read dir; do
popd
done
# For python-nemo.
mkdir -p %{buildroot}%{_docdir}/
mv -f %{buildroot}%{_datadir}/doc/nemo-python/ %{buildroot}%{_docdir}/nemo-python/
# For nemo-extension-audio-tab.
install -Dpm 0644 nemo-audio-tab/nemo-extension/nemo-audio-tab.py \
%{buildroot}%{_datadir}/nemo-python/extensions/nemo-audio-tab.py
@ -411,11 +399,6 @@ install -Dpm 0755 nemo-audio-tab/nemo-extension/nemo-audio-tab.glade \
%{buildroot}%{_datadir}/nemo-python/extensions/nemo-audio-tab.glade
# For nemo-extension-compare.
# "gtk-preferences icon isn't in hicolor-icon-theme, why not Meld?
sed -i 's/^\(Icon=\).*$/\1meld/' nemo-compare/data/nemo-compare-preferences.desktop
install -Dpm 0755 nemo-compare/data/nemo-compare-preferences.desktop \
%{buildroot}%{_datadir}/applications/nemo-compare-preferences.desktop
install -Dpm 0755 nemo-compare/src/nemo-compare.py \
%{buildroot}%{_datadir}/nemo-compare/nemo-compare.py
install -Dpm 0755 nemo-compare/src/utils.py %{buildroot}%{_datadir}/nemo-compare/utils.py
@ -428,24 +411,6 @@ mkdir -p %{buildroot}%{_bindir}/ %{buildroot}%{_datadir}/nemo-python/
ln -s %{_datadir}/nemo-compare/nemo-compare.py %{buildroot}%{_datadir}/nemo-python/extensions/nemo-compare.py
ln -s %{_datadir}/nemo-compare/nemo-compare-preferences.py %{buildroot}%{_bindir}/nemo-compare-preferences
%suse_update_desktop_file nemo-compare-preferences System FileManager
pushd nemo-compare/po/
ls *.po | while read file; do
mkdir -p %{buildroot}%{_datadir}/locale/${file%.po}/LC_MESSAGES/
msgfmt -f -o %{buildroot}%{_datadir}/locale/${file%.po}/LC_MESSAGES/nemo-compare.mo $file
done
popd
%find_lang nemo-compare
# For nemo-extension-pastebin.
sed -i 's/^\(Exec=nemo-pastebin-configurator\)/\1.py/' %{buildroot}%{_datadir}/applications/nemo-pastebin-configurator.desktop
%suse_update_desktop_file nemo-pastebin-configurator System FileManager
# For python-nemo.
mkdir -p %{buildroot}%{_docdir}/
mv -f %{buildroot}%{_datadir}/doc/nemo-python/ %{buildroot}%{_docdir}/nemo-python/
# For nemo-extension-rabbitvcs.
install -Dpm 0644 nemo-rabbitvcs/RabbitVCS.py \
%{buildroot}%{_datadir}/nemo-python/extensions/RabbitVCS.py
@ -459,9 +424,8 @@ cp -a src/*.xml %{buildroot}%{_datadir}/glib-2.0/schemas/
cp -a pixmap/*.png %{buildroot}%{_datadir}/nemo-terminal/
popd
for ext in emblems gtkhash filename-repairer image-converter pastebin preview share seahorse; do
%find_lang nemo-$ext
done
# Remove unused translations.
rm %{buildroot}%{_datadir}/locale/*/LC_MESSAGES/nemo-*.mo
# Compile Python bytecode.
dirname $(find %{buildroot}%{_datadir}/ -type f -name '*.py') | sort -u | while read dir; do
@ -482,14 +446,6 @@ find %{buildroot} -type f -name "*.la" -delete -print
%postun -n nemo-extension-fileroller -p /sbin/ldconfig
%post -n nemo-extension-gtkhash
/sbin/ldconfig
%glib2_gsettings_schema_post
%postun -n nemo-extension-gtkhash
/sbin/ldconfig
%glib2_gsettings_schema_postun
%post -n nemo-extension-image-converter -p /sbin/ldconfig
%postun -n nemo-extension-image-converter -p /sbin/ldconfig
@ -498,12 +454,6 @@ find %{buildroot} -type f -name "*.la" -delete -print
%postun -n nemo-extension-preview -p /sbin/ldconfig
%post -n nemo-extension-pastebin
%glib2_gsettings_schema_post
%postun -n nemo-extension-pastebin
%glib2_gsettings_schema_postun
%post -n nemo-extension-seahorse -p /sbin/ldconfig
%postun -n nemo-extension-seahorse -p /sbin/ldconfig
@ -516,11 +466,27 @@ find %{buildroot} -type f -name "*.la" -delete -print
%postun -n nemo-extension-share -p /sbin/ldconfig
%if 0%{?suse_version} <= 1320
%post -n nemo-extension-gtkhash
/sbin/ldconfig
%glib2_gsettings_schema_post
%postun -n nemo-extension-gtkhash
/sbin/ldconfig
%glib2_gsettings_schema_postun
%post -n nemo-extension-pastebin
%glib2_gsettings_schema_post
%postun -n nemo-extension-pastebin
%glib2_gsettings_schema_postun
%post -n nemo-extension-terminal
%glib2_gsettings_schema_post
%postun -n nemo-extension-terminal
%glib2_gsettings_schema_postun
%endif
%files -n python-nemo
%doc nemo-python/AUTHORS nemo-python/COPYING nemo-python/debian/changelog
@ -540,11 +506,8 @@ find %{buildroot} -type f -name "*.la" -delete -print
%{_bindir}/nemo-compare-preferences
%{_datadir}/nemo-compare/
%{_datadir}/nemo-python/extensions/nemo-compare.py
%{_datadir}/applications/nemo-compare-preferences.desktop
%{_mandir}/man1/nemo-compare-preferences.1%{?ext_man}
%files -n nemo-extension-compare-lang -f nemo-compare.lang
%files -n nemo-extension-dropbox
%doc nemo-dropbox/AUTHORS nemo-dropbox/COPYING nemo-dropbox/debian/changelog
%{_libdir}/nemo/extensions-3.0/libnemo-dropbox.so
@ -554,8 +517,6 @@ find %{buildroot} -type f -name "*.la" -delete -print
%{_datadir}/nemo-python/extensions/nemo-emblems.py
%{python_sitelib}/nemo_emblems-*
%files -n nemo-extension-emblems-lang -f nemo-emblems.lang
%files -n nemo-extension-fileroller
%doc nemo-fileroller/COPYING nemo-fileroller/debian/changelog
%{_libdir}/nemo/extensions-3.0/libnemo-fileroller.so
@ -567,27 +528,20 @@ find %{buildroot} -type f -name "*.la" -delete -print
%{_datadir}/nemo-gtkhash/
%{_datadir}/glib-2.0/schemas/*gtkhash*.gschema.xml
%files -n nemo-extension-gtkhash-lang -f nemo-gtkhash.lang
%files -n nemo-extension-image-converter
%doc nemo-image-converter/AUTHORS nemo-image-converter/COPYING nemo-image-converter/debian/changelog
%{_libdir}/nemo/extensions-3.0/libnemo-image-converter.so
%{_datadir}/nemo-image-converter/
%files -n nemo-extension-image-converter-lang -f nemo-image-converter.lang
%files -n nemo-extension-pastebin
%doc nemo-pastebin/COPYING nemo-pastebin/debian/changelog
%{_bindir}/nemo-pastebin.py
%{_bindir}/nemo-pastebin-configurator.py
%{_datadir}/nemo-pastebin/
%{python_sitelib}/nemo_pastebin-*
%{_datadir}/applications/nemo-pastebin-configurator.desktop
%{_datadir}/pixmaps/nemo-pastebin.*
%{_datadir}/glib-2.0/schemas/nemo-pastebin.gschema.xml
%files -n nemo-extension-pastebin-lang -f nemo-pastebin.lang
%files -n nemo-extension-preview
%doc nemo-preview/AUTHORS nemo-preview/COPYING nemo-preview/debian/changelog
%{_bindir}/nemo-preview
@ -596,8 +550,6 @@ find %{buildroot} -type f -name "*.la" -delete -print
%{_datadir}/nemo-preview/
%{_datadir}/dbus-1/services/org.nemo.Preview.service
%files -n nemo-extension-preview-lang -f nemo-preview.lang
%files -n nemo-extension-rabbitvcs
%doc nemo-rabbitvcs/AUTHORS nemo-rabbitvcs/COPYING nemo-rabbitvcs/debian/changelog
%{_datadir}/nemo-python/extensions/RabbitVCS.py
@ -608,20 +560,15 @@ find %{buildroot} -type f -name "*.la" -delete -print
%{_libdir}/nemo/extensions-3.0/libnemo-filename-repairer.so
%{_datadir}/nemo-filename-repairer/
%files -n nemo-extension-repairer-lang -f nemo-filename-repairer.lang
%files -n nemo-extension-seahorse
%doc nemo-seahorse/COPYING nemo-seahorse/debian/changelog
%{_libdir}/nemo/extensions-3.0/libnemo-seahorse.so
%files -n nemo-extension-seahorse-lang -f nemo-seahorse.lang
%files -n nemo-extension-share
%doc nemo-share/AUTHORS nemo-share/COPYING nemo-share/debian/changelog
%{_libdir}/nemo/extensions-3.0/libnemo-share.so
%{_datadir}/nemo-share/
%files -n nemo-extension-share-lang -f nemo-share.lang
%{_datadir}/polkit-1/actions/org.nemo.share.samba_install.policy
%files -n nemo-extension-terminal
%doc nemo-terminal/AUTHORS nemo-terminal/COPYING nemo-terminal/debian/changelog

View File

@ -1,255 +0,0 @@
--- nemo-gtkhash.orig/configure.ac
+++ nemo-gtkhash/configure.ac
@@ -144,13 +144,25 @@ AC_ARG_ENABLE([polarssl],
AC_MSG_RESULT(["${enable_polarssl}"])
AM_CONDITIONAL([ENABLE_POLARSSL], [test "${enable_polarssl}" = "yes"])
AC_DEFINE([ENABLE_POLARSSL], [0], [Use PolarSSL])
+AC_DEFINE([HAVE_MBEDTLS_2_0_0], [0], [Have mbed TLS 2.x+])
if test "${enable_polarssl}" = "yes" ; then
- AC_CHECK_HEADER([polarssl/md.h], [:], [AC_MSG_ERROR([polarssl headers not found])])
- AC_CHECK_LIB([polarssl], [md_update], [:], [AC_MSG_ERROR([polarssl library not found])])
- POLARSSL_LIBS="-lpolarssl"
+ AC_CHECK_HEADER([mbedtls/md.h], [have_mbedtls_2_0_0="yes"], [have_mbedtls_2_0_0="no"])
+ AC_CHECK_HEADER([polarssl/md.h], [have_mbedtls_1_3_0="yes"], [have_mbedtls_1_3_0="no"])
+ if test "${have_mbedtls_2_0_0}" != "yes" && test "${have_mbedtls_1_3_0}" != "yes"; then
+ AC_MSG_ERROR([mbedtls headers not found])
+ fi
+ if test "${have_mbedtls_2_0_0}" = "yes"; then
+ AC_CHECK_LIB([mbedcrypto], [mbedtls_md_update], [:], [AC_MSG_ERROR([mbedtls library not found])])
+ POLARSSL_LIBS="-lmbedcrypto"
+ hash_libs="${hash_libs} mbedtls"
+ AC_DEFINE([HAVE_MBEDTLS_2_0_0], [1])
+ else
+ AC_CHECK_LIB([polarssl], [md_update], [:], [AC_MSG_ERROR([mbedtls library not found])])
+ POLARSSL_LIBS="-lpolarssl"
+ hash_libs="${hash_libs} polarssl"
+ fi
AC_SUBST([POLARSSL_LIBS])
- hash_libs="${hash_libs} polarssl"
AC_DEFINE([ENABLE_POLARSSL], [1])
fi
@@ -365,6 +377,7 @@ nss_funcs="
SHA1 SHA256 SHA384 SHA512"
polarssl_funcs="
MD2 MD4 MD5
+ RIPEMD160
SHA1 SHA224 SHA256 SHA384 SHA512"
zlib_funcs="
CRC32
--- nemo-gtkhash.orig/src/hash/hash-lib-polarssl.c
+++ nemo-gtkhash/src/hash/hash-lib-polarssl.c
@@ -25,7 +25,11 @@
#include <stdbool.h>
#include <stdint.h>
#include <glib.h>
+#if HAVE_MBEDTLS_2_0_0
+#include <mbedtls/md.h>
+#else
#include <polarssl/md.h>
+#endif
#include "hash-lib-polarssl.h"
#include "hash-lib.h"
@@ -34,35 +38,83 @@
#define LIB_DATA ((struct hash_lib_polarssl_s *)func->lib_data)
struct hash_lib_polarssl_s {
+#if HAVE_MBEDTLS_2_0_0
+ mbedtls_md_context_t ctx;
+#else
md_context_t ctx;
+#endif
};
-static bool gtkhash_hash_lib_polarssl_set_type(const enum hash_func_e id, md_type_t *type)
+static bool gtkhash_hash_lib_polarssl_set_type(const enum hash_func_e id,
+#if HAVE_MBEDTLS_2_0_0
+ mbedtls_md_type_t *type)
+#else
+ md_type_t *type)
+#endif
{
switch (id) {
case HASH_FUNC_MD2:
+#if HAVE_MBEDTLS_2_0_0
+ *type = MBEDTLS_MD_MD2;
+#else
*type = POLARSSL_MD_MD2;
+#endif
break;
case HASH_FUNC_MD4:
+#if HAVE_MBEDTLS_2_0_0
+ *type = MBEDTLS_MD_MD4;
+#else
*type = POLARSSL_MD_MD4;
+#endif
break;
case HASH_FUNC_MD5:
+#if HAVE_MBEDTLS_2_0_0
+ *type = MBEDTLS_MD_MD5;
+#else
*type = POLARSSL_MD_MD5;
+#endif
+ break;
+ case HASH_FUNC_RIPEMD160:
+#if HAVE_MBEDTLS_2_0_0
+ *type = MBEDTLS_MD_RIPEMD160;
+#else
+ *type = POLARSSL_MD_RIPEMD160;
+#endif
break;
case HASH_FUNC_SHA1:
+#if HAVE_MBEDTLS_2_0_0
+ *type = MBEDTLS_MD_SHA1;
+#else
*type = POLARSSL_MD_SHA1;
+#endif
break;
case HASH_FUNC_SHA224:
+#if HAVE_MBEDTLS_2_0_0
+ *type = MBEDTLS_MD_SHA224;
+#else
*type = POLARSSL_MD_SHA224;
+#endif
break;
case HASH_FUNC_SHA256:
+#if HAVE_MBEDTLS_2_0_0
+ *type = MBEDTLS_MD_SHA256;
+#else
*type = POLARSSL_MD_SHA256;
+#endif
break;
case HASH_FUNC_SHA384:
+#if HAVE_MBEDTLS_2_0_0
+ *type = MBEDTLS_MD_SHA384;
+#else
*type = POLARSSL_MD_SHA384;
+#endif
break;
case HASH_FUNC_SHA512:
+#if HAVE_MBEDTLS_2_0_0
+ *type = MBEDTLS_MD_SHA512;
+#else
*type = POLARSSL_MD_SHA512;
+#endif
break;
default:
return false;
@@ -71,14 +123,29 @@ static bool gtkhash_hash_lib_polarssl_se
return true;
}
+
bool gtkhash_hash_lib_polarssl_is_supported(const enum hash_func_e id)
{
- struct hash_lib_polarssl_s data;
+#if HAVE_MBEDTLS_2_0_0
+ mbedtls_md_type_t type;
+#else
md_type_t type;
-
+#endif
if (!gtkhash_hash_lib_polarssl_set_type(id, &type))
return false;
+ struct hash_lib_polarssl_s data;
+#if HAVE_MBEDTLS_2_0_0
+ mbedtls_md_init(&data.ctx);
+
+ const mbedtls_md_info_t *info = mbedtls_md_info_from_type(type);
+ if (mbedtls_md_setup(&data.ctx, info, 0) != 0) {
+ mbedtls_md_free(&data.ctx);
+ return false;
+ }
+
+ mbedtls_md_free(&data.ctx);
+#else
if (md_init_ctx(&data.ctx, md_info_from_type(type)) != 0)
return false;
@@ -86,6 +153,7 @@ bool gtkhash_hash_lib_polarssl_is_suppor
g_assert_not_reached();
return false;
}
+#endif
return true;
}
@@ -93,34 +161,67 @@ bool gtkhash_hash_lib_polarssl_is_suppor
void gtkhash_hash_lib_polarssl_start(struct hash_func_s *func)
{
func->lib_data = g_new(struct hash_lib_polarssl_s, 1);
+#if HAVE_MBEDTLS_2_0_0
+ mbedtls_md_type_t type;
+#else
md_type_t type;
+#endif
if (!gtkhash_hash_lib_polarssl_set_type(func->id, &type))
g_assert_not_reached();
+#if HAVE_MBEDTLS_2_0_0
+ mbedtls_md_init(&LIB_DATA->ctx);
+
+ const mbedtls_md_info_t *info = mbedtls_md_info_from_type(type);
+ if (mbedtls_md_setup(&LIB_DATA->ctx, info, 0) != 0)
+ g_assert_not_reached();
+
+ if (mbedtls_md_starts(&LIB_DATA->ctx) != 0)
+ g_assert_not_reached();
+
+#else
if (md_init_ctx(&LIB_DATA->ctx, md_info_from_type(type)) != 0)
g_assert_not_reached();
if (md_starts(&LIB_DATA->ctx) != 0)
g_assert_not_reached();
+#endif
}
void gtkhash_hash_lib_polarssl_update(struct hash_func_s *func,
const uint8_t *buffer, const size_t size)
{
+#if HAVE_MBEDTLS_2_0_0
+ mbedtls_md_update(&LIB_DATA->ctx, buffer, size);
+#else
md_update(&LIB_DATA->ctx, buffer, size);
+#endif
}
void gtkhash_hash_lib_polarssl_stop(struct hash_func_s *func)
{
+#if HAVE_MBEDTLS_2_0_0
+ mbedtls_md_free(&LIB_DATA->ctx);
+#else
if (md_free_ctx(&LIB_DATA->ctx) != 0)
g_assert_not_reached();
+#endif
g_free(LIB_DATA);
}
uint8_t *gtkhash_hash_lib_polarssl_finish(struct hash_func_s *func,
size_t *size)
{
+#if HAVE_MBEDTLS_2_0_0
+ *size = mbedtls_md_get_size(LIB_DATA->ctx.md_info);
+ uint8_t *digest = g_malloc(*size);
+
+ if (mbedtls_md_finish(&LIB_DATA->ctx, digest) != 0)
+ g_assert_not_reached();
+
+ mbedtls_md_free(&LIB_DATA->ctx);
+#else
*size = LIB_DATA->ctx.md_info->size;
uint8_t *digest = g_malloc(*size);
@@ -129,6 +230,7 @@ uint8_t *gtkhash_hash_lib_polarssl_finis
if (md_free_ctx(&LIB_DATA->ctx) != 0)
g_assert_not_reached();
+#endif
g_free(LIB_DATA);
return digest;