Update to 1.2.9. Allow patches (openwrt). Fix buildroot kernel location.
authorManuel Novoa III <mjn3@codepoet.org>
Fri, 5 Mar 2004 19:17:21 +0000 (19:17 -0000)
committerManuel Novoa III <mjn3@codepoet.org>
Fri, 5 Mar 2004 19:17:21 +0000 (19:17 -0000)
Fix install behavior.

make/iptables.mk

index 56bbf1b27c11172b22b5e85450358cf253f1f282..886e54213d56eb1b054a2f73c15f7353872e4987 100644 (file)
@@ -4,8 +4,8 @@
 #
 #############################################################
 IPTABLES_SOURCE_URL=http://www.netfilter.org/files
-IPTABLES_SOURCE=iptables-1.2.8.tar.bz2
-IPTABLES_BUILD_DIR=$(BUILD_DIR)/iptables-1.2.8
+IPTABLES_SOURCE=iptables-1.2.9.tar.bz2
+IPTABLES_BUILD_DIR=$(BUILD_DIR)/iptables-1.2.9
 
 $(DL_DIR)/$(IPTABLES_SOURCE):
         $(WGET) -P $(DL_DIR) $(IPTABLES_SOURCE_URL)/$(IPTABLES_SOURCE) 
@@ -15,21 +15,28 @@ $(IPTABLES_BUILD_DIR)/.unpacked: $(DL_DIR)/$(IPTABLES_SOURCE)
        touch $(IPTABLES_BUILD_DIR)/.unpacked
 
 $(IPTABLES_BUILD_DIR)/.configured: $(IPTABLES_BUILD_DIR)/.unpacked
+       # Allow patches.  Needed for openwrt for instance.
+       $(SOURCE_DIR)/patch-kernel.sh $(IPTABLES_BUILD_DIR) $(SOURCE_DIR) iptables-*.patch
+       #
        $(SED) "s;\[ -f /usr/include/netinet/ip6.h \];grep -q '__UCLIBC_HAS_IPV6__ 1' \
                $(BUILD_DIR)/uClibc/include/bits/uClibc_config.h;" $(IPTABLES_BUILD_DIR)/Makefile
        touch  $(IPTABLES_BUILD_DIR)/.configured
 
 $(IPTABLES_BUILD_DIR)/iptables: $(IPTABLES_BUILD_DIR)/.configured
        $(TARGET_CONFIGURE_OPTS) \
-       $(MAKE) -C $(IPTABLES_BUILD_DIR) KERNEL_DIR=$(BUILD_DIR)/linux CC=$(TARGET_CC)
+       $(MAKE) -C $(IPTABLES_BUILD_DIR) \
+               KERNEL_DIR=$(LINUX_DIR) PREFIX=/usr \
+               CC=$(TARGET_CC) COPT_FLAGS="$(TARGET_CFLAGS)"
 
 $(TARGET_DIR)/sbin/iptables: $(IPTABLES_BUILD_DIR)/iptables
-       # Copy iptables 
-       cp -af $(IPTABLES_BUILD_DIR)/iptables $(TARGET_DIR)/sbin/
-       cp -af $(IPTABLES_BUILD_DIR)/iptables-save $(TARGET_DIR)/sbin/
-       cp -af $(IPTABLES_BUILD_DIR)/iptables-restore $(TARGET_DIR)/sbin/
-       -mkdir -p $(TARGET_DIR)/usr/local/lib/iptables
-       cp -af $(IPTABLES_BUILD_DIR)/extensions/*.so $(TARGET_DIR)/usr/local/lib/iptables/
+       $(TARGET_CONFIGURE_OPTS) \
+       $(MAKE) -C $(IPTABLES_BUILD_DIR) \
+               KERNEL_DIR=$(LINUX_DIR) PREFIX=/usr \
+               CC=$(TARGET_CC) COPT_FLAGS="$(TARGET_CFLAGS)" \
+               DESTDIR=$(TARGET_DIR) install
+       $(STRIP) $(TARGET_DIR)/usr/sbin/iptables*
+       $(STRIP) $(TARGET_DIR)/usr/lib/iptables/*.so
+       rm -rf $(TARGET_DIR)/usr/man
 
 iptables: $(TARGET_DIR)/sbin/iptables