summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexandre Rostovtsev <tetromino@gentoo.org>2013-09-09 00:40:44 +0000
committerAlexandre Rostovtsev <tetromino@gentoo.org>2013-09-09 00:40:44 +0000
commit72aeddc9af8896f6f6824a6d23f034d231405994 (patch)
tree1864944a7ee8e1103583a539f4cff200ed98ae14 /app-arch/file-roller
parentRestore 3.0.5, needed by stable dev-ruby/ruby2ruby-1.2.4-r2. (diff)
downloadgentoo-2-72aeddc9af8896f6f6824a6d23f034d231405994.tar.gz
gentoo-2-72aeddc9af8896f6f6824a6d23f034d231405994.tar.bz2
gentoo-2-72aeddc9af8896f6f6824a6d23f034d231405994.zip
Add support for rar-5 and unrar-5 (bug #483722).
(Portage version: 2.2.1/cvs/Linux x86_64, signed Manifest commit with key CF0ADD61)
Diffstat (limited to 'app-arch/file-roller')
-rw-r--r--app-arch/file-roller/ChangeLog8
-rw-r--r--app-arch/file-roller/file-roller-3.8.4-r1.ebuild102
-rw-r--r--app-arch/file-roller/files/file-roller-3.8.4-rar-5.patch246
3 files changed, 355 insertions, 1 deletions
diff --git a/app-arch/file-roller/ChangeLog b/app-arch/file-roller/ChangeLog
index 97bab4828ae6..0a6cef783982 100644
--- a/app-arch/file-roller/ChangeLog
+++ b/app-arch/file-roller/ChangeLog
@@ -1,6 +1,12 @@
# ChangeLog for app-arch/file-roller
# Copyright 1999-2013 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/app-arch/file-roller/ChangeLog,v 1.324 2013/08/27 06:24:25 pacho Exp $
+# $Header: /var/cvsroot/gentoo-x86/app-arch/file-roller/ChangeLog,v 1.325 2013/09/09 00:40:44 tetromino Exp $
+
+*file-roller-3.8.4-r1 (09 Sep 2013)
+
+ 09 Sep 2013; Alexandre Rostovtsev <tetromino@gentoo.org>
+ +file-roller-3.8.4-r1.ebuild, +files/file-roller-3.8.4-rar-5.patch:
+ Add support for rar-5 and unrar-5 (bug #483722).
27 Aug 2013; Pacho Ramos <pacho@gentoo.org> -file-roller-3.6.3.ebuild,
-file-roller-3.6.4.ebuild, -file-roller-3.8.2.ebuild,
diff --git a/app-arch/file-roller/file-roller-3.8.4-r1.ebuild b/app-arch/file-roller/file-roller-3.8.4-r1.ebuild
new file mode 100644
index 000000000000..8b682ea4152e
--- /dev/null
+++ b/app-arch/file-roller/file-roller-3.8.4-r1.ebuild
@@ -0,0 +1,102 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/app-arch/file-roller/file-roller-3.8.4-r1.ebuild,v 1.1 2013/09/09 00:40:44 tetromino Exp $
+
+EAPI="5"
+GCONF_DEBUG="no"
+GNOME2_LA_PUNT="yes"
+
+inherit eutils gnome2 readme.gentoo
+
+DESCRIPTION="Archive manager for GNOME"
+HOMEPAGE="http://fileroller.sourceforge.net/"
+
+LICENSE="GPL-2+ CC-BY-SA-3.0"
+SLOT="0"
+IUSE="nautilus packagekit"
+KEYWORDS="~alpha ~amd64 ~arm ~ia64 ~ppc ~ppc64 ~sparc ~x86 ~x86-fbsd ~x86-freebsd ~amd64-linux ~x86-linux"
+
+# gdk-pixbuf used extensively in the source
+# cairo used in eggtreemultidnd.c
+# pango used in fr-window
+RDEPEND="
+ >=app-arch/libarchive-3:=
+ >=dev-libs/glib-2.29.14:2
+ >=dev-libs/json-glib-0.14
+ >=x11-libs/gtk+-3.6:3
+ >=x11-libs/libnotify-0.4.3:=
+ sys-apps/file
+ x11-libs/cairo
+ x11-libs/gdk-pixbuf:2
+ x11-libs/libICE
+ x11-libs/libSM
+ x11-libs/pango
+ nautilus? ( >=gnome-base/nautilus-3 )
+ packagekit? ( app-admin/packagekit-base )
+"
+DEPEND="${RDEPEND}
+ dev-util/desktop-file-utils
+ >=dev-util/intltool-0.40.0
+ sys-devel/gettext
+ virtual/pkgconfig
+"
+# eautoreconf needs:
+# gnome-base/gnome-common
+
+DISABLE_AUTOFORMATTING="yes"
+DOC_CONTENTS="
+${PN} is a frontend for several archiving utilities. If you want a
+particular achive format support, see ${HOMEPAGE}
+and install the relevant package. For example:
+7-zip - app-arch/p7zip
+ace - app-arch/unace
+arj - app-arch/arj
+cpio - app-arch/cpio
+deb - app-arch/dpkg
+iso - app-cdr/cdrtools
+jar,zip - app-arch/zip and app-arch/unzip
+lha - app-arch/lha
+lzop - app-arch/lzop
+rar - app-arch/unrar or app-arch/unar
+rpm - app-arch/rpm
+unstuff - app-arch/stuffit
+zoo - app-arch/zoo"
+
+src_prepare() {
+ # Use absolute path to GNU tar since star doesn't have the same
+ # options. On Gentoo, star is /usr/bin/tar, GNU tar is /bin/tar
+ epatch "${FILESDIR}"/${PN}-2.10.3-use_bin_tar.patch
+
+ # app-arch/{un,}rar-5 support, https://bugzilla.gnome.org/show_bug.cgi?id=707568
+ epatch "${FILESDIR}"/${PN}-3.8.4-rar-5.patch
+
+ # File providing Gentoo package names for various archivers
+ cp -f "${FILESDIR}/3.6.0-packages.match" data/packages.match || die
+
+ gnome2_src_prepare
+}
+
+src_configure() {
+ DOCS="AUTHORS ChangeLog HACKING MAINTAINERS NEWS README* TODO"
+ # --disable-debug because enabling it adds -O0 to CFLAGS
+ gnome2_src_configure \
+ --disable-run-in-place \
+ --disable-static \
+ --disable-debug \
+ --enable-magic \
+ --enable-libarchive \
+ --with-smclient=xsmp \
+ $(use_enable nautilus nautilus-actions) \
+ $(use_enable packagekit) \
+ ITSTOOL=$(type -P true)
+}
+
+src_install() {
+ gnome2_src_install
+ readme.gentoo_create_doc
+}
+
+pkg_postinst() {
+ gnome2_pkg_postinst
+ readme.gentoo_print_elog
+}
diff --git a/app-arch/file-roller/files/file-roller-3.8.4-rar-5.patch b/app-arch/file-roller/files/file-roller-3.8.4-rar-5.patch
new file mode 100644
index 000000000000..73168e8b5982
--- /dev/null
+++ b/app-arch/file-roller/files/file-roller-3.8.4-rar-5.patch
@@ -0,0 +1,246 @@
+From 065550880248b6a66c2fa3143adc0962d0473283 Mon Sep 17 00:00:00 2001
+From: Alexandre Rostovtsev <tetromino@gentoo.org>
+Date: Sun, 8 Sep 2013 19:02:10 -0400
+Subject: [PATCH] rar: add support for rar-5.00
+
+https://bugzilla.gnome.org/show_bug.cgi?id=707568
+---
+ src/fr-command-rar.c | 153 +++++++++++++++++++++++++++++++++++++--------------
+ src/fr-command-rar.h | 3 +-
+ 2 files changed, 115 insertions(+), 41 deletions(-)
+
+diff --git a/src/fr-command-rar.c b/src/fr-command-rar.c
+index b67db1f..938bf8c 100644
+--- a/src/fr-command-rar.c
++++ b/src/fr-command-rar.c
+@@ -84,6 +84,82 @@ mktime_from_string (char *date_s,
+ return mktime (&tm);
+ }
+
++/* Sample rar-5 listing output:
++
++RAR 5.00 beta 8 Copyright (c) 1993-2013 Alexander Roshal 22 Aug 2013
++Trial version Type RAR -? for help
++
++Archive: test.rar
++Details: RAR 4
++
++ Attributes Size Packed Ratio Date Time Checksum Name
++----------- --------- -------- ----- -------- ----- -------- ----
++ -rw-r--r-- 453 304 67% 05-09-13 09:55 56DA5EF3 loremipsum.txt
++----------- --------- -------- ----- -------- ----- -------- ----
++ 453 304 67% 1
++
++ *
++ * Sample rar-4 listing output:
++ *
++
++RAR 4.20 Copyright (c) 1993-2012 Alexander Roshal 9 Jun 2012
++Trial version Type RAR -? for help
++
++Archive test.rar
++
++Pathname/Comment
++ Size Packed Ratio Date Time Attr CRC Meth Ver
++-------------------------------------------------------------------------------
++ loremipsum.txt
++ 453 304 67% 05-09-13 09:55 -rw-r--r-- 56DA5EF3 m3b 2.9
++-------------------------------------------------------------------------------
++ 1 453 304 67%
++
++ */
++
++static void
++parse_name_field (char *line,
++ FrCommandRar *rar_comm)
++{
++ const char *name_field;
++ FileData *fdata;
++
++ rar_comm->fdata = fdata = file_data_new ();
++
++ /* read file name. */
++
++ fdata->encrypted = (line[0] == '*') ? TRUE : FALSE;
++
++ if (rar_comm->rar4_odd_line)
++ name_field = line + 1;
++ else
++ /* rar-5 output adds trailing spaces to short file names :( */
++ name_field = g_strchomp (_g_str_get_last_field (line, 8));
++
++ if (*name_field == '/') {
++ fdata->full_path = g_strdup (name_field);
++ fdata->original_path = fdata->full_path;
++ }
++ else {
++ fdata->full_path = g_strconcat ("/", name_field, NULL);
++ fdata->original_path = fdata->full_path + 1;
++ }
++
++ fdata->link = NULL;
++ fdata->path = _g_path_remove_level (fdata->full_path);
++}
++
++static gboolean
++attr_field_is_dir (const char *attr_field,
++ FrCommandRar *rar_comm)
++{
++ if ((attr_field[0] == 'd') ||
++ (rar_comm->rar5 && attr_field[3] == 'D') ||
++ (!rar_comm->rar5 && attr_field[1] == 'D'))
++ return TRUE;
++
++ return FALSE;
++}
+
+ static void
+ process_line (char *line,
+@@ -92,14 +168,18 @@ process_line (char *line,
+ FrCommand *comm = FR_COMMAND (data);
+ FrCommandRar *rar_comm = FR_COMMAND_RAR (comm);
+ char **fields;
+- const char *name_field;
+
+ g_return_if_fail (line != NULL);
+
+ if (! rar_comm->list_started) {
+- if (strncmp (line, "--------", 8) == 0) {
++ if (strncmp (line, "Details:", 8) == 0) {
++ rar_comm->rar5 = TRUE;
++ return;
++ }
++ else if (strncmp (line, "--------", 8) == 0) {
+ rar_comm->list_started = TRUE;
+- rar_comm->odd_line = TRUE;
++ if (! rar_comm->rar5)
++ rar_comm->rar4_odd_line = TRUE;
+ }
+ else if (strncmp (line, "Volume ", 7) == 0)
+ FR_ARCHIVE (comm)->multi_volume = TRUE;
+@@ -111,24 +191,43 @@ process_line (char *line,
+ return;
+ }
+
+- if (! rar_comm->odd_line) {
+- FileData *fdata;
++ if (rar_comm->rar4_odd_line || rar_comm->rar5)
++ parse_name_field (line, rar_comm);
++
++ if (! rar_comm->rar4_odd_line) {
++ FileData *fdata;
++ const char *size_field, *ratio_field, *date_field, *time_field, *attr_field;
+
+ fdata = rar_comm->fdata;
+
+ /* read file info. */
+
+ fields = _g_str_split_line (line, 6);
++ if (rar_comm->rar5) {
++ size_field = fields[1];
++ ratio_field = fields[3];
++ date_field = fields[4];
++ time_field = fields[5];
++ attr_field = fields[0];
++ }
++ else {
++ size_field = fields[0];
++ ratio_field = fields[2];
++ date_field = fields[3];
++ time_field = fields[4];
++ attr_field = fields[5];
++ }
+ if (g_strv_length (fields) < 6) {
+ /* wrong line format, treat this line as a filename line */
+ g_strfreev (fields);
+ file_data_free (rar_comm->fdata);
+ rar_comm->fdata = NULL;
+- rar_comm->odd_line = TRUE;
++ rar_comm->rar4_odd_line = TRUE;
++ parse_name_field (line, rar_comm);
+ }
+ else {
+- if ((strcmp (fields[2], "<->") == 0)
+- || (strcmp (fields[2], "<--") == 0))
++ if ((strcmp (ratio_field, "<->") == 0)
++ || (strcmp (ratio_field, "<--") == 0))
+ {
+ /* ignore files that span more volumes */
+
+@@ -136,10 +235,10 @@ process_line (char *line,
+ rar_comm->fdata = NULL;
+ }
+ else {
+- fdata->size = g_ascii_strtoull (fields[0], NULL, 10);
+- fdata->modified = mktime_from_string (fields[3], fields[4]);
++ fdata->size = g_ascii_strtoull (size_field, NULL, 10);
++ fdata->modified = mktime_from_string (date_field, time_field);
+
+- if ((fields[5][1] == 'D') || (fields[5][0] == 'd')) {
++ if (attr_field_is_dir (attr_field, rar_comm)) {
+ char *tmp;
+
+ tmp = fdata->full_path;
+@@ -155,7 +254,7 @@ process_line (char *line,
+ }
+ else {
+ fdata->name = g_strdup (_g_path_get_basename (fdata->full_path));
+- if (fields[5][0] == 'l')
++ if (attr_field[0] == 'l')
+ fdata->link = g_strdup (_g_path_get_basename (fdata->full_path));
+ }
+
+@@ -167,34 +266,8 @@ process_line (char *line,
+ }
+ }
+
+- if (rar_comm->odd_line) {
+- FileData *fdata;
+-
+- rar_comm->fdata = fdata = file_data_new ();
+-
+- /* read file name. */
+-
+- fdata->encrypted = (line[0] == '*') ? TRUE : FALSE;
+-
+- name_field = line + 1;
+-
+- if (*name_field == '/') {
+- fdata->full_path = g_strdup (name_field);
+- fdata->original_path = fdata->full_path;
+- }
+- else {
+- fdata->full_path = g_strconcat ("/", name_field, NULL);
+- fdata->original_path = fdata->full_path + 1;
+- }
+-
+- fdata->link = NULL;
+- fdata->path = _g_path_remove_level (fdata->full_path);
+- }
+- else {
+-
+- }
+-
+- rar_comm->odd_line = ! rar_comm->odd_line;
++ if (! rar_comm->rar5)
++ rar_comm->rar4_odd_line = ! rar_comm->rar4_odd_line;
+ }
+
+
+diff --git a/src/fr-command-rar.h b/src/fr-command-rar.h
+index d60e422..09ed270 100644
+--- a/src/fr-command-rar.h
++++ b/src/fr-command-rar.h
+@@ -42,7 +42,8 @@ struct _FrCommandRar
+ FrCommand __parent;
+
+ gboolean list_started;
+- gboolean odd_line;
++ gboolean rar4_odd_line;
++ gboolean rar5;
+ FileData *fdata;
+ };
+
+--
+1.8.3.2
+