From 0bc2a5215b66b69b84b141fdade74c9081b541a0 Mon Sep 17 00:00:00 2001 From: Tim Orling Date: Feb 24 2018 17:52:58 +0000 Subject: Add static inline patch to fix FTBFS * Add autoconf, automake to BuildRequires * Fix tabs vs. spaces rpmlint warnings * Add rpmlint for spelling filters * Add static inline patch From: https://gitweb.gentoo.org/repo/gentoo.git/tree/net-analyzer/bwm-ng/files/bwm-ng-0.6.1-static-inline.patch --- diff --git a/.rpmlint b/.rpmlint new file mode 100644 index 0000000..a14a960 --- /dev/null +++ b/.rpmlint @@ -0,0 +1,9 @@ +addFilter("spelling-error %description -l en_US proc -> crop, prov, pro") +addFilter("spelling-error %description -l en_US dev -> deb, derv, div") +addFilter("spelling-error %description -l en_US netstat -> net stat, net-stat, nets tat") +addFilter("spelling-error %description -l en_US getifaddr -> multifaceted") +addFilter("spelling-error %description -l en_US sysctl -> systolic") +addFilter("spelling-error %description -l en_US kstat -> stat, k stat, ks tat") +addFilter("spelling-error %description -l en_US diskstats -> disk stats, disk-stats, disks tats") +addFilter("spelling-error %description -l en_US devstat -> devastate") +addFilter("spelling-error %description -l en_US libstatgrab -> Stalingrad") diff --git a/bwm-ng-0.6.1-static-inline.patch b/bwm-ng-0.6.1-static-inline.patch new file mode 100644 index 0000000..29b9ebc --- /dev/null +++ b/bwm-ng-0.6.1-static-inline.patch @@ -0,0 +1,257 @@ +Make all 'inline' functions 'static inline' such that +the compiler can emit definitions when needed. +http://www.greenend.org.uk/rjk/tech/inline.html + +--- a/src/bwm-ng.c ++++ b/src/bwm-ng.c +@@ -26,7 +26,7 @@ + + /* handle interrupt signal */ + void sigint(int sig) FUNCATTR_NORETURN; +-inline void init(void); ++static inline void init(void); + + /* clear stuff and exit */ + #ifdef __STDC__ +@@ -98,7 +98,7 @@ + deinit(0, NULL); + } + +-inline void init(void) { ++static inline void init(void) { + if_count=0; + delay=500; + #if EXTENDED_STATS +--- a/src/help.c ++++ b/src/help.c +@@ -24,9 +24,9 @@ + #include "global_vars.h" + #include "help.h" + +-inline void print_help_line(const char *short_c,const char * long_c,const char *descr); ++static inline void print_help_line(const char *short_c,const char * long_c,const char *descr); + +-inline void print_help_line(const char *short_c,const char * long_c,const char *descr) { ++static inline void print_help_line(const char *short_c,const char * long_c,const char *descr) { + #ifdef LONG_OPTIONS + printf(" %-23s",long_c); + #else +--- a/src/options.c ++++ b/src/options.c +@@ -30,12 +30,12 @@ + char *trim_whitespace(char *str); + int read_config(const char *config_file); + #endif +-inline int str2output_unit(char *optarg); ++static inline int str2output_unit(char *optarg); + #if EXTENDED_STATS +-inline int str2output_type(char *optarg); ++static inline int str2output_type(char *optarg); + #endif +-inline int str2out_method(char *optarg); +-inline int str2in_method(char *optarg); ++static inline int str2out_method(char *optarg); ++static inline int str2in_method(char *optarg); + + #ifdef CONFIG_FILE + /****************************************************************************** +@@ -65,7 +65,7 @@ + /******************************************************************************/ + #endif + +-inline int str2output_unit(char *optarg) { ++static inline int str2output_unit(char *optarg) { + if (optarg) { + if (!strcasecmp(optarg,"bytes")) return BYTES_OUT; + if (!strcasecmp(optarg,"bits")) return BITS_OUT; +@@ -76,7 +76,7 @@ + } + + #if EXTENDED_STATS +-inline int str2output_type(char *optarg) { ++static inline int str2output_type(char *optarg) { + if (optarg) { + if (!strcasecmp(optarg,"rate")) return RATE_OUT; + if (!strcasecmp(optarg,"max")) return MAX_OUT; +@@ -87,7 +87,7 @@ + } + #endif + +-inline int str2out_method(char *optarg) { ++static inline int str2out_method(char *optarg) { + if (optarg) { + if (!strcasecmp(optarg,"plain")) return PLAIN_OUT; + #ifdef HAVE_CURSES +@@ -109,7 +109,7 @@ + } + + +-inline int str2in_method(char *optarg) { ++static inline int str2in_method(char *optarg) { + if (optarg) { + #ifdef PROC_NET_DEV + if (!strcasecmp(optarg,"proc")) return PROC_IN; +--- a/src/output.c ++++ b/src/output.c +@@ -25,13 +25,13 @@ + #include "output.h" + + inline static const char *output_type2str(void); +-inline const char *input2str(void); +-inline const char *show_all_if2str(void); +-inline ullong direction2value(char mode,struct inout_long stats); ++static inline const char *input2str(void); ++static inline const char *show_all_if2str(void); ++static inline ullong direction2value(char mode,struct inout_long stats); + #if EXTENDED_STATS +-inline double direction_max2value(char mode,struct inouttotal_double stats,int items); ++static inline double direction_max2value(char mode,struct inouttotal_double stats,int items); + #endif +-inline char *dyn_byte_value2str(double value,char *str,int buf_size); ++static inline char *dyn_byte_value2str(double value,char *str,int buf_size); + char *values2str(char mode,t_iface_speed_stats stats,t_iface_stats full_stats,float multiplier,char *str,int buf_size); + + inline static const char *output_type2str(void) { +@@ -59,7 +59,7 @@ + } + + +-inline const char *input2str(void) { ++static inline const char *input2str(void) { + switch (input_method) { + #ifdef SYSCTL + case SYSCTL_IN: +@@ -121,7 +121,7 @@ + return ""; + } + +-inline const char *show_all_if2str(void) { ++static inline const char *show_all_if2str(void) { + switch (show_all_if) { + case 1: + return " (all)"; +@@ -262,7 +262,7 @@ + } + + +-inline ullong direction2value(char mode,struct inout_long stats) { ++static inline ullong direction2value(char mode,struct inout_long stats) { + switch (mode) { + case 0: + return stats.in; +@@ -275,7 +275,7 @@ + } + + #if EXTENDED_STATS +-inline double direction_max2value(char mode,struct inouttotal_double stats,int items) { ++static inline double direction_max2value(char mode,struct inouttotal_double stats,int items) { + switch (mode) { + case 0: + return (double)(stats.in/items); +@@ -288,7 +288,7 @@ + } + #endif + +-inline char *dyn_byte_value2str(double value,char *str,int buf_size) { ++static inline char *dyn_byte_value2str(double value,char *str,int buf_size) { + if (dynamic) { + if (value<1024) + snprintf(str,buf_size,"%15.2f ",value); +@@ -306,7 +306,7 @@ + return str; + } + +-inline char *dyn_bit_value2str(double value,char *str,int buf_size) { ++static inline char *dyn_bit_value2str(double value,char *str,int buf_size) { + if (dynamic) { + if (value<1000) + snprintf(str,buf_size,"%15.2f ",value); +--- a/src/process.c ++++ b/src/process.c +@@ -26,19 +26,19 @@ + + short show_iface(char *instr, char *searchstr,char iface_is_up); + #if HAVE_GETTIMEOFDAY +-inline long tvdiff(struct timeval newer, struct timeval older); ++static inline long tvdiff(struct timeval newer, struct timeval older); + float get_time_delay(int iface_num); + #endif +-inline ullong calc_new_values(ullong new, ullong old); ++static inline ullong calc_new_values(ullong new, ullong old); + t_iface_speed_stats convert2calced_values(t_iface_speed_stats new, t_iface_speed_stats old); + t_iface_speed_stats convert2calced_disk_values(t_iface_speed_stats new, t_iface_speed_stats old); + #if EXTENDED_STATS +-inline void sub_avg_values(struct inouttotal_double *values,struct inouttotal_double data); +-inline void add_avg_values(struct inouttotal_double *values,struct inouttotal_double data); +-inline void save_avg_values(struct inouttotal_double *values,struct inouttotal_double *data,struct inout_long calced_stats,float multiplier); ++static inline void sub_avg_values(struct inouttotal_double *values,struct inouttotal_double data); ++static inline void add_avg_values(struct inouttotal_double *values,struct inouttotal_double data); ++static inline void save_avg_values(struct inouttotal_double *values,struct inouttotal_double *data,struct inout_long calced_stats,float multiplier); + void save_avg(struct t_avg *avg,struct iface_speed_stats calced_stats,float multiplier); +-inline void save_sum(struct inout_long *stats,struct inout_long new_stats_values); +-inline void save_max(struct inouttotal_double *stats,struct inout_long calced_stats,float multiplier); ++static inline void save_sum(struct inout_long *stats,struct inout_long new_stats_values); ++static inline void save_max(struct inouttotal_double *stats,struct inout_long calced_stats,float multiplier); + #endif + + /* returns the whether to show the iface or not +@@ -74,7 +74,7 @@ + + #if HAVE_GETTIMEOFDAY + /* Returns: the time difference in milliseconds. */ +-inline long tvdiff(struct timeval newer, struct timeval older) { ++static inline long tvdiff(struct timeval newer, struct timeval older) { + return labs((newer.tv_sec-older.tv_sec)*1000+ + (newer.tv_usec-older.tv_usec)/1000); + } +@@ -92,7 +92,7 @@ + #endif + + /* basically new-old, but handles "overflow" of source aswell */ +-inline ullong calc_new_values(ullong new, ullong old) { ++static inline ullong calc_new_values(ullong new, ullong old) { + /* FIXME: WRAP_AROUND _might_ be wrong for libstatgrab, where the type is always long long */ + return (new>=old) ? (ullong)(new-old) : (ullong)(( + #ifdef HAVE_LIBKSTAT +@@ -133,13 +133,13 @@ + + #if EXTENDED_STATS + /* sub old values from cached for avg stats */ +-inline void sub_avg_values(struct inouttotal_double *values,struct inouttotal_double data) { ++static inline void sub_avg_values(struct inouttotal_double *values,struct inouttotal_double data) { + values->in-=data.in; + values->out-=data.out; + values->total-=data.total; + } + +-inline void add_avg_values(struct inouttotal_double *values,struct inouttotal_double data) { ++static inline void add_avg_values(struct inouttotal_double *values,struct inouttotal_double data) { + values->in+=data.in; + values->out+=data.out; + values->total+=data.total; +@@ -148,7 +148,7 @@ + + /* put new-old bytes in inout_long struct into a inouttotal_double struct + * and add values to cached .value struct */ +-inline void save_avg_values(struct inouttotal_double *values,struct inouttotal_double *data,struct inout_long calced_stats,float multiplier) { ++static inline void save_avg_values(struct inouttotal_double *values,struct inouttotal_double *data,struct inout_long calced_stats,float multiplier) { + data->in=calced_stats.in*multiplier; + data->out=calced_stats.out*multiplier; + data->total=(calced_stats.in+calced_stats.out)*multiplier; +@@ -198,13 +198,13 @@ + } + + /* add current in and out bytes to totals struct */ +-inline void save_sum(struct inout_long *stats,struct inout_long new_stats_values) { ++static inline void save_sum(struct inout_long *stats,struct inout_long new_stats_values) { + stats->in+=new_stats_values.in; + stats->out+=new_stats_values.out; + } + + /* lookup old max values and save new if higher */ +-inline void save_max(struct inouttotal_double *stats,struct inout_long calced_stats,float multiplier) { ++static inline void save_max(struct inouttotal_double *stats,struct inout_long calced_stats,float multiplier) { + if (multiplier*calced_stats.in > stats->in) + stats->in=multiplier*calced_stats.in; + if (multiplier*calced_stats.out>stats->out) + diff --git a/bwm-ng.spec b/bwm-ng.spec index e22f4fd..a19ac57 100644 --- a/bwm-ng.spec +++ b/bwm-ng.spec @@ -1,11 +1,14 @@ Name: bwm-ng Version: 0.6.1 -Release: 5%{?dist} +Release: 6%{?dist} Summary: Bandwidth Monitor NG License: GPLv2+ URL: http://www.volker-gropp.de/?id=projects&sub=bwm-ng Source0: http://www.volker-gropp.de/bwm-ng/%{name}-%{version}.tar.gz Source1: bwm-ng.conf +Patch0: bwm-ng-0.6.1-static-inline.patch +BuildRequires: autoconf +BuildRequires: automake BuildRequires: ncurses-devel Requires: hostname Requires: procps @@ -25,19 +28,20 @@ Features: %prep %setup -q +%patch0 -p1 %build %configure --enable-64bit \ - --enable-netstatbyte \ - --enable-netstatlink \ - --with-ncurses \ - --with-time \ - --with-getopt_long \ - --with-getifaddrs \ - --with-sysctl \ - --with-procnetdev \ - --with-netstatlinux \ - --without-strip + --enable-netstatbyte \ + --enable-netstatlink \ + --with-ncurses \ + --with-time \ + --with-getopt_long \ + --with-getifaddrs \ + --with-sysctl \ + --with-procnetdev \ + --with-netstatlinux \ + --without-strip make %{?_smp_mflags} %install @@ -52,6 +56,12 @@ install -pDm644 bwm-ng.1 %{buildroot}%{_mandir}/man1/bwm-ng.1 %{_mandir}/man1/bwm-ng.1* %changelog +* Sat Feb 24 2018 Tim Orling - 0.6.1-6 +- Add BuildRequires: autoconf automake +- Add static inline patch +- Add rpmlint +Resolves: rhbz#1423286 bwm-ng: FTBFS in rawhide + * Wed Aug 02 2017 Fedora Release Engineering - 0.6.1-5 - Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild @@ -118,56 +128,56 @@ install -pDm644 bwm-ng.1 %{buildroot}%{_mandir}/man1/bwm-ng.1 * Mon Feb 23 2009 Fedora Release Engineering - 0.6-4 - Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild -* Wed Feb 13 2008 Patrick "Jima" Laughton 0.6-3 +* Wed Feb 13 2008 Patrick "Jima" Laughton - 0.6-3 - Bump-n-build for GCC 4.3 -* Tue Aug 21 2007 Patrick "Jima" Laughton 0.6-2 +* Tue Aug 21 2007 Patrick "Jima" Laughton - 0.6-2 - Rebuild for BuildID - License clarification -* Fri Mar 16 2007 Patrick "Jima" Laughton 0.6-1 +* Fri Mar 16 2007 Patrick "Jima" Laughton - 0.6-1 - Update - Filename change: changelog -> ChangeLog - Removed tag at start of spec (since I don't use it) -* Thu Jan 25 2007 Patrick "Jima" Laughton 0.5-9 +* Thu Jan 25 2007 Patrick "Jima" Laughton - 0.5-9 - Added noreplace to config, as per rpmlint warning - Removed a couple spaces which triggered spaces/tabs rpmlint warning - Fixed project URL -* Wed Oct 04 2006 Patrick "Jima" Laughton 0.5-8 +* Wed Oct 04 2006 Patrick "Jima" Laughton - 0.5-8 - Bump-n-build -* Tue Sep 19 2006 Patrick "Jima" Laughton - 0.5-7 +* Tue Sep 19 2006 Patrick "Jima" Laughton - 0.5-7 - Bump for FC6 rebuild -* Fri Aug 12 2005 Oliver Falk - 0.5-6 +* Fri Aug 12 2005 Oliver Falk - 0.5-6 - Rebuild against libstatgrab 0.12 -* Thu Jul 14 2005 Oliver Falk - 0.5-5 +* Thu Jul 14 2005 Oliver Falk - 0.5-5 - Integrated Matthias changes, after his review -* Thu May 19 2005 Oliver Falk - 0.5-4.2 +* Thu May 19 2005 Oliver Falk - 0.5-4.2 - Specfile cleanup -* Fri Mar 25 2005 Oliver Falk - 0.5-4.1 +* Fri Mar 25 2005 Oliver Falk - 0.5-4.1 - Check with lint says: bwm-ng hardcoded-packager-tag Oliver: FIXED -* Wed Mar 16 2005 Oliver Falk - 0.5-4 +* Wed Mar 16 2005 Oliver Falk - 0.5-4 - Fix, still build pre1 :-/ -* Wed Mar 16 2005 Oliver Falk - 0.5-3 +* Wed Mar 16 2005 Oliver Falk - 0.5-3 - Update to real 0.5, not only 0.5pre1 -* Tue Feb 15 2005 Oliver Falk - 0.5-2 +* Tue Feb 15 2005 Oliver Falk - 0.5-2 - Make use of libstatgrab, by using it in the default config -* Tue Feb 15 2005 Oliver Falk - 0.5-1 +* Tue Feb 15 2005 Oliver Falk - 0.5-1 - Fix warnings spotted by rpmlint - Update - Update dependencies and add various configure switches, so this little thingy is no longer _little_ :-) -* Tue Oct 19 2004 Oliver Falk - 0.4-pre1-1 +* Tue Oct 19 2004 Oliver Falk - 0.4-pre1-1 - Initial package