Skip to content

Commit

Permalink
Import from v0.6.1
Browse files Browse the repository at this point in the history
  • Loading branch information
James Rowe authored and James Rowe committed Nov 2, 2003
1 parent 0da7ba7 commit 959128c
Show file tree
Hide file tree
Showing 18 changed files with 308 additions and 114 deletions.
10 changes: 10 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,13 @@
gkrellm.
* : Bumped revision to 0.6.0 from the original 0.5.1 release on
http://pigeond.net/bfm/.

2003-11-02 16:37 James Rowe <Jay@jnrowe.uklinux.net>
* : Applied patch from Huw Giddens to fix the memory usage routines
for 2.6 kernels that still works for 2.4 kernels. It is now
possible to use the same binary with different kernels.
* : Import of debian packaging dir, again from Huw Giddens. Probably
requires some fixing by someone with a Debian box, because
some of the Makefile changes have not been applied. [ PREFIX
and "all" target]. And the "install" target changes have been
taken under some duress.
9 changes: 5 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ EXTRA += -DENABLE_TIME
# EXTRA += -DKDE_DOCKAPP

# where to install this program
PREFIX = /usr/local
PREFIX ?= /usr/local

# no user serviceable parts below
EXTRA += $(WMAN)
Expand Down Expand Up @@ -134,6 +134,7 @@ clean_obj:
clean:
rm -f bubblefishymon *.o *.bb* *.gcov gmon.* *.da *~ *.so
install:
install $(INSTALL) $(BUBBLEFISHYMON) $(DESTDIR)$(PREFIX)/bin
install $(INSTALL_MAN) doc/bubblefishymon.1 $(DESTDIR)$(PREFIX)/man/man1
install:
install -d $(DESTDIR)/$(PREFIX)/bin $(DESTDIR)/$(PREFIX)/share/man/man1
install $(INSTALL) $(BUBBLEFISHYMON) $(DESTDIR)/$(PREFIX)/bin
install $(INSTALL_MAN) doc/bubblefishymon.1 $(DESTDIR)/$(PREFIX)/share/man/man1
4 changes: 2 additions & 2 deletions bubblemon.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* bubblefishymon 0.6.0
* bubblefishymon 0.6.1
*
* Well, Hacks from bubblemon by timecop and Johan
*
Expand Down Expand Up @@ -76,7 +76,7 @@
*/
#define _GNU_SOURCE

#define VERSION "0.6.0"
#define VERSION "0.6.1"

/* general includes */
#include <stdio.h>
Expand Down
7 changes: 7 additions & 0 deletions debian/README.Debian
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
bfm for Debian
--------------

Thanks go to Jamie Wilkinson, on account of how most of the package stuff is
'inspired' by his example with bfm-0.5.1

-- Huw Giddens <gidhu432@student.otago.ac.nz>, Mon, 27 Oct 2003 21:39:29 +1300
2 changes: 2 additions & 0 deletions debian/bubblefishymon.dirs
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
usr/bin
usr/share/man/man1
2 changes: 2 additions & 0 deletions debian/bubblefishymon.docs
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
README
README.bubblemon
35 changes: 35 additions & 0 deletions debian/changelog
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
bfm (0.6.0-5) unstable; urgency=low

* Added missing copyright text to fishmon.c
* Corrected code used to keep fish in the water so that it actually works.

-- Huw Giddens <gidhu432@student.otago.ac.nz> Tue, 28 Oct 2003 20:56:29 +1300

bfm (0.6.0-4) unstable; urgency=low

* If can't open /proc/meminfo, proceed safely rather than over a cliff.
* Add comments to sys_linux.c re: changes I've made.

-- Huw Giddens <gidhu432@student.otago.ac.nz> Mon, 27 Oct 2003 23:30:29 +1300

bfm (0.6.0-3) unstable; urgency=low

* Add other recommends &c. to control file.

-- Huw Giddens <gidhu432@student.otago.ac.nz> Mon, 27 Oct 2003 22:54:29 +1300

bfm (0.6.0-2) unstable; urgency=low

* Added missing build deps to gkrellm-bfm.

-- Huw Giddens <gidhu432@student.otago.ac.nz> Mon, 27 Oct 2003 22:50:29 +1300

bfm (0.6.0-1) unstable; urgency=low

* Initial Release.
* Changed Makefile to make the gkrellm plugin by default.
* Changed the code in sys_linux.c that reads the memory info from
/proc/meminfo to code that works in 2.4 and 2.6.

-- Huw Giddens <gidhu432@student.otago.ac.nz> Mon, 27 Oct 2003 21:39:29 +1300

1 change: 1 addition & 0 deletions debian/compat
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
4
23 changes: 23 additions & 0 deletions debian/control
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
Source: bfm
Section: x11
Priority: optional
Maintainer: Huw Giddens <gidhu432@student.otago.ac.nz>
Build-Depends: debhelper (>= 4.0.0), gkrellm, libgtk2.0-dev
Standards-Version: 3.6.0

Package: bubblefishymon
Architecture: any
Depends: ${shlibs:Depends}
Description: A system load dockapp, based on bubblemon
A load monitor dockapp, descended from wmfishtime and bubblemon.
Features include fish representing network traffic, bubbles representing CPU
usage, and a duck representing a duck.

Package: gkrellm-bfm
Architecture: any
Depends: ${shlibs:Depends}
Recommends: gkrellm
Description: A system load plugin for gkrellm
A load monitor for gkrellm, descended from wmfishtime and bubblemon.
Features include fish representing network traffic, bubbles representing CPU
usage, and a duck representing a duck.
10 changes: 10 additions & 0 deletions debian/copyright
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
This package was debianized by Huw Giddens <gidhu432@student.otago.ac.nz> on
Mon, 27 Oct 2003 21:39:29 +1300.

It was downloaded from http://www.jnrowe.uklinux.net/projects/bfm.php

Upstream Author: James Rowe <Jay@jnrowe.uklinux.net>

Copyright:

See /usr/share/common-licenses/GPL
2 changes: 2 additions & 0 deletions debian/dirs
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
usr/bin
usr/sbin
4 changes: 4 additions & 0 deletions debian/docs
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
README
README.bubblemon
TODO
ChangeLog.orig
1 change: 1 addition & 0 deletions debian/gkrellm-bfm.dirs
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
usr/lib/gkrellm2/plugins
6 changes: 6 additions & 0 deletions debian/menu
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
?package(bubblefishymon):\
needs=X11\
section=Apps/System\
hints="Dockapp,System,Monitor"\
title="bubblefishymon"\
command="/usr/bin/bubblefishymon -n"
115 changes: 115 additions & 0 deletions debian/rules
Original file line number Diff line number Diff line change
@@ -0,0 +1,115 @@
#!/usr/bin/make -f
# -*- makefile -*-
# Sample debian/rules that uses debhelper.
# GNU copyright 1997 to 1999 by Joey Hess.
#
# Modified to make a template file for a multi-binary package with separated
# build-arch and build-indep targets by Bill Allombert 2001

# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1

# This has to be exported to make some magic below work.
export DH_OPTIONS



CFLAGS = -Wall -g

ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
CFLAGS += -O0
else
CFLAGS += -O2
endif
ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
INSTALL_PROGRAM += -s
endif

configure: configure-stamp
configure-stamp:
dh_testdir
touch configure-stamp


#Architecture
build: build-arch build-indep

build-arch: build-arch-stamp
build-arch-stamp: configure-stamp

# Add here commands to compile the arch part of the package.
$(MAKE) bubblefishymon
$(MAKE) gkrellm
touch build-arch-stamp

build-indep: build-indep-stamp
build-indep-stamp: configure-stamp

# Add here commands to compile the indep part of the package.
#$(MAKE) doc
touch build-indep-stamp

clean:
dh_testdir
dh_testroot
rm -f build-arch-stamp build-indep-stamp #CONFIGURE-STAMP#

# Add here commands to clean up after the build process.
-$(MAKE) clean

dh_clean

install: install-arch
install-arch:
dh_testdir
dh_testroot
dh_clean -k -s --exclude ./ChangeLog.orig
dh_installdirs -s

# Add here commands to install the arch part of the package into
# debian/tmp.
$(MAKE) install PREFIX=/usr DESTDIR=$(CURDIR)/debian/bubblefishymon
cp gkrellm-bfm.so $(CURDIR)/debian/gkrellm-bfm/usr/lib/gkrellm2/plugins/

dh_install -s
# Must not depend on anything. This is to be called by
# binary-arch/binary-indep
# in another 'make' thread.
binary-common:
dh_testdir
dh_testroot
dh_installchangelogs ChangeLog
dh_installdocs
dh_installexamples
dh_installmenu
# dh_installdebconf
# dh_installlogrotate
# dh_installemacsen
# dh_installpam
# dh_installmime
# dh_installinit
# dh_installcron
# dh_installinfo
dh_installman
dh_link
dh_strip
dh_compress
dh_fixperms
# dh_perl
# dh_python
dh_makeshlibs
dh_installdeb
dh_shlibdeps
dh_gencontrol
dh_md5sums
dh_builddeb
# Build architecture independant packages using the common target.
binary-indep: build-indep
$(MAKE) -f debian/rules DH_OPTIONS=-i binary-common

# Build architecture dependant packages using the common target.
binary-arch: build-arch install-arch
$(MAKE) -f debian/rules DH_OPTIONS=-a binary-common

binary: binary-arch
.PHONY: build clean binary-arch binary install install-arch configure
55 changes: 36 additions & 19 deletions fishmon.c
Original file line number Diff line number Diff line change
@@ -1,3 +1,23 @@
/* BubbleFishyMon dockapp 0.6.1
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Street #330, Boston, MA 02111-1307, USA.
*/
/* Huw Giddens 2003-10-28: Added missing copyright boilerplate. Corrected the
* calculation that keeps the fish in the water, and put it in its own
* function adjust_y().
*/
#define _GNU_SOURCE
#define VERSION "1.23"

Expand Down Expand Up @@ -50,7 +70,6 @@ void prepare_sprites(void);

/* global variables */
extern BubbleMonData bm;
extern int real_waterlevel_max;
extern int fish_traffic;
extern int time_enabled;

Expand Down Expand Up @@ -226,10 +245,23 @@ void bubble_update(void)
}
}

/* This function adjusts a passed y value so that it's not less than the
* water level. 0 on the y axis is at the top of the frame. This is called by
* fish_update() and traffic_fish_update(). It returns the corrected value.
*/
static int adjust_y(int y)
{
// Pigeon
// Make sure the fish is in the water :)
int min_y = (YMAX * (100 - bm.mem_percent))/100;

if(y <= min_y) return min_y;
else return y;
}

void fish_update(void)
{
int i, j;
int min_y;

for (i = 0; i < NRFISH; i++) {

Expand Down Expand Up @@ -283,14 +315,7 @@ void fish_update(void)
bm.fishes[i].y++;
}

// Pigeon
// Make sure the fish is in the water :)
min_y = real_waterlevel_max + 3;

if(bm.fishes[i].y <= min_y)
{
bm.fishes[i].y = min_y;
}
bm.fishes[i].y = adjust_y(bm.fishes[i].y);

/* handle fish currently turning around */
if (bm.fishes[i].turn) {
Expand Down Expand Up @@ -613,7 +638,6 @@ void putpixel(int x, int y, float i, int linewidth, int color)
void traffic_fish_update()
{
int i, j;
int min_y;

int rx_speed = net_rx_speed();
int tx_speed = net_tx_speed();
Expand Down Expand Up @@ -696,14 +720,7 @@ void traffic_fish_update()
bm.fishes[i].y++;
}

// Pigeon
// Make sure the fish is in the water :)
min_y = real_waterlevel_max + 3;

if(bm.fishes[i].y <= min_y)
{
bm.fishes[i].y = min_y;
}
bm.fishes[i].y = adjust_y(bm.fishes[i].y);

/* animate fishes using fish_animation array */
draw_sprite(bm.fishes[i].tx, bm.fishes[i].y,
Expand Down
2 changes: 1 addition & 1 deletion gkrellm-bfm.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
#include <stdlib.h>
#include <time.h>

#define PLUGIN_VERSION "0.6.0"
#define PLUGIN_VERSION "0.6.1"

#define PLUGIN_NAME "gkrellm-bfm"
#define PLUGIN_DESC "bubblefishymon gkrellm port"
Expand Down
Loading

0 comments on commit 959128c

Please sign in to comment.