From 622be8fe01ff2b7a28a5c19436f140c76a63ba86 Mon Sep 17 00:00:00 2001 From: Andy Boyett Date: Sun, 3 Aug 2008 22:25:03 +0000 Subject: [PATCH] net/ipkungfu: Cleanup - use openwrt locations for utilities, fixes compilation on systems missing those utilites, allows ipkungfu to run - $(INSTALL_BIN) to properly install binaries - rewrite to use insmod in place of modprobe - depends on bash - delete autogenerated md5sum manifsts during removal, fixes reinstallation/upgrades - needs more work, but this is a start and prevents error during compilation SVN-Revision: 12083 --- net/ipkungfu/Makefile | 27 ++++++++++++++++--- .../001-replace-modprobe-with-insmod.patch | 22 +++++++++++++++ 2 files changed, 45 insertions(+), 4 deletions(-) create mode 100644 net/ipkungfu/patches/001-replace-modprobe-with-insmod.patch diff --git a/net/ipkungfu/Makefile b/net/ipkungfu/Makefile index 3a981d048..1e9ebdbc0 100644 --- a/net/ipkungfu/Makefile +++ b/net/ipkungfu/Makefile @@ -10,7 +10,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=ipkungfu PKG_VERSION:=0.6.1 -PKG_RELEASE:=1 +PKG_RELEASE:=2 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=http://www.linuxkungfu.org/ipkungfu @@ -24,6 +24,7 @@ define Package/ipkungfu TITLE:=IPKungFu is an iptables-based Linux firewall URL:=http://www.linuxkungfu.org/ SUBMENU:=firewall + DEPENDS:=+bash endef define Package/ipkungfu/description @@ -47,7 +48,25 @@ define Package/ipkungfu/conffiles /etc/ipkungfu/vhosts.conf endef +define Package/ipkungfu/postrm +#!/bin/sh +rm -rf /etc/ipkungfu/cache +rmdir /etc/ipkungfu 2>/dev/null || true +endef + # uses GNU configure +CONFIGURE_VARS+= \ + ac_cv_path_IPTABLES="/usr/sbin/iptables" \ + ac_cv_path_MD5SUM="/usr/bin/md5sum" \ + ac_cv_path_MODPROBE="/sbin/insmod" \ + ac_cv_path_RMMOD="/sbin/rmmode" \ + ac_cv_path_DEPMOD="/bin/true" \ + ac_cv_path_LSMOD="/sbin/lsmod" \ + ac_cv_path_CUT="/usr/bincut" \ + ac_cv_path_TR="/usr/bintr" \ + ac_cv_path_GREP="/bin/grep" \ + ac_cv_path_SED="/bin/sed" \ + ac_cv_path_AWK="/usr/bin/awk" \ define Build/Compile $(MAKE) -C $(PKG_BUILD_DIR) \ @@ -55,10 +74,10 @@ define Build/Compile all install endef -define Package/ipkungfu/install +define Package/ipkungfu/install $(INSTALL_DIR) $(1)/usr/sbin - $(CP) $(PKG_BUILD_DIR)/dummy_server $(1)/usr/sbin/ - $(CP) $(PKG_BUILD_DIR)/ipkungfu $(1)/usr/sbin/ + $(INSTALL_BIN) $(PKG_BUILD_DIR)/dummy_server $(1)/usr/sbin/ + $(INSTALL_BIN) $(PKG_BUILD_DIR)/ipkungfu $(1)/usr/sbin/ $(INSTALL_DIR) $(1)/etc/ipkungfu/ $(CP) $(PKG_BUILD_DIR)/files/conf/* $(1)/etc/ipkungfu/ endef diff --git a/net/ipkungfu/patches/001-replace-modprobe-with-insmod.patch b/net/ipkungfu/patches/001-replace-modprobe-with-insmod.patch new file mode 100644 index 000000000..477c258f9 --- /dev/null +++ b/net/ipkungfu/patches/001-replace-modprobe-with-insmod.patch @@ -0,0 +1,22 @@ +Index: ipkungfu-0.6.1/ipkungfu.in +=================================================================== +--- ipkungfu-0.6.1.orig/ipkungfu.in 2007-01-21 19:47:04.000000000 -0800 ++++ ipkungfu-0.6.1/ipkungfu.in 2008-08-03 11:41:13.000000000 -0700 +@@ -618,7 +618,7 @@ + # they're built in. + DEFAULT_MODULES_LIST="ip_nat_irc ip_conntrack_ftp ip_nat_ftp ip_conntrack_irc" + for default_module in $DEFAULT_MODULES_LIST; do +- if [ -f $($MODPROBE -la | grep ${default_module}) ]; then ++ if [ -f $(find /lib/modules/$(uname -r) -name "${default_module}*") ]; then + $MODPROBE ${default_module} 2>&1 | logError + fi + done +@@ -627,7 +627,7 @@ + MODULES_ARRAY=(${MODULES_LIST}) + + for module in ${MODULES_ARRAY[@]}; do +- if [ -e /lib/modules/`uname -r`/kernel/net/ipv4/netfilter/${module}* ]; then ++ if [ -e /lib/modules/`uname -r`/${module}* ]; then + if [ -z "`${LSMOD} | grep ${module}`" ] ; then + if [ $INIT != 1 ] ; then + echo -n -e "Loading ${BRIGHT_COLOUR}${module}${CLOSE_COLOUR} module..." -- 2.30.2