From 6833d2b363f7942661242a4b2589c73f2dd1afce Mon Sep 17 00:00:00 2001 From: Florian Fainelli Date: Mon, 7 Aug 2006 12:39:12 +0000 Subject: [PATCH] Port reaim to -ng SVN-Revision: 4505 --- net/reaim/Makefile | 52 ++++++++++++++++ net/reaim/files/reaim.init | 62 +++++++++++++++++++ .../patches/501-cross_compile-install.patch | 16 +++++ 3 files changed, 130 insertions(+) create mode 100644 net/reaim/Makefile create mode 100644 net/reaim/files/reaim.init create mode 100644 net/reaim/patches/501-cross_compile-install.patch diff --git a/net/reaim/Makefile b/net/reaim/Makefile new file mode 100644 index 000000000..87e8700f7 --- /dev/null +++ b/net/reaim/Makefile @@ -0,0 +1,52 @@ +# +# Copyright (C) 2006 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# +# $Id$ + +include $(TOPDIR)/rules.mk + +PKG_NAME:=reaim +PKG_VERSION:=0.8 +PKG_RELEASE:=1 +PKG_MD5SUM:=647d2ab72ec454f89294accfb3182c09 + +PKG_SOURCE_URL:=@SF/reaim +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_CAT:=zcat + +PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION) +PKG_INSTALL_DIR:=$(PKG_BUILD_DIR)/ipkg-install + +include $(INCLUDE_DIR)/package.mk + +define Package/reaim + SECTION:=net + CATEGORY:=Network + DEPENDS:=+iptables + TITLE:=A transparent AIM / MSN proxy + DESCRIPTION:=ReAIM is a proxy for file transfers with MSN/AIM. + URL:=http://reaim.sourceforge.net +endef + +define Build/Compile + rm -rf $(PKG_INSTALL_DIR) + mkdir -p $(PKG_INSTALL_DIR) + $(MAKE) -C $(PKG_BUILD_DIR) \ + CC=$(TARGET_CC) \ + CFLAGS="$(TARGET_CFLAGS)" \ + DESTDIR="$(PKG_INSTALL_DIR)" \ + all install +endef + +define Package/reaim/install + install -d -m0755 $(1)/etc/init.d + install -m0755 ./files/reaim.init $(1)/etc/init.d/reaim + ln -sf reaim $(1)/etc/init.d/S63reaim + install -d -m0755 $(1)/usr/sbin + $(CP) $(PKG_INSTALL_DIR)/usr/sbin/reaim $(1)/usr/sbin/ +endef + +$(eval $(call BuildPackage,reaim)) diff --git a/net/reaim/files/reaim.init b/net/reaim/files/reaim.init new file mode 100644 index 000000000..93ceea3d4 --- /dev/null +++ b/net/reaim/files/reaim.init @@ -0,0 +1,62 @@ +#! /bin/sh + +PATH=/sbin:/bin:/usr/sbin:/usr/bin +NAME=reaim +DESC="Transparent proxy for IM behind NAT" +. /etc/functions.sh +WAN=$(nvram get wan_ifname) +IPT=/usr/sbin/iptables +case "$1" in + start) + if [ -e /var/run/$NAME.pid ]; then + echo "$DESC: $NAME already started." + exit 0 + fi + echo -n "Starting $DESC: $NAME" + $IPT -A input_rule -i $WAN -p tcp --dport 1863:1864 -j ACCEPT + $IPT -A input_rule -i $WAN -p tcp --dport 4443 -j ACCEPT + $IPT -A input_rule -i $WAN -p tcp --dport 5566 -j ACCEPT + $IPT -A input_rule -i $WAN -p tcp --dport 40000:40099 -j ACCEPT + + test -e /var/run/$NAME.pid || touch /var/run/$NAME.pid + /usr/sbin/$NAME + echo "." + ;; + + stop) + if [ ! -e /var/run/$NAME.pid ]; then + echo "$DESC: $NAME is not running." + exit 0 + fi + echo -n "Stopping $DESC: $NAME" + killall $NAME + rm -f /var/run/$NAME.pid + + echo "." + ;; + + restart|force-reload) + if [ ! -e /var/run/$NAME.pid ]; then + $0 start + exit 0 + fi + echo -n "Restarting $DESC: $NAME" + $IPT -A input_rule -i $WAN -p tcp --dport 1863:1864 -j ACCEPT + $IPT -A input_rule -i $WAN -p tcp --dport 4443 -j ACCEPT + $IPT -A input_rule -i $WAN -p tcp --dport 5566 -j ACCEPT + $IPT -A input_rule -i $WAN -p tcp --dport 40000:40099 -j ACCEPT + killall $NAME + sleep 1 + /usr/sbin/$NAME + echo "." + ;; + + *) + N=/etc/init.d/$NAME + echo "Usage: $N {start|stop|restart|force-reload}" >&2 + exit 1 + ;; + +esac + +exit 0 diff --git a/net/reaim/patches/501-cross_compile-install.patch b/net/reaim/patches/501-cross_compile-install.patch new file mode 100644 index 000000000..9e88f617e --- /dev/null +++ b/net/reaim/patches/501-cross_compile-install.patch @@ -0,0 +1,16 @@ +diff -urN reaim-0.8/Makefile reaim-0.8/Makefile +--- reaim-0.8/Makefile 2002-11-28 06:10:38.000000000 +0100 ++++ reaim-0.8/Makefile 2005-10-07 12:07:43.000000000 +0200 +@@ -11,7 +11,10 @@ + endif + + reaim: reaim.c +- gcc -o reaim reaim.c -g -Wall $(FW_FLAGS) +- ++ $(CC) $(CFLAGS) -o reaim reaim.c -Wall $(FW_FLAGS) + clean: + -rm reaim ++ ++install: ++ install -d -m 0755 $(DESTDIR)/usr/sbin ++ install -m 0755 reaim $(DESTDIR)/usr/sbin/ -- 2.30.2