diff options
-rw-r--r-- | .SRCINFO | 18 | ||||
-rw-r--r-- | PKGBUILD | 37 | ||||
-rw-r--r-- | fix-warnings.patch | 40 | ||||
-rw-r--r-- | makefile_update.patch | 23 |
4 files changed, 118 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO new file mode 100644 index 000000000000..45b19defcc04 --- /dev/null +++ b/.SRCINFO @@ -0,0 +1,18 @@ +pkgbase = cpuled + pkgdesc = It's a program to let the keyboard LEDs indicate CPU load. + pkgver = 0.1 + pkgrel = 3 + url = http://web.archive.org/web/20011210154318/www.sudac.org/~napolium/linux/ + arch = i686 + arch = x86_64 + license = GPL + depends = glibc + source = http://lara.craft.net.br/cpuled-0.1.tar.gz + source = fix-warnings.patch + source = makefile_update.patch + md5sums = 9b84e1903f2eb555006de0a5cb243c56 + md5sums = 5bcf6651c1d14457dab7c4ed564fffaa + md5sums = 7d54f422517caa23d355483495558f19 + +pkgname = cpuled + diff --git a/PKGBUILD b/PKGBUILD new file mode 100644 index 000000000000..289d1714cf99 --- /dev/null +++ b/PKGBUILD @@ -0,0 +1,37 @@ +# Maintainer: Lara Maia <lara@craft.net.br> + +pkgname=cpuled +pkgdesc="It's a program to let the keyboard LEDs indicate CPU load." +url='http://web.archive.org/web/20011210154318/www.sudac.org/~napolium/linux/' +pkgver=0.1 +pkgrel=3 +arch=('i686' 'x86_64') +depends=('glibc') +license='GPL' + +source=("http://lara.craft.net.br/$pkgname-$pkgver.tar.gz" + 'fix-warnings.patch' + 'makefile_update.patch') + +md5sums=('9b84e1903f2eb555006de0a5cb243c56' + '5bcf6651c1d14457dab7c4ed564fffaa' + '7d54f422517caa23d355483495558f19') + +prepare() { + cd "$srcdir"/$pkgname-$pkgver + + patch -Np0 -i ../fix-warnings.patch + patch -Np0 -i ../makefile_update.patch +} + +build() { + cd "$srcdir"/$pkgname-$pkgver + + make +} + +package() { + cd "$srcdir"/$pkgname-$pkgver + + make DESTDIR="$pkgdir" install +} diff --git a/fix-warnings.patch b/fix-warnings.patch new file mode 100644 index 000000000000..f2e1829a50ea --- /dev/null +++ b/fix-warnings.patch @@ -0,0 +1,40 @@ +--- cpuled.c.orig 2000-08-06 19:37:20.000000000 -0300 ++++ cpuled.c 2012-07-28 22:15:03.873389569 -0300 +@@ -25,7 +25,9 @@ + #include <fcntl.h> + #include <linux/kd.h> + #include <sys/utsname.h> ++#include <sys/ioctl.h> + #include <signal.h> ++#include <stdlib.h> + #include <unistd.h> + + const char *banner = +@@ -96,7 +98,7 @@ + last_total_ticks = cur_total_ticks; + last_ticks = cur_ticks; + +- sscanf(b,"cpu %u %u %u %lu", ++ sscanf(b,"cpu %lu %lu %lu %lu", + &utime,&ntime,&stime,&jiffies); + + #ifdef DEBUG +@@ -112,7 +114,7 @@ + + void update_leds(char status) + { +- char temp; ++ unsigned char temp; + unsigned char leds[3] = {LED_NUM,LED_CAP,LED_SCR}; + + for(temp=0;temp < 3;temp++) +@@ -152,8 +154,8 @@ + int main(int argc, char *argv[]) + { + unsigned long int time_dummy = 0; ++ unsigned char arg_dummy; + char tty[20] = "/dev/"; +- char arg_dummy; + + if(argc < 2) + { diff --git a/makefile_update.patch b/makefile_update.patch new file mode 100644 index 000000000000..f1de2df896bc --- /dev/null +++ b/makefile_update.patch @@ -0,0 +1,23 @@ +--- Makefile.orig 2012-07-29 02:06:22.819373027 -0300 ++++ Makefile 2012-07-29 02:07:19.739370225 -0300 +@@ -1,5 +1,8 @@ ++prefix = /usr ++bindir = $(prefix)/bin + CC = gcc +-CFLAGS = -O2 #-DDEBUG -g ++INSTALL = install ++CFLAGS = -O2 -Wall #-DDEBUG -g + OBJFILES = cpuled.o + PROGRAM = cpuled + VERSION = 0.1 +@@ -7,6 +10,10 @@ + all: $(OBJFILES) + $(CC) $(CFLAGS) $(OBJFILES) -o $(PROGRAM) + ++install: all ++ $(INSTALL) -d $(DESTDIR)$(bindir) ++ $(INSTALL) -m755 $(PROGRAM) $(DESTDIR)$(bindir)/$(PROGRAM) ++ + clean: + -rm $(OBJFILES) + -rm cpuled |