SFExfce-ristretto.spec: Initial spec + patches
authorkenmays
Thu, 09 Jun 2011 06:13:46 +0000
changeset 3505 9c9851c07943
parent 3504 aaf8d0784e4c
child 3506 704373dfdb8c
SFExfce-ristretto.spec: Initial spec + patches
ChangeLog
SFExfce-ristretto.spec
patches/mousepad-01-find-and-replace.diff
patches/ristretto-01-window.diff
patches/ristretto-02-string.diff
patches/ristretto-03-main.diff
patches/ristretto-04-makefile.diff
--- a/ChangeLog	Wed Jun 08 22:32:51 2011 +0000
+++ b/ChangeLog	Thu Jun 09 06:13:46 2011 +0000
@@ -1,3 +1,11 @@
+2011-06-09  Ken Mays  <[email protected]>
+
+	 * SFExfce-ristretto.spec: Initial spec
+	 * patches/ristretto-01-window.diff: Fix CLI dir open
+	 * patches/ristretto-03-main.diff: Add quit shortcut (q)
+	 * patches/ristretto-02-string.diff: Include string.h
+	 * patches/ristretto-04-makefile.diff: fix doc dir
+
 2010-06-08 Brian Cameron  <[email protected]>
 
 	* SFElibexo.spec: The gio directory is no longer built now that
@@ -25,6 +33,7 @@
 	  deleted+recreaed by other commiter)
 
 2011-06-08  Ken Mays  <[email protected]>
+
 	* SFEwine.spec: Modified for SFEgcc
 	* SFEinkscape: Added inkscape-01-combo.diff cluster patch
 	* SFEsupertuxkart.spec: Bump to 0.7.1b
@@ -34,6 +43,7 @@
 	* Added patches/mousepad-02-desktop.diff
 
 2011-06-07  Ken Mays  <[email protected]>
+
 	* SFEreadline.spec: Bumped to 6.2
 	* SFEpure-ftpd.spec: Bumped to 1.0.32
 	* SFEnasm.spec: Bumped to 2.10rc6
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/SFExfce-ristretto.spec	Thu Jun 09 06:13:46 2011 +0000
@@ -0,0 +1,72 @@
+#
+# spec file for package XFCE ristretto 
+#
+# by Ken Mays
+
+%include Solaris.inc
+
+%define src_name ristretto
+%define src_url http://archive.xfce.org/src/apps/ristretto/0.2/
+
+Name:           SFExfce-ristretto
+Summary:        Image Viewer
+Version:        0.0.93
+URL:            http://www.xfce.org/
+Source:         %{src_url}/%{src_name}-%{version}.tar.bz2
+SUNW_BaseDir:   %{_basedir}
+BuildRoot:      %{_tmppath}/%{name}-%{version}-build
+%include default-depend.inc
+BuildRequires:  SFElibxfcegui4 
+BuildRequires:  SUNWlibexif
+BuildRequires:  SFElibxfce4ui
+BuildRequires:  SFEthunar
+BuildRequires:  SFExfce4-dev-tools 
+Patch1: 	ristretto-01-window.diff
+Patch2:		ristretto-02-string.diff
+Patch3: 	ristretto-03-main.diff
+Patch4:		ristretto-04-makefile.diff
+ 
+%description
+Ristretto is a simple image viewer for Xfce
+
+%prep
+%setup -q -n %{src_name}-%{version}
+%patch1 -p1
+%patch2 -p1
+%patch3 -p1
+%patch4 -p1
+
+%build
+CPUS=`/usr/sbin/psrinfo | grep on-line | wc -l | tr -d ' '`
+if test "x$CPUS" = "x" -o $CPUS = 0; then
+  CPUS=1
+fi 
+
+./configure --prefix=%{_prefix}         \
+        --bindir=%{_bindir}             \
+        --libdir=%{_libdir}             \
+        --libexecdir=%{_libexecdir}     \
+        --datadir=%{_datadir}           \
+        --mandir=%{_mandir}             \
+        --sysconfdir=%{_sysconfdir}
+
+make -j $CPUS
+
+%install
+rm -rf $RPM_BUILD_ROOT
+make install DESTDIR=$RPM_BUILD_ROOT
+
+%clean
+rm -rf $RPM_BUILD_ROOT
+
+
+%files
+%defattr(-,root,bin)
+%{_bindir}/ristretto 
+%dir %attr (0755, root, sys) %{_datadir}
+%{_datadir}/applications/ristretto.desktop 
+%{_datadir}/icons/hicolor/*/apps/ristretto.* 
+ 
+%changelog
+* Thu Jun 9 2011 - Ken Mays <[email protected]>
+- Initial spec for Xfce ristretto 
--- a/patches/mousepad-01-find-and-replace.diff	Wed Jun 08 22:32:51 2011 +0000
+++ b/patches/mousepad-01-find-and-replace.diff	Thu Jun 09 06:13:46 2011 +0000
@@ -1,53 +1,68 @@
---- mousepad-0.2.16/src/search.c.orig	2011-06-08 17:25:56.659505600 -0400
-+++ mousepad-0.2.16/src/search.c	2011-06-08 17:53:40.881688100 -0400
-@@ -78,7 +78,9 @@
+--- mousepad-0.2.16/src/search.c.orig	2011-06-08 17:58:44.095184600 -0400
++++ mousepad-0.2.16/src/search.c	2011-06-09 00:26:05.511231000 -0400
+@@ -78,7 +78,7 @@
  static gint document_replace_real(StructData *sd)
  {
  	GtkTextIter iter, match_start, match_end;
 -	GtkTextMark *mark_init = NULL;
-+        GtkTextMark *mark_init = NULL, *mark_start, *mark_end;
-+               mark_start = gtk_text_buffer_create_mark(textbuffer, NULL, &match_start, FALSE);
-+               mark_end = gtk_text_buffer_create_mark(textbuffer, NULL, &match_end, FALSE);
++	GtkTextMark *mark_init = NULL, *mark_start, *mark_end;
  	gboolean res;
  	gint num = 0;
  	GtkWidget *q_dialog = NULL;
-@@ -122,6 +124,11 @@
+@@ -113,6 +113,11 @@
+ 				if (num == 0 && q_dialog == NULL)
+ 					q_dialog = create_dialog_message_question(
+ 						gtk_widget_get_toplevel(sd->mainwin->textview), _("Replace?"));
++
++				gtk_text_buffer_get_selection_bounds(textbuffer, &match_start, &match_end);
++				mark_start = gtk_text_buffer_create_mark(textbuffer, NULL, &match_start, FALSE);
++				mark_end = gtk_text_buffer_create_mark(textbuffer, NULL, &match_end, FALSE);
++
+ 				switch (gtk_dialog_run(GTK_DIALOG(q_dialog))) {
+ 				case GTK_RESPONSE_CANCEL:
+ 					res = 0;
+@@ -122,6 +127,11 @@
  				case GTK_RESPONSE_NO:
  					continue;
  				}
 +
-+			               gtk_text_buffer_get_iter_at_mark(textbuffer, &match_start, mark_start);
-+               				gtk_text_buffer_get_iter_at_mark(textbuffer, &match_end, mark_end);
-+              				 gtk_text_buffer_move_mark_by_name(textbuffer, "selection_bound",  &match_start);
-+               				gtk_text_buffer_move_mark_by_name(textbuffer, "insert", &match_end);
++				gtk_text_buffer_get_iter_at_mark(textbuffer, &match_start, mark_start);
++				gtk_text_buffer_get_iter_at_mark(textbuffer, &match_end, mark_end);
++				gtk_text_buffer_move_mark_by_name(textbuffer, "selection_bound", &match_start);
++				gtk_text_buffer_move_mark_by_name(textbuffer, "insert", &match_end);
  			}
  			gtk_text_buffer_delete_selection(textbuffer, TRUE, TRUE);
  			undo_set_sequency(TRUE);
-@@ -210,8 +217,11 @@
+@@ -210,8 +220,11 @@
  		G_CALLBACK(toggle_sensitivity), NULL);
  	 g_signal_connect(G_OBJECT(entry_find), "delete-text",
  		G_CALLBACK(toggle_sensitivity), NULL);
 -	 if (sd->search.string_find) 
--		 gtk_entry_set_text(GTK_ENTRY(entry_find), sd->search.string_find);
-+         if (sd->search.string_find) {
-+              gtk_entry_set_text(GTK_ENTRY(entry_find), sd->search.string_find);
-+               gtk_dialog_set_response_sensitive(GTK_DIALOG(dialog),
-+                 GTK_RESPONSE_OK, TRUE);
-+          }
++	 if (sd->search.string_find) {
+ 		 gtk_entry_set_text(GTK_ENTRY(entry_find), sd->search.string_find);
++		 gtk_dialog_set_response_sensitive(GTK_DIALOG(dialog),
++			GTK_RESPONSE_OK, TRUE);
++	 }
  
  	gtk_dialog_set_default_response(GTK_DIALOG(dialog), GTK_RESPONSE_OK);
  	gtk_entry_set_activates_default(GTK_ENTRY(entry_find), TRUE);
-@@ -275,8 +285,11 @@
+@@ -275,8 +288,11 @@
  		G_CALLBACK(toggle_sensitivity), NULL);
  	 g_signal_connect(G_OBJECT(entry_find), "delete-text",
  		G_CALLBACK(toggle_sensitivity), NULL);
 -	 if (sd->search.string_find) 
--		 gtk_entry_set_text(GTK_ENTRY(entry_find), sd->search.string_find);
-+         if (sd->search.string_find) {
-+            gtk_entry_set_text(GTK_ENTRY(entry_find), sd->search.string_find);
-+             gtk_dialog_set_response_sensitive(GTK_DIALOG(dialog),
-+               GTK_RESPONSE_OK, TRUE);
-+         }
++	 if (sd->search.string_find) {
+ 		 gtk_entry_set_text(GTK_ENTRY(entry_find), sd->search.string_find);
++		 gtk_dialog_set_response_sensitive(GTK_DIALOG(dialog),
++			GTK_RESPONSE_OK, TRUE);
++	}
  	label_replace = gtk_label_new_with_mnemonic(_("Re_place with: "));
  	 gtk_misc_set_alignment(GTK_MISC(label_replace), 0, 0.5);
  	 gtk_table_attach_defaults(GTK_TABLE(table), label_replace, 0, 1, 1, 2);
+@@ -371,3 +387,6 @@
+ 	
+ 	gtk_widget_destroy (dialog);
+ }
++ 
++
++
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/patches/ristretto-01-window.diff	Thu Jun 09 06:13:46 2011 +0000
@@ -0,0 +1,29 @@
+--- ristretto-0.0.93/src/main_window.c	2011-02-28 14:52:54.000000000 -0500
++++ ristretto-0.0.93/src/main_window.c.patched	2011-06-09 01:35:48.540929000 -0400
+@@ -399,6 +399,7 @@
+     GClosure        *leave_fullscreen_closure = g_cclosure_new_swap ((GCallback)gtk_window_unfullscreen, window, NULL);
+     GClosure        *next_image_closure = g_cclosure_new ((GCallback)cb_rstto_main_window_next_image, window, NULL);
+     GClosure        *previous_image_closure = g_cclosure_new ((GCallback)cb_rstto_main_window_previous_image, window, NULL);
++    GClosure        *quit_closure = g_cclosure_new ((GCallback)cb_rstto_main_window_quit, window, NULL);
+ 
+     guint navigationbar_position = 3;
+ 
+@@ -434,10 +435,12 @@
+     gtk_accel_group_connect_by_path (accel_group, "<Window>/unfullscreen", leave_fullscreen_closure);
+     gtk_accel_group_connect_by_path (accel_group, "<Window>/next-image", next_image_closure);
+     gtk_accel_group_connect_by_path (accel_group, "<Window>/previous-image", previous_image_closure);
++    gtk_accel_group_connect_by_path (accel_group, "<Window>/quit", quit_closure);
+     /* Set default accelerators */
+     gtk_accel_map_change_entry ("<Window>/unfullscreen", GDK_Escape, 0, FALSE);
+     gtk_accel_map_change_entry ("<Window>/next-image", GDK_Page_Down, 0, FALSE);
+     gtk_accel_map_change_entry ("<Window>/previous-image", GDK_Page_Up, 0, FALSE);
++    gtk_accel_map_change_entry ("<Window>/quit", GDK_q, 0, FALSE);
+ 
+     /* Create mergeid's for adding ui-components */
+     window->priv->recent_merge_id = gtk_ui_manager_new_merge_id (window->priv->ui_manager);
+@@ -2550,3 +2553,5 @@
+ 
+     return FALSE;
+ }
++
++
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/patches/ristretto-02-string.diff	Thu Jun 09 06:13:46 2011 +0000
@@ -0,0 +1,17 @@
+--- ristretto-0.0.93/src/thumbnailer.c.orig	2011-02-28 13:45:45.000000000 -0500
++++ ristretto-0.0.93/src/thumbnailer.c	2011-06-09 01:45:27.281438000 -0400
+@@ -18,6 +18,8 @@
+ 
+ #include <config.h>
+ 
++#include <string.h>
++
+ #include <glib.h>
+ #include <gtk/gtk.h>
+ #include <gio/gio.h>
+@@ -388,3 +390,5 @@
+ 
+                     
+ */
++
++
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/patches/ristretto-03-main.diff	Thu Jun 09 06:13:46 2011 +0000
@@ -0,0 +1,91 @@
+--- ristretto-0.0.93/src/main.c	2011-02-28 13:45:44.000000000 -0500
++++ ristretto-0.0.93/src/main.c	2011-06-09 01:55:15.806743500 -0400
+@@ -143,6 +143,7 @@
+ static gboolean
+ cb_rstto_open_files (RsttoOpenFiles *rof)
+ {
++    GFileType file_type;
+     GFile *file, *p_file, *child_file;
+     GFileInfo *file_info;
+     const gchar *content_type, *filename;
+@@ -156,7 +157,15 @@
+             file = g_file_new_for_commandline_arg (rof->argv[rof->iter]);
+             if (file)
+             {
+-                file_info = g_file_query_info (file, "standard::content-type", 0, NULL, NULL);
++                if (rof->open_entire_folder) 
++                {
++                    file_info = g_file_query_info (file, "standard::content-type,standard::type", 0, NULL, NULL);
++                }
++                else
++                {
++                    file_info = g_file_query_info (file, "standard::content-type", 0, NULL, NULL);
++                }
++
+                 if (file_info)
+                 {
+                     content_type = g_file_info_get_attribute_string (file_info, "standard::content-type");
+@@ -165,6 +174,29 @@
+                     {
+                         rstto_image_list_add_file (rof->image_list, file, NULL);
+                     }
++
++                    if (rof->open_entire_folder) 
++                    {
++                        file_type = g_file_info_get_file_type(file_info);
++                        if (file_type == G_FILE_TYPE_DIRECTORY)
++                        {
++                            file_enumarator = g_file_enumerate_children (file, "standard::*", 0, NULL, NULL);
++                            for(file_info = g_file_enumerator_next_file (file_enumarator, NULL, NULL); file_info != NULL; file_info = g_file_enumerator_next_file (file_enumarator, NULL, NULL))
++                            {
++                                filename = g_file_info_get_name (file_info);
++                                content_type  = g_file_info_get_content_type (file_info);
++                                child_file = g_file_get_child (file, filename);
++
++                                if (strncmp (content_type, "image/", 6) == 0)
++                                {
++                                    rstto_image_list_add_file (rof->image_list, child_file, NULL);
++                                }
++
++                                g_object_unref (child_file);
++                                g_object_unref (file_info);
++                            }
++                        }
++                    }
+                 }
+             }
+             rof->iter++;
+@@ -176,10 +208,11 @@
+         file = g_file_new_for_commandline_arg (rof->argv[rof->iter]);
+         if (file)
+         {
+-            file_info = g_file_query_info (file, "standard::content-type", 0, NULL, NULL);
++            file_info = g_file_query_info (file, "standard::content-type,standard::type", 0, NULL, NULL);
+             if (file_info)
+             {
+                 content_type = g_file_info_get_attribute_string (file_info, "standard::content-type");
++                file_type = g_file_info_get_file_type (file_info);
+ 
+                 if (strncmp (content_type, "image/", 6) == 0)
+                 {
+@@ -187,7 +220,13 @@
+                 }
+             }
+         }
+-        p_file = g_file_get_parent (file);
++        if (file_type != G_FILE_TYPE_DIRECTORY) {
++            p_file = g_file_get_parent (file);
++        }
++        else
++        {
++            p_file = file;
++        }
+         file_enumarator = g_file_enumerate_children (p_file, "standard::*", 0, NULL, NULL);
+         for(file_info = g_file_enumerator_next_file (file_enumarator, NULL, NULL); file_info != NULL; file_info = g_file_enumerator_next_file (file_enumarator, NULL, NULL))
+         {
+@@ -206,3 +245,5 @@
+     }
+     return FALSE;
+ }
++
++
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/patches/ristretto-04-makefile.diff	Thu Jun 09 06:13:46 2011 +0000
@@ -0,0 +1,17 @@
+--- ristretto-0.0.93/docs/manual/C/Makefile.am	2010-11-13 09:03:47.000000000 -0500
++++ ristretto-0.0.93/docs/manual/C/Makefile.am.patched	2011-06-09 01:29:36.016925500 -0400
+@@ -3,7 +3,7 @@
+ SUBDIRS = 					\
+ 	images
+ 
+-TARGET_DIR = $(datadir)/doc/ristretto/html/C
++TARGET_DIR = $(docdir)/html/C
+ STYLESHEET = ../ristretto.xsl
+ DOCUMENT = ristretto.xml
+ 
+@@ -64,3 +64,5 @@
+ 	-cp $(srcdir)/html/* $(distdir)/html
+ 
+ .PHONY: dist-hook-local
++
++