[Pkg-wmaker-commits] [wmacpi] 82/105: Rename acpi-ng to wmacpi-cli. Renaming moved from debian/rules to Makefile patch.

Doug Torrance dtorrance-guest at moszumanska.debian.org
Tue Aug 18 01:13:48 UTC 2015


This is an automated email from the git hooks/post-receive script.

dtorrance-guest pushed a commit to branch master
in repository wmacpi.

commit 417eb5245a5c74e800609dccaeee2752a13cc0bf
Author: Doug Torrance <dtorrance at monmouthcollege.edu>
Date:   Mon Jul 28 16:01:34 2014 -0500

    Rename acpi-ng to wmacpi-cli. Renaming moved from debian/rules to Makefile patch.
---
 debian/patches/fix_compiler_flags.patch        |  13 +-
 debian/patches/rename_acpi_to_acpi-ng.patch    |  68 -----
 debian/patches/rename_acpi_to_wmacpi-cli.patch | 349 +++++++++++++++++++++++++
 debian/patches/series                          |   2 +-
 debian/rules                                   |   2 -
 5 files changed, 356 insertions(+), 78 deletions(-)

diff --git a/debian/patches/fix_compiler_flags.patch b/debian/patches/fix_compiler_flags.patch
index 0e60126..f855cd7 100644
--- a/debian/patches/fix_compiler_flags.patch
+++ b/debian/patches/fix_compiler_flags.patch
@@ -1,12 +1,11 @@
 Description: Fix compiler flags
  Fix Makefile so that CFLAGS and LDFLAGS are not overwritten.  Compile
- with CFLAGS and CPPFLAGS.  
+ with CFLAGS and CPPFLAGS.
 
 Author: Doug Torrance <dtorrance at monmouthcollege.edu>
-
---- wmacpi-2.2~rc5.orig/Makefile
-+++ wmacpi-2.2~rc5/Makefile
-@@ -13,8 +13,8 @@ BUILD_CLI = 1
+--- a/Makefile
++++ b/Makefile
+@@ -13,8 +13,8 @@
  #OPT	= -pg -g
  
  CC	:= gcc
@@ -17,7 +16,7 @@ Author: Doug Torrance <dtorrance at monmouthcollege.edu>
  
  WMSRC	:= wmacpi.c libacpi.c
  HEADERS := libacpi.h wmacpi.h
-@@ -37,7 +37,7 @@ WMOBJ := $(patsubst %.c,%.o,$(filter %.c
+@@ -37,7 +37,7 @@
  -include $(WMOBJ:.o=.d)
  
  wmacpi:	$(WMOBJ)
@@ -26,7 +25,7 @@ Author: Doug Torrance <dtorrance at monmouthcollege.edu>
  
  # for the Debian package, we want to make building the command line tools
  # optional. So, we hide all the necessary stuff here . . . 
-@@ -47,7 +47,7 @@ CLOBJ := $(patsubst %.c,%.o,$(filter %.c
+@@ -47,7 +47,7 @@
  -include $(CLOBJ:.o=.d)
  
  acpi: $(CLOBJ)
diff --git a/debian/patches/rename_acpi_to_acpi-ng.patch b/debian/patches/rename_acpi_to_acpi-ng.patch
deleted file mode 100644
index dba7dee..0000000
--- a/debian/patches/rename_acpi_to_acpi-ng.patch
+++ /dev/null
@@ -1,68 +0,0 @@
-Description: Rename acpi to acpi-ng.
- To avoid conflict with the acpi package, which also provides /usr/bin/acpi,
- the acpi binary file provided with this package is being renamed to acpi-ng.
- This was a former name of this file in a previous release, and it is still
- referred to as such several places in the source.  This patch updates the
- documentation to reflect this change.
-Author: Doug Torrance <dtorrance at monmouthcollege.edu>
-Last-Update: <2014-07-20>
-
---- wmacpi-2.2~rc5.orig/acpi.c
-+++ wmacpi-2.2~rc5/acpi.c
-@@ -45,7 +45,7 @@ void usage(char *name)
- 
- void print_version(void)
- {
--	printf("acpi version %s\n", ACPI_VER);
-+	printf("acpi-ng version %s\n", ACPI_VER);
- 	printf(" Using libacpi version %s\n", LIBACPI_VER);
- }
- 
---- wmacpi-2.2~rc5.orig/wmacpi.1
-+++ wmacpi-2.2~rc5/wmacpi.1
-@@ -2,7 +2,7 @@
- .SH NAME
- wmacpi \- Battery status monitor for systems supporting ACPI
- .SH NAME
--acpi \- Query battery status for systems supporting ACPI
-+acpi-ng \- Query battery status for systems supporting ACPI
- .SH SYNOPSIS
- .B wmacpi
- [
-@@ -39,7 +39,7 @@ samples ]
- .RI -h
- ]
- .PP
--.B acpi
-+.B acpi-ng
- [
- .RI -a
- samples ]
-@@ -77,7 +77,7 @@ and a scrolling message with some hopefu
- Clicking on the window cycles through the batteries that the ACPI
- system knows about.
- .PP
--.B acpi
-+.B acpi-ng
- queries the battery status from the command line. It prints the power
- status, the percentage remaining for each battery found, and the time
- remaining if the system is on battery, or the time remaining for each
-@@ -115,8 +115,7 @@ rate.
- .TP
- .B \-x, --cmdline
- Run wmacpi in command line mode - this operates identically to 
--.B acpi
--..
-+.B acpi-ng\&.
- .TP
- .B \-a, --samples=samples
- Average the time remaining over num samples. This greatly improves the
-@@ -136,7 +135,7 @@ Disable scrolling message.
- .B \-h, --help
- Display help.
- .TP
--.B acpi
-+.B acpi-ng
- .TP
- .B \-a num
- Average the time remaining over num samples. This greatly improves the
diff --git a/debian/patches/rename_acpi_to_wmacpi-cli.patch b/debian/patches/rename_acpi_to_wmacpi-cli.patch
new file mode 100644
index 0000000..41a409d
--- /dev/null
+++ b/debian/patches/rename_acpi_to_wmacpi-cli.patch
@@ -0,0 +1,349 @@
+Description: Rename acpi to wmacpi-cli.
+ To avoid conflict with the acpi package, which also provides /usr/bin/acpi,
+ the acpi binary file provided with this package is being renamed to wmacpi-cli.
+Author: Doug Torrance <dtorrance at monmouthcollege.edu>
+Last-Update: <2014-07-28>
+
+--- a/acpi.c
++++ /dev/null
+@@ -1,129 +0,0 @@
+-/*
+- * acpi-ng: command line acpi battery status tool.
+- *
+- * Written by Simon Fowler <simon at dreamcraft.com.au>, 2003-06-20.
+- * Copyright 2003-06-20 Dreamcraft Pty Ltd.
+- *
+- * This file is distributed under the GNU General Public License, 
+- * version 2. Please see the COPYING file for details.
+- */
+-
+-/*
+- * 2003-06-20.
+- * I'm getting sick of not having a convenient way to query battery
+- * status on the command line, so I'm hacking up this - a quick little
+- * command line tool to display current battery status, using the same
+- * libacpi code as wmacpi-ng.
+- */
+-
+-#define _GNU_SOURCE
+-
+-#include <stdio.h>
+-#include <stdlib.h>
+-#include <string.h>
+-#include <getopt.h>
+-#include <unistd.h>
+-
+-#include "libacpi.h"
+-
+-#define ACPI_VER "2.2rc5"
+-
+-global_t *globals;
+-
+-void usage(char *name)
+-{
+-	printf("%s: query battery status on ACPI enabled systems.\n"
+-	       "Usage:\n"
+-	       "%s [-h] [-a samples]\n"
+-	       " h - display this help information\n"
+-	       " a - average remaining time over some number of samples\n"
+-	       "     much more accurate than using a single sample\n"
+-	       " V - increase verbosity\n"
+-	       " v - print version information\n",
+-	       name, name);
+-}
+-
+-void print_version(void)
+-{
+-	printf("acpi version %s\n", ACPI_VER);
+-	printf(" Using libacpi version %s\n", LIBACPI_VER);
+-}
+-
+-int main(int argc, char *argv[])
+-{
+-	int i, j, ch;
+-	int sleep_time = 0;
+-	int samples = 1;
+-	battery_t *binfo;
+-	adapter_t *ap;
+-
+-	while((ch = getopt(argc, argv, "hvVa:")) != EOF) {
+-		switch(ch) {
+-		case 'h':
+-			usage(argv[0]);
+-			return 0;
+-		case 'V':
+-			verbosity++;
+-			break;
+-		case 'v':
+-			print_version();
+-			return 0;
+-		case 'a':
+-			if(optarg != NULL) {
+-				samples = atoi(optarg);
+-				if(samples > 1000 || samples <= 0) {
+-					fprintf(stderr, "Please specify a reasonable number of samples\n");
+-					exit(1);
+-				}
+-			}
+-			pinfo("samples: %d\n", samples);
+-			sleep_time = 1000000/samples;
+-			break;
+-		default:
+-			usage(argv[0]);
+-			return 1;
+-		}
+-	}
+-
+-	globals = (global_t *) malloc(sizeof(global_t));
+-
+-	power_init(globals);
+-	/* we want to acquire samples over some period of time, so . . . */
+-	for(i = 0; i < samples + 2; i++) {
+-		for(j = 0; j < globals->battery_count; j++)
+-			acquire_batt_info(globals, j);
+-		acquire_global_info(globals);
+-		usleep(sleep_time);
+-	}
+-	
+-	ap = &globals->adapter;
+-	if(ap->power == AC) {
+-		printf("On AC Power");
+-		for(i = 0; i < globals->battery_count; i++) {
+-			binfo = &batteries[i];
+-			if(binfo->present && (binfo->charge_state == CHARGE)) {
+-				printf("; Battery %s charging", binfo->name);
+-				printf(", currently at %2d%%", binfo->percentage);
+-				if(binfo->charge_time >= 0) 
+-					printf(", %2d:%02d remaining", 
+-					       binfo->charge_time/60,
+-					       binfo->charge_time%60);
+-			}
+-		}
+-		printf("\n");
+-	} else if(ap->power == BATT) {
+-		printf("On Battery");
+-		for(i = 0; i < globals->battery_count; i++) {
+-			binfo = &batteries[i];
+-			if(binfo->present && (binfo->percentage >= 0))
+-				printf(", Battery %s at %d%%", binfo->name,
+-				       binfo->percentage);
+-		}
+-		if(globals->rtime >= 0)
+-			printf("; %d:%02d remaining", globals->rtime/60, 
+-			       globals->rtime%60);
+-		printf("\n");
+-	}
+-	return 0;
+-}
+-
+--- a/wmacpi.1
++++ b/wmacpi.1
+@@ -2,7 +2,7 @@
+ .SH NAME
+ wmacpi \- Battery status monitor for systems supporting ACPI
+ .SH NAME
+-acpi \- Query battery status for systems supporting ACPI
++wmacpi-cli \- Query battery status for systems supporting ACPI
+ .SH SYNOPSIS
+ .B wmacpi
+ [
+@@ -39,7 +39,7 @@
+ .RI -h
+ ]
+ .PP
+-.B acpi
++.B wmacpi-cli
+ [
+ .RI -a
+ samples ]
+@@ -77,7 +77,7 @@
+ Clicking on the window cycles through the batteries that the ACPI
+ system knows about.
+ .PP
+-.B acpi
++.B wmacpi-cli
+ queries the battery status from the command line. It prints the power
+ status, the percentage remaining for each battery found, and the time
+ remaining if the system is on battery, or the time remaining for each
+@@ -115,8 +115,7 @@
+ .TP
+ .B \-x, --cmdline
+ Run wmacpi in command line mode - this operates identically to 
+-.B acpi
+-..
++.B wmacpi-cli\&.
+ .TP
+ .B \-a, --samples=samples
+ Average the time remaining over num samples. This greatly improves the
+@@ -136,7 +135,7 @@
+ .B \-h, --help
+ Display help.
+ .TP
+-.B acpi
++.B wmacpi-cli
+ .TP
+ .B \-a num
+ Average the time remaining over num samples. This greatly improves the
+--- a/Makefile
++++ b/Makefile
+@@ -22,8 +22,8 @@
+ doc_targets := wmacpi.1
+ 
+ ifdef BUILD_CLI
+-targets += acpi
+-doc_targets += acpi.1
++targets += wmacpi-cli
++doc_targets += wmacpi-cli.1
+ endif
+ 
+ PREFIX := /usr/local
+@@ -42,11 +42,11 @@
+ # for the Debian package, we want to make building the command line tools
+ # optional. So, we hide all the necessary stuff here . . . 
+ ifdef BUILD_CLI
+-CLSRC := acpi.c libacpi.c
++CLSRC := wmacpi-cli.c libacpi.c
+ CLOBJ := $(patsubst %.c,%.o,$(filter %.c,$(CLSRC)))
+ -include $(CLOBJ:.o=.d)
+ 
+-acpi: $(CLOBJ)
++wmacpi-cli: $(CLOBJ)
+ 	$(CC) $(LDFLAGS) -o $@ $^ $(CFLAGS) $(CPPFLAGS)
+ endif
+ 
+--- /dev/null
++++ b/wmacpi-cli.1
+@@ -0,0 +1 @@
++.so man1/wmacpi.1
+--- /dev/null
++++ b/wmacpi-cli.c
+@@ -0,0 +1,129 @@
++/*
++ * acpi-ng: command line acpi battery status tool.
++ *
++ * Written by Simon Fowler <simon at dreamcraft.com.au>, 2003-06-20.
++ * Copyright 2003-06-20 Dreamcraft Pty Ltd.
++ *
++ * This file is distributed under the GNU General Public License, 
++ * version 2. Please see the COPYING file for details.
++ */
++
++/*
++ * 2003-06-20.
++ * I'm getting sick of not having a convenient way to query battery
++ * status on the command line, so I'm hacking up this - a quick little
++ * command line tool to display current battery status, using the same
++ * libacpi code as wmacpi-ng.
++ */
++
++#define _GNU_SOURCE
++
++#include <stdio.h>
++#include <stdlib.h>
++#include <string.h>
++#include <getopt.h>
++#include <unistd.h>
++
++#include "libacpi.h"
++
++#define ACPI_VER "2.2rc5"
++
++global_t *globals;
++
++void usage(char *name)
++{
++	printf("%s: query battery status on ACPI enabled systems.\n"
++	       "Usage:\n"
++	       "%s [-h] [-a samples]\n"
++	       " h - display this help information\n"
++	       " a - average remaining time over some number of samples\n"
++	       "     much more accurate than using a single sample\n"
++	       " V - increase verbosity\n"
++	       " v - print version information\n",
++	       name, name);
++}
++
++void print_version(void)
++{
++	printf("wmacpi-cli version %s\n", ACPI_VER);
++	printf(" Using libacpi version %s\n", LIBACPI_VER);
++}
++
++int main(int argc, char *argv[])
++{
++	int i, j, ch;
++	int sleep_time = 0;
++	int samples = 1;
++	battery_t *binfo;
++	adapter_t *ap;
++
++	while((ch = getopt(argc, argv, "hvVa:")) != EOF) {
++		switch(ch) {
++		case 'h':
++			usage(argv[0]);
++			return 0;
++		case 'V':
++			verbosity++;
++			break;
++		case 'v':
++			print_version();
++			return 0;
++		case 'a':
++			if(optarg != NULL) {
++				samples = atoi(optarg);
++				if(samples > 1000 || samples <= 0) {
++					fprintf(stderr, "Please specify a reasonable number of samples\n");
++					exit(1);
++				}
++			}
++			pinfo("samples: %d\n", samples);
++			sleep_time = 1000000/samples;
++			break;
++		default:
++			usage(argv[0]);
++			return 1;
++		}
++	}
++
++	globals = (global_t *) malloc(sizeof(global_t));
++
++	power_init(globals);
++	/* we want to acquire samples over some period of time, so . . . */
++	for(i = 0; i < samples + 2; i++) {
++		for(j = 0; j < globals->battery_count; j++)
++			acquire_batt_info(globals, j);
++		acquire_global_info(globals);
++		usleep(sleep_time);
++	}
++	
++	ap = &globals->adapter;
++	if(ap->power == AC) {
++		printf("On AC Power");
++		for(i = 0; i < globals->battery_count; i++) {
++			binfo = &batteries[i];
++			if(binfo->present && (binfo->charge_state == CHARGE)) {
++				printf("; Battery %s charging", binfo->name);
++				printf(", currently at %2d%%", binfo->percentage);
++				if(binfo->charge_time >= 0) 
++					printf(", %2d:%02d remaining", 
++					       binfo->charge_time/60,
++					       binfo->charge_time%60);
++			}
++		}
++		printf("\n");
++	} else if(ap->power == BATT) {
++		printf("On Battery");
++		for(i = 0; i < globals->battery_count; i++) {
++			binfo = &batteries[i];
++			if(binfo->present && (binfo->percentage >= 0))
++				printf(", Battery %s at %d%%", binfo->name,
++				       binfo->percentage);
++		}
++		if(globals->rtime >= 0)
++			printf("; %d:%02d remaining", globals->rtime/60, 
++			       globals->rtime%60);
++		printf("\n");
++	}
++	return 0;
++}
++
diff --git a/debian/patches/series b/debian/patches/series
index 4b387a9..7df00e8 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,3 +1,3 @@
 fix_compiler_flags.patch
-rename_acpi_to_acpi-ng.patch
+rename_acpi_to_wmacpi-cli.patch
 install_manpages_to_usr_share.patch
diff --git a/debian/rules b/debian/rules
index 0f86c51..45695b4 100755
--- a/debian/rules
+++ b/debian/rules
@@ -8,5 +8,3 @@ override_dh_auto_clean:
 
 override_dh_auto_install:
 	make install PREFIX=$(CURDIR)/debian/wmacpi/usr
-	mv $(CURDIR)/debian/wmacpi/usr/bin/acpi $(CURDIR)/debian/wmacpi/usr/bin/acpi-ng
-	mv $(CURDIR)/debian/wmacpi/usr/share/man/man1/acpi.1 $(CURDIR)/debian/wmacpi/usr/share/man/man1/acpi-ng.1

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-wmaker/wmacpi.git



More information about the Pkg-wmaker-commits mailing list