From 190e2b4bb2f768228319f2e3d0507c8b7380996c Mon Sep 17 00:00:00 2001
From: Kaspar Schleiser <kaspar@schleiser.de>
Date: Tue, 22 Mar 2016 18:29:46 +0100
Subject: [PATCH] pkg: libcoap: adapt to use pkg.mk

---
 pkg/libcoap/Makefile         | 30 ++++--------------------------
 pkg/libcoap/Makefile.include |  2 +-
 2 files changed, 5 insertions(+), 27 deletions(-)

diff --git a/pkg/libcoap/Makefile b/pkg/libcoap/Makefile
index 5953fc8c3c..7a97abcd3c 100644
--- a/pkg/libcoap/Makefile
+++ b/pkg/libcoap/Makefile
@@ -1,37 +1,15 @@
 PKG_NAME=libcoap
 PKG_URL=https://github.com/obgm/libcoap
 PKG_VERSION=ef41ce5d02d64cec0751882ae8fd95f6c32bc018
-PKG_DIR=$(CURDIR)/$(PKG_NAME)
 
 ifneq ($(RIOTBASE),)
 INCLUDES += -I$(RIOTBASE)/sys/include -I$(RIOTBASE)/sys/net/include \
 			-I$(RIOTBASE)/sys/posix/include -I$(RIOTBASE)/sys/posix/pnet/include
 endif
 
-.PHONY: all clean patch reset
+.PHONY: all
 
-all: patch
-	"$(MAKE)" -C $(PKG_DIR)
+all: download
+	"$(MAKE)" -C $(PKG_BUILDDIR)
 
-patch: $(PKG_DIR)/Makefile
-
-$(PKG_DIR)/Makefile: $(PKG_DIR)/.git/config
-	cd "$(PKG_DIR)" && git am --ignore-whitespace "$(CURDIR)"/*.patch
-
-$(PKG_DIR)/.git/config:
-	test -d "$(PKG_DIR)" || $(GITCACHE) clone "$(PKG_URL)" "$(PKG_VERSION)" "$(PKG_DIR)"
-
-clean::
-	@echo "Cleaning up libcoap package..."
-	@cd "$(PKG_DIR)" 2> /dev/null > /dev/null && \
-		git clean -x -f && \
-		git am --abort && \
-		git reset --hard "$(PKG_VERSION)" && \
-		$(MAKE) patch || true
-
-
-distclean::
-	rm -rf "$(PKG_DIR)"
-
-Makefile.include:
-	@true
+include $(RIOTBASE)/pkg/pkg.mk
diff --git a/pkg/libcoap/Makefile.include b/pkg/libcoap/Makefile.include
index 1370285f4d..7b3d3b9756 100644
--- a/pkg/libcoap/Makefile.include
+++ b/pkg/libcoap/Makefile.include
@@ -1,3 +1,3 @@
-INCLUDES += -I$(RIOTPKG)/libcoap/libcoap \
+INCLUDES += -I$(BINDIR)/pkg/libcoap \
 			-I$(RIOTBASE)/sys/posix/include \
 			-I$(RIOTBASE)/sys/net/include
-- 
GitLab