diff --git a/.file-roller.metadata b/.file-roller.metadata index 208c185..9924274 100644 --- a/.file-roller.metadata +++ b/.file-roller.metadata @@ -1 +1 @@ -f0ba4542272d0f685c1ef7292d027a05f15a4e2f SOURCES/file-roller-3.22.3.tar.xz +8d5b063e7eeec62b18115aa283ce3b08b9f3a38b SOURCES/file-roller-3.28.1.tar.xz diff --git a/.gitignore b/.gitignore index 653987d..878939d 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1 @@ -SOURCES/file-roller-3.22.3.tar.xz +SOURCES/file-roller-3.28.1.tar.xz diff --git a/SOURCES/0001-Revert-Remove-nautilus-extension.patch b/SOURCES/0001-Revert-Remove-nautilus-extension.patch deleted file mode 100644 index 0959247..0000000 --- a/SOURCES/0001-Revert-Remove-nautilus-extension.patch +++ /dev/null @@ -1,743 +0,0 @@ -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/no-python3.patch b/SOURCES/no-python3.patch new file mode 100644 index 0000000..0487703 --- /dev/null +++ b/SOURCES/no-python3.patch @@ -0,0 +1,32 @@ +diff -urNp file-roller-3.28.0.old/postinstall.py file-roller-3.28.0/postinstall.py +--- file-roller-3.28.0.old/postinstall.py 2018-06-06 13:50:07.196718573 +0100 ++++ file-roller-3.28.0/postinstall.py 2018-06-06 13:55:42.210647307 +0100 +@@ -1,4 +1,4 @@ +-#!/usr/bin/env python3 ++#!/usr/bin/env python + + import os + import subprocess +@@ -8,19 +8,19 @@ datadir = os.path.join(prefix, 'share') + + # Packaging tools define DESTDIR and this isn't needed for them + if 'DESTDIR' not in os.environ: +- print('Updating icon cache…') ++ print('Updating icon cache') + icon_cache_dir = os.path.join(datadir, 'icons', 'hicolor') + if not os.path.exists(icon_cache_dir): + os.makedirs(icon_cache_dir) + subprocess.call(['gtk-update-icon-cache', '-qtf', icon_cache_dir]) + +- print('Updating desktop database…') ++ print('Updating desktop database') + desktop_database_dir = os.path.join(datadir, 'applications') + if not os.path.exists(desktop_database_dir): + os.makedirs(desktop_database_dir) + subprocess.call(['update-desktop-database', '-q', desktop_database_dir]) + +- print('Compiling GSettings schemas…') ++ print('Compiling GSettings schemas') + schemas_dir = os.path.join(datadir, 'glib-2.0', 'schemas') + if not os.path.exists(schemas_dir): + os.makedirs(schemas_dir) diff --git a/SOURCES/revert-remove-compress-support.patch b/SOURCES/revert-remove-compress-support.patch new file mode 100644 index 0000000..9f6059d --- /dev/null +++ b/SOURCES/revert-remove-compress-support.patch @@ -0,0 +1,111 @@ +From a5e3f2407589a232edd6bcf498d13529cedcd599 Mon Sep 17 00:00:00 2001 +From: Carlos Soriano +Date: Wed, 29 Aug 2018 16:20:14 +0200 +Subject: [PATCH] Revert "nautilus-fileroller: remove compress support" + +This reverts commit fad2372ccbbfd40013b4225002f4a737d67928bc. +--- + nautilus/nautilus-fileroller.c | 66 ++++++++++++++++++++++++++++++++++ + 1 file changed, 66 insertions(+) + +diff --git a/nautilus/nautilus-fileroller.c b/nautilus/nautilus-fileroller.c +index 441356bf..196f0282 100644 +--- a/nautilus/nautilus-fileroller.c ++++ b/nautilus/nautilus-fileroller.c +@@ -105,6 +105,44 @@ extract_here_callback (NautilusMenuItem *item, + 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; +@@ -218,6 +256,10 @@ nautilus_fr_get_file_items (NautilusMenuProvider *provider, + 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; +@@ -254,6 +296,11 @@ nautilus_fr_get_file_items (NautilusMenuProvider *provider, + + /**/ + ++ 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; + +@@ -293,6 +340,25 @@ nautilus_fr_get_file_items (NautilusMenuProvider *provider, + + } + ++ 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; + } + +-- +2.17.1 + diff --git a/SPECS/file-roller.spec b/SPECS/file-roller.spec index 2adc2f0..14813d4 100644 --- a/SPECS/file-roller.spec +++ b/SPECS/file-roller.spec @@ -1,11 +1,11 @@ Name: file-roller -Version: 3.22.3 -Release: 1%{?dist} +Version: 3.28.1 +Release: 2%{?dist} Summary: Tool for viewing and creating archives License: GPLv2+ URL: https://wiki.gnome.org/Apps/FileRoller -Source0: https://download.gnome.org/sources/%{name}/3.22/%{name}-%{version}.tar.xz +Source0: https://download.gnome.org/sources/%{name}/3.28/%{name}-%{version}.tar.xz # Fix a crash when the progress dialog is shown. # https://bugzilla.redhat.com/show_bug.cgi?id=1186481 @@ -15,9 +15,11 @@ Patch0: file-roller-3.14.2-fix-extraction-progress-dialog-crash.patch # 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 +# No py3 in RHEL 7 +Patch2: no-python3.patch + +# Add back the file-roller compress support +Patch3: revert-remove-compress-support.patch BuildRequires: pkgconfig(gio-unix-2.0) BuildRequires: pkgconfig(gtk+-3.0) @@ -28,12 +30,9 @@ BuildRequires: pkgconfig(libnotify) BuildRequires: file-devel BuildRequires: gettext BuildRequires: desktop-file-utils -BuildRequires: intltool BuildRequires: itstool +BuildRequires: meson 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 @@ -70,28 +69,20 @@ or directories. %patch0 -p1 %patch1 -p1 %patch2 -p1 +%patch3 -p1 %build -# For patch2 -autoreconf -fi - -%configure \ - --disable-static \ - --enable-nautilus-actions \ - --enable-packagekit - -make V=1 %{?_smp_mflags} +%meson +%meson_build %install -%make_install - -find $RPM_BUILD_ROOT -name '*.la' -delete +%meson_install %find_lang %{name} --with-gnome %check -appstream-util validate-relax --nonet $RPM_BUILD_ROOT%{_datadir}/appdata/org.gnome.FileRoller.appdata.xml +appstream-util validate-relax --nonet $RPM_BUILD_ROOT%{_datadir}/metainfo/org.gnome.FileRoller.appdata.xml desktop-file-validate $RPM_BUILD_ROOT%{_datadir}/applications/org.gnome.FileRoller.desktop @@ -116,7 +107,6 @@ glib-compile-schemas %{_datadir}/glib-2.0/schemas &> /dev/null || : %license COPYING %{_bindir}/file-roller %{_datadir}/file-roller -%{_datadir}/appdata/org.gnome.FileRoller.appdata.xml %{_datadir}/applications/org.gnome.FileRoller.desktop %{_libexecdir}/file-roller %{_datadir}/dbus-1/services/org.gnome.FileRoller.ArchiveManager1.service @@ -124,12 +114,23 @@ glib-compile-schemas %{_datadir}/glib-2.0/schemas &> /dev/null || : %{_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 +%{_datadir}/metainfo/org.gnome.FileRoller.appdata.xml %files nautilus %{_libdir}/nautilus/extensions-3.0/libnautilus-fileroller.so %changelog +* Thu Aug 23 2018 Carlos Soriano - 3.28.1-2 +- Put back the nautilus compress support + +* Wed Jul 25 2018 Kalev Lember - 3.28.1-1 +- Update to 3.28.1 +- Resolves: #1567187 + +* Wed Jun 06 2018 Richard Hughes - 3.28.0-1 +- Update to 3.28.0 +- Resolves: #1567187 + * Mon Feb 27 2017 Kalev Lember - 3.22.3-1 - Update to 3.22.3 - Add back the file-roller nautilus extension