Port peerguardian to -ng
authorflorian <florian@3c298f89-4303-0410-b956-a3cf2f4a3e73>
Mon, 7 Aug 2006 09:10:43 +0000 (09:10 +0000)
committerflorian <florian@3c298f89-4303-0410-b956-a3cf2f4a3e73>
Mon, 7 Aug 2006 09:10:43 +0000 (09:10 +0000)
git-svn-id: svn://svn.openwrt.org/openwrt/packages@4499 3c298f89-4303-0410-b956-a3cf2f4a3e73

net/peerguardian/Makefile [new file with mode: 0755]
net/peerguardian/files/peerguardian.init [new file with mode: 0644]
net/peerguardian/patches/01-honor-libipq.patch [new file with mode: 0755]

diff --git a/net/peerguardian/Makefile b/net/peerguardian/Makefile
new file mode 100755 (executable)
index 0000000..91a3f50
--- /dev/null
@@ -0,0 +1,56 @@
+# 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:=peerguardian
+PKG_VERSION:=1.5beta
+PKG_RELEASE:=1
+PKG_MD5SUM:=0fb2bc5501b031604fc56eec3bd35fa4
+
+PKG_SOURCE_URL:=@SF/peerguardian
+PKG_SOURCE:=pglinux-$(PKG_VERSION).tar.gz
+PKG_BUILD_DIR:=$(BUILD_DIR)/pglinux-$(PKG_VERSION)
+PKG_CAT:=zcat
+PKG_INSTALL_DIR:=$(PKG_BUILD_DIR)/ipkg-install
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/peerguardian
+  SECTION:=net
+  CATEGORY:=Network
+  DEPENDS:=+libpthread +libncurses +iptables
+  TITLE:=PeerGuardian for Linux
+  DESCRIPTION:=PeerGuardian helps protect your privacy by blocking many ranges\\\
+       of aggressive IPs while you use P2P.\\\
+  URL:=http://phoenixlabs.org/
+endef
+
+define Package/peerguardian/conffiles
+/etc/PG.conf
+/etc/p2p.p2b.p2p
+endef
+
+define Build/Configure
+$(call Build/Configure/Default)
+endef  
+
+define Build/Compile
+       $(MAKE) -C $(PKG_BUILD_DIR) \
+               STAGING_DIR=$(STAGING_DIR)
+endef
+
+define Package/peerguardian/install
+       install -d -m0755 $(1)/usr/sbin $(1)/etc/init.d
+       install -m0755 $(PKG_BUILD_DIR)/peerguardnf $(1)/usr/sbin/
+       install -m0755 $(PKG_BUILD_DIR)/pgtext $(1)/usr/sbin/
+       install -m0644 $(PKG_BUILD_DIR)/PG.conf $(1)/etc/
+       install -m0644 $(PKG_BUILD_DIR)/p2p.p2b.p2p $(1)/etc/
+       install -m0644 files/peerguardian.init $(1)/etc/init.d/peerguardian
+endef
+
+$(eval $(call BuildPackage,peerguardian))
diff --git a/net/peerguardian/files/peerguardian.init b/net/peerguardian/files/peerguardian.init
new file mode 100644 (file)
index 0000000..5807314
--- /dev/null
@@ -0,0 +1,21 @@
+#!/bin/sh
+
+BIN=pgtext
+DEFAULT=/etc/default/$BIN
+[ -f $DEFAULT ] && . $DEFAULT
+RUN_D=/var/run
+PID_F=$RUN_D/$BIN_${IF}_${ID}.pid
+
+case $1 in
+ start)
+  $BIN $OPTIONS
+  ;;
+ stop)
+  [ -f $PID_F ] && kill $(cat $PID_F) >/dev/null 2>&1
+  ;;
+ *)
+  echo "usage: $0 (start|stop)"
+  exit 1
+esac
+
+exit $?
diff --git a/net/peerguardian/patches/01-honor-libipq.patch b/net/peerguardian/patches/01-honor-libipq.patch
new file mode 100755 (executable)
index 0000000..02bab14
--- /dev/null
@@ -0,0 +1,16 @@
+diff -urN pglinux-1.5beta/Makefile.in pglinux-1.5beta/Makefile.in
+--- pglinux-1.5beta/Makefile.in        2005-03-31 09:40:29.000000000 +0200
++++ pglinux-1.5beta/Makefile.in        2005-11-25 19:14:16.000000000 +0100
+@@ -83,10 +83,10 @@
+ PROGRAMS =  $(mybin_PROGRAMS)
+-DEFS = @DEFS@ -I. -I$(srcdir) -I.
++DEFS = @DEFS@ -I. -I$(srcdir) -I. -I$(STAGING_DIR)/usr/include
+ CPPFLAGS = @CPPFLAGS@
+ LDFLAGS = @LDFLAGS@
+-LIBS = @LIBS@
++LIBS = @LIBS@ -L$(STAGING_DIR)/usr/lib
+ peerguardnf_OBJECTS =  Main.o PeerGuard.o BlockList.o Blocker_Linux.o \
+ Blocker_BSD.o HttpServer.o HttpRequest.o sha1.o
+ peerguardnf_DEPENDENCIES =