diff options
author | Connor Behan | 2015-06-08 18:41:46 -0400 |
---|---|---|
committer | Connor Behan | 2015-06-08 18:41:46 -0400 |
commit | 7bbb12c64936b0c786d5f0557380c361c0bfe2c8 (patch) | |
tree | f375b1dd4b4ad97611259b87a23c9135cfd74f35 | |
download | aur-7bbb12c64936b0c786d5f0557380c361c0bfe2c8.tar.gz |
Initial import
-rw-r--r-- | .SRCINFO | 33 | ||||
-rw-r--r-- | PKGBUILD | 58 | ||||
-rw-r--r-- | add-mime-types.patch | 17 | ||||
-rw-r--r-- | explicit-extension.patch | 88 | ||||
-rw-r--r-- | fix-password-protected.patch | 42 | ||||
-rw-r--r-- | fix-rpm-support.patch | 86 | ||||
-rw-r--r-- | xarchiver.install | 12 |
7 files changed, 336 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO new file mode 100644 index 000000000000..114b494606fd --- /dev/null +++ b/.SRCINFO @@ -0,0 +1,33 @@ +pkgbase = xarchiver-assume-name + pkgdesc = Xarchiver with the ability to archive directories without a name change + pkgver = 0.5.4 + pkgrel = 1 + url = http://xarchiver.sourceforge.net/ + install = xarchiver.install + arch = i686 + arch = x86_64 + groups = xfce4-goodies + license = GPL + makedepends = intltool + depends = gtk2 + depends = desktop-file-utils + optdepends = zip: ZIP support + optdepends = unzip: ZIP support + optdepends = p7zip: 7z support + optdepends = arj: ARJ support + optdepends = lzop: LZOP support + optdepends = cpio: RPM support + optdepends = unrar: RAR support + source = http://downloads.sourceforge.net/xarchiver/xarchiver-0.5.4.tar.bz2 + source = fix-rpm-support.patch + source = fix-password-protected.patch + source = add-mime-types.patch + source = explicit-extension.patch + md5sums = 1b4cd37a6af03afc957a8e307417e8d0 + md5sums = 812b93339f5e3332621f3c5abebfe277 + md5sums = 35ab96d98521a0a36f3e9e9ec0969107 + md5sums = 0cee887b3c989ba2cdce9154813843fb + md5sums = 5fb11bb9842f60dd29a0b3267c1ca804 + +pkgname = xarchiver-assume-name + diff --git a/PKGBUILD b/PKGBUILD new file mode 100644 index 000000000000..c819f0b3e2b1 --- /dev/null +++ b/PKGBUILD @@ -0,0 +1,58 @@ +# Contributor: Connor Behan <connor.behan@gmail.com> + +pkgname=xarchiver-assume-name +pkgver=0.5.4 +pkgrel=1 +pkgdesc="Xarchiver with the ability to archive directories without a name change" +arch=('i686' 'x86_64') +url="http://xarchiver.sourceforge.net/" +license=('GPL') +groups=('xfce4-goodies') +depends=('gtk2' 'desktop-file-utils') +makedepends=('intltool') +optdepends=('zip: ZIP support' + 'unzip: ZIP support' + 'p7zip: 7z support' + 'arj: ARJ support' + 'lzop: LZOP support' + 'cpio: RPM support' + 'unrar: RAR support') +install=xarchiver.install +source=(http://downloads.sourceforge.net/xarchiver/xarchiver-$pkgver.tar.bz2 + fix-rpm-support.patch + fix-password-protected.patch + add-mime-types.patch + explicit-extension.patch) + +prepare() { + cd xarchiver-$pkgver + + # Fix RPM support + patch -Np1 -i ../fix-rpm-support.patch + + # Fix segfault when handling password protected files + patch -Np1 -i ../fix-password-protected.patch + + # Add more MIME types in the desktop file + patch -Np1 -i ../add-mime-types.patch + + # Stop GTK filechooser from cding to a dir you want to archive + patch -Np1 -i ../explicit-extension.patch +} + +build() { + cd xarchiver-$pkgver + ./configure --prefix=/usr --libexecdir=/usr/lib/xfce4 + make +} + +package() { + cd xarchiver-$pkgver + make DESTDIR="$pkgdir" install +} + +md5sums=('1b4cd37a6af03afc957a8e307417e8d0' + '812b93339f5e3332621f3c5abebfe277' + '35ab96d98521a0a36f3e9e9ec0969107' + '0cee887b3c989ba2cdce9154813843fb' + '5fb11bb9842f60dd29a0b3267c1ca804') diff --git a/add-mime-types.patch b/add-mime-types.patch new file mode 100644 index 000000000000..ec427b99aeee --- /dev/null +++ b/add-mime-types.patch @@ -0,0 +1,17 @@ +diff -Naur xarchiver-0.5.3.orig/xarchiver.desktop.in xarchiver-0.5.3/xarchiver.desktop.in +--- xarchiver-0.5.3.orig/xarchiver.desktop.in 2014-05-12 01:08:12.159131913 +0000 ++++ xarchiver-0.5.3/xarchiver.desktop.in 2014-05-12 01:09:02.585526393 +0000 +@@ -4,11 +4,11 @@ + _Name=Xarchiver + _Comment=A GTK+2 only archive manager + _GenericName=Archive manager +-Exec=xarchiver ++Exec=xarchiver %f + Icon=xarchiver + Terminal=false + Type=Application + X-MultipleArgs=false + Categories=GTK;Archiving;Utility; + StartupNotify=true +-MimeType=application/x-arj;application/arj;application/x-bzip;application/x-bzip-compressed-tar;application/x-gzip;application/x-rar;application/x-rar-compressed;application/x-tar;application/x-zip;application/x-zip-compressed;application/zip;multipart/x-zip;application/x-7z-compressed;application/x-compressed-tar;application/x-bzip2;application/x-bzip2-compressed-tar; ++MimeType=application/x-arj;application/arj;application/x-bzip;application/x-bzip-compressed-tar;application/x-gzip;application/x-rar;application/x-rar-compressed;application/x-tar;application/x-zip;application/x-zip-compressed;application/zip;application/x-7z-compressed;application/x-compressed-tar;application/x-bzip2;application/x-bzip2-compressed-tar;application/x-lzma;application/x-lzma-compressed-tar;application/x-lzop;application/x-lzop-compressed-tar;application/x-xz;application/x-xz-compressed-tar;application/x-deb;application/x-rpm; diff --git a/explicit-extension.patch b/explicit-extension.patch new file mode 100644 index 000000000000..fe5bb70c7851 --- /dev/null +++ b/explicit-extension.patch @@ -0,0 +1,88 @@ +diff -rudp xarchiver-0.5.3.orig/src/new_dialog.c xarchiver-0.5.3/src/new_dialog.c +--- xarchiver-0.5.3.orig/src/new_dialog.c 2014-02-09 07:26:24.000000000 -0800 ++++ xarchiver-0.5.3/src/new_dialog.c 2014-02-21 19:41:06.000000000 -0800 +@@ -30,13 +30,34 @@ gchar *current_new_directory = NULL; + gint new_combo_box = -1; + gchar *ComboArchiveType; + ++void xa_change_archive_extension (GtkComboBox *combo_box, GtkWidget *xa_file_chooser) { ++ GList *Name; ++ gchar *path; ++ ++ Name = g_list_last(ArchiveType); ++ path = g_path_get_basename ( gtk_file_chooser_get_filename ( GTK_FILE_CHOOSER (xa_file_chooser) )); ++ ++ while (Name) ++ { ++ if (g_str_has_suffix(path, Name->data)) { ++ ComboArchiveType = gtk_combo_box_get_active_text (combo_box); ++ /* Replaces the valid extension present in the filename with the one just selected */ ++ gtk_file_chooser_set_current_name (GTK_FILE_CHOOSER (xa_file_chooser), g_strconcat(g_strndup(path, strlen(path) - strlen(Name->data)), ComboArchiveType, NULL)); ++ return; ++ } ++ Name = g_list_previous (Name); ++ } ++ ++ /* Appends the extension without taking anything out */ ++ gtk_file_chooser_set_current_name (GTK_FILE_CHOOSER (xa_file_chooser), g_strconcat(path, ComboArchiveType, NULL)); ++} ++ + XArchive *xa_new_archive_dialog (gchar *path, XArchive *archive_open[], gboolean flag) + { + XArchive *archive = NULL; + GtkWidget *xa_file_chooser; + GtkWidget *hbox = NULL; + GtkWidget *combo_box = NULL; +- GtkWidget *add_extension_cb = NULL; + GtkFileFilter *xa_new_archive_dialog_filter; + GtkTooltips *filter_tooltip; + GList *Suffix,*Name; +@@ -112,23 +133,25 @@ XArchive *xa_new_archive_dialog (gchar * + + gtk_box_pack_start (GTK_BOX (hbox), combo_box, TRUE, TRUE, 0); + +- add_extension_cb = gtk_check_button_new_with_label (_("Add the archive extension to the filename")); +- gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON(add_extension_cb),TRUE); +- gtk_box_pack_start (GTK_BOX (hbox), add_extension_cb, TRUE, TRUE, 0); + gtk_widget_show_all (hbox); + gtk_file_chooser_set_extra_widget (GTK_FILE_CHOOSER (xa_file_chooser), hbox); +- ++ ComboArchiveType = gtk_combo_box_get_active_text (GTK_COMBO_BOX (combo_box)); ++ g_signal_connect(G_OBJECT(combo_box), "changed", G_CALLBACK(xa_change_archive_extension), xa_file_chooser); ++ + if (path != NULL) + { + basepath = g_path_get_basename (path); +- gtk_file_chooser_set_current_name (GTK_FILE_CHOOSER (xa_file_chooser),basepath); ++ gtk_file_chooser_set_current_name (GTK_FILE_CHOOSER (xa_file_chooser), g_strconcat(basepath, ".", ComboArchiveType, NULL)); + + current_dir = g_get_current_dir (); + gtk_file_chooser_set_current_folder (GTK_FILE_CHOOSER (xa_file_chooser),current_dir); + + g_free (basepath); + g_free (current_dir); ++ } else { ++ gtk_file_chooser_set_current_name (GTK_FILE_CHOOSER (xa_file_chooser), g_strconcat(".", ComboArchiveType, NULL)); + } ++ + gtk_window_set_modal (GTK_WINDOW (xa_file_chooser),TRUE); + if (current_new_directory != NULL) + gtk_file_chooser_set_current_folder ( GTK_FILE_CHOOSER (xa_file_chooser),current_new_directory); +@@ -138,17 +161,6 @@ XArchive *xa_new_archive_dialog (gchar * + if (response == GTK_RESPONSE_ACCEPT) + { + my_path = gtk_file_chooser_get_filename ( GTK_FILE_CHOOSER (xa_file_chooser) ); +- ComboArchiveType = gtk_combo_box_get_active_text (GTK_COMBO_BOX (combo_box)); +- +- if ( gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (add_extension_cb))) +- { +- if ( ! g_str_has_suffix (my_path,ComboArchiveType)) +- { +- my_path_ext = g_strconcat (my_path, ".",ComboArchiveType,NULL); +- g_free (my_path); +- my_path = my_path_ext; +- } +- } + + if (xa_main_window) + { diff --git a/fix-password-protected.patch b/fix-password-protected.patch new file mode 100644 index 000000000000..00969349db01 --- /dev/null +++ b/fix-password-protected.patch @@ -0,0 +1,42 @@ +diff -Naur xarchiver-0.5.3.orig/src/window.c xarchiver-0.5.2/src/window.c +--- xarchiver-0.5.3.orig/src/window.c 2014-01-24 08:10:09.305990000 +0100 ++++ xarchiver-0.5.3/src/window.c 2014-01-24 08:42:45.110729290 +0100 +@@ -1694,7 +1694,7 @@ + { + if (archive->passwd == NULL) + { +- archive->passwd = xa_create_password_dialog(NULL); ++ archive->passwd = xa_create_password_dialog(archive); + if ( archive->passwd == NULL) + { + gtk_drag_finish (dc,FALSE,FALSE,t); +@@ -2702,9 +2702,12 @@ + + if (entry->is_encrypted) + { +- archive[idx]->passwd = xa_create_password_dialog(archive[idx]); + if (archive[idx]->passwd == NULL) +- return; ++ { ++ archive[idx]->passwd = xa_create_password_dialog(archive[idx]); ++ if (archive[idx]->passwd == NULL) ++ return; ++ } + } + filename = g_strconcat(archive[idx]->tmp,"/",entry->filename,NULL); + if (g_file_test(filename,G_FILE_TEST_EXISTS)) +@@ -2768,8 +2771,12 @@ + { + if (entry->is_encrypted) + { +- if (archive->passwd == NULL) +- return; ++ if (archive->passwd == NULL) ++ { ++ archive->passwd = xa_create_password_dialog(archive); ++ if (archive->passwd == NULL) ++ return; ++ } + } + if (archive->extraction_path) + { diff --git a/fix-rpm-support.patch b/fix-rpm-support.patch new file mode 100644 index 000000000000..cf17ff7385cb --- /dev/null +++ b/fix-rpm-support.patch @@ -0,0 +1,86 @@ +diff -Naur xarchiver-0.5.3.orig/src/rpm.c xarchiver-0.5.3/src/rpm.c +--- xarchiver-0.5.3.orig/src/rpm.c 2014-02-09 16:26:24.000000000 +0100 ++++ xarchiver-0.5.3/src/rpm.c 2014-02-19 07:54:27.744136749 +0100 +@@ -23,8 +23,11 @@ + + void xa_open_rpm (XArchive *archive) + { ++ unsigned char bytes[8]; + unsigned short int i; +- int response; ++ int dl,il,sigsize,offset,response; ++ gchar *ibs,*executable; ++ gchar *gzip_tmp = NULL; + GSList *list = NULL; + FILE *stream; + gboolean result; +@@ -53,14 +56,68 @@ + archive->column_types[i] = types[i]; + + xa_create_liststore (archive,names); ++ if (fseek ( stream, 104 , SEEK_CUR ) ) ++ { ++ fclose (stream); ++ response = xa_show_message_dialog (GTK_WINDOW (xa_main_window),GTK_DIALOG_MODAL,GTK_MESSAGE_ERROR,GTK_BUTTONS_OK,_("Can't fseek to position 104:"),g_strerror(errno)); ++ return; ++ } ++ if ( fread ( bytes, 1, 8, stream ) == 0 ) ++ { ++ fclose ( stream ); ++ response = xa_show_message_dialog (GTK_WINDOW (xa_main_window),GTK_DIALOG_MODAL,GTK_MESSAGE_ERROR,GTK_BUTTONS_OK,_("Can't read data from file:"),g_strerror(errno)); ++ return; ++ } ++ il = 256 * ( 256 * ( 256 * bytes[0] + bytes[1]) + bytes[2] ) + bytes[3]; ++ dl = 256 * ( 256 * ( 256 * bytes[4] + bytes[5]) + bytes[6] ) + bytes[7]; ++ sigsize = 8 + 16 * il + dl; ++ offset = 104 + sigsize + ( 8 - ( sigsize % 8 ) ) % 8 + 8; ++ if (fseek ( stream, offset , SEEK_SET ) ) ++ { ++ fclose (stream); ++ response = xa_show_message_dialog (GTK_WINDOW (xa_main_window),GTK_DIALOG_MODAL,GTK_MESSAGE_ERROR,GTK_BUTTONS_OK,_("Can't fseek in file:"),g_strerror(errno)); ++ return; ++ } ++ if ( fread ( bytes, 1, 8, stream ) == 0 ) ++ { ++ fclose ( stream ); ++ response = xa_show_message_dialog (GTK_WINDOW (xa_main_window),GTK_DIALOG_MODAL,GTK_MESSAGE_ERROR,GTK_BUTTONS_OK,_("Can't read data from file:"),g_strerror(errno)); ++ return; ++ } ++ il = 256 * ( 256 * ( 256 * bytes[0] + bytes[1]) + bytes[2] ) + bytes[3]; ++ dl = 256 * ( 256 * ( 256 * bytes[4] + bytes[5]) + bytes[6] ) + bytes[7]; ++ sigsize = 8 + 16 * il + dl; ++ offset = offset + sigsize; ++ fclose (stream); + + /* Create a unique temp dir in /tmp */ + result = xa_create_temp_directory (archive); + if (!result) + return; + ++ gzip_tmp = g_strconcat (archive->tmp,"/file.gz_bz",NULL); ++ ibs = g_strdup_printf ( "%u" , offset ); ++ + /* Now I run dd to have the bzip2 / gzip compressed cpio archive in /tmp */ +- gchar *command = g_strconcat ( "sh -c \"rpm2cpio ",archive->escaped_path," > ",archive->tmp, "/file.cpio\"",NULL); ++ gchar *command = g_strconcat ( "dd if=",archive->escaped_path," ibs=",ibs," skip=1 of=",gzip_tmp,NULL); ++ g_free (ibs); ++ list = g_slist_append(list,command); ++ batch_mode = TRUE; ++ result = xa_run_command (archive,list); ++ if (result == FALSE) ++ { ++ g_free (gzip_tmp); ++ return; ++ } ++ if (xa_detect_archive_type (gzip_tmp) == XARCHIVETYPE_GZIP) ++ executable = "gzip -dc "; ++ else if (xa_detect_archive_type (gzip_tmp) == XARCHIVETYPE_BZIP2) ++ executable = "bzip2 -dc "; ++ else ++ executable = "xz -dc "; ++ ++ command = g_strconcat("sh -c \"",executable,gzip_tmp," > ",archive->tmp,"/file.cpio\"",NULL); ++ g_free(gzip_tmp); + list = NULL; + list = g_slist_append(list,command); + result = xa_run_command (archive,list); diff --git a/xarchiver.install b/xarchiver.install new file mode 100644 index 000000000000..c317fbaca442 --- /dev/null +++ b/xarchiver.install @@ -0,0 +1,12 @@ +post_install() { + update-desktop-database -q + gtk-update-icon-cache -q -t -f usr/share/icons/hicolor +} + +post_upgrade() { + post_install +} + +post_remove() { + post_install +} |