diff --git a/.file-roller.metadata b/.file-roller.metadata index 1555c2f..208c185 100644 --- a/.file-roller.metadata +++ b/.file-roller.metadata @@ -1 +1 @@ -6b59302ede484df1c261e08329dcab11c45f6ef9 SOURCES/file-roller-3.14.2.tar.xz +f0ba4542272d0f685c1ef7292d027a05f15a4e2f SOURCES/file-roller-3.22.3.tar.xz diff --git a/.gitignore b/.gitignore index dca6874..653987d 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1 @@ -SOURCES/file-roller-3.14.2.tar.xz +SOURCES/file-roller-3.22.3.tar.xz diff --git a/SOURCES/0001-Revert-Remove-nautilus-extension.patch b/SOURCES/0001-Revert-Remove-nautilus-extension.patch new file mode 100644 index 0000000..0959247 --- /dev/null +++ b/SOURCES/0001-Revert-Remove-nautilus-extension.patch @@ -0,0 +1,743 @@ +From 366a5147bd097a877d85295a36fb062213355a36 Mon Sep 17 00:00:00 2001 +From: Carlos Soriano +Date: Wed, 1 Mar 2017 20:49:53 +0100 +Subject: [PATCH] Revert "Remove nautilus extension" + +This reverts commit da09ee41ca7c9b63082cf2a35ae19701c34adca7. + +Some of the main compressed archive formats are not still supported by +libarchive, for example, RAR5. + +This is a major issue for the Nautilus builtin compression handling, so +for now, and until libarchive adds support for RAR5, let's enable the +nautilus extension of file-roller for the "Extract here" menu item. + +See https://github.com/libarchive/libarchive/issues/373 for libarchive +support of RAR5. + +https://bugzilla.gnome.org/show_bug.cgi?id=772765 +--- + Makefile.am | 7 + + README | 1 + + configure.ac | 27 +++ + nautilus/Makefile.am | 23 +++ + nautilus/fileroller-module.c | 56 ++++++ + nautilus/nautilus-fileroller.c | 447 +++++++++++++++++++++++++++++++++++++++++ + nautilus/nautilus-fileroller.h | 51 +++++ + po/POTFILES.in | 3 + + 8 files changed, 615 insertions(+) + create mode 100644 nautilus/Makefile.am + create mode 100644 nautilus/fileroller-module.c + create mode 100644 nautilus/nautilus-fileroller.c + create mode 100644 nautilus/nautilus-fileroller.h + +diff --git a/Makefile.am b/Makefile.am +index a9acd51..0a21675 100644 +--- a/Makefile.am ++++ b/Makefile.am +@@ -1,9 +1,16 @@ + ACLOCAL_AMFLAGS=-I m4 ${ACLOCAL_FLAGS} + ++if ENABLE_NAUTILUS_ACTIONS ++NAUTILUS = nautilus ++else ++NAUTILUS = ++endif ++ + SUBDIRS = \ + data \ + src \ + help \ ++ $(NAUTILUS) \ + po + + distcleancheck_listfiles = find . -type f -print | grep -v 'omf\.out' +diff --git a/README b/README +index 2b55dc9..1ce5348 100644 +--- a/README ++++ b/README +@@ -70,6 +70,7 @@ + * libgnome >= 2.6.0 + * libgnomeui >= 2.6.0 + * libglade >= 2.4.0 ++ * libnautilus-extension >= 2.22.2 (optional) + + * Install + +diff --git a/configure.ac b/configure.ac +index 586ebcd..b096b60 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -23,6 +23,7 @@ AC_PATH_PROG(GLIB_COMPILE_RESOURCES, glib-compile-resources) + GLIB_REQUIRED=2.36.0 + GIO_REQUIRED=2.36.0 + GTK_REQUIRED=3.13.2 ++NAUTILUS_REQUIRED=2.22.2 + JSON_GLIB_REQUIRED=0.14.0 + LIBNOTIFY_REQUIRED=0.4.3 + LIBARCHIVE_REQUIRED=3.0.0 +@@ -97,6 +98,30 @@ AC_SUBST(FR_LIBS) + + dnl ****************************** + dnl ++dnl nautilus actions ++dnl ++AC_ARG_ENABLE([nautilus_actions], ++ [AS_HELP_STRING([--disable-nautilus-actions], ++ [do not build the nautilus context menu actions])],, ++ [enable_nautilus_actions=yes]) ++ ++if test x"$enable_nautilus_actions" != x"no" ; then ++ PKG_CHECK_MODULES(NAUTILUS, \ ++ [libnautilus-extension >= $NAUTILUS_REQUIRED \ ++ glib-2.0 \ ++ gio-2.0], ++ [enable_nautilus_actions=yes], ++ [enable_nautilus_actions=no]) ++ NAUTILUS_EXTENSION_DIR=`$PKG_CONFIG --variable=extensiondir libnautilus-extension` ++fi ++ ++AC_SUBST(NAUTILUS_CFLAGS) ++AC_SUBST(NAUTILUS_LIBS) ++AC_SUBST(NAUTILUS_EXTENSION_DIR) ++AM_CONDITIONAL(ENABLE_NAUTILUS_ACTIONS, test x"$enable_nautilus_actions" != x"no") ++ ++dnl ****************************** ++dnl + dnl json-glib-1.0 + dnl + PKG_CHECK_MODULES(JSON_GLIB, +@@ -278,6 +303,7 @@ AC_CONFIG_FILES([Makefile + src/commands/Makefile + src/sh/Makefile + src/ui/Makefile ++ nautilus/Makefile + help/Makefile + po/Makefile.in]) + AC_OUTPUT +@@ -293,6 +319,7 @@ Configuration: + Disable deprecated code : ${disable_deprecated} + Run in place : ${enable_run_in_place} + Internal mkdtemp : ${mkdtemp_missing} ++ Nautilus module : ${enable_nautilus_actions} + PackageKit support : ${enable_packagekit} + Use libmagic : ${enable_magic} + JSON support : ${enable_json_glib} +diff --git a/nautilus/Makefile.am b/nautilus/Makefile.am +new file mode 100644 +index 0000000..55bb742 +--- /dev/null ++++ b/nautilus/Makefile.am +@@ -0,0 +1,23 @@ ++AM_CPPFLAGS = \ ++ -DLOCALEDIR=\"$(localedir)\" \ ++ -I$(top_srcdir) \ ++ -I$(top_builddir) \ ++ $(DISABLE_DEPRECATED) \ ++ $(NAUTILUS_CFLAGS) \ ++ $(FR_CFLAGS) \ ++ $(JSON_GLIB_CFLAGS) \ ++ $(LIBNOTIFY_CFLAGS) ++ ++nautilus_extensiondir=$(NAUTILUS_EXTENSION_DIR) ++ ++nautilus_extension_LTLIBRARIES=libnautilus-fileroller.la ++ ++libnautilus_fileroller_la_SOURCES = \ ++ nautilus-fileroller.c \ ++ nautilus-fileroller.h \ ++ fileroller-module.c ++ ++libnautilus_fileroller_la_LDFLAGS = -module -avoid-version -no-undefined ++libnautilus_fileroller_la_LIBADD = $(NAUTILUS_LIBS) ++ ++-include $(top_srcdir)/git.mk +diff --git a/nautilus/fileroller-module.c b/nautilus/fileroller-module.c +new file mode 100644 +index 0000000..4a45750 +--- /dev/null ++++ b/nautilus/fileroller-module.c +@@ -0,0 +1,56 @@ ++/* ++ * File-Roller ++ * ++ * Copyright (C) 2004 Free Software Foundation, Inc. ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU General Public ++ * License as published by the Free Software Foundation; either ++ * version 2 of the License, or (at your option) any later version. ++ * ++ * This library is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ * Library General Public License for more details. ++ * ++ * You should have received a copy of the GNU General Public ++ * License along with this library; if not, write to the Free ++ * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. ++ * ++ * Author: Paolo Bacchilega ++ * ++ */ ++ ++#include ++#include ++#include ++#include ++#include "nautilus-fileroller.h" ++ ++ ++void ++nautilus_module_initialize (GTypeModule*module) ++{ ++ nautilus_fr_register_type (module); ++ ++ bindtextdomain (GETTEXT_PACKAGE, LOCALEDIR); ++ bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8"); ++} ++ ++ ++void ++nautilus_module_shutdown (void) ++{ ++} ++ ++ ++void ++nautilus_module_list_types (const GType **types, ++ int *num_types) ++{ ++ static GType type_list[1]; ++ ++ type_list[0] = NAUTILUS_TYPE_FR; ++ *types = type_list; ++ *num_types = 1; ++} +diff --git a/nautilus/nautilus-fileroller.c b/nautilus/nautilus-fileroller.c +new file mode 100644 +index 0000000..285c83d +--- /dev/null ++++ b/nautilus/nautilus-fileroller.c +@@ -0,0 +1,447 @@ ++/* ++ * File-Roller ++ * ++ * Copyright (C) 2004 Free Software Foundation, Inc. ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU General Public ++ * License as published by the Free Software Foundation; either ++ * version 2 of the License, or (at your option) any later version. ++ * ++ * This library is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ * Library General Public License for more details. ++ * ++ * You should have received a copy of the GNU General Public ++ * License along with this library; if not, write to the Free ++ * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. ++ * ++ * Author: Paolo Bacchilega ++ * ++ */ ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include "nautilus-fileroller.h" ++ ++ ++static GObjectClass *parent_class; ++ ++ ++static void ++extract_to_callback (NautilusMenuItem *item, ++ gpointer user_data) ++{ ++ GList *files; ++ NautilusFileInfo *file; ++ char *uri, *default_dir; ++ GString *cmd; ++ ++ files = g_object_get_data (G_OBJECT (item), "files"); ++ file = files->data; ++ ++ uri = nautilus_file_info_get_uri (file); ++ default_dir = nautilus_file_info_get_parent_uri (file); ++ ++ cmd = g_string_new ("file-roller"); ++ g_string_append_printf (cmd, ++ " --default-dir=%s --extract %s", ++ g_shell_quote (default_dir), ++ g_shell_quote (uri)); ++ ++#ifdef DEBUG ++ g_print ("EXEC: %s\n", cmd->str); ++#endif ++ ++ g_spawn_command_line_async (cmd->str, NULL); ++ ++ g_string_free (cmd, TRUE); ++ g_free (default_dir); ++ g_free (uri); ++} ++ ++ ++static void ++extract_here_callback (NautilusMenuItem *item, ++ gpointer user_data) ++{ ++ GList *files, *scan; ++ NautilusFileInfo *file; ++ char *dir; ++ GString *cmd; ++ ++ files = g_object_get_data (G_OBJECT (item), "files"); ++ file = files->data; ++ ++ dir = nautilus_file_info_get_parent_uri (file); ++ ++ cmd = g_string_new ("file-roller"); ++ g_string_append_printf (cmd," --extract-here --notify"); ++ ++ g_free (dir); ++ ++ for (scan = files; scan; scan = scan->next) { ++ NautilusFileInfo *file = scan->data; ++ char *uri; ++ ++ uri = nautilus_file_info_get_uri (file); ++ g_string_append_printf (cmd, " %s", g_shell_quote (uri)); ++ g_free (uri); ++ } ++ ++ g_spawn_command_line_async (cmd->str, NULL); ++ ++#ifdef DEBUG ++ g_print ("EXEC: %s\n", cmd->str); ++#endif ++ ++ g_string_free (cmd, TRUE); ++} ++ ++ ++static void ++add_callback (NautilusMenuItem *item, ++ gpointer user_data) ++{ ++ GList *files, *scan; ++ NautilusFileInfo *file; ++ char *uri, *dir; ++ GString *cmd; ++ ++ files = g_object_get_data (G_OBJECT (item), "files"); ++ file = files->data; ++ ++ uri = nautilus_file_info_get_uri (file); ++ dir = g_path_get_dirname (uri); ++ ++ cmd = g_string_new ("file-roller"); ++ g_string_append (cmd, " --notify"); ++ g_string_append_printf (cmd," --default-dir=%s", g_shell_quote (dir)); ++ g_string_append (cmd," --add"); ++ ++ g_free (dir); ++ g_free (uri); ++ ++ for (scan = files; scan; scan = scan->next) { ++ NautilusFileInfo *file = scan->data; ++ ++ uri = nautilus_file_info_get_uri (file); ++ g_string_append_printf (cmd, " %s", g_shell_quote (uri)); ++ g_free (uri); ++ } ++ ++ g_spawn_command_line_async (cmd->str, NULL); ++ ++ g_string_free (cmd, TRUE); ++} ++ ++ ++static struct { ++ char *mime_type; ++ gboolean is_compressed; ++} archive_mime_types[] = { ++ { "application/x-7z-compressed", TRUE }, ++ { "application/x-7z-compressed-tar", TRUE }, ++ { "application/x-ace", TRUE }, ++ { "application/x-alz", TRUE }, ++ { "application/x-ar", TRUE }, ++ { "application/x-arj", TRUE }, ++ { "application/x-bzip", TRUE }, ++ { "application/x-bzip-compressed-tar", TRUE }, ++ { "application/x-bzip1", TRUE }, ++ { "application/x-bzip1-compressed-tar", TRUE }, ++ { "application/vnd.ms-cab-compressed", TRUE }, ++ { "application/x-cbr", TRUE }, ++ { "application/x-cbz", TRUE }, ++ { "application/x-cd-image", FALSE }, ++ { "application/x-compress", TRUE }, ++ { "application/x-compressed-tar", TRUE }, ++ { "application/x-cpio", TRUE }, ++ { "application/x-deb", TRUE }, ++ { "application/vnd.debian.binary-package", TRUE }, ++ { "application/x-ear", TRUE }, ++ { "application/x-ms-dos-executable", FALSE }, ++ { "application/x-gtar", FALSE }, ++ { "application/x-gzip", TRUE }, ++ { "application/x-gzpostscript", TRUE }, ++ { "application/x-java-archive", TRUE }, ++ { "application/x-lha", TRUE }, ++ { "application/x-lhz", TRUE }, ++ { "application/x-lzip", TRUE }, ++ { "application/x-lzip-compressed-tar", TRUE }, ++ { "application/x-lzma", TRUE }, ++ { "application/x-lzma-compressed-tar", TRUE }, ++ { "application/x-lzop", TRUE }, ++ { "application/x-lzop-compressed-tar", TRUE }, ++ { "application/x-ms-wim", TRUE }, ++ { "application/x-rar", TRUE }, ++ { "application/x-rar-compressed", TRUE }, ++ { "application/x-rpm", TRUE }, ++ { "application/x-rzip", TRUE }, ++ { "application/x-tar", FALSE }, ++ { "application/x-tarz", TRUE }, ++ { "application/x-stuffit", TRUE }, ++ { "application/x-war", TRUE }, ++ { "application/x-xz", TRUE }, ++ { "application/x-xz-compressed-tar", TRUE }, ++ { "application/x-zip", TRUE }, ++ { "application/x-zip-compressed", TRUE }, ++ { "application/x-zoo", TRUE }, ++ { "application/zip", TRUE }, ++ { "multipart/x-zip", TRUE }, ++ { NULL, FALSE } ++}; ++ ++ ++typedef struct { ++ gboolean is_archive; ++ gboolean is_derived_archive; ++ gboolean is_compressed_archive; ++} FileMimeInfo; ++ ++ ++static FileMimeInfo ++get_file_mime_info (NautilusFileInfo *file) ++{ ++ FileMimeInfo file_mime_info; ++ int i; ++ ++ file_mime_info.is_archive = FALSE; ++ file_mime_info.is_derived_archive = FALSE; ++ file_mime_info.is_compressed_archive = FALSE; ++ ++ for (i = 0; archive_mime_types[i].mime_type != NULL; i++) ++ if (nautilus_file_info_is_mime_type (file, archive_mime_types[i].mime_type)) { ++ char *mime_type; ++ char *content_type_mime_file; ++ char *content_type_mime_compare; ++ ++ mime_type = nautilus_file_info_get_mime_type (file); ++ ++ content_type_mime_file = g_content_type_from_mime_type (mime_type); ++ content_type_mime_compare = g_content_type_from_mime_type (archive_mime_types[i].mime_type); ++ ++ file_mime_info.is_archive = TRUE; ++ file_mime_info.is_compressed_archive = archive_mime_types[i].is_compressed; ++ if ((content_type_mime_file != NULL) && (content_type_mime_compare != NULL)) ++ file_mime_info.is_derived_archive = ! g_content_type_equals (content_type_mime_file, content_type_mime_compare); ++ ++ g_free (mime_type); ++ g_free (content_type_mime_file); ++ g_free (content_type_mime_compare); ++ ++ return file_mime_info; ++ } ++ ++ return file_mime_info; ++} ++ ++ ++static gboolean ++unsupported_scheme (NautilusFileInfo *file) ++{ ++ gboolean result = FALSE; ++ GFile *location; ++ char *scheme; ++ ++ location = nautilus_file_info_get_location (file); ++ scheme = g_file_get_uri_scheme (location); ++ ++ if (scheme != NULL) { ++ const char *unsupported[] = { "trash", "computer", "x-nautilus-desktop", NULL }; ++ int i; ++ ++ for (i = 0; unsupported[i] != NULL; i++) ++ if (strcmp (scheme, unsupported[i]) == 0) ++ result = TRUE; ++ } ++ ++ g_free (scheme); ++ g_object_unref (location); ++ ++ return result; ++} ++ ++ ++static GList * ++nautilus_fr_get_file_items (NautilusMenuProvider *provider, ++ GtkWidget *window, ++ GList *files) ++{ ++ GList *items = NULL; ++ GList *scan; ++ gboolean can_write = TRUE; ++ gboolean one_item; ++ gboolean one_archive = FALSE; ++ gboolean one_derived_archive = FALSE; ++ gboolean one_compressed_archive = FALSE; ++ gboolean all_archives = TRUE; ++ gboolean all_archives_derived = TRUE; ++ gboolean all_archives_compressed = TRUE; ++ ++ if (files == NULL) ++ return NULL; ++ ++ for (scan = files; scan; scan = scan->next) { ++ NautilusFileInfo *file = scan->data; ++ FileMimeInfo file_mime_info; ++ ++ if (unsupported_scheme (file)) ++ return NULL; ++ ++ file_mime_info = get_file_mime_info (file); ++ ++ if (all_archives && ! file_mime_info.is_archive) ++ all_archives = FALSE; ++ ++ if (all_archives_compressed && file_mime_info.is_archive && ! file_mime_info.is_compressed_archive) ++ all_archives_compressed = FALSE; ++ ++ if (all_archives_derived && file_mime_info.is_archive && ! file_mime_info.is_derived_archive) ++ all_archives_derived = FALSE; ++ ++ if (can_write) { ++ NautilusFileInfo *parent; ++ ++ parent = nautilus_file_info_get_parent_info (file); ++ can_write = nautilus_file_info_can_write (parent); ++ g_object_unref (parent); ++ } ++ } ++ ++ /**/ ++ ++ one_item = (files != NULL) && (files->next == NULL); ++ one_archive = one_item && all_archives; ++ one_derived_archive = one_archive && all_archives_derived; ++ one_compressed_archive = one_archive && all_archives_compressed; ++ ++ if (all_archives && can_write) { ++ NautilusMenuItem *item; ++ ++ item = nautilus_menu_item_new ("NautilusFr::extract_here", ++ g_dgettext ("file-roller", "Extract Here"), ++ /* Translators: the current position is the current folder */ ++ g_dgettext ("file-roller", "Extract the selected archive to the current position"), ++ "drive-harddisk"); ++ g_signal_connect (item, ++ "activate", ++ G_CALLBACK (extract_here_callback), ++ provider); ++ g_object_set_data_full (G_OBJECT (item), ++ "files", ++ nautilus_file_info_list_copy (files), ++ (GDestroyNotify) nautilus_file_info_list_free); ++ ++ items = g_list_append (items, item); ++ } ++ else if (all_archives && ! can_write) { ++ NautilusMenuItem *item; ++ ++ item = nautilus_menu_item_new ("NautilusFr::extract_to", ++ g_dgettext ("file-roller", "Extract To..."), ++ g_dgettext ("file-roller", "Extract the selected archive"), ++ "drive-harddisk"); ++ g_signal_connect (item, ++ "activate", ++ G_CALLBACK (extract_to_callback), ++ provider); ++ g_object_set_data_full (G_OBJECT (item), ++ "files", ++ nautilus_file_info_list_copy (files), ++ (GDestroyNotify) nautilus_file_info_list_free); ++ ++ items = g_list_append (items, item); ++ ++ } ++ ++ if (! one_compressed_archive || one_derived_archive) { ++ NautilusMenuItem *item; ++ ++ item = nautilus_menu_item_new ("NautilusFr::add", ++ g_dgettext ("file-roller", "Compress..."), ++ g_dgettext ("file-roller", "Create a compressed archive with the selected objects"), ++ "gnome-mime-application-x-archive"); ++ g_signal_connect (item, ++ "activate", ++ G_CALLBACK (add_callback), ++ provider); ++ g_object_set_data_full (G_OBJECT (item), ++ "files", ++ nautilus_file_info_list_copy (files), ++ (GDestroyNotify) nautilus_file_info_list_free); ++ ++ items = g_list_append (items, item); ++ } ++ ++ return items; ++} ++ ++ ++static void ++nautilus_fr_menu_provider_iface_init (NautilusMenuProviderIface *iface) ++{ ++ iface->get_file_items = nautilus_fr_get_file_items; ++} ++ ++ ++static void ++nautilus_fr_instance_init (NautilusFr *fr) ++{ ++} ++ ++ ++static void ++nautilus_fr_class_init (NautilusFrClass *class) ++{ ++ parent_class = g_type_class_peek_parent (class); ++} ++ ++ ++static GType fr_type = 0; ++ ++ ++GType ++nautilus_fr_get_type (void) ++{ ++ return fr_type; ++} ++ ++ ++void ++nautilus_fr_register_type (GTypeModule *module) ++{ ++ static const GTypeInfo info = { ++ sizeof (NautilusFrClass), ++ (GBaseInitFunc) NULL, ++ (GBaseFinalizeFunc) NULL, ++ (GClassInitFunc) nautilus_fr_class_init, ++ NULL, ++ NULL, ++ sizeof (NautilusFr), ++ 0, ++ (GInstanceInitFunc) nautilus_fr_instance_init, ++ }; ++ ++ static const GInterfaceInfo menu_provider_iface_info = { ++ (GInterfaceInitFunc) nautilus_fr_menu_provider_iface_init, ++ NULL, ++ NULL ++ }; ++ ++ fr_type = g_type_module_register_type (module, ++ G_TYPE_OBJECT, ++ "NautilusFileRoller", ++ &info, 0); ++ ++ g_type_module_add_interface (module, ++ fr_type, ++ NAUTILUS_TYPE_MENU_PROVIDER, ++ &menu_provider_iface_info); ++} +diff --git a/nautilus/nautilus-fileroller.h b/nautilus/nautilus-fileroller.h +new file mode 100644 +index 0000000..df2ccb5 +--- /dev/null ++++ b/nautilus/nautilus-fileroller.h +@@ -0,0 +1,51 @@ ++/* ++ * File-Roller ++ * ++ * Copyright (C) 2004 Free Software Foundation, Inc. ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU General Public ++ * License as published by the Free Software Foundation; either ++ * version 2 of the License, or (at your option) any later version. ++ * ++ * This library is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ * Library General Public License for more details. ++ * ++ * You should have received a copy of the GNU General Public ++ * License along with this library; if not, write to the Free ++ * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. ++ * ++ * Author: Paolo Bacchilega ++ * ++ */ ++ ++#ifndef NAUTILUS_FILEROLLER_H ++#define NAUTILUS_FILEROLLER_H ++ ++#include ++ ++G_BEGIN_DECLS ++ ++#define NAUTILUS_TYPE_FR (nautilus_fr_get_type ()) ++#define NAUTILUS_FR(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), NAUTILUS_TYPE_FR, NautilusFr)) ++#define NAUTILUS_IS_FR(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), NAUTILUS_TYPE_FR)) ++ ++typedef struct _NautilusFr NautilusFr; ++typedef struct _NautilusFrClass NautilusFrClass; ++ ++struct _NautilusFr { ++ GObject __parent; ++}; ++ ++struct _NautilusFrClass { ++ GObjectClass __parent; ++}; ++ ++GType nautilus_fr_get_type (void); ++void nautilus_fr_register_type (GTypeModule *module); ++ ++G_END_DECLS ++ ++#endif /* NAUTILUS_FILEROLLER_H */ +diff --git a/po/POTFILES.in b/po/POTFILES.in +index f09b6a8..03282a8 100644 +--- a/po/POTFILES.in ++++ b/po/POTFILES.in +@@ -7,6 +7,9 @@ + data/org.gnome.FileRoller.appdata.xml.in + data/org.gnome.FileRoller.desktop.in.in + [type: gettext/gsettings]data/org.gnome.FileRoller.gschema.xml ++nautilus/fileroller-module.c ++nautilus/nautilus-fileroller.c ++nautilus/nautilus-fileroller.h + src/commands/rpm2cpio.c + src/dlg-add.c + src/dlg-add.h +-- +1.8.3.1 + diff --git a/SOURCES/Use-the-X11-backend-instead-of-Wayland.patch b/SOURCES/Use-the-X11-backend-instead-of-Wayland.patch new file mode 100644 index 0000000..720dadf --- /dev/null +++ b/SOURCES/Use-the-X11-backend-instead-of-Wayland.patch @@ -0,0 +1,31 @@ +From 00d2fbb998de419e514568c79fe0c3d8b9cc1a38 Mon Sep 17 00:00:00 2001 +From: Kalev Lember +Date: Wed, 14 Sep 2016 17:52:24 +0200 +Subject: [PATCH] Use the X11 backend instead of Wayland + +Force file-roller to use the gtk+ X11 backend even when running under a +Wayland session. This is currently needed to work around missing support +for arbitrarily named clipboards. + +https://bugzilla.gnome.org/show_bug.cgi?id=770333 +--- + src/main.c | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/src/main.c b/src/main.c +index 043f604..9fcb993 100644 +--- a/src/main.c ++++ b/src/main.c +@@ -34,6 +34,10 @@ main (int argc, char **argv) + bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8"); + textdomain (GETTEXT_PACKAGE); + ++ /* Use the X11 backend instead of Wayland, ++ * https://bugzilla.gnome.org/show_bug.cgi?id=770333 */ ++ gdk_set_allowed_backends ("x11"); ++ + app = fr_application_new (); + status = g_application_run (G_APPLICATION (app), argc, argv); + +-- +2.7.4 \ No newline at end of file diff --git a/SOURCES/file-roller-3.14.2-fix-add-button-sensitivity.patch b/SOURCES/file-roller-3.14.2-fix-add-button-sensitivity.patch deleted file mode 100644 index c25f149..0000000 --- a/SOURCES/file-roller-3.14.2-fix-add-button-sensitivity.patch +++ /dev/null @@ -1,37 +0,0 @@ -From f34f684103d16520fd22777377c630a947c7de0c Mon Sep 17 00:00:00 2001 -From: David King -Date: Wed, 4 May 2016 19:43:52 +0100 -Subject: [PATCH] Fix Add Files dialog button sensitivity - -When the Add Files dialog has previously been opened and there are -selected files, the selection is restored for subsequent views of the -dialog. However, the sensitivity of the Add button is only updated when -manually selecting a file, as the dialog only updates the sensitivity -in response to the GtkCellRendererToggle for the selected state being -changed. When setting a list of selected files on the dialog, as done -when restoring the list of selected files on subsequent views of the -dialog, the Add button is only ever set to be insensitive. - -Fix this by updating the Add button sensitivity after the list of files -has been loaded. - -https://bugzilla.gnome.org/show_bug.cgi?id=738177 ---- - src/fr-file-selector-dialog.c | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/src/fr-file-selector-dialog.c b/src/fr-file-selector-dialog.c -index 0e87b02..017df88 100644 ---- a/src/fr-file-selector-dialog.c -+++ b/src/fr-file-selector-dialog.c -@@ -882,6 +882,7 @@ get_folder_content_done_cb (GError *error, - - gtk_tree_sortable_set_sort_column_id (GTK_TREE_SORTABLE (GET_WIDGET ("files_liststore")), sort_column_id, sort_order); - set_current_folder (self, load_data->folder); -+ _update_sensitivity (self); - - if (load_data->dialog->priv->current_operation == load_data) - load_data->dialog->priv->current_operation = NULL; --- -2.8.2 - diff --git a/SOURCES/file-roller-3.14.2-fix-delete-all.patch b/SOURCES/file-roller-3.14.2-fix-delete-all.patch deleted file mode 100644 index 1178a2d..0000000 --- a/SOURCES/file-roller-3.14.2-fix-delete-all.patch +++ /dev/null @@ -1,79 +0,0 @@ -From 3d9bfa9677960c1c03d795c1d5e849fc1ac4e18d Mon Sep 17 00:00:00 2001 -From: Paolo Bacchilega -Date: Sun, 15 Feb 2015 11:52:55 +0100 -Subject: Deleting all files does not work - -only happens when the archive is modified with libarchive - -[bug #738178] ---- - src/fr-archive-libarchive.c | 24 +++++++++++++++++------- - 1 file changed, 17 insertions(+), 7 deletions(-) - -diff --git a/src/fr-archive-libarchive.c b/src/fr-archive-libarchive.c -index 8770f8a..6909b8a 100644 ---- a/src/fr-archive-libarchive.c -+++ b/src/fr-archive-libarchive.c -@@ -1641,6 +1641,7 @@ fr_archive_libarchive_add_files (FrArchive *archive, - - typedef struct { - GHashTable *files_to_remove; -+ gboolean remove_all_files; - int n_files_to_remove; - } RemoveData; - -@@ -1648,7 +1649,8 @@ typedef struct { - static void - remove_data_free (RemoveData *remove_data) - { -- g_hash_table_unref (remove_data->files_to_remove); -+ if (remove_data->files_to_remove != NULL) -+ g_hash_table_unref (remove_data->files_to_remove); - g_free (remove_data); - } - -@@ -1662,7 +1664,7 @@ _remove_files_begin (SaveData *save_data, - - fr_archive_progress_set_total_files (load_data->archive, remove_data->n_files_to_remove); - fr_archive_progress_set_total_bytes (load_data->archive, -- FR_ARCHIVE_LIBARCHIVE (load_data->archive)->priv->uncompressed_size); -+ FR_ARCHIVE_LIBARCHIVE (load_data->archive)->priv->uncompressed_size); - } - - -@@ -1676,6 +1678,9 @@ _remove_files_entry_action (SaveData *save_data, - WriteAction action; - const char *pathname; - -+ if (remove_data->remove_all_files) -+ return WRITE_ACTION_SKIP_ENTRY; -+ - action = WRITE_ACTION_WRITE_ENTRY; - pathname = archive_entry_pathname (w_entry); - if (g_hash_table_lookup (remove_data->files_to_remove, pathname) != NULL) { -@@ -1701,12 +1706,17 @@ fr_archive_libarchive_remove_files (FrArchive *archive, - GList *scan; - - remove_data = g_new0 (RemoveData, 1); -- remove_data->files_to_remove = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, NULL); -- remove_data->n_files_to_remove = 0; -- for (scan = file_list; scan; scan = scan->next) { -- g_hash_table_insert (remove_data->files_to_remove, g_strdup (scan->data), GINT_TO_POINTER (1)); -- remove_data->n_files_to_remove++; -+ remove_data->remove_all_files = (file_list == NULL); -+ if (! remove_data->remove_all_files) { -+ remove_data->files_to_remove = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, NULL); -+ remove_data->n_files_to_remove = 0; -+ for (scan = file_list; scan; scan = scan->next) { -+ g_hash_table_insert (remove_data->files_to_remove, g_strdup (scan->data), GINT_TO_POINTER (1)); -+ remove_data->n_files_to_remove++; -+ } - } -+ else -+ remove_data->n_files_to_remove = archive->files->len; - - _fr_archive_libarchive_save (archive, - FALSE, --- -cgit v0.12 - diff --git a/SOURCES/file-roller-3.14.2-fix-password-protected-rename.patch b/SOURCES/file-roller-3.14.2-fix-password-protected-rename.patch deleted file mode 100644 index f9716bf..0000000 --- a/SOURCES/file-roller-3.14.2-fix-password-protected-rename.patch +++ /dev/null @@ -1,49 +0,0 @@ -From d309d278bf298d0fe7241b0c5cf2548e322b80a0 Mon Sep 17 00:00:00 2001 -From: David King -Date: Tue, 10 May 2016 13:13:50 +0100 -Subject: [PATCH] Fix renaming files in a password-protected archive - -When opening a password-protected archive, and renaming a file within, -the password dialog takes user input, sets the password for the archive -and then restarts the rename action. As part of doing so, it frees the -existing action and replaces it with a duplicate. However, pointers to -fields inside the original (now freed) action struct are used to -provide the old and new filenames, among other arguments. This leads to -the file being deleted (although accessing freed memory is undefined, -so other outcomes are possible). - -Fix the rename operation by always using the fields from the new -struct, which exists for the lifetime of the rename action. - -https://bugzilla.redhat.com/show_bug.cgi?id=1233853 -https://bugzilla.gnome.org/show_bug.cgi?id=766227 ---- - src/fr-window.c | 12 ++++++------ - 1 file changed, 6 insertions(+), 6 deletions(-) - -diff --git a/src/fr-window.c b/src/fr-window.c -index fd161b7..1d0a661 100644 ---- a/src/fr-window.c -+++ b/src/fr-window.c -@@ -8205,12 +8205,12 @@ rename_selection (FrWindow *window, - fr_window_clipboard_remove_file_list (window, file_list); - fr_archive_rename (window->archive, - file_list, -- old_name, -- new_name, -- current_dir, -- is_dir, -- dir_in_archive, -- original_path, -+ rdata->old_name, -+ rdata->new_name, -+ rdata->current_dir, -+ rdata->is_dir, -+ rdata->dir_in_archive, -+ rdata->original_path, - window->priv->cancellable, - archive_rename_ready_cb, - window); --- -2.8.2 - diff --git a/SPECS/file-roller.spec b/SPECS/file-roller.spec index 17460f6..2adc2f0 100644 --- a/SPECS/file-roller.spec +++ b/SPECS/file-roller.spec @@ -1,63 +1,67 @@ -Summary: Tool for viewing and creating archives Name: file-roller -Version: 3.14.2 -Release: 10%{?dist} +Version: 3.22.3 +Release: 1%{?dist} +Summary: Tool for viewing and creating archives + License: GPLv2+ -Group: Applications/Archiving -URL: http://download.gnome.org/sources/file-roller/ -#VCS: git:git://git.gnome.org/file-roller -Source: http://download.gnome.org/sources/file-roller/3.14/file-roller-%{version}.tar.xz +URL: https://wiki.gnome.org/Apps/FileRoller +Source0: https://download.gnome.org/sources/%{name}/3.22/%{name}-%{version}.tar.xz + # Fix a crash when the progress dialog is shown. # https://bugzilla.redhat.com/show_bug.cgi?id=1186481 Patch0: file-roller-3.14.2-fix-extraction-progress-dialog-crash.patch -# https://bugzilla.redhat.com/show_bug.cgi?id=1228645 -Patch1: file-roller-3.14.2-fix-delete-all.patch -# https://bugzilla.redhat.com/show_bug.cgi?id=1222955 -Patch2: file-roller-3.14.2-fix-add-button-sensitivity.patch -# https://bugzilla.redhat.com/show_bug.cgi?id=1233853 -Patch3: file-roller-3.14.2-fix-password-protected-rename.patch - -BuildRequires: glib2-devel -BuildRequires: pango-devel -BuildRequires: gtk3-devel -BuildRequires: nautilus-devel -BuildRequires: libtool -BuildRequires: gettext -BuildRequires: desktop-file-utils -BuildRequires: intltool -BuildRequires: itstool -BuildRequires: file-devel -BuildRequires: libarchive-devel -BuildRequires: json-glib-devel -BuildRequires: libnotify-devel +# Use the X11 backend instead of Wayland +# https://bugzilla.gnome.org/show_bug.cgi?id=770333 +Patch1: Use-the-X11-backend-instead-of-Wayland.patch + +# Add back the file-roller nautilus extension +# https://bugzilla.gnome.org/show_bug.cgi?id=772765 +Patch2: 0001-Revert-Remove-nautilus-extension.patch + +BuildRequires: pkgconfig(gio-unix-2.0) +BuildRequires: pkgconfig(gtk+-3.0) +BuildRequires: pkgconfig(json-glib-1.0) +BuildRequires: pkgconfig(libarchive) +BuildRequires: pkgconfig(libnautilus-extension) +BuildRequires: pkgconfig(libnotify) +BuildRequires: file-devel +BuildRequires: gettext +BuildRequires: desktop-file-utils +BuildRequires: intltool +BuildRequires: itstool +BuildRequires: /usr/bin/appstream-util +# For patch2 +BuildRequires: autoconf automake libtool +BuildRequires: gnome-common + +%if 0%{?rhel} # Explicitly depend on various archivers to avoid problems when installing # new archiver support on demand. # https://bugzilla.redhat.com/show_bug.cgi?id=837608 -Requires: /usr/bin/ar -Requires: /usr/bin/bzip2 -Requires: /usr/bin/compress -Requires: /usr/bin/cpio -Requires: /usr/bin/gzip -Requires: /usr/bin/isoinfo -Requires: /usr/bin/lzop -Requires: /usr/bin/tar -Requires: /usr/bin/unzip -Requires: /usr/bin/xz -Requires: /usr/bin/zip +Requires: /usr/bin/ar +Requires: /usr/bin/bzip2 +Requires: /usr/bin/compress +Requires: /usr/bin/cpio +Requires: /usr/bin/gzip +Requires: /usr/bin/isoinfo +Requires: /usr/bin/lzop +Requires: /usr/bin/tar +Requires: /usr/bin/unzip +Requires: /usr/bin/xz +Requires: /usr/bin/zip +%endif %description File Roller is an application for creating and viewing archives files, such as tar or zip files. - %package nautilus Summary: File Roller extension for nautilus -Group: User Interface/Desktops Requires: %{name}%{_isa} = %{version}-%{release} %description nautilus -This package contains the file-roller extension for the nautilus file manger. +This package contains the file-roller extension for the nautilus file manager. It adds an item to the nautilus context menu that lets you compress files or directories. @@ -66,34 +70,30 @@ or directories. %patch0 -p1 %patch1 -p1 %patch2 -p1 -%patch3 -p1 %build +# For patch2 +autoreconf -fi + %configure \ --disable-static \ --enable-nautilus-actions \ --enable-packagekit -export tagname=CC -make V=1 LIBTOOL=/usr/bin/libtool +make V=1 %{?_smp_mflags} %install -export tagname=CC -make install DESTDIR=$RPM_BUILD_ROOT +%make_install -rm -rf $RPM_BUILD_ROOT/var/scrollkeeper -rm -f $RPM_BUILD_ROOT%{_libdir}/nautilus/extensions-3.0/*.{a,la} -rm -f $RPM_BUILD_ROOT%{_datadir}/icons/hicolor/icon-theme.cache +find $RPM_BUILD_ROOT -name '*.la' -delete %find_lang %{name} --with-gnome + +%check +appstream-util validate-relax --nonet $RPM_BUILD_ROOT%{_datadir}/appdata/org.gnome.FileRoller.appdata.xml desktop-file-validate $RPM_BUILD_ROOT%{_datadir}/applications/org.gnome.FileRoller.desktop -# for backward compatibility with user defined file associations -cp $RPM_BUILD_ROOT%{_datadir}/applications/org.gnome.FileRoller.desktop $RPM_BUILD_ROOT%{_datadir}/applications/file-roller.desktop -echo NoDisplay=true >> $RPM_BUILD_ROOT%{_datadir}/applications/file-roller.desktop -sed -i -e 's/X-GNOME-UsesNotifications=true/X-GNOME-UsesNotifications=false/' $RPM_BUILD_ROOT%{_datadir}/applications/file-roller.desktop -echo X-RHEL-AliasOf=org.gnome.FileRoller >> $RPM_BUILD_ROOT%{_datadir}/applications/file-roller.desktop %post update-desktop-database &> /dev/null || : @@ -112,23 +112,34 @@ gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || : glib-compile-schemas %{_datadir}/glib-2.0/schemas &> /dev/null || : %files -f %{name}.lang -%doc README COPYING NEWS AUTHORS +%doc README NEWS AUTHORS +%license COPYING %{_bindir}/file-roller %{_datadir}/file-roller %{_datadir}/appdata/org.gnome.FileRoller.appdata.xml -%{_datadir}/applications/*.desktop +%{_datadir}/applications/org.gnome.FileRoller.desktop %{_libexecdir}/file-roller %{_datadir}/dbus-1/services/org.gnome.FileRoller.ArchiveManager1.service %{_datadir}/dbus-1/services/org.gnome.FileRoller.service %{_datadir}/icons/hicolor/*/apps/file-roller.png +%{_datadir}/icons/hicolor/scalable/apps/file-roller-symbolic.svg %{_datadir}/glib-2.0/schemas/org.gnome.FileRoller.gschema.xml %{_datadir}/GConf/gsettings/file-roller.convert %files nautilus %{_libdir}/nautilus/extensions-3.0/libnautilus-fileroller.so - %changelog +* Mon Feb 27 2017 Kalev Lember - 3.22.3-1 +- Update to 3.22.3 +- Add back the file-roller nautilus extension +- Resolves: #1386857 + +* Fri Feb 24 2017 Matthias Clasen - 3.22.2-1.el7 +- Rebase to 3.22.2 +- Drop upstreamed patches + Resolves: rhbz#1386857 + * Tue May 10 2016 David King - 3.14.2-10 - Fix renaming files in a password-protected archive (#1233853)