Ticket #10686: net-mrtg.diff

File net-mrtg.diff, 5.9 KB (added by p.pisati@…, 6 years ago)
  • feeds/packages/net/mrtg/patches/001-rm-printf-longlong-fmt-test.patch

     
     1--- mrtg-2.17.3.orig/configure.in       2011-12-25 23:54:18.284584003 +0100 
     2+++ mrtg-2.17.3/configure.in    2011-12-25 23:54:52.377260252 +0100 
     3@@ -19,47 +19,6 @@ 
     4  
     5 AC_PATH_PROGS(NROFF, groff nroff) 
     6  
     7-dnl Check for long long type (64 bit rateup) 
     8-AC_CHECK_HEADERS(inttypes.h) 
     9-AC_CHECK_TYPE(unsigned long long) 
     10-AC_CHECK_TYPE(long long) 
     11-AC_CHECK_FUNCS(strtoll) 
     12- 
     13-# Taken from libIDL-0.8.2 
     14-AC_MSG_CHECKING([for printf long long format specifier]) 
     15-AC_CACHE_VAL(long_long_format_specifier,[ 
     16-    for format in ll l q I64; do 
     17-        AC_TRY_RUN([#include <stdio.h>   
     18-            int main() 
     19-            { 
     20-                long long b, a = -0x3AFAFAFAFAFAFAFALL; 
     21-                char buffer[1000]; 
     22-                sprintf (buffer, "%${format}u", a); 
     23-                sscanf (buffer, "%${format}u", &b); 
     24-                exit (b!=a); 
     25-            } 
     26-            ], 
     27-            long_long_format_specifier="%${format}d" 
     28-            long_long_format="${format}d" 
     29-            break) 
     30-        done]) 
     31-AC_MSG_RESULT($long_long_format_specifier) 
     32-AC_DEFINE_UNQUOTED(LLD, "$long_long_format_specifier", 
     33-    [How to print a long long]) 
     34-AC_DEFINE_UNQUOTED(LLD_FORMAT, "$long_long_format", 
     35-    [long long format without % specifier]) 
     36- 
     37-AH_BOTTOM( 
     38-#ifndef HAVE_STRTOLL      
     39-long long int strtoll(const char *str, char **ptr, int base) 
     40-{ 
     41-        long long int ll; 
     42-        sscanf(str, LLD, &ll); 
     43-        return ll; 
     44-} 
     45-#endif 
     46-) 
     47- 
     48 dnl Checks for libraries. 
     49 AC_CHECK_LIB(m, pow, [ MATHLIBS="-lm" ]) 
     50  
     51--- mrtg-2.17.3.orig/configure  2011-12-26 00:02:43.178539074 +0100 
     52+++ mrtg-2.17.3/configure       2011-12-26 00:04:09.056241468 +0100 
     53@@ -3609,60 +3609,6 @@ 
     54 done 
     55  
     56  
     57-# Taken from libIDL-0.8.2 
     58-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for printf long long format specifier" >&5 
     59-$as_echo_n "checking for printf long long format specifier... " >&6; } 
     60-if test "${long_long_format_specifier+set}" = set; then : 
     61-  $as_echo_n "(cached) " >&6 
     62-else 
     63- 
     64-    for format in ll l q I64; do 
     65-        if test "$cross_compiling" = yes; then : 
     66-  { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 
     67-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} 
     68-as_fn_error $? "cannot run test program while cross compiling 
     69-See \`config.log' for more details" "$LINENO" 5 ; } 
     70-else 
     71-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext 
     72-/* end confdefs.h.  */ 
     73-#include <stdio.h> 
     74-            int main() 
     75-            { 
     76-                long long b, a = -0x3AFAFAFAFAFAFAFALL; 
     77-                char buffer[1000]; 
     78-                sprintf (buffer, "%${format}u", a); 
     79-                sscanf (buffer, "%${format}u", &b); 
     80-                exit (b!=a); 
     81-            } 
     82- 
     83-_ACEOF 
     84-if ac_fn_c_try_run "$LINENO"; then : 
     85-  long_long_format_specifier="%${format}d" 
     86-            long_long_format="${format}d" 
     87-            break 
     88-fi 
     89-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ 
     90-  conftest.$ac_objext conftest.beam conftest.$ac_ext 
     91-fi 
     92- 
     93-        done 
     94-fi 
     95- 
     96-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $long_long_format_specifier" >&5 
     97-$as_echo "$long_long_format_specifier" >&6; } 
     98- 
     99-cat >>confdefs.h <<_ACEOF 
     100-#define LLD "$long_long_format_specifier" 
     101-_ACEOF 
     102- 
     103- 
     104-cat >>confdefs.h <<_ACEOF 
     105-#define LLD_FORMAT "$long_long_format" 
     106-_ACEOF 
     107- 
     108- 
     109- 
     110- 
     111 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pow in -lm" >&5 
     112 $as_echo_n "checking for pow in -lm... " >&6; } 
     113 if test "${ac_cv_lib_m_pow+set}" = set; then : 
  • feeds/packages/net/mrtg/Makefile

     
     1#  
     2# Copyright (C) 2011 OpenWrt.org 
     3# Copyright (C) 2011 Paolo Pisati <p.pisati@gmail.com> 
     4# 
     5# This is free software, licensed under the GNU General Public License v2. 
     6# See /LICENSE for more information. 
     7# 
     8 
     9include $(TOPDIR)/rules.mk 
     10 
     11PKG_NAME:=mrtg 
     12PKG_VERSION:=2.17.3 
     13PKG_RELEASE:= 
     14 
     15PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz 
     16PKG_SOURCE_URL:=http://oss.oetiker.ch/mrtg/pub/ 
     17PKG_MD5SUM:=c803f671d04367ee719039ea71fb5b37 
     18 
     19PKG_INSTALL:=1 
     20 
     21include $(INCLUDE_DIR)/package.mk 
     22 
     23define Package/mrtg 
     24  SECTION:=net 
     25  CATEGORY:=Network 
     26  DEPENDS:=+libgd +libpng +zlib +perl +perlbase-essential +perlbase-findbin +perlbase-cwd +perlbase-config +perlbase-file +perlbase-getopt +perlbase-math +perlbase-integer +perlbase-xsloader +perlbase-pod +perlbase-universal +perlbase-socket +perlbase-posix +perlbase-autoloader +perlbase-fcntl +perlbase-tie +perlbase-io +perlbase-symbol +perlbase-selectsaver +perlbase-errno 
     27  TITLE:=The Multi Router Traffic Grapher 
     28  URL:=http://oss.oetiker.ch/mrtg/index.en.html 
     29endef 
     30 
     31define Package/mrtg/description 
     32  The Multi Router Traffic Grapher, or just simply MRTG, is free software for 
     33  monitoring and measuring the traffic load on network links. It allows the 
     34  user to see traffic load on a network over time in graphical form. It was 
     35  originally developed by Tobias Oetiker and Dave Rand to monitor router 
     36  traffic, but has developed into a tool that can create graphs and statistics 
     37  for almost anything. 
     38endef 
     39 
     40EXTRA_CFLAGS+= $(TARGET_CPPFLAGS) 
     41EXTRA_LDFLAGS+= $(TARGET_LDFLAGS) -Wl,-rpath-link,$(STAGING_DIR)/usr/lib 
     42 
     43define Package/mrtg/install 
     44        $(INSTALL_DIR) $(1)/usr/bin 
     45        $(CP) $(PKG_INSTALL_DIR)/usr/bin/* $(1)/usr/bin/ 
     46        $(INSTALL_DIR) $(1)/usr/lib 
     47        $(CP) $(PKG_INSTALL_DIR)/usr/lib/* $(1)/usr/lib/ 
     48        $(INSTALL_DIR) $(1)/usr/share 
     49        $(CP) $(PKG_INSTALL_DIR)/usr/share/* $(1)/usr/share/ 
     50endef 
     51 
     52$(eval $(call BuildPackage,mrtg))