From bdb959b292eb6029e8a1058566e8b47c61c53004 Mon Sep 17 00:00:00 2001 From: Automatic Build System Date: Sat, 6 Jan 2024 10:32:20 +0100 Subject: [PATCH] automatic rebuild by autodist [release 18-4mamba;Tue Aug 27 2013] --- README.md | 5 ++ procinfo-17-lsdev.patch | 43 +++++++++++++++++ procinfo-17-uptime.patch | 33 +++++++++++++ procinfo-18-maxdev.patch | 28 +++++++++++ procinfo-18-mharris-use-sysconf.patch | 23 +++++++++ procinfo-18.makeinstall.patch | 39 +++++++++++++++ procinfo.spec | 69 +++++++++++++++++++++++++++ 7 files changed, 240 insertions(+) create mode 100644 procinfo-17-lsdev.patch create mode 100644 procinfo-17-uptime.patch create mode 100644 procinfo-18-maxdev.patch create mode 100644 procinfo-18-mharris-use-sysconf.patch create mode 100644 procinfo-18.makeinstall.patch create mode 100644 procinfo.spec diff --git a/README.md b/README.md index ad9d00f..c7c9518 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,7 @@ # procinfo +The procinfo command gets system data from the /proc directory (a Linux kernel filesystem), formats it and displays it on standard output. +You can use procinfo to acquire information about your system from the kernel as it is running. + +Install procinfo if you'd like to use it to gather and display system data. + diff --git a/procinfo-17-lsdev.patch b/procinfo-17-lsdev.patch new file mode 100644 index 0000000..e7660b4 --- /dev/null +++ b/procinfo-17-lsdev.patch @@ -0,0 +1,43 @@ +--- procinfo-17/lsdev.pl.broken Thu Nov 16 13:38:17 2000 ++++ procinfo-17/lsdev.pl Thu Nov 16 13:48:42 2000 +@@ -16,6 +16,7 @@ + while () { + next if /^[ \t]*[A-Z]/; + chop; ++ s/^ +//g; + if (/PIC/) { + $n = (@line = split()); + } else { +@@ -32,6 +33,7 @@ + open (DMA, ") { + chop; ++ s/^ +//g; + @line = split(': '); + @tmp = split (/[ \(]/, $line[1]); + $name = $tmp[0]; +@@ -43,6 +45,7 @@ + open (IOPORTS, ") { + chop; ++ s/^ +//g; + @line = split(' : '); + @tmp = split (/[ \(]/, $line[1]); + $name = $tmp[0]; +@@ -51,12 +54,12 @@ + } + close (IOPORTS); + +-printf ("%-16s %4s%6s %s\n------------------------------------------------\n", +- "Device", "DMA", "IRQ", " I/O Ports"); ++printf "%-16s %4s%6s %s\n------------------------------------------------\n", ++ "Device", "DMA", "IRQ", " I/O Ports"; + + foreach $name (sort { uc($a) cmp uc($b) } keys %device) { +- printf ("%-16s %4s%6s %s\n", +- $name, $dma{$name}, $irq{$name}, $port{$name}); ++ printf "%-16s %4s%6s %s\n", ++ $name, $dma{$name}, $irq{$name}, $port{$name}; + } + + # The End #################################################################### diff --git a/procinfo-17-uptime.patch b/procinfo-17-uptime.patch new file mode 100644 index 0000000..71923d7 --- /dev/null +++ b/procinfo-17-uptime.patch @@ -0,0 +1,33 @@ +--- procinfo-17/routines.c.uptime Thu Nov 16 14:21:02 2000 ++++ procinfo-17/routines.c Thu Nov 16 14:30:37 2000 +@@ -390,19 +390,19 @@ + unsigned int d, h, m, s; + static char buf[22]; + +- t = t * 100 / HZ; +- d = (int) (t / 8640000); +- t = t - (long) (d * 8640000); +- h = (int) (t / 360000); +- t = t - (long) (h * 360000); +- m = (int) (t / 6000); +- t = t - (long) (m * 6000); +- s = (int) (t / 100); +- t = t - (long) (s * 100); ++ t *= (100 / HZ); ++ d = (unsigned int) (t / 8640000); ++ t -= (unsigned long) (d * 8640000); ++ h = (unsigned int) (t / 360000); ++ t -= (unsigned long) (h * 360000); ++ m = (unsigned int) (t / 6000); ++ t -= (unsigned long) (m * 6000); ++ s = (unsigned int) (t / 100); ++ t -= (unsigned long) (s * 100); + if (d > 0) +- sprintf (buf, "%3ud %2u:%02u:%02u.%02u", d, h, m, s, (int) t); ++ sprintf (buf, "%3ud %2u:%02u:%02u.%02u", d, h, m, s, (unsigned int) t); + else +- sprintf (buf, " %2u:%02u:%02u.%02u", h, m, s, (int) t); ++ sprintf (buf, " %2u:%02u:%02u.%02u", h, m, s, (unsigned int) t); + return buf; + } + diff --git a/procinfo-18-maxdev.patch b/procinfo-18-maxdev.patch new file mode 100644 index 0000000..5a2806a --- /dev/null +++ b/procinfo-18-maxdev.patch @@ -0,0 +1,28 @@ +--- procinfo-18/procinfo.h.maxdev 2004-12-16 18:02:26.000000000 +0100 ++++ procinfo-18/procinfo.h 2004-12-17 11:18:11.239523416 +0100 +@@ -69,10 +69,10 @@ + #define CDRV 0 + #define BDRV 1 + #ifndef MAX_CHRDEV +-#define MAX_CHRDEV 32 ++#define MAX_CHRDEV 512 + #endif + #ifndef MAX_BLKDEV +-#define MAX_BLKDEV 32 ++#define MAX_BLKDEV 512 + #endif + #define MAX_DEV MAX(MAX_CHRDEV, MAX_BLKDEV) + +--- procinfo-18/procinfo.c.maxdev 2004-12-17 11:19:52.421141472 +0100 ++++ procinfo-18/procinfo.c 2004-12-17 11:20:49.312492672 +0100 +@@ -613,7 +613,9 @@ + printf ("%s\nCharacter Devices: " + "Block Devices:\n", + fs ? ce : ""); +- while (fgets (line, sizeof (line), devicesfp)) { ++ while (fgets (line, sizeof (line), devicesfp) && ++ count[CDRV] < MAX_DEV && ++ count[BDRV] < MAX_DEV) { + switch (line[0]) { + case 'C': + which = CDRV; diff --git a/procinfo-18-mharris-use-sysconf.patch b/procinfo-18-mharris-use-sysconf.patch new file mode 100644 index 0000000..ac4e58c --- /dev/null +++ b/procinfo-18-mharris-use-sysconf.patch @@ -0,0 +1,23 @@ +--- procinfo-18/procinfo.c.mharris-use-sysconf 2004-01-16 15:40:37.000000000 -0500 ++++ procinfo-18/procinfo.c 2004-01-17 02:01:16.000000000 -0500 +@@ -837,19 +837,7 @@ + } + + /* Count number of CPUs */ +- cpuinfofp = myfopen (PROC_DIR "cpuinfo"); +- if (cpuinfofp) { +- while (fgets (line, sizeof (line), cpuinfofp)) +- if (!strncmp ("processor", line, 9)) /* intel */ +- nr_cpus++; +- else if (!strncmp ("ncpus ", line, 6)) /* sparc */ +- nr_cpus = atoi(line+19); +- else if (!strncmp ("cpus detected", line, 13)) /* alpha */ +- nr_cpus = atoi(line+27); +- fclose (cpuinfofp); +- } +- if (nr_cpus == 0) +- nr_cpus = 1; ++ nr_cpus = sysconf (_SC_NPROCESSORS_ONLN); + + /* Gets called from winsz(), but in case stdout is redirected: */ + version = make_version (versionfp); diff --git a/procinfo-18.makeinstall.patch b/procinfo-18.makeinstall.patch new file mode 100644 index 0000000..b520914 --- /dev/null +++ b/procinfo-18.makeinstall.patch @@ -0,0 +1,39 @@ +--- procinfo-18/Makefile 2001-02-25 00:29:53.000000000 +0100 ++++ procinfo-18-fix/Makefile 2005-09-13 10:26:41.000000000 +0200 +@@ -1,10 +1,12 @@ + ### Makefile for procinfo. + + prefix=/usr ++bindir=$(prefix)/bin ++mandir=$(prefix)/share/man + + CC = gcc -Wall -Wstrict-prototypes + +-CFLAGS = -O2 ++CFLAGS = $(RPM_OPT_FLAGS) + LDFLAGS = -s + + # If you get lots of `undefined references', you probably need -lncurses +@@ -32,14 +34,14 @@ + procinfo: procinfo.o routines.o + + install: procinfo procinfo.8 lsdev.pl socklist.pl lsdev.8 +- -mkdir -p $(prefix)/bin +- install procinfo $(prefix)/bin/procinfo +- install lsdev.pl $(prefix)/bin/lsdev +- install socklist.pl $(prefix)/bin/socklist +- -mkdir -p $(prefix)/man/man8 +- install -m 644 procinfo.8 $(prefix)/man/man8/procinfo.8 +- install -m 644 lsdev.8 $(prefix)/man/man8/lsdev.8 +- install -m 644 socklist.8 $(prefix)/man/man8/socklist.8 ++ -mkdir -p $(bindir) ++ install -m 755 procinfo $(bindir)/procinfo ++ install -m 755 lsdev.pl $(bindir)/lsdev ++ install -m 755 socklist.pl $(bindir)/socklist ++ -mkdir -p $(mandir)/man8 ++ install -m 644 procinfo.8 $(mandir)/man8/procinfo.8 ++ install -m 644 lsdev.8 $(mandir)/man8/lsdev.8 ++ install -m 644 socklist.8 $(mandir)/man8/socklist.8 + + clean: + rm -f procinfo procinfo.0 *.o *~ out diff --git a/procinfo.spec b/procinfo.spec new file mode 100644 index 0000000..c8cf484 --- /dev/null +++ b/procinfo.spec @@ -0,0 +1,69 @@ +Name: procinfo +Version: 18 +Release: 4mamba +Summary: A tool for gathering and displaying system information +Group: System/Tools +Vendor: openmamba +Distribution: openmamba +Packager: Silvan Calarco +URL: ftp://ftp.cistron.nl/pub/people/00-OLD/sandervm +Source: ftp://ftp.cistron.nl/pub/people/00-OLD/sandervm/%{name}-%{version}.tar.gz +Patch0: %{name}-17-lsdev.patch +Patch1: %{name}-17-uptime.patch +Patch2: %{name}-18.makeinstall.patch +Patch3: %{name}-18-maxdev.patch +Patch4: %{name}-18-mharris-use-sysconf.patch +License: GPL +BuildRoot: %{_tmppath}/%{name}-%{version}-root +## AUTOBUILDREQ-BEGIN +BuildRequires: glibc-devel +BuildRequires: libncurses-devel +## AUTOBUILDREQ-END + +%description +The procinfo command gets system data from the /proc directory (a Linux kernel filesystem), formats it and displays it on standard output. +You can use procinfo to acquire information about your system from the kernel as it is running. + +Install procinfo if you'd like to use it to gather and display system data. + +%prep +%setup -q +%patch0 -p1 -b .lsdev +%patch1 -p1 -b .uptime +%patch2 -p1 -b .makeinstall +%patch3 -p1 -b .maxdev +%patch4 -p1 -b .mharris-use-sysconf + +%build +%make LDLIBS=-lncurses LDFLAGS= + +%install +[ "%{buildroot}" != / ] && rm -rf "%{buildroot}" +%makeoldinstall + +%clean +[ "%{buildroot}" != / ] && rm -rf "%{buildroot}" + +%files +%defattr(-,root,root) +%{_bindir}/procinfo +%{_bindir}/lsdev +%{_bindir}/socklist +%{_mandir}/man8/procinfo.* +%{_mandir}/man8/lsdev.* +%{_mandir}/man8/socklist.* +%doc README CHANGES + +%changelog +* Tue Aug 27 2013 Automatic Build System 18-4mamba +- automatic rebuild by autodist + +* Tue Sep 30 2008 Tiziana Ferro 18-3mamba +- update buildrequirements list +- format descripion + +* Tue Sep 13 2005 Davide Madrisan 18-2qilnx +- specfile fixes + +* Wed Apr 09 2003 Mirko Cortillaro 18-1qilnx +- first build