Package-Name: procps
Requires: glibc ncurses|ncurses4
Compile-Requires: gcc binutils make
Homepage: http://procps.sourceforge.net/
Source: http://procps.sourceforge.net/download.html/(procps-\d+\.\d+\.\d+\.tar\.gz)/[\0-\377]*?procps-(\d+.\d+.\d+).tar.gz $1
Zap-Before-Install: 1
Repack:
	tar xzvfp "$(SOURCE)"
Compile:
	cp -pf BUGS COPYING* NEWS TODO "$(PREFIX)/"
	umask 022 ; mkdir -p "$(PREFIX)"/{bin,man/man{1,8},sbin}
	$(MAKE) all install \
		CC="gcc -I/usr/include/ncurses -O2 $(GCC_OPT_FLAGS)" \
		SHARED=0 \
		DESTDIR="" \
		bin="$(PREFIX)/bin/" \
		usr/bin="$(PREFIX)/bin/" \
		usr/proc/bin="$(PREFIX)/bin/" \
		usr/X11/bin="$(PREFIX)/bin/" \
		sbin="$(PREFIX)/sbin/" \
		man1="$(PREFIX)/man/man1/" \
		man5="$(PREFIX)/man/man5/" \
		man8="$(PREFIX)/man/man8/" \
		etc/X11/applnk/Utilities="$(PREFIX)/etc/" \
		lib="$(PREFIX)/lib/" \
		usr/lib="$(PREFIX)/lib/" \
		usr/include="$(PREFIX)/include/" \
		ln_f="ln -fs"
	rm -f "$(PREFIX)"/bin/oldps "$(PREFIX)"/man/man1/oldps.1
Install:
	mv -f "$(PREFIX)"/bin/{kill,ps} /bin/
	mv -f "$(PREFIX)"/sbin/sysctl /sbin/
	$(MAKE) instbin BIN="free pgrep pkill pmap skill snice tload top uptime vmstat w watch"
	if test -x "$(PREFIX)"/bin/XConsole ; then \
		$(MAKE) instbin BIN=XConsole ; \
	fi
	$(MAKE) instman SECTION=1 MAN="free kill pgrep pkill pmap ps skill snice tload top uptime w watch"
	$(MAKE) instman SECTION=5 MAN="sysctl.conf"
	$(MAKE) instman SECTION=8 MAN="sysctl vmstat"
Patch: <<EOT
######## begin HZ calculation fix
--- proc/sysinfo.c.old	2005-03-14 13:31:27 +0900
+++ proc/sysinfo.c	2006-03-20 16:11:52 +0900
@@ -122,7 +122,8 @@
 unsigned long long Hertz;
 
 static void old_Hertz_hack(void){
-  unsigned long long user_j, nice_j, sys_j, other_j;  /* jiffies (clock ticks) */
+  unsigned long long user_j, nice_j, sys_j, idle_j, iowait_j, irq_j,
+                     softirq_j, steal_j;  /* jiffies (clock ticks) */
   double up_1, up_2, seconds;
   unsigned long long jiffies;
   unsigned h;
@@ -133,13 +134,15 @@
   do{
     FILE_TO_BUF(UPTIME_FILE,uptime_fd);  sscanf(buf, "%lf", &up_1);
     /* uptime(&up_1, NULL); */
+    user_j = nice_j = sys_j = idle_j = iowait_j = irq_j = softirq_j = steal_j = 0;
     FILE_TO_BUF(STAT_FILE,stat_fd);
-    sscanf(buf, "cpu %Lu %Lu %Lu %Lu", &user_j, &nice_j, &sys_j, &other_j);
+    sscanf(buf, "cpu %Lu %Lu %Lu %Lu %Lu %Lu %Lu %Lu", &user_j, &nice_j,
+           &sys_j, &idle_j, &iowait_j, &irq_j, &softirq_j, &steal_j);
     FILE_TO_BUF(UPTIME_FILE,uptime_fd);  sscanf(buf, "%lf", &up_2);
     /* uptime(&up_2, NULL); */
   } while((long long)( (up_2-up_1)*1000.0/up_1 )); /* want under 0.1% error */
   setlocale(LC_NUMERIC, savelocale);
-  jiffies = user_j + nice_j + sys_j + other_j;
+  jiffies = user_j + nice_j + sys_j + idle_j + iowait_j + irq_j + softirq_j + steal_j;
   seconds = (up_1 + up_2) / 2;
   h = (unsigned)( (double)jiffies/seconds/smp_num_cpus );
   /* actual values used by 2.4 kernels: 32 64 100 128 1000 1024 1200 */
######## end HZ calculation fix
######## begin cuteness patch
--- kill.1.old	2003-06-30 12:22:41 +0900
+++ kill.1	2003-11-08 23:58:11 +0900
@@ -7,7 +7,7 @@
 .\" Michael K. Johnson
 .TH KILL 1 "November 21, 1999" "Linux" "Linux User's Manual"
 .SH NAME
-kill \- send a signal to a process
+kill \- terminate a process with extreme prejudice
 
 .SH SYNOPSIS
 .TS
######## end cuteness patch
EOT

/bin/kill
/bin/ps
/sbin/sysctl
/pkg/procps/
/usr/bin/XConsole
/usr/bin/free
/usr/bin/pgrep
/usr/bin/pkill
/usr/bin/pmap
/usr/bin/skill
/usr/bin/snice
/usr/bin/tload
/usr/bin/top
/usr/bin/uptime
/usr/bin/vmstat
/usr/bin/w
/usr/bin/watch
/usr/man/man1/free.1.gz
/usr/man/man1/kill.1.gz
/usr/man/man1/pgrep.1.gz
/usr/man/man1/pkill.1.gz
/usr/man/man1/pmap.1.gz
/usr/man/man1/ps.1.gz
/usr/man/man1/skill.1.gz
/usr/man/man1/snice.1.gz
/usr/man/man1/tload.1.gz
/usr/man/man1/top.1.gz
/usr/man/man1/uptime.1.gz
/usr/man/man1/w.1.gz
/usr/man/man1/watch.1.gz
/usr/man/man5/sysctl.conf.5.gz
/usr/man/man8/sysctl.8.gz
/usr/man/man8/vmstat.8.gz
