[Midnightbsd-cvs] mports: devel/fam: add fam

laffer1 at midnightbsd.org laffer1 at midnightbsd.org
Thu Sep 25 15:03:52 EDT 2008


Log Message:
-----------
add fam

Added Files:
-----------
    mports/devel/fam:
        Makefile (r1.1)
        distinfo (r1.1)
        pkg-descr (r1.1)
        pkg-plist (r1.1)
    mports/devel/fam/files:
        mntent.h (r1.1)
        mntent_compat.c++ (r1.1)
        patch-configure.in (r1.1)
        patch-fam-Listener.c++ (r1.1)
        patch-fam-Log.c++ (r1.1)
        patch-fam::SmallTable.h (r1.1)
        patch-fam_Directory.c++ (r1.1)
        patch-fam_DirectoryScanner.c++ (r1.1)
        patch-fam_DirectoryScanner.h (r1.1)
        patch-fam_FileSystem.c++ (r1.1)
        patch-fam_FileSystemTable.c++ (r1.1)
        patch-fam_Makefile.am (r1.1)
        patch-fam_StringTable.h (r1.1)
        patch-include::BTree.h (r1.1)
        pkg-message.in (r1.1)

-------------- next part --------------
--- /dev/null
+++ devel/fam/pkg-descr
@@ -0,0 +1,4 @@
+FAM, the File Alteration Monitor, provides an API which applications can use
+to be notified when specific files or directories are changed.
+
+WWW: http://oss.sgi.com/projects/fam/
--- /dev/null
+++ devel/fam/pkg-plist
@@ -0,0 +1,9 @@
+bin/fam
+etc/fam.conf
+include/fam.h
+lib/libfam.a
+lib/libfam.la
+lib/libfam.so
+lib/libfam.so.0
+ at comment For non-standard prefixes
+ at rmtry libdata/ldconfig/fam
--- /dev/null
+++ devel/fam/Makefile
@@ -0,0 +1,41 @@
+# ports collection makefile for:	fam
+# Date created:				20 February 2001
+# Whom:					Jeremy Norris <ishmael27 at home.com>
+#
+# $MidnightBSD: mports/devel/fam/Makefile,v 1.1 2008/09/25 19:03:49 laffer1 Exp $
+# $FreeBSD: ports/devel/fam/Makefile,v 1.35 2008/08/20 00:56:36 ade Exp $
+#
+
+PORTNAME=	fam
+PORTVERSION=	2.6.10
+CATEGORIES=	devel
+MASTER_SITES=	ftp://oss.sgi.com/projects/fam/download/
+DIST_SUBDIR=	${PORTNAME}
+
+MAINTAINER=	ports at MidnightBSD.org
+COMMENT=	A file alteration monitor
+LICENSE=	gpl2
+
+CFLAGS+=	-Wno-deprecated
+
+USE_AUTOTOOLS=	aclocal:19 automake:19 autoconf:262 libtool:15
+AUTOMAKE_ARGS=	-c -a
+USE_GMAKE=	yes
+USE_GNOME=	gnometarget
+USE_LDCONFIG=	yes
+ACLOCAL_ARGS=	-I "${ACLOCAL_DIR}" -I ${LOCALBASE}/share/aclocal
+SUB_FILES=	pkg-message
+
+MAN1=		fam.1m
+MAN3=		fam.3x
+
+CONFLICTS=	gamin-[0-9]*
+
+pre-configure:
+	@${RM} -fr ${WRKSRC}/util
+	@${MV} ${WRKSRC}/Makefile.am ${WRKSRC}/Makefile.am.orig
+	@${SED} -e s/util// -e /SUBDIRS/q \
+		<${WRKSRC}/Makefile.am.orig >${WRKSRC}/Makefile.am
+	@${CP} ${FILESDIR}/mntent* ${WRKSRC}/fam
+
+.include <bsd.port.mk>
--- /dev/null
+++ devel/fam/distinfo
@@ -0,0 +1,3 @@
+MD5 (fam/fam-2.6.10.tar.gz) = 1c5a2ea659680bdd1e238d7828a857a7
+SHA256 (fam/fam-2.6.10.tar.gz) = 885ced3480aef3cee519a459a572e31cd2fd5e24bcd35b1d0c8833361699026e
+SIZE (fam/fam-2.6.10.tar.gz) = 321189
--- /dev/null
+++ devel/fam/files/patch-fam_Makefile.am
@@ -0,0 +1,10 @@
+--- fam/Makefile.am.orig	Fri Aug 11 22:29:03 2006
++++ fam/Makefile.am	Fri Aug 11 22:29:18 2006
+@@ -72,6 +72,7 @@
+   main.c++ \
+   timeval.c++ \
+   timeval.h \
++  mntent_compat.c++ \
+   @IMON_FUNCS at .c++
+ 
+ EXTRA_fam_SOURCES = IMonIrix.c++ IMonLinux.c++ IMonNone.c++
--- /dev/null
+++ devel/fam/files/mntent_compat.c++
@@ -0,0 +1,174 @@
+/*
+ * Copyright (c) 1980, 1989, 1993, 1994
+ *      The Regents of the University of California.  All rights reserved.
+ * Copyright (c) 2001
+ *      David Rufino <daverufino at btinternet.com>
+ * Copyright (c) 2006
+ *      Stanislav Sedov <ssedov at mbsd.msk.ru>
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ *    must display the following acknowledgement:
+ *      This product includes software developed by the University of
+ *      California, Berkeley and its contributors.
+ * 4. Neither the name of the University nor the names of its contributors
+ *    may be used to endorse or promote products derived from this software
+ *    without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+/* most of this was ripped from the mount(3) source */
+
+#include "config.h"
+#include "mntent.h"
+#include <stdlib.h>
+#include <string.h>
+#include <sys/param.h>
+#include <sys/ucred.h>
+#include <sys/mount.h>
+
+static int pos = -1;
+static int mntsize = -1;
+static struct mntent _mntent;
+
+struct {
+	int		m_flag;
+	const char	*m_option;
+} mntoptions[] = {
+	{ MNT_ASYNC,		"async" },
+	{ MNT_NOATIME,		"noatime"},
+	{ MNT_NOEXEC,		"noexec"},
+	{ MNT_NOSUID,		"nosuid"},
+	{ MNT_NOSYMFOLLOW,	"nosymfollow"},
+	{ MNT_SYNCHRONOUS,	"sync"},
+	{ MNT_UNION,		"union"},
+	{ MNT_NOCLUSTERR,	"noclusterr"},
+	{ MNT_NOCLUSTERW,	"noclusterw"},
+	{ MNT_SUIDDIR,		"suiddir"},
+#ifdef MNT_SNAPSHOT
+	{ MNT_SNAPSHOT,		"snapshot"},
+#endif
+#ifdef MNT_MULTILABEL
+	{ MNT_MULTILABEL,	"multilabel"},
+#endif
+#ifdef MNT_ACLS
+	{ MNT_ACLS,		"acls"},
+#endif
+#ifdef MNT_NODEV
+	{ MNT_NODEV,		"nodev"},
+#endif
+};
+
+#define N_OPTS (sizeof(mntoptions) / sizeof(*mntoptions))
+
+char *
+hasmntopt (const struct mntent *mnt, const char *option)
+{
+	int found;
+	char *opt, *optbuf;
+
+	optbuf = strdup(mnt->mnt_opts);
+	found = 0;
+	for (opt = optbuf; (opt = strtok(opt, " ")) != NULL; opt = NULL) {
+		if (!strcasecmp(opt, option)) {
+			opt = opt - optbuf + mnt->mnt_opts;
+			free (optbuf);
+			return (opt);
+		}
+	}
+	free (optbuf);
+	return (NULL);
+}
+
+static char *
+catopt (char *s0, const char *s1)
+{
+	size_t newlen;
+	char *cp;
+
+	if (s1 == NULL || *s1 == '\0')
+		return s0;
+
+	if (s0 != NULL) {
+		newlen = strlen(s0) + strlen(s1) + 1 + 1;
+		if ((cp = (char *)realloc(s0, newlen)) == NULL)
+			return (NULL);
+
+		(void)strcat(cp, " ");
+		(void)strcat(cp, s1);
+	} else
+		cp = strdup(s1);
+
+	return (cp);
+}
+
+
+static char *
+flags2opts (int flags)
+{
+	char *res = NULL;
+	int i;
+
+	res = catopt(res, (flags & MNT_RDONLY) ? "ro" : "rw");
+
+	for (i = 0; i < N_OPTS; i++)
+		if (flags & mntoptions[i].m_flag)
+			res = catopt(res, mntoptions[i].m_option);
+	return res;
+}
+
+static struct mntent *
+statfs_to_mntent (struct statfs *mntbuf)
+{
+	static char opts_buf[40], *tmp;
+	
+	_mntent.mnt_fsname = mntbuf->f_mntfromname;
+	_mntent.mnt_dir = mntbuf->f_mntonname;
+	_mntent.mnt_type = mntbuf->f_fstypename;
+	tmp = flags2opts (mntbuf->f_flags);
+	if (tmp) {
+		opts_buf[sizeof(opts_buf) - 1] = '\0';
+		strncpy (opts_buf, tmp, sizeof(opts_buf)-1);
+		free (tmp);
+	} else {
+		*opts_buf = '\0';
+	}
+	_mntent.mnt_opts = opts_buf;	
+	_mntent.mnt_freq = _mntent.mnt_passno = 0;
+	return (&_mntent);
+}
+
+struct mntent *
+getmntent (FILE *fp)
+{
+	struct statfs *mntbuf;
+
+	if (pos == -1 || mntsize == -1)
+		mntsize = getmntinfo (&mntbuf, MNT_NOWAIT);
+
+	++pos;
+	if (pos == mntsize) {
+		pos = mntsize = -1;
+		return (NULL);
+	}
+
+	return (statfs_to_mntent (&mntbuf[pos]));
+}
--- /dev/null
+++ devel/fam/files/patch-include::BTree.h
@@ -0,0 +1,56 @@
+--- include/BTree.h.orig	Tue Jul 16 14:23:25 2002
++++ include/BTree.h	Sat Jul 31 13:13:24 2004
+@@ -236,7 +236,7 @@
+ //  to the right and returns them.
+ 
+ template <class Key, class Value>
+-BTree<Key, Value>::Closure
++typename BTree<Key, Value>::Closure
+ BTree<Key, Value>::Node::remove(unsigned j)
+ {
+     Key k = key[j];
+@@ -348,7 +348,7 @@
+ }
+ 
+ template <class Key, class Value>
+-BTree<Key, Value>::Closure
++typename BTree<Key, Value>::Closure
+ BTree<Key, Value>::Node::next(const Key& pred) const
+ {
+     if (!this)
+@@ -404,7 +404,7 @@
+ //  nodes as necessary on the way back.
+ 
+ template <class Key, class Value>
+-BTree<Key, Value>::Closure
++typename BTree<Key, Value>::Closure
+ BTree<Key, Value>::insert(Node *p, const Key& key, const Value& value)
+ {
+     if (!p) return Closure(key, value, NULL);
+@@ -499,7 +499,7 @@
+ //  Returns UNDER if node p is too small afterward, OK otherwise.
+ 
+ template <class Key, class Value>
+-BTree<Key, Value>::Status
++typename BTree<Key, Value>::Status
+ BTree<Key, Value>::underflow(Node *p, unsigned i)
+ {
+     assert(p);
+@@ -557,7 +557,7 @@
+ 
+ 
+ template <class Key, class Value>
+-BTree<Key, Value>::Closure
++typename BTree<Key, Value>::Closure
+ BTree<Key, Value>::remove_rightmost(Node *p)
+ {
+     int i = p->n;
+@@ -587,7 +587,7 @@
+ //  back up.
+ 
+ template <class Key, class Value>
+-BTree<Key, Value>::Status
++typename BTree<Key, Value>::Status
+ BTree<Key, Value>::remove(Node *p, const Key& key)
+ {
+     if (!p)
--- /dev/null
+++ devel/fam/files/patch-fam_FileSystem.c++
@@ -0,0 +1,11 @@
+--- fam/FileSystem.c++.orig	Fri Aug 11 22:26:04 2006
++++ fam/FileSystem.c++	Fri Aug 11 22:26:26 2006
+@@ -22,7 +22,7 @@
+ 
+ #include "FileSystem.h"
+ 
+-#include <mntent.h>
++#include "mntent.h"
+ #include <string.h>
+ 
+ #include "Event.h"
--- /dev/null
+++ devel/fam/files/patch-fam_DirectoryScanner.c++
@@ -0,0 +1,11 @@
+--- fam/DirectoryScanner.c++.orig	Sat Aug 12 00:12:06 2006
++++ fam/DirectoryScanner.c++	Sat Aug 12 00:13:23 2006
+@@ -100,7 +100,7 @@
+     
+     while (dir && ready)
+     {
+-	struct direct *dp = readdir(dir);
++	struct dirent *dp = readdir(dir);
+ 	if (dp == NULL)
+ 	{   closedir(dir);
+ 	    dir = NULL;
--- /dev/null
+++ devel/fam/files/patch-fam_Directory.c++
@@ -0,0 +1,11 @@
+--- fam/Directory.c++.orig	Tue Apr 15 10:21:29 2003
++++ fam/Directory.c++	Sat Aug 12 00:10:16 2006
+@@ -26,7 +26,7 @@
+ #include <errno.h>
+ #include <string.h>
+ #include <stdio.h>
+-#include <sys/dir.h>
++#include <dirent.h>
+ #include <sys/stat.h>
+ #include <sys/wait.h>
+ #include <unistd.h>
--- /dev/null
+++ devel/fam/files/patch-fam_StringTable.h
@@ -0,0 +1,10 @@
+--- fam/StringTable.h.orig	Fri Aug 11 22:29:55 2006
++++ fam/StringTable.h	Fri Aug 11 22:30:12 2006
+@@ -25,6 +25,7 @@
+ 
+ #include <assert.h>
+ #include <string.h>
++#include "mntent.h"
+ 
+ //  A StringTable maps C strings onto values.  It is a cheap O(n)
+ //  implementation, suitable only for small tables that are
--- /dev/null
+++ devel/fam/files/patch-fam_DirectoryScanner.h
@@ -0,0 +1,11 @@
+--- fam/DirectoryScanner.h.orig	Tue Apr 15 10:21:30 2003
++++ fam/DirectoryScanner.h	Sat Aug 12 00:10:29 2006
+@@ -27,7 +27,7 @@
+ 
+ #include <stddef.h>
+ #include <sys/types.h>
+-#include <sys/dir.h>
++#include <dirent.h>
+ 
+ #include "Event.h"
+ 
--- /dev/null
+++ devel/fam/files/patch-fam-Listener.c++
@@ -0,0 +1,22 @@
+--- fam/Listener.c++.orig	Tue Apr 15 13:52:40 2003
++++ fam/Listener.c++	Thu Jan 11 05:28:45 2007
+@@ -36,6 +36,10 @@
+ #include <sys/stat.h>
+ #include <sys/un.h>
+ #include <unistd.h>
++#ifdef __FreeBSD__
++#include <stdio.h>
++#include <stdlib.h>
++#endif // __FreeBSD__
+ 
+ #include <errno.h>
+ 
+@@ -203,7 +207,7 @@
+     //  requested user and pass the name back to the client.
+ 
+     //  Unset TMPDIR to ensure that tempnam() works as desired
+-    putenv("TMPDIR=");
++    unsetenv("TMPDIR");
+ 
+     char *tmpfile = tempnam("/tmp", ".fam");
+ #if defined(__FreeBSD__)
--- /dev/null
+++ devel/fam/files/mntent.h
@@ -0,0 +1,56 @@
+/*
+ *  mntent
+ *  mntent.h - compatability header for FreeBSD
+ *
+ *  Copyright (c) 2001 David Rufino <daverufino at btinternet.com>
+ *  All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#if defined(HAVE_MNTENT_H)
+#include <mntent.h>
+#else
+#ifndef _MNTENT_H
+#define _MNTENT_H
+#include <stdio.h>
+
+#define MOUNTED "dummy"
+
+#define MNTTYPE_NFS "nfs"
+
+struct mntent {
+	char *mnt_fsname;
+	char *mnt_dir;
+	char *mnt_type;
+	char *mnt_opts;
+	int mnt_freq;
+	int mnt_passno;
+};
+
+#define setmntent(x,y) ((FILE *)0x1)
+struct mntent *getmntent __P ((FILE *fp));
+char *hasmntopt __P ((const struct mntent *mnt, const char *option));
+#define endmntent(x) ((int)1)
+
+#endif /* _MNTENT_H */
+#endif /* HAVE_MNTENT_H */
--- /dev/null
+++ devel/fam/files/patch-fam-Log.c++
@@ -0,0 +1,13 @@
+--- fam/Log.c++~	Tue Jul 16 02:16:14 2002
++++ fam/Log.c++	Tue Sep  3 19:56:25 2002
+@@ -28,9 +28,9 @@
+ #include <stdlib.h>
+ #include <string.h>
+ #include <syslog.h>
++#include <sys/time.h>
+ #include <sys/resource.h>
+ #include <sys/stat.h>
+-#include <sys/time.h>
+ #include <sys/types.h>
+ #include <unistd.h>
+ #ifdef HAVE_AUDIT
--- /dev/null
+++ devel/fam/files/pkg-message.in
@@ -0,0 +1,31 @@
+************************************************************************
+
+1. In order to run this port, please add the following line to /etc/rpc if
+it is not already there:
+
+--------------------------------------------------------------------
+sgi_fam		391002
+--------------------------------------------------------------------
+
+2. To run fam from inetd (the recommended method), then please add the
+following lines to /etc/inetd.conf if they are not already there:
+
+--------------------------------------------------------------------
+# FAM: File Alteration Monitor [devel/fam]
+sgi_fam/1-2	stream rpc/tcp wait root %%LOCALBASE%%/bin/fam	fam
+--------------------------------------------------------------------
+
+After modifying /etc/inetd.conf, you must (as root) run:
+
+	killall -HUP inetd
+
+Fam also requires that portmapper is running.  Add the appropriate
+entry to /etc/rc.conf:
+
+For 4.x:
+Add portmap_enable="YES" and either reboot or run /usr/sbin/portmap.
+
+For 5.x and later:
+Add rpcbind_enable="YES" and either reboot or run /etc/rc.d/rpcbind start.
+
+************************************************************************
--- /dev/null
+++ devel/fam/files/patch-fam::SmallTable.h
@@ -0,0 +1,11 @@
+--- fam/SmallTable.h.orig	Tue Jul 16 14:23:25 2002
++++ fam/SmallTable.h	Sat Jul 31 13:14:09 2004
+@@ -98,7 +98,7 @@
+ }
+ 
+ template <class Tkey, class Tvalue>
+-SmallTable<Tkey, Tvalue>::Closure
++typename SmallTable<Tkey, Tvalue>::Closure
+ SmallTable<Tkey, Tvalue>::position(const Tkey& key) const
+ {
+     unsigned l = 0, r = n;
--- /dev/null
+++ devel/fam/files/patch-configure.in
@@ -0,0 +1,23 @@
+--- configure.in.orig	Fri Aug 11 22:23:19 2006
++++ configure.in	Fri Aug 11 22:24:34 2006
+@@ -308,11 +308,6 @@
+ dnl If we don't have MNTTYPE_NFS , we croak.
+ dnl
+ 
+-FAM_DECL_IN_MNTENT(MNTTYPE_NFS, ,AC_MSG_ERROR(Didn't find MNTTYPE_NFS in mntent.h))
+-FAM_DECL_IN_MNTENT(MNTTYPE_NFS2, AC_DEFINE(HAVE_MNTTYPE_NFS2))
+-FAM_DECL_IN_MNTENT(MNTTYPE_NFS3, AC_DEFINE(HAVE_MNTTYPE_NFS3))
+-FAM_DECL_IN_MNTENT(MNTTYPE_CACHEFS, AC_DEFINE(HAVE_MNTTYPE_CACHEFS))
+-
+ dnl
+ dnl  Test for bindresvport() prototype.
+ dnl
+@@ -563,8 +558,6 @@
+     man/fam.1m
+     support/Makefile
+     test/Makefile
+-    util/Makefile
+-    util/editconf/Makefile
+ )
+ 
+ dnl 
--- /dev/null
+++ devel/fam/files/patch-fam_FileSystemTable.c++
@@ -0,0 +1,10 @@
+--- fam/FileSystemTable.c++.orig	Fri Aug 11 22:27:15 2006
++++ fam/FileSystemTable.c++	Fri Aug 11 22:28:29 2006
+@@ -255,7 +255,6 @@
+     //  create_fs_by_name initializes our "root" member variable.
+     if (!fs_by_name)
+     {   create_fs_by_name();
+-	mtab_watcher = new InternalClient(mtab_name, mtab_event_handler, NULL);
+     }
+ 
+     cr.become_user();


More information about the Midnightbsd-cvs mailing list