summarylogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.SRCINFO40
-rw-r--r--PKGBUILD46
-rw-r--r--file-roller.install13
-rw-r--r--tmp-as-temp.patch79
4 files changed, 178 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 000000000000..9896e8e321a3
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,40 @@
+pkgbase = file-roller-tmp
+ pkgdesc = This version of file-roller puts temporary files in /tmp instead of ~/.cache and therefore reduces the amount of writes to SSDs.
+ pkgver = 3.16.3
+ pkgrel = 2
+ url = http://www.gnome.org
+ install = file-roller.install
+ arch = i686
+ arch = x86_64
+ groups = gnome-extra
+ license = GPL
+ makedepends = intltool
+ makedepends = pkg-config
+ makedepends = libnautilus-extension
+ makedepends = itstool
+ makedepends = docbook-xsl
+ depends = desktop-file-utils
+ depends = gtk3
+ depends = hicolor-icon-theme
+ depends = dconf
+ depends = libarchive
+ depends = file
+ depends = json-glib
+ depends = libnotify
+ depends = p7zip
+ depends = zip
+ depends = unzip
+ optdepends = unrar: better RAR archive support
+ optdepends = unace: ACE archive support
+ optdepends = lrzip: lrzip archive support
+ optdepends = cdrkit: ISO image support
+ provides = file-roller
+ conflicts = file-roller
+ options = !emptydirs
+ source = http://ftp.gnome.org/pub/gnome/sources/file-roller/3.16/file-roller-3.16.3.tar.xz
+ source = tmp-as-temp.patch
+ sha256sums = 2b3a1111caba26e67b96559a3118a700dbfb6a4c6ad7ebd3e509df227995411c
+ sha256sums = 9556742b38c06f131f7d56eb72522e38402a85ec99904be73ccae228f5b9572f
+
+pkgname = file-roller-tmp
+
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 000000000000..e79a734b1649
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,46 @@
+# $Id$
+# Maintainer: Kresimir Pripuzic <kpripuzic@gmail.com>
+
+pkgname=file-roller-tmp
+pkgver=3.16.3
+pkgrel=2
+pkgdesc="This version of file-roller puts temporary files in /tmp instead of ~/.cache and therefore reduces the amount of writes to SSDs."
+arch=('i686' 'x86_64')
+license=('GPL')
+depends=('desktop-file-utils' 'gtk3' 'hicolor-icon-theme' 'dconf' 'libarchive' 'file' 'json-glib' 'libnotify' 'p7zip'
+ 'zip' 'unzip')
+makedepends=('intltool' 'pkg-config' 'libnautilus-extension' 'itstool' 'docbook-xsl')
+optdepends=('unrar: better RAR archive support'
+ 'unace: ACE archive support'
+ 'lrzip: lrzip archive support'
+ 'cdrkit: ISO image support')
+groups=('gnome-extra')
+provides=('file-roller')
+conflicts=('file-roller')
+options=('!emptydirs')
+install=file-roller.install
+url="http://www.gnome.org"
+source=(http://ftp.gnome.org/pub/gnome/sources/${pkgname:0:11}/${pkgver:0:4}/${pkgname:0:11}-$pkgver.tar.xz
+ tmp-as-temp.patch)
+sha256sums=('2b3a1111caba26e67b96559a3118a700dbfb6a4c6ad7ebd3e509df227995411c'
+ '9556742b38c06f131f7d56eb72522e38402a85ec99904be73ccae228f5b9572f')
+
+prepare() {
+ cd ${pkgname:0:11}-$pkgver
+ patch -Np1 -i ../tmp-as-temp.patch
+}
+
+build() {
+ cd ${pkgname:0:11}-$pkgver
+
+ ./configure --prefix=/usr --sysconfdir=/etc \
+ --libexecdir=/usr/lib/file-roller \
+ --localstatedir=/var --disable-static \
+ --disable-schemas-compile
+ make
+}
+
+package() {
+ cd ${pkgname:0:11}-$pkgver
+ make DESTDIR="$pkgdir" install
+}
diff --git a/file-roller.install b/file-roller.install
new file mode 100644
index 000000000000..8b17fa3d4103
--- /dev/null
+++ b/file-roller.install
@@ -0,0 +1,13 @@
+post_install() {
+ glib-compile-schemas /usr/share/glib-2.0/schemas
+ update-desktop-database -q
+ gtk-update-icon-cache -q -t -f /usr/share/icons/hicolor
+}
+
+post_upgrade() {
+ post_install
+}
+
+post_remove() {
+ post_install
+}
diff --git a/tmp-as-temp.patch b/tmp-as-temp.patch
new file mode 100644
index 000000000000..ca592404b401
--- /dev/null
+++ b/tmp-as-temp.patch
@@ -0,0 +1,79 @@
+diff --git a/src/file-utils.c b/src/file-utils.c
+index 62a240e..35f23d9 100644
+--- a/src/file-utils.c
++++ b/src/file-utils.c
+@@ -52,26 +52,6 @@
+ /* path */
+
+
+-static const char *try_folder[] = { "cache", "~", "tmp", NULL };
+-
+-
+-static const char *
+-get_nth_temp_folder_to_try (int n)
+-{
+- const char *folder;
+-
+- folder = try_folder[n];
+- if (strcmp (folder, "cache") == 0)
+- folder = g_get_user_cache_dir ();
+- else if (strcmp (folder, "~") == 0)
+- folder = g_get_home_dir ();
+- else if (strcmp (folder, "tmp") == 0)
+- folder = g_get_tmp_dir ();
+-
+- return folder;
+-}
+-
+-
+ char *
+ _g_path_get_temp_work_dir (const char *parent_folder)
+ {
+@@ -82,24 +62,7 @@ _g_path_get_temp_work_dir (const char *parent_folder)
+ char *result = NULL;
+
+ if (parent_folder == NULL) {
+- /* find the folder with more free space. */
+-
+- for (i = 0; try_folder[i] != NULL; i++) {
+- const char *folder;
+- GFile *file;
+- guint64 size;
+-
+- folder = get_nth_temp_folder_to_try (i);
+- file = g_file_new_for_path (folder);
+- size = _g_file_get_free_space (file);
+- g_object_unref (file);
+-
+- if (max_size < size) {
+- max_size = size;
+- g_free (best_folder);
+- best_folder = g_strdup (folder);
+- }
+- }
++ best_folder = g_strdup (g_get_tmp_dir ());
+ }
+ else
+ best_folder = g_strdup (parent_folder);
+@@ -576,15 +539,13 @@ _g_file_is_temp_work_dir (GFile *file)
+ if (path[0] != '/')
+ return FALSE;
+
+- for (i = 0; try_folder[i] != NULL; i++) {
+- const char *folder;
+
+- folder = get_nth_temp_folder_to_try (i);
+- if (strncmp (path, folder, strlen (folder)) == 0) {
+- if (strncmp (path + strlen (folder), "/.fr-", 5) == 0) {
+- result = TRUE;
+- break;
+- }
++ const char *folder;
++
++ folder = g_strdup (g_get_tmp_dir ());
++ if (strncmp (path, folder, strlen (folder)) == 0) {
++ if (strncmp (path + strlen (folder), "/.fr-", 5) == 0) {
++ result = TRUE;
+ }
+ }
+