Permalink
Browse files

imspector-devel - ports files to compile

  • Loading branch information...
1 parent 6935390 commit 94c0d89e7054f841aee7d423acdab9f46d4348d9 @marcelloc committed May 11, 2012
@@ -0,0 +1,52 @@
+# New ports collection makefile for: imspector
+# Date created: 17 March 2008
+# Whom: Ilja Dejs <ilja.dejs@gmail.com>
+#
+# $FreeBSD: ports/net-im/imspector/Makefile,v 1.6 2011/06/14 19:10:49 jlaffaye Exp $
+#
+
+PORTNAME= imspector
+PORTVERSION= 20111108
+CATEGORIES= net-im
+MASTER_SITES= http://www.imspector.org/downloads/snapshots/
+
+MAINTAINER= m.tsatsenko@gmail.com
+COMMENT= IM transparent proxy with monitoring, blocking and content-filtering
+
+LIB_DEPENDS= mysqlclient.18:${PORTSDIR}/databases/mysql55-client
@billm

billm May 11, 2012

pfPorts uses MySQL 5.1 (https://github.com/marcelloc/pfsense-tools/blob/master/pfPorts/imspector/Makefile#L21), I'm seeing that SQLITE is also brought in with a USE statement and not as a LIB_DEPENDS. This was the only other issue that stood out to me, I'll ask jim-p@ to take a quick glance also.

@marcelloc

marcelloc via email May 11, 2012

Owner
@marcelloc

marcelloc via email May 11, 2012

Owner
@billm

billm May 11, 2012

We need to make it use 5.1 as the rest of the ports system uses 5.1, else we'll have package conflicts and there's no need to force an upgrade to 5.5 when 5.1 works fine.

+LIB_DEPENDS+= sqlite3.8:${PORTSDIR}/databases/sqlite3
+
+LICENSE= GPLv2
+
+CFLAGS+= -fPIC -I ${LOCALBASE}/include -DHAVE_SSL
+USE_GMAKE= YES
+USE_ICONV= YES
+USE_OPENSSL= YES
+
+CONFLICTS= imspector-0.*
+
+LATEST_LINK= imspector-devel
+
+CONFIG_FILES= imspector.conf badwords.txt acl.txt
+
+USE_RC_SUBR= ${PORTNAME}
+
+MAKE_ENV+= ETCDIR=${ETCDIR}
+
+post-extract:
+ ${MV} ${WRKDIR}/${PORTNAME} ${WRKSRC}
+post-patch:
+ @${REINPLACE_CMD} -e 's,%%PREFIX%%,${PREFIX},g' \
+ ${WRKSRC}/imspector.conf \
+ ${WRKSRC}/main.cpp
+ @${REINPLACE_CMD} -e 's,#ADD_PLUGINS,ADD_PLUGINS,' \
+ ${WRKSRC}/Makefile
+
+post-install:
+.for f in ${CONFIG_FILES}
+ @if [ ! -f ${ETCDIR}/${f} ]; then \
+ ${CP} -p ${ETCDIR}/${f}.sample ${ETCDIR}/${f} ; \
+ fi
+.endfor
+
+.include <bsd.port.mk>
@@ -0,0 +1,2 @@
+SHA256 (imspector-20111108.tar.gz) = 36f3b1f3b722dc1e4aa7a020f07ef17fa71da060f2290e5e63b9887da70d8c82
+SIZE (imspector-20111108.tar.gz) = 88601
@@ -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.
+#
+
+. /etc/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"
@@ -0,0 +1,71 @@
+--- Makefile.orig 2008-12-22 15:03:15.000000000 +0300
++++ Makefile 2011-06-14 14:26:22.072210675 +0400
+@@ -1,5 +1,5 @@
+-DESTDIR = /
+-PREFIX = /usr
++DESTDIR ?= /
++PREFIX ?= /usr
+
+ ##########
+ # Comment this out if you dont want SSL
+@@ -7,11 +7,11 @@
+
+ ##########
+ # Location of openssl installation
+-SSL_DIR = /usr
++SSL_DIR ?= /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 dbresponderplugin.so
+@@ -23,11 +23,11 @@
+ SSL_OBJS = sslstate.o
+ endif
+
+-CXX = g++
++CXX ?= g++
+
+-CXXFLAGS = -Wall -O2 -fPIC $(SSL_FLAGS)
++CXXFLAGS ?= -Wall -O2 -fPIC $(SSL_FLAGS)
+
+-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 responderplugin.o $(SSL_OBJS)
+
+@@ -54,7 +54,7 @@
+ msnprotocolplugin.so: msnprotocolplugin.o libimspector.so
+ $(CXX) msnprotocolplugin.o libimspector.so $(PLUGIN_FLAGS)
+ icqprotocolplugin.so: icqprotocolplugin.o libimspector.so
+- $(CXX) icqprotocolplugin.o libimspector.so $(PLUGIN_FLAGS)
++ $(CXX) icqprotocolplugin.o libimspector.so $(PLUGIN_FLAGS) -liconv -L${LOCALBASE}/lib
+ yahooprotocolplugin.so: yahooprotocolplugin.o libimspector.so
+ $(CXX) yahooprotocolplugin.o libimspector.so $(PLUGIN_FLAGS)
+ ircprotocolplugin.so: ircprotocolplugin.o libimspector.so
+@@ -162,15 +162,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) $(ADD_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
+ -mkdir -p /var/lib/imspector
+
@@ -0,0 +1,28 @@
+--- icqprotocolplugin.cpp.orig 2010-11-23 17:53:29.000000000 +0300
++++ icqprotocolplugin.cpp 2011-11-08 19:13:36.000000000 +0400
+@@ -10,6 +10,7 @@
+ * in the README file. */
+
+ #include "imspector.h"
++#include <sys/endian.h>
+
+ #define PLUGIN_NAME "ICQ-AIM IMSpector protocol plugin"
+ #define PROTOCOL_NAME "ICQ-AIM"
+@@ -675,7 +676,7 @@
+ size_t inbytesleft = mylength - 4;
+ size_t outbytesleft = BUFFER_SIZE - 1; /* Trailing \0 */
+ size_t result = iconv(iconv_utf16be_utf8,
+- &inbuf, &inbytesleft, &outbuf, &outbytesleft);
++ (const char**) &inbuf, &inbytesleft, &outbuf, &outbytesleft);
+
+ if (result == (size_t) -1)
+ {
+@@ -810,7 +811,7 @@
+ GET_TYPE(uint16_t)
+
+ # if __BYTE_ORDER == __BIG_ENDIAN
+- *rc = __bswap_16(*rc);
++ *rc = bswap16(*rc);
+ #endif
+
+ return true;
@@ -0,0 +1,51 @@
+--- imspector.conf.orig 2008-09-04 17:48:13.000000000 +0400
++++ imspector.conf 2011-06-10 23:41:46.273771152 +0400
+@@ -4,7 +4,7 @@
+ #http_port=18080
+
+ # 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
+@@ -12,19 +12,19 @@
+
+ # SSL support?
+ #ssl=on
+-#ssl_key=/usr/etc/imspector/serverkey.pem
++#ssl_key=%%PREFIX%%/etc/imspector/serverkey.pem
+
+ # Fixed cert?
+-#ssl_cert=/usr/etc/imspector/servercert.pem
++#ssl_cert=%%PREFIX%%/etc/imspector/servercert.pem
+
+ # Or certs created on-the-fly and signed against a CA
+-#ssl_ca_key=/usr/etc/imspector/cakey.pem
+-#ssl_ca_cert=/usr/etc/imspector/cacert.pem
++#ssl_ca_key=%%PREFIX%%/etc/imspector/cakey.pem
++#ssl_ca_cert=%%PREFIX%%/etc/imspector/cacert.pem
+ # And finally a directory to store the created certs
+ #ssl_cert_dir=/var/lib/imspector
+
+ # Directory of CA certs for IM server cert validation
+-#ssl_verify_dir=/usr/lib/ssl/certs
++#ssl_verify_dir=%%PREFIX%%/lib/ssl/certs
+ # Drop connection when the IM server has a bad cert
+ #ssl_verify=block
+
+@@ -70,12 +70,12 @@
+ #sqlite_file=/path/to/file
+
+ # Bad words filtering
+-#badwords_filename=/usr/etc/imspector/badwords.txt
++#badwords_filename=%%PREFIX%%/etc/imspector/badwords.txt
+ #badwords_replace_character=*
+ #badwords_block_count=1
+
+ # ACL
+-#acl_filename=/usr/etc/imspector/acl.txt
++#acl_filename=%%PREFIX%%/etc/imspector/acl.txt
+
+ # SQLite-backed filter
+ #db_filter_filename=/path/to/file
@@ -0,0 +1,16 @@
+--- main.cpp.orig 2010-02-23 20:21:10.000000000 +0300
++++ main.cpp 2011-11-08 19:05:36.000000000 +0400
+@@ -17,11 +17,11 @@
+ #include "imspector.h"
+
+ /*! The default location for where to find the config file. */
+-#define DEFAULT_CONFIG "/usr/etc/imspector/imspector.conf"
++#define DEFAULT_CONFIG "%%PREFIX%%/etc/imspector/imspector.conf"
+ /*! The location of the logging process's UNIX socket. */
+ #define LOGGING_SOCKET "/tmp/.imspectorlog"
+ /*! The default place for where to find plugins. */
+-#define DEFAULT_PLUGIN_DIR "/usr/lib/imspector"
++#define DEFAULT_PLUGIN_DIR "%%PREFIX%%/lib/imspector"
+
+ #define DEFAULT_RESPONSE_PREFIX "Message from IMSpector: -="
+ #define DEFAULT_RESPONSE_POSTFIX "=-"
@@ -0,0 +1,61 @@
+===> License GPLv2 accepted by the user
+===> Extracting for imspector-20111108
+=> SHA256 Checksum OK for imspector-20111108.tar.gz.
+/bin/mv /usr/ports/net-im/imspector-devel/work/imspector /usr/ports/net-im/imspector-devel/work/imspector-20111108
+===> Patching for imspector-20111108
+===> Applying FreeBSD patches for imspector-20111108
+===> imspector-20111108 depends on executable: gmake - found
+===> imspector-20111108 depends on shared library: mysqlclient.18 - found
+===> imspector-20111108 depends on shared library: sqlite3.8 - found
+===> imspector-20111108 depends on shared library: iconv.3 - found
+===> Configuring for imspector-20111108
+===> Building for imspector-20111108
+c++ -O2 -pipe -fPIC -I /usr/local/include -DHAVE_SSL -fno-strict-aliasing main.cpp -c
+c++ -O2 -pipe -fPIC -I /usr/local/include -DHAVE_SSL -fno-strict-aliasing protocolplugin.cpp -c
+c++ -O2 -pipe -fPIC -I /usr/local/include -DHAVE_SSL -fno-strict-aliasing loggingplugin.cpp -c
+c++ -O2 -pipe -fPIC -I /usr/local/include -DHAVE_SSL -fno-strict-aliasing filterplugin.cpp -c
+c++ -O2 -pipe -fPIC -I /usr/local/include -DHAVE_SSL -fno-strict-aliasing responderplugin.cpp -c
+c++ -O2 -pipe -fPIC -I /usr/local/include -DHAVE_SSL -fno-strict-aliasing sslstate.cpp -c
+c++ -O2 -pipe -fPIC -I /usr/local/include -DHAVE_SSL -fno-strict-aliasing socket.cpp -c
+c++ -O2 -pipe -fPIC -I /usr/local/include -DHAVE_SSL -fno-strict-aliasing options.cpp -c
+c++ -O2 -pipe -fPIC -I /usr/local/include -DHAVE_SSL -fno-strict-aliasing tools.cpp -c
+c++ socket.o options.o tools.o -fPIC -shared -Wl,-soname,libimspector.so -o libimspector.so
+c++ main.o protocolplugin.o loggingplugin.o filterplugin.o responderplugin.o sslstate.o libimspector.so -o imspector -L/usr/lib -lssl
+c++ -O2 -pipe -fPIC -I /usr/local/include -DHAVE_SSL -fno-strict-aliasing msnprotocolplugin.cpp -c
+c++ msnprotocolplugin.o libimspector.so -fPIC -shared -Wl,-soname,msnprotocolplugin.so -o msnprotocolplugin.so
+c++ -O2 -pipe -fPIC -I /usr/local/include -DHAVE_SSL -fno-strict-aliasing icqprotocolplugin.cpp -c
+c++ icqprotocolplugin.o libimspector.so -fPIC -shared -Wl,-soname,icqprotocolplugin.so -o icqprotocolplugin.so -liconv -L/usr/local/lib
+c++ -O2 -pipe -fPIC -I /usr/local/include -DHAVE_SSL -fno-strict-aliasing yahooprotocolplugin.cpp -c
+c++ yahooprotocolplugin.o libimspector.so -fPIC -shared -Wl,-soname,yahooprotocolplugin.so -o yahooprotocolplugin.so
+c++ -O2 -pipe -fPIC -I /usr/local/include -DHAVE_SSL -fno-strict-aliasing ircprotocolplugin.cpp -c
+c++ ircprotocolplugin.o libimspector.so -fPIC -shared -Wl,-soname,ircprotocolplugin.so -o ircprotocolplugin.so
+c++ -O2 -pipe -fPIC -I /usr/local/include -DHAVE_SSL -fno-strict-aliasing ggprotocolplugin.cpp -c
+c++ ggprotocolplugin.o libimspector.so -fPIC -shared -Wl,-soname,ggprotocolplugin.so -o ggprotocolplugin.so
+c++ -O2 -pipe -fPIC -I /usr/local/include -DHAVE_SSL -fno-strict-aliasing jabberprotocolplugin.cpp -c
+c++ jabberprotocolplugin.o libimspector.so -fPIC -shared -Wl,-soname,jabberprotocolplugin.so -o jabberprotocolplugin.so
+c++ -O2 -pipe -fPIC -I /usr/local/include -DHAVE_SSL -fno-strict-aliasing httpsprotocolplugin.cpp -c
+c++ httpsprotocolplugin.o libimspector.so -fPIC -shared -Wl,-soname,httpsprotocolplugin.so -o httpsprotocolplugin.so
+c++ -O2 -pipe -fPIC -I /usr/local/include -DHAVE_SSL -fno-strict-aliasing fileloggingplugin.cpp -c
+c++ fileloggingplugin.o libimspector.so -fPIC -shared -Wl,-soname,fileloggingplugin.so -o fileloggingplugin.so
+c++ -O2 -pipe -fPIC -I /usr/local/include -DHAVE_SSL -fno-strict-aliasing debugloggingplugin.cpp -c
+c++ debugloggingplugin.o libimspector.so -fPIC -shared -Wl,-soname,debugloggingplugin.so -o debugloggingplugin.so
+c++ -O2 -pipe -fPIC -I /usr/local/include -DHAVE_SSL -fno-strict-aliasing catsloggingplugin.cpp -c
+c++ catsloggingplugin.o libimspector.so -fPIC -shared -Wl,-soname,catsloggingplugin.so -o catsloggingplugin.so
+c++ -O2 -pipe -fPIC -I /usr/local/include -DHAVE_SSL -fno-strict-aliasing badwordsfilterplugin.cpp -c
+c++ badwordsfilterplugin.o libimspector.so -fPIC -shared -Wl,-soname,badwordsfilterplugin.so -o badwordsfilterplugin.so
+c++ -O2 -pipe -fPIC -I /usr/local/include -DHAVE_SSL -fno-strict-aliasing aclfilterplugin.cpp -c
+c++ aclfilterplugin.o libimspector.so -fPIC -shared -Wl,-soname,aclfilterplugin.so -o aclfilterplugin.so
+c++ -O2 -pipe -fPIC -I /usr/local/include -DHAVE_SSL -fno-strict-aliasing miscfilterplugin.cpp -c
+c++ miscfilterplugin.o libimspector.so -fPIC -shared -Wl,-soname,miscfilterplugin.so -o miscfilterplugin.so
+c++ -O2 -pipe -fPIC -I /usr/local/include -DHAVE_SSL -fno-strict-aliasing censordfilterplugin.cpp -c
+c++ censordfilterplugin.o libimspector.so -fPIC -shared -Wl,-soname,censordfilterplugin.so -o censordfilterplugin.so
+c++ -O2 -pipe -fPIC -I /usr/local/include -DHAVE_SSL -fno-strict-aliasing mysqlloggingplugin.cpp -c -I/usr/local/include
+c++ mysqlloggingplugin.o libimspector.so -fPIC -shared -Wl,-soname,mysqlloggingplugin.so -o mysqlloggingplugin.so -L/usr/local/lib/mysql -lmysqlclient
+c++ -O2 -pipe -fPIC -I /usr/local/include -DHAVE_SSL -fno-strict-aliasing sqliteloggingplugin.cpp -c -I/usr/local/include
+c++ sqliteloggingplugin.o libimspector.so -fPIC -shared -Wl,-soname,sqliteloggingplugin.so -o sqliteloggingplugin.so -L/usr/local/lib -lsqlite3
+c++ -O2 -pipe -fPIC -I /usr/local/include -DHAVE_SSL -fno-strict-aliasing postgresqlloggingplugin.cpp -c -I/usr/local/include
+c++ postgresqlloggingplugin.o libimspector.so -fPIC -shared -Wl,-soname,postgresqlloggingplugin.so -o postgresqlloggingplugin.so -L/usr/local/lib -lpq
+c++ -O2 -pipe -fPIC -I /usr/local/include -DHAVE_SSL -fno-strict-aliasing dbfilterplugin.cpp -c -I/usr/local/include
+c++ dbfilterplugin.o libimspector.so -fPIC -shared -Wl,-soname,dbfilterplugin.so -o dbfilterplugin.so -L/usr/local/lib -lsqlite3
+c++ -O2 -pipe -fPIC -I /usr/local/include -DHAVE_SSL -fno-strict-aliasing dbresponderplugin.cpp -c -I/usr/local/include
+c++ dbresponderplugin.o libimspector.so -fPIC -shared -Wl,-soname,dbresponderplugin.so -o dbresponderplugin.so -L/usr/local/lib -lsqlite3
@@ -0,0 +1,4 @@
+IMSpector is an Instant Messenger transparent proxy with monitoring,
+blocking, and content-filtering capabilities.
+
+WWW: http://www.imspector.org/
@@ -0,0 +1,36 @@
+@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
+@exec /bin/mkdir -p /var/lib/imspector
+@exec /bin/mkdir -p /var/log/imspector
+lib/imspector/aclfilterplugin.so
+lib/imspector/badwordsfilterplugin.so
+lib/imspector/catsloggingplugin.so
+lib/imspector/censordfilterplugin.so
+lib/imspector/debugloggingplugin.so
+lib/imspector/httpsprotocolplugin.so
+lib/imspector/jabberprotocolplugin.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/imspector/mysqlloggingplugin.so
+lib/imspector/sqliteloggingplugin.so
+lib/imspector/dbfilterplugin.so
+lib/imspector/dbresponderplugin.so
+lib/libimspector.so
+sbin/imspector
+@dirrmtry etc/imspector
+@dirrm lib/imspector
+@cwd /
+@dirrmtry var/lib/imspector
+@dirrmtry var/log/imspector

1 comment on commit 94c0d89

billm commented on 94c0d89 May 11, 2012

Remove nohup.out please, still looking through the rest of the diff.

Please sign in to comment.