aboutsummaryrefslogtreecommitdiff
path: root/net-im/imspector
diff options
context:
space:
mode:
authorRong-En Fan <rafan@FreeBSD.org>2008-03-19 04:27:40 +0000
committerRong-En Fan <rafan@FreeBSD.org>2008-03-19 04:27:40 +0000
commit0c50a725e528dc024ee27f735f5d31af9504d3a3 (patch)
treebd210f6a3d50cc33806a9b9a99623c51c1da5cd1 /net-im/imspector
parent368ba2cc463bc26c5225848190931fa839a5cd81 (diff)
downloadports-0c50a725e528dc024ee27f735f5d31af9504d3a3.tar.gz
ports-0c50a725e528dc024ee27f735f5d31af9504d3a3.zip
Notes
Diffstat (limited to 'net-im/imspector')
-rw-r--r--net-im/imspector/Makefile37
-rw-r--r--net-im/imspector/distinfo3
-rw-r--r--net-im/imspector/files/imspector.in30
-rw-r--r--net-im/imspector/files/patch-Makefile51
-rw-r--r--net-im/imspector/files/patch-imspector.conf20
-rw-r--r--net-im/imspector/files/patch-main.cpp14
-rw-r--r--net-im/imspector/pkg-descr7
-rw-r--r--net-im/imspector/pkg-plist23
8 files changed, 185 insertions, 0 deletions
diff --git a/net-im/imspector/Makefile b/net-im/imspector/Makefile
new file mode 100644
index 000000000000..8d822bdb2f63
--- /dev/null
+++ b/net-im/imspector/Makefile
@@ -0,0 +1,37 @@
+# New ports collection makefile for: imspector
+# Date created: 17 March 2008
+# Whom: Ilja Dejs <ilja.dejs@gmail.com>
+#
+# $FreeBSD$
+#
+
+PORTNAME= imspector
+PORTVERSION= 0.5
+CATEGORIES= net-im
+MASTER_SITES= http://www.imspector.org/downloads/
+
+MAINTAINER= lawrence@aslak.net
+COMMENT= IM transparent proxy with monitoring, blocking, and content-filtering supports
+
+CFLAGS+= -fPIC
+
+CONFIG_FILES= imspector.conf badwords.txt acl.txt
+
+USE_RC_SUBR= ${PORTNAME}
+
+.include <bsd.port.pre.mk>
+
+MAKE_ENV+= ETCDIR=${ETCDIR}
+
+post-patch:
+ @${REINPLACE_CMD} -e 's,%%PREFIX%%,${PREFIX},g' \
+ ${WRKSRC}/imspector.conf \
+ ${WRKSRC}/main.cpp
+post-install:
+.for f in ${CONFIG_FILES}
+ @if [ ! -f ${ETCDIR}/${f} ]; then \
+ ${CP} -p ${ETCDIR}/${f}.sample ${ETCDIR}/${f} ; \
+ fi
+.endfor
+
+.include <bsd.port.post.mk>
diff --git a/net-im/imspector/distinfo b/net-im/imspector/distinfo
new file mode 100644
index 000000000000..5bd16452871d
--- /dev/null
+++ b/net-im/imspector/distinfo
@@ -0,0 +1,3 @@
+MD5 (imspector-0.5.tar.gz) = fce590f4cc9e420624fb417f27750dc9
+SHA256 (imspector-0.5.tar.gz) = e40c1e2dfda2602442d2d17306b2a6e39a526d5a17a9c1174858acb639ec1552
+SIZE (imspector-0.5.tar.gz) = 39865
diff --git a/net-im/imspector/files/imspector.in b/net-im/imspector/files/imspector.in
new file mode 100644
index 000000000000..e434752574aa
--- /dev/null
+++ b/net-im/imspector/files/imspector.in
@@ -0,0 +1,30 @@
+#!/bin/sh
+
+# PROVIDE: imspector
+# REQUIRE: LOGIN
+# KEYWORD: shutdown
+#
+# Add the following lines to /etc/rc.conf.local or /etc/rc.conf
+# to enable this service:
+#
+# imspector_enable (bool): Set to NO by default.
+# Set it to YES to enable imspector.
+# imspector_config (path): Set to %%PREFIX%%/etc/imspector/imspector.conf
+# by default.
+#
+
+. %%RC_SUBR%%
+
+name="imspector"
+rcvar=${name}_enable
+
+command=%%PREFIX%%/sbin/${name}
+
+load_rc_config $name
+
+: ${imspector_enable="NO"}
+: ${imspector_config="%%PREFIX%%/etc/imspector/imspector.conf"}
+
+command_args="-c $imspector_config"
+
+run_rc_command "$1"
diff --git a/net-im/imspector/files/patch-Makefile b/net-im/imspector/files/patch-Makefile
new file mode 100644
index 000000000000..57f4842ac658
--- /dev/null
+++ b/net-im/imspector/files/patch-Makefile
@@ -0,0 +1,51 @@
+--- Makefile.orig 2008-03-14 00:55:41.000000000 +0800
++++ Makefile 2008-03-17 21:14:55.000000000 +0800
+@@ -1,19 +1,19 @@
+-DESTDIR = /
+-PREFIX = /usr
++DESTDIR ?= /
++PREFIX ?= /usr
+
+ ##########
+ # If using FreeBSD or OpenBSD COMMENT the below lines
+-LIBS = -ldl
++#LIBS = -ldl
+
+ # For any distro
+ #ADD_PLUGINS = mysqlloggingplugin.so sqliteloggingplugin.so postgresqlloggingplugin.so dbfilterplugin.so
+ ##########
+
+-CXX = g++
++CXX ?= g++
+
+-CXXFLAGS = -Wall -O2 -fPIC
++CXXFLAGS ?= -Wall -O2 -fPIC
+
+-PLUGIN_FLAGS = $(LIBS) -fPIC -shared -Wl,-soname,$@ -o $@
++PLUGIN_FLAGS ?= $(LIBS) -fPIC -shared -Wl,-soname,$@ -o $@
+
+ IMSPECTOR_OBJS = main.o protocolplugin.o loggingplugin.o filterplugin.o
+
+@@ -117,15 +117,15 @@
+ install: imspector libimspector.so $(PLUGINS)
+ -mkdir -p $(DESTDIR)/$(PREFIX)/sbin
+ -mkdir -p $(DESTDIR)/$(PREFIX)/lib/imspector
+- -install imspector $(DESTDIR)/$(PREFIX)/sbin/imspector
+- -install libimspector.so $(DESTDIR)/$(PREFIX)/lib/libimspector.so
++ -${BSD_INSTALL_PROGRAM} imspector $(DESTDIR)/$(PREFIX)/sbin/imspector
++ -${BSD_INSTALL_PROGRAM} libimspector.so $(DESTDIR)/$(PREFIX)/lib/libimspector.so
+ -(for PLUGIN in $(PLUGINS); do \
+- install $$PLUGIN $(DESTDIR)/$(PREFIX)/lib/imspector/$$PLUGIN; \
++ ${BSD_INSTALL_PROGRAM} $$PLUGIN $(DESTDIR)/$(PREFIX)/lib/imspector/$$PLUGIN; \
+ done);
+- -mkdir -p $(DESTDIR)/$(PREFIX)/etc/imspector
+- -install imspector.conf $(DESTDIR)/$(PREFIX)/etc/imspector/imspector.conf
+- -install badwords.txt $(DESTDIR)/$(PREFIX)/etc/imspector/badwords.txt
+- -install acl.txt $(DESTDIR)/$(PREFIX)/etc/imspector/acl.txt
++ -mkdir -p $(DESTDIR)/${ETCDIR}
++ -${BSD_INSTALL_DATA} imspector.conf $(DESTDIR)/${ETCDIR}/imspector.conf.sample
++ -${BSD_INSTALL_DATA} badwords.txt $(DESTDIR)/${ETCDIR}/badwords.txt.sample
++ -${BSD_INSTALL_DATA} acl.txt $(DESTDIR)/${ETCDIR}/acl.txt.sample
+ -mkdir -p /var/log/imspector
+
+ uninstall:
diff --git a/net-im/imspector/files/patch-imspector.conf b/net-im/imspector/files/patch-imspector.conf
new file mode 100644
index 000000000000..ebae2c39a8e3
--- /dev/null
+++ b/net-im/imspector/files/patch-imspector.conf
@@ -0,0 +1,20 @@
+--- imspector.conf Thu Mar 13 20:55:41 2008
++++ imspector.conf Mon Mar 17 15:07:27 2008
+@@ -2,7 +2,7 @@
+ #port=16667
+
+ # This is the default location of protocol and logging plugins.
+-#plugin_dir=/usr/lib/imspector
++#plugin_dir=%%PREFIX%%/lib/imspector
+
+ # For dropping privs - you probably want to do this.
+ #user=imspector
+@@ -19,7 +19,7 @@
+ gg_protocol=on
+
+ # Bad words filtering
+-#badwords_filename=/etc/imspector/badwords.txt
++#badwords_filename=%%PREFIX%%/etc/imspector/badwords.txt
+ #badwords_replace_character=*
+ #badwords_block_count=1
+
diff --git a/net-im/imspector/files/patch-main.cpp b/net-im/imspector/files/patch-main.cpp
new file mode 100644
index 000000000000..afd558343a68
--- /dev/null
+++ b/net-im/imspector/files/patch-main.cpp
@@ -0,0 +1,14 @@
+--- main.cpp Thu Mar 13 20:55:41 2008
++++ main.cpp Mon Mar 17 15:07:27 2008
+@@ -9,9 +9,9 @@
+
+ #include "imspector.h"
+
+-#define DEFAULT_CONFIG "/usr/etc/imspector/imspector.conf"
++#define DEFAULT_CONFIG "%%PREFIX%%/etc/imspector/imspector.conf"
+ #define LOGGING_SOCKET "/tmp/.imspectorlog"
+-#define DEFAULT_PLUGIN_DIR "/usr/lib/imspector"
++#define DEFAULT_PLUGIN_DIR "%%PREFIX%%/lib/imspector"
+
+ std::vector<class ProtocolPlugin> protocolplugins;
+ std::vector<class FilterPlugin> filterplugins;
diff --git a/net-im/imspector/pkg-descr b/net-im/imspector/pkg-descr
new file mode 100644
index 000000000000..bc3ad6044c3b
--- /dev/null
+++ b/net-im/imspector/pkg-descr
@@ -0,0 +1,7 @@
+IMSpector is an Instant Messenger transparent proxy with monitoring,
+blocking, and content-filtering capabilities.
+
+WWW: http://www.imspector.org/
+
+- Dejs Ilja
+ilja.dejs@gmail.com
diff --git a/net-im/imspector/pkg-plist b/net-im/imspector/pkg-plist
new file mode 100644
index 000000000000..1505b4edb9e0
--- /dev/null
+++ b/net-im/imspector/pkg-plist
@@ -0,0 +1,23 @@
+@unexec if cmp -s %D/%%ETCDIR%%/acl.txt.sample %D/%%ETCDIR%%/acl.txt; then rm -f %D/%%ETCDIR%%/acl.txt; fi
+%%ETCDIR%%/acl.txt.sample
+@exec if [ ! -f %D/%%ETCDIR%%/acl.txt ] ; then cp -p %D/%F %B/acl.txt; fi
+@unexec if cmp -s %D/%%ETCDIR%%/badwords.txt.sample %D/%%ETCDIR%%/badwords.txt; then rm -f %D/%%ETCDIR%%/badwords.txt; fi
+%%ETCDIR%%/badwords.txt.sample
+@exec if [ ! -f %D/%%ETCDIR%%/badwords.txt ] ; then cp -p %D/%F %B/badwords.txt; fi
+@unexec if cmp -s %D/%%ETCDIR%%/imspector.conf.sample %D/%%ETCDIR%%/imspector.conf; then rm -f %D/%%ETCDIR%%/imspector.conf; fi
+%%ETCDIR%%/imspector.conf.sample
+@exec if [ ! -f %D/%%ETCDIR%%/imspector.conf ] ; then cp -p %D/%F %B/imspector.conf; fi
+lib/imspector/aclfilterplugin.so
+lib/imspector/badwordsfilterplugin.so
+lib/imspector/debugloggingplugin.so
+lib/imspector/fileloggingplugin.so
+lib/imspector/ggprotocolplugin.so
+lib/imspector/icqprotocolplugin.so
+lib/imspector/ircprotocolplugin.so
+lib/imspector/miscfilterplugin.so
+lib/imspector/msnprotocolplugin.so
+lib/imspector/yahooprotocolplugin.so
+lib/libimspector.so
+sbin/imspector
+@dirrmtry etc/imspector
+@dirrm lib/imspector