Browse Source

port the stats utility from Rusty Russell

Phil Sutter 9 years ago
parent
commit
49e03ead81
2 changed files with 52 additions and 0 deletions
  1. 24 0
      package/stats/Makefile
  2. 28 0
      package/stats/patches/patch-Makefile

+ 24 - 0
package/stats/Makefile

@@ -0,0 +1,24 @@
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include $(ADK_TOPDIR)/rules.mk
+
+
+PKG_NAME:=		stats
+PKG_VERSION:=		82bd4977b607b8714f361467e37a9d801ff911b6
+PKG_RELEASE:=		1
+PKG_DESCR:=		Rusty Russell\'s stats utility
+PKG_SECTION:=		sys/utils
+PKG_URL:=		https://github.com/rustyrussell/stats
+PKG_SITES:=		git://github.com/rustyrussell/stats.git
+
+include $(ADK_TOPDIR)/mk/package.mk
+
+$(eval $(call PKG_template,STATS,$(PKG_NAME),$(PKG_VERSION)-${PKG_RELEASE},${PKG_DEPENDS},${PKG_DESCR},${PKG_SECTION}))
+
+post-install:
+	$(INSTALL_DIR) $(IDIR_STATS)/usr/bin
+	$(INSTALL_BIN) $(WRKINST)/usr/local/bin/stats \
+		$(IDIR_STATS)/usr/bin
+
+include ${ADK_TOPDIR}/mk/pkg-bottom.mk

+ 28 - 0
package/stats/patches/patch-Makefile

@@ -0,0 +1,28 @@
+	- allow for passing custom compiler FLAGS
+	- use host CC and CFLAGS for tools/configurator build
+--- stats-82bd4977b607b8714f361467e37a9d801ff911b6.orig/Makefile	2015-02-23 22:34:48.000000000 +0100
++++ stats-82bd4977b607b8714f361467e37a9d801ff911b6/Makefile	2015-02-23 22:38:45.478017862 +0100
+@@ -5,10 +5,10 @@ PREFIX = /usr/local
+ OPTFLAGS=-O3 -flto
+ #OPTFLAGS=-g
+ WARNFLAGS=-Wall -Wstrict-prototypes -Wundef
+-CPPFLAGS=-I.
+-CFLAGS=$(OPTFLAGS) $(WARNFLAGS)
+-LDFLAGS=$(OPTFLAGS)
+-LDLIBS=-lm
++CPPFLAGS+=-I.
++CFLAGS+=$(OPTFLAGS) $(WARNFLAGS)
++LDFLAGS+=$(OPTFLAGS)
++LDLIBS+=-lm
+ 
+ # Comment this out (or use "VALGRIND=" on cmdline) if you don't have valgrind.
+ VALGRIND=valgrind --quiet --leak-check=full --error-exitcode=5
+@@ -41,6 +41,8 @@ $(OFILES): config.h
+ config.h: tools/configurator
+ 	if $< > $@.tmp; then mv $@.tmp $@; else rm -f $@.tmp; fi
+ 
++tools/configurator: CC=${CC_FOR_BUILD}
++tools/configurator: CFLAGS=${OPTFLAGS} ${WARNFLAGS}
+ stats: $(OFILES)
+ 
+ distclean: clean