From fe7b34efdbf394a6c8f3cba8c6c87d057da4aa90 Mon Sep 17 00:00:00 2001 From: Nicolas Thill Date: Fri, 7 Oct 2005 22:44:29 +0000 Subject: [PATCH] add reaim (thanks to Florian Fainelli) SVN-Revision: 2072 --- openwrt/package/Config.in | 1 + openwrt/package/Makefile | 1 + openwrt/package/reaim/Config.in | 8 +++ openwrt/package/reaim/Makefile | 42 +++++++++++++ openwrt/package/reaim/files/reaim.init | 62 +++++++++++++++++++ openwrt/package/reaim/ipkg/reaim.control | 7 +++ .../patches/501-cross_compile-install.patch | 16 +++++ 7 files changed, 137 insertions(+) create mode 100644 openwrt/package/reaim/Config.in create mode 100644 openwrt/package/reaim/Makefile create mode 100644 openwrt/package/reaim/files/reaim.init create mode 100644 openwrt/package/reaim/ipkg/reaim.control create mode 100644 openwrt/package/reaim/patches/501-cross_compile-install.patch diff --git a/openwrt/package/Config.in b/openwrt/package/Config.in index d16861113d..9cf104b7eb 100644 --- a/openwrt/package/Config.in +++ b/openwrt/package/Config.in @@ -99,6 +99,7 @@ source "package/pptpd/Config.in" source "package/quagga/Config.in" source "package/radvd/Config.in" source "package/rarpd/Config.in" +source "package/reaim/Config.in" source "package/robocfg/Config.in" source "package/rsync/Config.in" source "package/samba/Config.in" diff --git a/openwrt/package/Makefile b/openwrt/package/Makefile index 564fd926da..fbb3de8e86 100644 --- a/openwrt/package/Makefile +++ b/openwrt/package/Makefile @@ -146,6 +146,7 @@ package-$(BR2_PACKAGE_QUAGGA) += quagga package-$(BR2_PACKAGE_RADVD) += radvd package-$(BR2_PACKAGE_RARPD) += rarpd package-$(BR2_PACKAGE_READLINE) += readline +package-$(BR2_PACKAGE_REAIM) += reaim package-$(BR2_PACKAGE_ROBOCFG) += robocfg package-$(BR2_COMPILE_RP_PPPOE) += rp-pppoe package-$(BR2_PACKAGE_RRDCOLLECT) += rrdcollect diff --git a/openwrt/package/reaim/Config.in b/openwrt/package/reaim/Config.in new file mode 100644 index 0000000000..0fb2e76d4f --- /dev/null +++ b/openwrt/package/reaim/Config.in @@ -0,0 +1,8 @@ +config BR2_PACKAGE_REAIM + tristate "reaim - A transparent AIM / MSN proxy" + default m if CONFIG_DEVEL + help + ReAIM is a proxy for file transfers with MSN/AIM. + + http://reaim.sourceforge.net/ + diff --git a/openwrt/package/reaim/Makefile b/openwrt/package/reaim/Makefile new file mode 100644 index 0000000000..dc1a0927b8 --- /dev/null +++ b/openwrt/package/reaim/Makefile @@ -0,0 +1,42 @@ +# $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 $(TOPDIR)/package/rules.mk + +$(eval $(call PKG_template,REAIM,reaim,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH))) + +$(PKG_BUILD_DIR)/.configured: + touch $@ + +$(PKG_BUILD_DIR)/.built: + 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 + touch $@ + +$(IPKG_REAIM): + install -d -m0755 $(IDIR_REAIM)/etc/init.d + install -m0755 ./files/reaim.init $(IDIR_REAIM)/etc/init.d/reaim + ln -sf reaim $(IDIR_REAIM)/etc/init.d/S63reaim + install -d -m0755 $(IDIR_REAIM)/usr/sbin + cp -fpR $(PKG_INSTALL_DIR)/usr/sbin/reaim $(IDIR_REAIM)/usr/sbin/ + $(RSTRIP) $(IDIR_REAIM) + $(IPKG_BUILD) $(IDIR_REAIM) $(PACKAGE_DIR) + diff --git a/openwrt/package/reaim/files/reaim.init b/openwrt/package/reaim/files/reaim.init new file mode 100644 index 0000000000..93ceea3d42 --- /dev/null +++ b/openwrt/package/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/openwrt/package/reaim/ipkg/reaim.control b/openwrt/package/reaim/ipkg/reaim.control new file mode 100644 index 0000000000..638babd06c --- /dev/null +++ b/openwrt/package/reaim/ipkg/reaim.control @@ -0,0 +1,7 @@ +Package: reaim +Priority: optional +Section: net +Maintainer: OpenWrt Developers Team , Florian Fainelli +Source: http://openwrt.org/cgi-bin/viewcvs.cgi/openwrt/package/reaim/ +Depends: +Description: A transparent AIM / MSN proxy diff --git a/openwrt/package/reaim/patches/501-cross_compile-install.patch b/openwrt/package/reaim/patches/501-cross_compile-install.patch new file mode 100644 index 0000000000..9e88f617e6 --- /dev/null +++ b/openwrt/package/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