summaryrefslogtreecommitdiff
path: root/recipes/gpe-package
diff options
context:
space:
mode:
authorDenys Dmytriyenko <denis@denix.org>2009-03-17 14:32:59 -0400
committerDenys Dmytriyenko <denis@denix.org>2009-03-17 14:32:59 -0400
commit709c4d66e0b107ca606941b988bad717c0b45d9b (patch)
tree37ee08b1eb308f3b2b6426d5793545c38396b838 /recipes/gpe-package
parentfa6cd5a3b993f16c27de4ff82b42684516d433ba (diff)
rename packages/ to recipes/ per earlier agreement
See links below for more details: http://thread.gmane.org/gmane.comp.handhelds.openembedded/21326 http://thread.gmane.org/gmane.comp.handhelds.openembedded/21816 Signed-off-by: Denys Dmytriyenko <denis@denix.org> Acked-by: Mike Westerhof <mwester@dls.net> Acked-by: Philip Balister <philip@balister.org> Acked-by: Khem Raj <raj.khem@gmail.com> Acked-by: Marcin Juszkiewicz <hrw@openembedded.org> Acked-by: Koen Kooi <koen@openembedded.org> Acked-by: Frans Meulenbroeks <fransmeulenbroeks@gmail.com>
Diffstat (limited to 'recipes/gpe-package')
-rw-r--r--recipes/gpe-package/files/gpe-package2
-rw-r--r--recipes/gpe-package/files/sbin-and-no-suid-install.patch15
-rw-r--r--recipes/gpe-package/files/search.patch313
-rw-r--r--recipes/gpe-package/gpe-package-0.2/nostropts.patch15
-rw-r--r--recipes/gpe-package/gpe-package-0.2/use-filesel.patch51
-rw-r--r--recipes/gpe-package/gpe-package_0.2.bb12
-rw-r--r--recipes/gpe-package/gpe-package_0.3.bb23
-rw-r--r--recipes/gpe-package/gpe-package_0.4.bb22
8 files changed, 453 insertions, 0 deletions
diff --git a/recipes/gpe-package/files/gpe-package b/recipes/gpe-package/files/gpe-package
new file mode 100644
index 0000000000..2555dfb975
--- /dev/null
+++ b/recipes/gpe-package/files/gpe-package
@@ -0,0 +1,2 @@
+#!/bin/sh
+exec /usr/bin/gpe-su -c /usr/sbin/gpe-package
diff --git a/recipes/gpe-package/files/sbin-and-no-suid-install.patch b/recipes/gpe-package/files/sbin-and-no-suid-install.patch
new file mode 100644
index 0000000000..10a90f1d30
--- /dev/null
+++ b/recipes/gpe-package/files/sbin-and-no-suid-install.patch
@@ -0,0 +1,15 @@
+--- gpe-package-0.3/Makefile 2005-08-26 06:14:00.000000000 -0700
++++ gpe-package-0.3-oe/Makefile 2006-05-24 16:51:02.459320395 -0700
+@@ -52,9 +52,9 @@
+ mkdir -p $(DESTDIR)/CONTROL
+ sed -e s/VERSION/$(VERSION)/ < familiar/control > $(DESTDIR)/CONTROL/control
+ mkdir -p $(DESTDIR)/etc/gpe
+- mkdir -p $(DESTDIR)/$(PREFIX)/bin
+- $(INSTALL) -m 4755 $(PACKAGE) $(DESTDIR)$(PREFIX)/bin/$(PACKAGE)
+- $(STRIP) $(DESTDIR)$(PREFIX)/bin/$(PACKAGE)
++ mkdir -p $(DESTDIR)/$(PREFIX)/sbin
++ $(INSTALL) -m 0744 $(PACKAGE) $(DESTDIR)$(PREFIX)/sbin/$(PACKAGE)
++ $(STRIP) $(DESTDIR)$(PREFIX)/sbin/$(PACKAGE)
+ mkdir -p $(DESTDIR)$(PREFIX)/share/pixmaps
+ for i in $(PIXMAPS); do install -m 644 -D pixmaps/$$i $(DESTDIR)$(PREFIX)/share/pixmaps/$$i; done
+ mkdir -p $(DESTDIR)$(PREFIX)/share/applications
diff --git a/recipes/gpe-package/files/search.patch b/recipes/gpe-package/files/search.patch
new file mode 100644
index 0000000000..2a71c5339f
--- /dev/null
+++ b/recipes/gpe-package/files/search.patch
@@ -0,0 +1,313 @@
+--- /tmp/interface.c 2006-08-31 09:49:57.000000000 +0200
++++ gpe-package-0.3/interface.c 2006-08-31 09:50:20.855780000 +0200
+@@ -27,6 +27,10 @@
+ #include <locale.h>
+ #include <libintl.h>
+
++#ifdef ENABLE_PCRE
++#include <pcre.h>
++#endif
++
+ #define _(x) gettext(x)
+ #define N_(_x) (_x)
+
+@@ -55,11 +59,8 @@
+ #define MI_PACKAGES_APPLY 7
+ #define MI_FILTER_INST 8
+ #define MI_FILTER_NOTINST 9
+-#define MI_PACKAGES_INFO 10
+-
+-#define TREE_SHOW_ALL 0x00
+-#define TREE_SHOW_INST 0x01
+-#define TREE_SHOW_NOTINST 0x02
++#define MI_FILTER_SEARCH 10
++#define MI_PACKAGES_INFO 11
+
+ #define HELPMESSAGE "GPE-Package\nVersion " VERSION \
+ "\nGPE frontend for ipkg\n\nflorian@handhelds.org"
+@@ -79,7 +80,6 @@
+
+ static description_t *pkg_info = NULL;
+ static int pkg_count = 0;
+-static int tree_filter = TREE_SHOW_ALL;
+
+ int sock;
+ static pkcommand_t running_command = CMD_NONE;
+@@ -91,10 +91,12 @@
+ static GtkWidget *notebook;
+ static GtkWidget *txLog;
+ static GtkWidget *treeview;
++static GtkTreeModel *filter;
++static gchar *filter_term = NULL;
+ static GtkTreeStore *store = NULL;
+ static GtkToolItem *bApply;
+ static GtkWidget *miUpdate, *miSysUpgrade, *miSelectLocal, *miApply;
+-static GtkWidget *miFilterInst, *miFilterNotInst;
++static GtkWidget *miFilterInst, *miFilterNotInst, *miFilterSearch;
+ static GtkWidget *sbar;
+ GtkWidget *fMain;
+ static GtkWidget *dlgAction = NULL;
+@@ -102,10 +104,17 @@
+ static GtkTextBuffer *infobuffer = NULL;
+ static GtkWidget *mMain;
+
++#ifdef ENABLE_PCRE
++static gboolean is_regexp;
++#endif
+
+ /* some forwards */
+ gboolean get_pending_messages ();
+ void on_tree_filter_changed(GtkCheckMenuItem *menuitem, gpointer user_data);
++void on_tree_filter_search_changed (GtkCheckMenuItem *menuitem, gpointer user_data);
++gboolean filter_visible_func (GtkTreeModel *model, GtkTreeIter *iter, gpointer user_data);
++void set_filter_term (const gchar *text, gboolean regexp);
++void search_entry_activated (GtkEntry *entry, gpointer user_data);
+ void create_fMain (void);
+ void on_select_local(GtkButton *button, gpointer user_data);
+ void on_packages_update_clicked(GtkButton *button, gpointer user_data);
+@@ -125,8 +134,10 @@
+ { N_("/Packages/Show Insta_lled"), "", on_tree_filter_changed, MI_FILTER_INST , "<CheckItem>"},
+ { N_("/Packages/Show _Not Installed"), "", on_tree_filter_changed, MI_FILTER_NOTINST, "<CheckItem>"},
+ { N_("/_Packages/s2"), NULL , NULL, 0, "<Separator>"},
+- { N_("/Packages/Show _Info"), "<Control> I", on_package_info_clicked, MI_PACKAGES_INFO , "<Item>"},
++ { N_("/Packages/_Search"), "<Control> I", on_tree_filter_search_changed, MI_FILTER_SEARCH , "<CheckItem>"},
+ { N_("/_Packages/s3"), NULL , NULL, 0, "<Separator>"},
++ { N_("/Packages/Show _Info"), "<Control> I", on_package_info_clicked, MI_PACKAGES_INFO , "<Item>"},
++ { N_("/_Packages/s4"), NULL , NULL, 0, "<Separator>"},
+ { N_("/Packages/_Update lists"), "<Control> U", on_packages_update_clicked, MI_PACKAGES_UPDATE , "<Item>"},
+ { N_("/Packages/Upgrade _System"), "", on_system_update_clicked, MI_PACKAGES_UPGRADE, "<Item>"},
+ { N_("/_Packages/s3"), NULL , NULL, 0, "<Separator>"},
+@@ -215,10 +226,10 @@
+ GtkWidget *
+ progress_dialog (gchar * text, GdkPixbuf * pixbuf)
+ {
+-GtkWidget *window;
+-GtkWidget *label;
+-GtkWidget *image;
+-GtkWidget *hbox;
++ GtkWidget *window;
++ GtkWidget *label;
++ GtkWidget *image;
++ GtkWidget *hbox;
+
+ window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
+ hbox = gtk_hbox_new (FALSE, 0);
+@@ -227,6 +238,7 @@
+
+ gtk_window_set_type_hint (GTK_WINDOW (window),
+ GDK_WINDOW_TYPE_HINT_DIALOG);
++ gtk_window_set_title (GTK_WINDOW (window), _("Working"));
+
+ gtk_label_set_line_wrap (GTK_LABEL (label), TRUE);
+
+@@ -381,9 +393,9 @@
+
+ void update_tree(void)
+ {
+-guint id;
+-int i;
+-GtkTreeIter iter;
++ guint id;
++ int i;
++ GtkTreeIter iter;
+
+ id = gtk_statusbar_get_context_id(GTK_STATUSBAR(sbar),"upd");
+ gtk_statusbar_push(GTK_STATUSBAR(sbar),
+@@ -392,10 +404,6 @@
+ gtk_tree_store_clear(GTK_TREE_STORE(store));
+
+ for (i=0; i<pkg_count; i++) {
+- if (((tree_filter & TREE_SHOW_INST) && (pkg_info[i].status == SS_INSTALLED))
+- || ((tree_filter & TREE_SHOW_NOTINST) && (pkg_info[i].status != SS_INSTALLED)))
+- continue;
+-
+ gtk_tree_store_append (store, &iter, NULL);
+
+ gtk_tree_store_set (store, &iter,
+@@ -412,14 +420,137 @@
+
+ void on_tree_filter_changed(GtkCheckMenuItem *menuitem, gpointer user_data)
+ {
+- tree_filter =
+- !gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM(miFilterInst)) *
+- TREE_SHOW_INST +
+- !gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM(miFilterNotInst)) *
+- TREE_SHOW_NOTINST;
+- update_tree();
++ if (filter)
++ gtk_tree_model_filter_refilter (GTK_TREE_MODEL_FILTER (filter));
+ }
+
++gboolean filter_visible_func (GtkTreeModel *model, GtkTreeIter *iter, gpointer user_data)
++{
++ gboolean installed;
++ gboolean not_installed;
++ GValue value_installed = { 0, };
++ GValue value_name = { 0, };
++ const gchar *pkgname;
++
++ installed = gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM(miFilterInst));
++ not_installed = gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM(miFilterNotInst));
++
++ gtk_tree_model_get_value (model, iter, COL_INSTALLED, &value_installed);
++
++ if (g_value_get_boolean (&value_installed)) {
++ /* Package is installed */
++ if (!installed)
++ return FALSE;
++ } else {
++ /* Package is not installed */
++ if (!not_installed)
++ return FALSE;
++ }
++
++ if (!filter_term)
++ return TRUE;
++
++ gtk_tree_model_get_value (model, iter, COL_NAME, &value_name);
++
++ pkgname = g_value_get_string (&value_name);
++
++#ifdef ENABLE_PCRE
++ pcre *re;
++ gint ret;
++ const gchar *error;
++ gint error_offset;
++
++ if (is_regexp) {
++ re = pcre_compile (filter_term, 0, &error, &error_offset, NULL);
++
++ if (re) {
++ ret = pcre_exec (re, NULL, pkgname, strlen (pkgname), 0, 0, NULL, 0);
++
++ g_free (re);
++
++ if (ret >= 0) {
++ return TRUE;
++ }
++ }
++
++ return FALSE;
++ }
++#endif
++
++ if (strstr (pkgname, filter_term))
++ return TRUE;
++
++ return FALSE;
++}
++
++void set_filter_term (const gchar *text, gboolean regexp)
++{
++ if (filter_term) {
++ g_free (filter_term);
++ }
++
++ filter_term = g_strdup (text);
++
++#ifdef ENABLE_PCRE
++ is_regexp = regexp;
++#endif
++
++ gtk_tree_model_filter_refilter (GTK_TREE_MODEL_FILTER (filter));
++}
++
++void search_entry_activated (GtkEntry *entry, gpointer user_data)
++{
++ GtkDialog *dialog = user_data;
++
++ gtk_dialog_response (dialog, GTK_RESPONSE_ACCEPT);
++}
++
++void on_tree_filter_search_changed (GtkCheckMenuItem *menuitem, gpointer user_data)
++{
++ GtkWidget *dialog;
++ GtkWidget *entry;
++ const gchar *text;
++#ifdef ENABLE_PCRE
++ GtkWidget *checkbutton;
++#endif
++
++ if (gtk_check_menu_item_get_active (GTK_CHECK_MENU_ITEM (miFilterSearch))) {
++ dialog = gtk_dialog_new_with_buttons (_("Search term:"),
++ GTK_WINDOW (fMain),
++ GTK_DIALOG_DESTROY_WITH_PARENT,
++ GTK_STOCK_OK, GTK_RESPONSE_ACCEPT,
++ GTK_STOCK_CANCEL, GTK_RESPONSE_REJECT,
++ NULL);
++ entry = gtk_entry_new ();
++ g_signal_connect (G_OBJECT (entry), "activate", G_CALLBACK (search_entry_activated), dialog);
++ gtk_widget_show (entry);
++ gtk_container_add (GTK_CONTAINER (GTK_DIALOG (dialog)->vbox), entry);
++#ifdef ENABLE_PCRE
++ checkbutton = gtk_check_button_new_with_label (_("Regular expression"));
++ gtk_widget_show (checkbutton);
++ gtk_container_add (GTK_CONTAINER (GTK_DIALOG (dialog)->vbox), checkbutton);
++#endif
++ if (gtk_dialog_run (GTK_DIALOG (dialog)) == GTK_RESPONSE_ACCEPT) {
++ text = gtk_entry_get_text (GTK_ENTRY (entry));
++ if (strlen (text)) {
++#ifdef ENABLE_PCRE
++ set_filter_term (text, gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (checkbutton)));
++#else
++ set_filter_term (text, FALSE);
++#endif
++ } else {
++ gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (miFilterSearch), FALSE);
++ }
++ } else {
++ gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (miFilterSearch), FALSE);
++ }
++ gtk_widget_destroy (dialog);
++ } else {
++ set_filter_term (NULL, FALSE);
++ }
++
++
++}
+
+ void on_about_clicked (GtkWidget * w)
+ {
+@@ -740,9 +871,9 @@
+
+ void on_package_info_clicked(GtkButton *button, gpointer user_data)
+ {
+-GtkTreeIter iter;
+-GtkTreeSelection *sel;
+-char *name = NULL;
++ GtkTreeIter iter;
++ GtkTreeSelection *sel;
++ char *name = NULL;
+
+ sel = gtk_tree_view_get_selection(GTK_TREE_VIEW(treeview));
+
+@@ -848,7 +979,7 @@
+ selection = gtk_tree_view_get_selection (treeview);
+ if (gtk_tree_selection_get_selected (selection, NULL, &iter) == FALSE)
+ return FALSE;
+- gtk_tree_model_get (GTK_TREE_MODEL (store), &iter, COL_VERSION, &version, -1);
++ gtk_tree_model_get (GTK_TREE_MODEL (filter), &iter, COL_VERSION, &version, -1);
+ gtk_statusbar_push(GTK_STATUSBAR(sbar),0,version);
+
+ return TRUE;
+@@ -882,6 +1013,8 @@
+ MI_FILTER_INST);
+ miFilterNotInst = gtk_item_factory_get_item_by_action(itemfactory,
+ MI_FILTER_NOTINST);
++ miFilterSearch = gtk_item_factory_get_item_by_action(itemfactory,
++ MI_FILTER_SEARCH);
+
+ gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(miFilterInst),TRUE);
+ gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(miFilterNotInst),TRUE);
+@@ -984,7 +1117,9 @@
+ gtk_box_pack_start(GTK_BOX(vbox), cur, TRUE, TRUE, 0);
+
+ /* packages tree */
+- treeview = gtk_tree_view_new_with_model (GTK_TREE_MODEL (store));
++ filter = gtk_tree_model_filter_new (GTK_TREE_MODEL (store), NULL);
++ gtk_tree_model_filter_set_visible_func (GTK_TREE_MODEL_FILTER (filter), filter_visible_func, NULL, NULL);
++ treeview = gtk_tree_view_new_with_model (GTK_TREE_MODEL (filter));
+ gtk_tree_view_set_reorderable(GTK_TREE_VIEW(treeview),FALSE);
+ gtk_tree_view_set_rules_hint (GTK_TREE_VIEW(treeview),TRUE);
+ gtk_container_add(GTK_CONTAINER(cur),treeview);
+
diff --git a/recipes/gpe-package/gpe-package-0.2/nostropts.patch b/recipes/gpe-package/gpe-package-0.2/nostropts.patch
new file mode 100644
index 0000000000..907f3017ef
--- /dev/null
+++ b/recipes/gpe-package/gpe-package-0.2/nostropts.patch
@@ -0,0 +1,15 @@
+
+#
+# Patch managed by http://www.mn-logistik.de/unsupported/pxa250/patcher
+#
+
+--- gpe-package-0.2/interface.c~nostropts 2004-10-19 18:33:19.000000000 -0400
++++ gpe-package-0.2/interface.c 2005-01-04 15:14:08.587136384 -0500
+@@ -18,7 +18,6 @@
+ #include <unistd.h>
+ #include <dirent.h>
+ #include <fcntl.h>
+-#include <stropts.h>
+ #include <poll.h>
+ #include <sys/types.h>
+ #include <sys/socket.h>
diff --git a/recipes/gpe-package/gpe-package-0.2/use-filesel.patch b/recipes/gpe-package/gpe-package-0.2/use-filesel.patch
new file mode 100644
index 0000000000..c25b9b1022
--- /dev/null
+++ b/recipes/gpe-package/gpe-package-0.2/use-filesel.patch
@@ -0,0 +1,51 @@
+diff -urNd ../gpe-package-0.2-r0/gpe-package-0.2/Makefile gpe-package-0.2/Makefile
+--- ../gpe-package-0.2-r0/gpe-package-0.2/Makefile 2004-10-20 09:37:58 +01:00
++++ gpe-package-0.2/Makefile 2004-12-24 20:57:02 +00:00
+@@ -18,7 +18,7 @@
+ BUILD = build
+ endif
+
+-MEMBERS = main interface packages filechooser feededit
++MEMBERS = main interface packages filesel feededit
+
+ ifeq ($(DEBUG),yes)
+ CFLAGS += -g -DDEBUG
+diff -urNd ../gpe-package-0.2-r0/gpe-package-0.2/filesel.c gpe-package-0.2/filesel.c
+--- ../gpe-package-0.2-r0/gpe-package-0.2/filesel.c 2003-11-28 23:50:10 +00:00
++++ gpe-package-0.2/filesel.c 2004-12-24 21:14:38 +00:00
+@@ -81,20 +81,18 @@
+ }
+
+
+-void
++/*void
+ ask_user_a_file (char *path, char *prompt,
+ void (*File_Selected) (char *filename, gpointer data),
+- void (*Cancel) (gpointer data), gpointer data)
++ void (*Cancel) (gpointer data), gpointer data)*/
++int package_choose(GtkWidget *parent, void (*File_Selected) (char *filename, gpointer data))
+ {
+ char buf[1024];
+ char *ret = getcwd (buf, 1024);
+
+- if (path) // this is a hack, we're all waiting a gtk_file_selection_change_directory().. (TODO)
+- chdir (path);
+ {
+ GtkWidget *fileselection1 =
+- gtk_file_selection_new (prompt ? prompt :
+- _("Select File"));
++ gtk_file_selection_new (_("Choose packages"));
+ GtkWidget *ok_button1 =
+ GTK_FILE_SELECTION (fileselection1)->ok_button;
+ GtkWidget *cancel_button1 =
+@@ -110,8 +108,8 @@
+ chdir (buf);
+ s->fs = fileselection1;
+ s->File_Selected = File_Selected;
+- s->Cancel = Cancel;
+- s->data = data;
++ s->Cancel = NULL;
++ s->data = NULL;
+
+ GTK_WINDOW (fileselection1)->type = GTK_WINDOW_TOPLEVEL;
+
diff --git a/recipes/gpe-package/gpe-package_0.2.bb b/recipes/gpe-package/gpe-package_0.2.bb
new file mode 100644
index 0000000000..ff85a33ec0
--- /dev/null
+++ b/recipes/gpe-package/gpe-package_0.2.bb
@@ -0,0 +1,12 @@
+LICENSE = "GPL"
+PR = "r2"
+inherit gpe pkgconfig
+
+DESCRIPTION = "A package manager GUI for GPE"
+DEPENDS = "ipkg libgpewidget"
+RDEPENDS = "gpe-icons"
+SECTION = "gpe"
+PRIORITY = "optional"
+
+SRC_URI += "file://use-filesel.patch;patch=1 \
+ file://nostropts.patch;patch=1"
diff --git a/recipes/gpe-package/gpe-package_0.3.bb b/recipes/gpe-package/gpe-package_0.3.bb
new file mode 100644
index 0000000000..1ee7a9a2ff
--- /dev/null
+++ b/recipes/gpe-package/gpe-package_0.3.bb
@@ -0,0 +1,23 @@
+LICENSE = "GPL"
+PR = "r3"
+inherit gpe pkgconfig
+
+DESCRIPTION = "A package manager GUI for GPE"
+DEPENDS = "ipkg libpcre libgpewidget"
+RDEPENDS = "gpe-icons gpe-su"
+SECTION = "gpe"
+PRIORITY = "optional"
+
+SRC_URI += " file://sbin-and-no-suid-install.patch;patch=1 \
+ file://search.patch;patch=1 \
+ file://gpe-package"
+
+FILES_${PN} += " /usr/bin/gpe-package"
+
+CFLAGS += "-DENABLE_PCRE"
+LDFLAGS += "-lpcre"
+
+do_install_append() {
+ install -d ${D}${bindir}
+ install -m 0755 ${WORKDIR}/gpe-package ${D}${bindir}
+}
diff --git a/recipes/gpe-package/gpe-package_0.4.bb b/recipes/gpe-package/gpe-package_0.4.bb
new file mode 100644
index 0000000000..65b4ac138b
--- /dev/null
+++ b/recipes/gpe-package/gpe-package_0.4.bb
@@ -0,0 +1,22 @@
+LICENSE = "GPL"
+PR = "r0"
+inherit gpe pkgconfig
+
+DESCRIPTION = "A package manager GUI for GPE"
+DEPENDS = "ipkg libpcre libgpewidget"
+RDEPENDS = "gpe-icons gpe-su"
+SECTION = "gpe"
+PRIORITY = "optional"
+
+SRC_URI += " file://sbin-and-no-suid-install.patch;patch=1 \
+ file://gpe-package"
+
+FILES_${PN} += " /usr/bin/gpe-package"
+
+CFLAGS += "-DENABLE_PCRE"
+LDFLAGS += "-lpcre"
+
+do_install_append() {
+ install -d ${D}${bindir}
+ install -m 0755 ${WORKDIR}/gpe-package ${D}${bindir}
+}