summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Schlemmer <azarah@gentoo.org>2004-08-22 22:43:17 +0000
committerMartin Schlemmer <azarah@gentoo.org>2004-08-22 22:43:17 +0000
commite59c4fc66de1985af3359be71ffc41614bc9f62f (patch)
tree8743bb87b28973cc3869079421a83ef7f8061661 /app-admin/gamin
parentStable on sparc. (Manifest recommit) (diff)
downloadgentoo-2-e59c4fc66de1985af3359be71ffc41614bc9f62f.tar.gz
gentoo-2-e59c4fc66de1985af3359be71ffc41614bc9f62f.tar.bz2
gentoo-2-e59c4fc66de1985af3359be71ffc41614bc9f62f.zip
Add runtime-backend-select.patch to select between inotify/dnotify/poll at run
time. Add inotify header, and fixup build to use a local copy.
Diffstat (limited to 'app-admin/gamin')
-rw-r--r--app-admin/gamin/ChangeLog11
-rw-r--r--app-admin/gamin/Manifest5
-rw-r--r--app-admin/gamin/files/digest-gamin-0.0.6-r11
-rw-r--r--app-admin/gamin/files/gamin-0.0.6-inotify_h-include.patch11
-rw-r--r--app-admin/gamin/files/gamin-0.0.6-runtime-backend-select.patch121
-rw-r--r--app-admin/gamin/files/inotify-0.8.1.h74
-rw-r--r--app-admin/gamin/gamin-0.0.6-r1.ebuild57
7 files changed, 279 insertions, 1 deletions
diff --git a/app-admin/gamin/ChangeLog b/app-admin/gamin/ChangeLog
index bb9e400db138..fac1874dd8c1 100644
--- a/app-admin/gamin/ChangeLog
+++ b/app-admin/gamin/ChangeLog
@@ -1,6 +1,15 @@
# ChangeLog for app-admin/gamin
# Copyright 1999-2004 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/app-admin/gamin/ChangeLog,v 1.1 2004/08/19 21:44:45 azarah Exp $
+# $Header: /var/cvsroot/gentoo-x86/app-admin/gamin/ChangeLog,v 1.2 2004/08/22 22:43:17 azarah Exp $
+
+*gamin-0.0.6-r1 (23 Aug 2004)
+
+ 23 Aug 2004; Martin Schlemmer <azarah@gentoo.org>
+ +files/gamin-0.0.6-inotify_h-include.patch,
+ +files/gamin-0.0.6-runtime-backend-select.patch, +files/inotify-0.8.1.h,
+ +gamin-0.0.6-r1.ebuild:
+ Add runtime-backend-select.patch to select between inotify/dnotify/poll at run
+ time. Add inotify header, and fixup build to use a local copy.
*gamin-0.0.6 (19 Aug 2004)
diff --git a/app-admin/gamin/Manifest b/app-admin/gamin/Manifest
index 4a03f178eba1..b9d5a35b4a07 100644
--- a/app-admin/gamin/Manifest
+++ b/app-admin/gamin/Manifest
@@ -1,4 +1,9 @@
MD5 2847b07301ae44b9920bfcbd56211e6b ChangeLog 341
MD5 875135e8740bafa4dab79ee592cf9744 metadata.xml 279
MD5 b9cbe4aee62373ce44ff01b583afb639 gamin-0.0.6.ebuild 712
+MD5 5451bc8b0420f60fe54b9a16a836e7dd gamin-0.0.6-r1.ebuild 1207
MD5 59c722e7488d52801fe5b6df1cd6d48e files/digest-gamin-0.0.6 63
+MD5 14f8206ef4729b512f65d5f8d8b2da96 files/inotify-0.8.1.h 2465
+MD5 f52f7211e1d89b971993c4ad763b1dde files/gamin-0.0.6-inotify_h-include.patch 373
+MD5 beba31edee924b3c6c195cd2534cffd2 files/gamin-0.0.6-runtime-backend-select.patch 2940
+MD5 59c722e7488d52801fe5b6df1cd6d48e files/digest-gamin-0.0.6-r1 63
diff --git a/app-admin/gamin/files/digest-gamin-0.0.6-r1 b/app-admin/gamin/files/digest-gamin-0.0.6-r1
new file mode 100644
index 000000000000..8254b2729611
--- /dev/null
+++ b/app-admin/gamin/files/digest-gamin-0.0.6-r1
@@ -0,0 +1 @@
+MD5 8f8841ed896cd11a96ad2089ab7326b8 gamin-0.0.6.tar.gz 385972
diff --git a/app-admin/gamin/files/gamin-0.0.6-inotify_h-include.patch b/app-admin/gamin/files/gamin-0.0.6-inotify_h-include.patch
new file mode 100644
index 000000000000..bf65b20bac9a
--- /dev/null
+++ b/app-admin/gamin/files/gamin-0.0.6-inotify_h-include.patch
@@ -0,0 +1,11 @@
+--- gamin-0.0.6/server/gam_inotify.c 2004-08-23 00:16:20.821374728 +0200
++++ gamin-0.0.6.az/server/gam_inotify.c 2004-08-23 00:16:31.835700296 +0200
+@@ -27,7 +27,7 @@
+ #include <unistd.h>
+ #include <stdio.h>
+ #include <glib.h>
+-#include "/usr/src/linux/include/linux/inotify.h"
++#include "inotify.h"
+ #include "gam_error.h"
+ #include "gam_inotify.h"
+ #include "gam_tree.h"
diff --git a/app-admin/gamin/files/gamin-0.0.6-runtime-backend-select.patch b/app-admin/gamin/files/gamin-0.0.6-runtime-backend-select.patch
new file mode 100644
index 000000000000..3dd51c219512
--- /dev/null
+++ b/app-admin/gamin/files/gamin-0.0.6-runtime-backend-select.patch
@@ -0,0 +1,121 @@
+diff -urN gamin-0.0.6/server/gam_server.c gamin-0.0.6.az/server/gam_server.c
+--- gamin-0.0.6/server/gam_server.c 2004-08-19 12:54:45.000000000 +0200
++++ gamin-0.0.6.az/server/gam_server.c 2004-08-23 00:22:48.136493880 +0200
+@@ -41,6 +41,7 @@
+ #endif
+
+ static const char *session;
++static int gam_backend;
+
+ /**
+ * gam_shutdown:
+@@ -63,13 +64,36 @@
+ gboolean
+ gam_init_subscriptions(void)
+ {
++ gboolean ret;
++
++ gam_backend = 0;
++
+ #ifdef USE_INOTIFY
+- return (gam_inotify_init());
+-#elif linux
+- return (gam_dnotify_init());
+-#else
+- return (gam_poll_init());
++ if ((!gam_backend) && (ret = gam_inotify_init())) {
++ gam_backend = BACKEND_INOTIFY;
++ gam_debug(DEBUG_INFO, "Using INotify as backend\n");
++ return ret;
++ }
+ #endif
++#ifdef linux
++ if ((!gam_backend) && (ret = gam_dnotify_init())) {
++ gam_backend = BACKEND_DNOTIFY;
++ gam_debug(DEBUG_INFO, "Using DNotify as backend\n");
++ return ret;
++ }
++#endif
++ if (!gam_backend) {
++ ret = gam_poll_init();
++ if (ret) {
++ gam_backend = BACKEND_POLL;
++ gam_debug(DEBUG_INFO, "Using Poll as backend\n");
++ }
++ return ret;
++ }
++
++ gam_debug(DEBUG_INFO, "Cannot initialize any backend\n");
++
++ return FALSE;
+ }
+
+ /**
+@@ -113,13 +137,21 @@
+ return (gam_poll_add_subscription(sub));
+ }
+ ***/
++ switch (gam_backend) {
+ #ifdef USE_INOTIFY
+- return (gam_inotify_add_subscription(sub));
+-#elif linux
+- return (gam_dnotify_add_subscription(sub));
+-#else
+- return (gam_poll_add_subscription(sub));
++ case BACKEND_INOTIFY:
++ return (gam_inotify_add_subscription(sub));
++ break;
+ #endif
++#ifdef linux
++ case BACKEND_DNOTIFY:
++ return (gam_dnotify_add_subscription(sub));
++ break;
++#endif
++ case BACKEND_POLL:
++ return (gam_poll_add_subscription(sub));
++ break;
++ }
+ }
+
+ /**
+@@ -132,13 +164,21 @@
+ gboolean
+ gam_remove_subscription(GamSubscription * sub)
+ {
++ switch (gam_backend) {
+ #ifdef USE_INOTIFY
+- return (gam_inotify_remove_subscription(sub));
+-#elif linux
+- return (gam_dnotify_remove_subscription(sub));
+-#else
+- return (gam_poll_remove_subscription(sub));
++ case BACKEND_INOTIFY:
++ return (gam_inotify_remove_subscription(sub));
++ break;
++#endif
++#ifdef linux
++ case BACKEND_DNOTIFY:
++ return (gam_dnotify_remove_subscription(sub));
++ break;
+ #endif
++ case BACKEND_POLL:
++ return (gam_poll_remove_subscription(sub));
++ break;
++ }
+ }
+
+ /**
+diff -urN gamin-0.0.6/server/gam_server.h gamin-0.0.6.az/server/gam_server.h
+--- gamin-0.0.6/server/gam_server.h 2004-08-19 12:51:57.000000000 +0200
++++ gamin-0.0.6.az/server/gam_server.h 2004-08-23 00:20:01.420838512 +0200
+@@ -9,6 +9,10 @@
+ extern "C" {
+ #endif
+
++#define BACKEND_INOTIFY 1
++#define BACKEND_DNOTIFY 2
++#define BACKEND_POLL 3
++
+ gboolean gam_init_subscriptions (void);
+ gboolean gam_add_subscription (GamSubscription *sub);
+ gboolean gam_remove_subscription (GamSubscription *sub);
diff --git a/app-admin/gamin/files/inotify-0.8.1.h b/app-admin/gamin/files/inotify-0.8.1.h
new file mode 100644
index 000000000000..a6f9e86d7abf
--- /dev/null
+++ b/app-admin/gamin/files/inotify-0.8.1.h
@@ -0,0 +1,74 @@
+/*
+ * Inode based directory notification for Linux
+ *
+ * Copyright (C) 2004 John McCutchan
+ *
+ * Signed-off-by: John McCutchan ttb@tentacle.dhs.org
+ */
+
+#ifndef _LINUX_INOTIFY_H
+#define _LINUX_INOTIFY_H
+
+struct inode;
+struct dentry;
+struct super_block;
+
+struct inotify_event {
+ int wd;
+ int mask;
+ char filename[256];
+ /* When you are watching a directory you will get the filenames
+ * for events like IN_CREATE, IN_DELETE, IN_OPEN, IN_CLOSE, etc..
+ */
+};
+/* When reading from the device you must provide a buffer
+ * that is a multiple of the sizeof(inotify_event)
+ */
+
+#define IN_ACCESS 0x00000001 /* File was accessed */
+#define IN_MODIFY 0x00000002 /* File was modified */
+#define IN_CREATE 0x00000004 /* File was created */
+#define IN_DELETE 0x00000008 /* File was deleted */
+#define IN_RENAME 0x00000010 /* File was renamed */
+#define IN_ATTRIB 0x00000020 /* File changed attributes */
+#define IN_MOVE 0x00000040 /* File was moved */
+#define IN_UNMOUNT 0x00000080 /* Device file was on, was unmounted */
+#define IN_CLOSE 0x00000100 /* File was closed */
+#define IN_OPEN 0x00000200 /* File was opened */
+#define IN_IGNORED 0x00000400 /* File was ignored */
+#define IN_ALL_EVENTS 0xffffffff /* All the events */
+
+/* ioctl */
+
+/* Fill this and pass it to INOTIFY_WATCH ioctl */
+struct inotify_watch_request {
+ char *dirname; // directory name
+ unsigned long mask; // event mask
+};
+
+#define INOTIFY_IOCTL_MAGIC 'Q'
+#define INOTIFY_IOCTL_MAXNR 4
+
+#define INOTIFY_WATCH _IOR(INOTIFY_IOCTL_MAGIC, 1, struct inotify_watch_request)
+#define INOTIFY_IGNORE _IOR(INOTIFY_IOCTL_MAGIC, 2, int)
+#define INOTIFY_STATS _IOR(INOTIFY_IOCTL_MAGIC, 3, int)
+#define INOTIFY_SETDEBUG _IOR(INOTIFY_IOCTL_MAGIC, 4, int)
+
+#define INOTIFY_DEBUG_NONE 0x00000000
+#define INOTIFY_DEBUG_ALLOC 0x00000001
+#define INOTIFY_DEBUG_EVENTS 0x00000002
+#define INOTIFY_DEBUG_INODE 0x00000004
+#define INOTIFY_DEBUG_ERRORS 0x00000008
+#define INOTIFY_DEBUG_FILEN 0x00000010
+#define INOTIFY_DEBUG_ALL 0xffffffff
+
+/* Kernel API */
+/* Adds events to all watchers on inode that are interested in mask */
+void inotify_inode_queue_event (struct inode *inode, unsigned long mask, const char *filename);
+/* Same as above but uses dentry's inode */
+void inotify_dentry_parent_queue_event (struct dentry *dentry, unsigned long mask, const char *filename);
+/* This will remove all watchers from all inodes on the superblock */
+void inotify_super_block_umount (struct super_block *sb);
+
+#endif
+
diff --git a/app-admin/gamin/gamin-0.0.6-r1.ebuild b/app-admin/gamin/gamin-0.0.6-r1.ebuild
new file mode 100644
index 000000000000..44856f8c9997
--- /dev/null
+++ b/app-admin/gamin/gamin-0.0.6-r1.ebuild
@@ -0,0 +1,57 @@
+# Copyright 1999-2004 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/app-admin/gamin/gamin-0.0.6-r1.ebuild,v 1.1 2004/08/22 22:43:17 azarah Exp $
+
+inherit eutils
+
+INOTIFY_VER="0.8.1"
+
+DESCRIPTION="Library providing the FAM File Alteration Monitor API"
+HOMEPAGE="http://www.gnome.org/~veillard/gamin/"
+SRC_URI="http://www.gnome.org/~veillard/gamin/sources/${P}.tar.gz"
+
+LICENSE="LGPL-2"
+SLOT="0"
+KEYWORDS="~x86"
+IUSE=
+
+DEPEND="virtual/libc
+ >=dev-libs/glib-2.0
+ !app-admin/fam"
+
+PROVIDE="virtual/fam"
+
+src_unpack() {
+ unpack ${A}
+
+ cd ${S}/server
+ if [ -f "/usr/src/linux/include/linux/inotify.h" ]
+ then
+ cp /usr/src/linux/include/linux/inotify.h .
+ elif [ -f "/usr/include/linux/inotify.h" ]
+ then
+ cp /usr/include/linux/inotify.h .
+ else
+ cp "${FILESDIR}/inotify-${INOTIFY_VER}.h" inotify.h
+ fi
+
+ # Include our inotify.h
+ epatch ${FILESDIR}/${P}-inotify_h-include.patch
+ # Select the backend at runtime
+ epatch ${FILESDIR}/${P}-runtime-backend-select.patch
+}
+
+src_compile() {
+ econf --enable-inotify \
+ --enable-debug || die
+ # Enable debug for testing the runtime backend patch
+
+ # Currently not smp safe
+ emake || die "emake failed"
+}
+
+src_install() {
+ einstall || die
+
+ dodoc AUTHORS COPYING ChangeLog Copyright README TODO
+}