summaryrefslogtreecommitdiff
path: root/package/netplug
diff options
context:
space:
mode:
authorMartin Banky <martin.banky@gmail.com>2010-12-12 22:54:01 +0100
committerPeter Korsgaard <jacmet@sunsite.dk>2010-12-14 00:56:10 +0100
commit20d4792e5ba878962a135057bff7ee658c264911 (patch)
treecc845165085eee8482f7d9d6d7fbad6e9c74cbb9 /package/netplug
parent03f36427e4ed199cd2890b254c160dc09656c3d8 (diff)
netplug: convert to gentargets and bump to 1.2.9.2
Signed-off-by: Martin Banky <Martin.Banky@gmail.com> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com> Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
Diffstat (limited to 'package/netplug')
-rw-r--r--package/netplug/netplug-1.2.9-disable-werror.patch22
-rw-r--r--package/netplug/netplug-1.2.9.2-makefile-flags.patch21
-rw-r--r--package/netplug/netplug-socklen-type.patch12
-rw-r--r--package/netplug/netplug.mk53
4 files changed, 35 insertions, 73 deletions
diff --git a/package/netplug/netplug-1.2.9-disable-werror.patch b/package/netplug/netplug-1.2.9-disable-werror.patch
deleted file mode 100644
index d8a3e15a1..000000000
--- a/package/netplug/netplug-1.2.9-disable-werror.patch
+++ /dev/null
@@ -1,22 +0,0 @@
-netplug uses nested functions, and gcc generates a warning that
-is turned into an error:
-
-cc1: warnings being treated as errors
-if_info.c: In function 'ifsm_scriptdone':
-if_info.c:289: error: generating trampoline in object (requires executable stack)
-
-Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
-
-Index: netplug-1.2.9/Makefile
-===================================================================
---- netplug-1.2.9.orig/Makefile 2010-05-09 21:07:40.000000000 +0200
-+++ netplug-1.2.9/Makefile 2010-05-09 21:09:32.000000000 +0200
-@@ -9,7 +9,7 @@
-
- install_opts :=
-
--CFLAGS += -Wall -Werror -std=gnu99 -DNP_ETC_DIR='"$(etcdir)"' \
-+CFLAGS += -Wall -std=gnu99 -DNP_ETC_DIR='"$(etcdir)"' \
- -DNP_SCRIPT_DIR='"$(scriptdir)"' -ggdb3 -O3 -DNP_VERSION='"$(version)"'
-
- netplugd: config.o netlink.o lib.o if_info.o main.o
diff --git a/package/netplug/netplug-1.2.9.2-makefile-flags.patch b/package/netplug/netplug-1.2.9.2-makefile-flags.patch
new file mode 100644
index 000000000..b2468f8c8
--- /dev/null
+++ b/package/netplug/netplug-1.2.9.2-makefile-flags.patch
@@ -0,0 +1,21 @@
+Preserve the cflags settings, because buildroot clobbers them.
+
+--- a/Makefile 2010-10-05 00:06:38.000000000 -0700
++++ b/Makefile 2010-10-05 00:15:27.000000000 -0700
+@@ -11,11 +11,14 @@ mandir ?= $(prefix)/usr/share/man
+
+ install_opts :=
+
+-CFLAGS += -Wall -std=gnu99 -DNP_ETC_DIR='"$(etcdir)"' \
++NETPLUG_CFLAGS += -Wall -std=gnu99 -DNP_ETC_DIR='"$(etcdir)"' \
+ -DNP_SCRIPT_DIR='"$(scriptdir)"' -ggdb3 -O3 -DNP_VERSION='"$(version)"'
+
++%.o: %.c
++ $(CC) $(NETPLUG_CFLAGS) $(CFLAGS) -c -o $@ $<
++
+ netplugd: config.o netlink.o lib.o if_info.o main.o
+- $(CC) $(LDFLAGS) -o $@ $^
++ $(CC) $(LDFLAGS) -o $@ $(NETPLUG_CFLAGS) $^
+
+ install:
+ install -d $(install_opts) -m 755 \
diff --git a/package/netplug/netplug-socklen-type.patch b/package/netplug/netplug-socklen-type.patch
deleted file mode 100644
index 1e3698823..000000000
--- a/package/netplug/netplug-socklen-type.patch
+++ /dev/null
@@ -1,12 +0,0 @@
-diff -ur netplug-1.2.9/netlink.c netplug-1.2.9-patched/netlink.c
---- netplug-1.2.9/netlink.c 2005-01-07 23:57:09.000000000 -0600
-+++ netplug-1.2.9-patched/netlink.c 2008-02-27 20:18:09.855767996 -0600
-@@ -284,7 +284,7 @@
- exit(1);
- }
-
-- int addr_len = sizeof(addr);
-+ socklen_t addr_len = sizeof(addr);
-
- if (getsockname(fd, (struct sockaddr *) &addr, &addr_len) == -1) {
- do_log(LOG_ERR, "Could not get socket details: %m");
diff --git a/package/netplug/netplug.mk b/package/netplug/netplug.mk
index 74fa0c597..98d15044c 100644
--- a/package/netplug/netplug.mk
+++ b/package/netplug/netplug.mk
@@ -3,51 +3,26 @@
# netplug
#
#############################################################
-NETPLUG_VERSION=1.2.9
+NETPLUG_VERSION=1.2.9.2
NETPLUG_SOURCE=netplug-$(NETPLUG_VERSION).tar.bz2
NETPLUG_SITE=http://www.red-bean.com/~bos/netplug
-NETPLUG_DIR=$(BUILD_DIR)/netplug-$(NETPLUG_VERSION)
-NETPLUG_CAT:=$(BZCAT)
-NETPLUG_BINARY:=netplugd
-NETPLUG_TARGET_BINARY:=sbin/netplugd
-$(DL_DIR)/$(NETPLUG_SOURCE):
- $(call DOWNLOAD,$(NETPLUG_SITE),$(NETPLUG_SOURCE))
+define NETPLUG_BUILD_CMDS
+ $(MAKE) $(TARGET_CONFIGURE_OPTS) -C $(@D)
+endef
-netplug-source: $(DL_DIR)/$(NETPLUG_SOURCE)
+define NETPLUG_INSTALL_TARGET_CMDS
+ $(MAKE) DESTDIR=$(TARGET_DIR) -C $(@D) install
+endef
-$(NETPLUG_DIR)/.unpacked: $(DL_DIR)/$(NETPLUG_SOURCE)
- $(NETPLUG_CAT) $(DL_DIR)/$(NETPLUG_SOURCE) | tar -C $(BUILD_DIR) $(TAR_OPTIONS) -
- toolchain/patch-kernel.sh $(NETPLUG_DIR) package/netplug/ netplug\*.patch
- touch $(NETPLUG_DIR)/.unpacked
-
-$(NETPLUG_DIR)/$(NETPLUG_BINARY): $(NETPLUG_DIR)/.unpacked
- $(MAKE) CC="$(TARGET_CC)" -C $(NETPLUG_DIR)
- $(STRIPCMD) $(NETPLUG_DIR)/$(NETPLUG_BINARY)
-
-$(TARGET_DIR)/$(NETPLUG_TARGET_BINARY): $(NETPLUG_DIR)/$(NETPLUG_BINARY)
- $(INSTALL) -m 644 -D $(NETPLUG_DIR)/etc/netplugd.conf $(TARGET_DIR)/etc/netplug/netplugd.conf
- $(INSTALL) -m 755 -D package/netplug/netplug-script $(TARGET_DIR)/etc/netplug.d/netplug
- $(INSTALL) -m 755 -D package/netplug/S29netplug $(TARGET_DIR)/etc/init.d
- $(INSTALL) -m 755 -D $(NETPLUG_DIR)/$(NETPLUG_BINARY) $(TARGET_DIR)/$(NETPLUG_TARGET_BINARY)
- touch -c $(TARGET_DIR)/$(NETPLUG_TARGET_BINARY)
-
-netplug: $(TARGET_DIR)/$(NETPLUG_TARGET_BINARY)
-
-netplug-clean:
- rm -f $(TARGET_DIR)/$(NETPLUG_TARGET_BINARY)
+define NETPLUG_UNINSTALL_TARGET_CMDS
+ rm -f $(TARGET_DIR)/sbin/netplugd
rm -rf $(TARGET_DIR)/etc/netplug*
rm -f $(TARGET_DIR)/etc/init.d/S*netplug
- -$(MAKE) -C $(NETPLUG_DIR) clean
+endef
-netplug-dirclean:
- rm -rf $(NETPLUG_DIR)
+define NETPLUG_CLEAN_CMDS
+ -$(MAKE) -C $(@D) clean
+endef
-#############################################################
-#
-# Toplevel Makefile options
-#
-#############################################################
-ifeq ($(BR2_PACKAGE_NETPLUG),y)
-TARGETS+=netplug
-endif
+$(eval $(call GENTARGETS,package,netplug))