[package] update imspector to 0.8 (#5357)
authorFlorian Fainelli <florian@openwrt.org>
Wed, 17 Jun 2009 16:03:08 +0000 (16:03 +0000)
committerFlorian Fainelli <florian@openwrt.org>
Wed, 17 Jun 2009 16:03:08 +0000 (16:03 +0000)
SVN-Revision: 16494

net/imspector/Makefile
net/imspector/files/imspector.config
net/imspector/files/imspector.init
net/imspector/patches/100-iconv_const.patch [new file with mode: 0644]
net/imspector/patches/110-iconv_link.patch [new file with mode: 0644]

index 38bfb4b..fe4a924 100644 (file)
@@ -9,28 +9,29 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=imspector
-PKG_VERSION:=0.7
+PKG_VERSION:=0.8
 PKG_RELEASE:=1
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=http://www.imspector.org/downloads
-PKG_MD5SUM:=08f983f5cd54094dac51ab39fe1ae839
+PKG_MD5SUM:=08a2ecdc7328d14b36f692c006e33029
 
 include $(INCLUDE_DIR)/package.mk
 
 define Package/imspector
-       SECTION:=net
-       CATEGORY:=Network
-       TITLE:=IMSpector is an Instant Messenger proxy
-       URL:=http://www.imspector.org
-       DEPENDS:=+libopenssl +libstdcpp +libmysqlclient +libsqlite3 +libpq
+  SECTION:=net
+  CATEGORY:=Network
+  TITLE:=IMSpector is an Instant Messenger proxy
+  URL:=http://www.imspector.org
+  DEPENDS:=+libopenssl +libstdcpp +libmysqlclient +libsqlite3 +libpq \
+       +libiconv
 endef
 
 define Package/imspector/description
-       IMSpector is an Instant Messenger proxy with monitoring and blocking, and content-filtering capabilities.
+       IMSpector is an Instant Messenger proxy with monitoring and blocking,
+       and content-filtering capabilities.
 endef
 
-
 define Package/imspector/conffiles
 /etc/config/imspector
 endef
@@ -41,7 +42,6 @@ define Build/Configure
        );
 endef
 
-
 define Build/Compile
        $(MAKE) -C $(PKG_BUILD_DIR) \
            DESTDIR="$(PKG_INSTALL_DIR)" \
@@ -53,11 +53,11 @@ define Build/Compile
            PREFIX="$(STAGING_DIR)/usr" \
            CXX=$(TARGET_CXX) \
            CXXFLAGS="$(TARGET_CXXFLAGS) $(TARGET_CFLAGS) $(FPIC) $(TARGET_CPPFLAGS) \
+                       -I$(STAGING_DIR)/usr/lib/libiconv/include \
                        $(TARGET_LDFLAGS) -DHAVE_SSL" \
            all
 endef
 
-
 define Build/Install
        $(MAKE) -C $(PKG_BUILD_DIR) \
            DESTDIR="$(PKG_INSTALL_DIR)" \
@@ -66,19 +66,18 @@ endef
 
 define Package/imspector/install
        $(INSTALL_DIR) $(1)/usr/sbin
-       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/imspector  $(1)/usr/sbin/imspector
+       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/imspector $(1)/usr/sbin/
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/libimspector.so $(1)/usr/lib/
        $(INSTALL_DIR) $(1)/usr/lib/$(PKG_NAME)
-       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libimspector.so $(1)/usr/lib/
-       $(CP) $(PKG_INSTALL_DIR)/usr/lib/$(PKG_NAME)/*.so $(1)/usr/lib/$(PKG_NAME)
-       $(INSTALL_DIR) $(1)/etc/$(PKG_NAME)
+       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/$(PKG_NAME)/*.so $(1)/usr/lib/$(PKG_NAME)/
        $(INSTALL_DIR) $(1)/etc/config
-       $(CP) ./files/imspector.config $(1)/etc/config/imspector 
+       $(INSTALL_CONF) ./files/imspector.config $(1)/etc/config/imspector
        $(INSTALL_DIR) $(1)/etc/init.d
-       $(CP) ./files/imspector.init $(1)/etc/init.d/imspector
-       $(CP) $(PKG_INSTALL_DIR)/usr/etc/$(PKG_NAME)/badwords.txt $(1)/etc/$(PKG_NAME)/
-       $(CP) $(PKG_INSTALL_DIR)/usr/etc/$(PKG_NAME)/acl.txt $(1)/etc/$(PKG_NAME)/
-       $(INSTALL_DIR) $(1)/var/log/$(PKG_NAME)
-       $(INSTALL_DIR) $(1)/var/lib/$(PKG_NAME)
+       $(INSTALL_BIN) ./files/imspector.init $(1)/etc/init.d/imspector
+       $(INSTALL_DIR) $(1)/etc/$(PKG_NAME)
+       $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/etc/$(PKG_NAME)/badwords.txt $(1)/etc/$(PKG_NAME)/
+       $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/etc/$(PKG_NAME)/acl.txt $(1)/etc/$(PKG_NAME)/
 endef
 
 $(eval $(call BuildPackage,imspector))
index fe3835a..4eb687a 100644 (file)
@@ -2,7 +2,7 @@ config imspector
        # Enable the proxy
        option enable 1
 
-       # The listening ip address  for redirected connections
+       # The listening ip address for redirected connections
        option listenaddr 0.0.0.0
 
        # The listening port for redirected connections
@@ -46,6 +46,21 @@ config imspector
        # Drop connection when the IM server has a bad cert
        #option ssl_verify "block"
 
+       # Prefix and postfix to all responses using all responder plugins
+       #option response_prefix "Message from IMSpector: -="
+       #option response_postfix "=-"
+
+       # SQLite DB filename for automated responses
+       #option responder_filename "/etc/imspector/sqlitedb_responder"
+       # Inform parties that chats are monitored every N days (default is never)
+       #option notice_days 7
+       # Customised notice text
+       #option notice_response "Your activities are being logged"
+       # Inform of a blocked event, but upto a max of every N mins (default is never)
+       #option filtered_mins 15
+       # Customised filtered text (message text or filename follows in response)
+       #option filtered_response "The message or action was blocked"
+
        # Will load enabled plugins in plugin_dir
        option icq_protocol on
        option irc_protocol on
@@ -86,9 +101,6 @@ config imspector
        # SQLite-backed filter
        #option db_filter_filename "/etc/imspector/sqlitedb_filter"
 
-       # Block all non whitelisted events?
-       option block_unlisted off
-
        # Block all filetransfers?
        option block_files off
 
index f9d069e..99d4798 100644 (file)
@@ -3,9 +3,14 @@
 START=50
 
 DAEMON=/usr/sbin/imspector
-CFGFILE=/var/etc/imspector.conf
+CFG_D=/var/etc
+CFGFILE=$CFG_D/imspector.conf
+LOG_D=/var/log/imspector
 
 start() {
+       [ -d $CFG_D ] || mkdir -p $CFG_D
+       [ -d $LOG_D ] || mkdir -p $LOG_D
+
        config_load imspector
        config_foreach start_imspector imspector
 }
@@ -31,20 +36,21 @@ start_imspector() {
        echo '' >> $CFGFILE
 
        imspector_options='listenaddr port http_port pidfilename plugin_dir
-               user group ssl ssl_key ssl_cert icq_protocol irc_protocol 
-               msn_protocol yahoo_protocol gg_protocol jabber_protocol 
-               https_protocol log_typing_events  file_logging_dir 
-               badwords_filename badwords_replace_character badwords_block_count 
-               acl_filename db_filter_filename block_unlisted block_files block_webcams
-               mysql_server mysql_database mysql_username mysql_password
-               sqlite_file pgsql_connect censord'
-
+               user group ssl ssl_key ssl_cert ssl_ca_key ssl_ca_cert
+               ssl_cert_dir ssl_verify_dir ssl_verify response_prefix
+               response_postfix responder_filename notice_days notice_response
+               filtered_mins filtered_response icq_protocol irc_protocol
+               msn_protocol yahoo_protocol gg_protocol jabber_protocol
+               https_protocol log_typing_events file_logging_dir mysql_server
+               mysql_database mysql_username mysql_password sqlite_file
+               pgsql_connect badwords_filename badwords_replace_character
+               badwords_block_count acl_filename db_filter_filename
+               block_files block_webcams censord'
        
        for option in $imspector_options; do
                imspector_atom "$1" "$option" '"' >> $CFGFILE
        done
 
-
        start-stop-daemon -S -q -x "$DAEMON" -- -c "$CFGFILE"
 }
 
diff --git a/net/imspector/patches/100-iconv_const.patch b/net/imspector/patches/100-iconv_const.patch
new file mode 100644 (file)
index 0000000..4257175
--- /dev/null
@@ -0,0 +1,11 @@
+--- a/icqprotocolplugin.cpp
++++ b/icqprotocolplugin.cpp
+@@ -668,7 +668,7 @@ int getmessage(GET_ARGS, std::string &me
+                                       char converted_string[BUFFER_SIZE];
+                                       memset(converted_string, 0, BUFFER_SIZE);
+                                       
+-                                      char *inbuf = string;
++                                      const char *inbuf = string;
+                                       char *outbuf = converted_string;
+                                       size_t inbytesleft = mylength - 4;
+                                       size_t outbytesleft = BUFFER_SIZE - 1; /* Trailing \0 */
diff --git a/net/imspector/patches/110-iconv_link.patch b/net/imspector/patches/110-iconv_link.patch
new file mode 100644 (file)
index 0000000..d755884
--- /dev/null
@@ -0,0 +1,11 @@
+--- a/Makefile
++++ b/Makefile
+@@ -54,7 +54,7 @@ libimspector.so: $(LIBIMSPECTOR_OBJS)
+ 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) -L$(PREFIX)/lib/libiconv/lib -liconv
+ yahooprotocolplugin.so: yahooprotocolplugin.o libimspector.so
+       $(CXX) yahooprotocolplugin.o libimspector.so $(PLUGIN_FLAGS)
+ ircprotocolplugin.so: ircprotocolplugin.o libimspector.so