New package: pbbuttonsd-0.8.1a

This is a daemon that allows functionality such as keyboard
backlight and media keys in general to work on Apple PowerPC
laptops.
This commit is contained in:
q66 2020-02-09 01:26:59 +01:00
parent 5423f43c02
commit d9cc3b4898
14 changed files with 718 additions and 0 deletions

1
srcpkgs/pbbuttonsd-devel Symbolic link
View file

@ -0,0 +1 @@
pbbuttonsd

View file

@ -0,0 +1,6 @@
# Send pbbuttonsd a HUP signal if a new event device is connected
ACTION=="add", KERNEL=="event[0-9]*", RUN+="/bin/sh -c 'kill -HUP $$(pidof pbbuttonsd)'"
# load i2c-dev module so pbbuttonsd keyboard backlight works
ACTION=="add", SUBSYSTEM=="i2c", RUN+="/sbin/modprobe i2c-dev"

View file

@ -0,0 +1,3 @@
#!/bin/sh
[ -r conf ] && . ./conf
exec pbbuttonsd --configfile=${CONF:=/etc/pbbuttonsd.cnf} ${OPTS}

View file

@ -0,0 +1,21 @@
Description: 01-no-ftbfs-format-security.diff
- Replace a call to fprintf with no arguments with an equivalent fputs.
- Use "%s" as a format string and pass inptr as an argument when calling
syslog(3).
Author: Steve Langasek <vorlon@debian.org>
--- pbbuttonsd-0.7.9.orig/libpbbipc/pbb_errno.c
+++ pbbuttonsd-0.7.9/libpbbipc/pbb_errno.c
@@ -108,9 +108,9 @@
*/
if (base->daemon != PBBDS_NONE) {
if (type == PBB_ERR && base->daemon != PBBDS_CHILD)
- fprintf(stderr, inptr);
- syslog(level, inptr);
+ fputs(inptr, stderr);
+ syslog(level, "%s", inptr);
} else
- fprintf(stderr, inptr);
+ fputs(inptr, stderr);
}

View file

@ -0,0 +1,65 @@
Description: String typo fixes
Fix various language nits in the program strings.
Author: Malcolm Parsons
Bug-Ubuntu: https://bugs.launchpad.net/bugs/62854
=== modified file 'pbbcmd/pbbcmd.c'
Index: pbbuttonsd-0.8.1/pbbuttonsd.1
===================================================================
--- pbbuttonsd-0.8.1.orig/pbbuttonsd.1
+++ pbbuttonsd-0.8.1/pbbuttonsd.1
@@ -159,7 +159,7 @@ VolumeDownKey \-\- Decrease vol
MuteKey \-\- Disable/enable sound output. The volume level
won't change. Pressing any other volume con\-
- trol key will automaticaly enable sound out\-
+ trol key will automatically enable sound out\-
put again.
EjectCDKey \-\- Ejects a CDROM from CDROM drive. If necessary
@@ -464,12 +464,12 @@ a bit the first time. But after roundabo
cycles the predicted time and the battery warnings will be rather stable
and reliable.
.PP
-The database is updated continously so that any aging of the battery is taken
+The database is updated continuously so that any aging of the battery is taken
into account. When \fBpbbuttons\fP tells you now, you still have 10 minutes
left on battery, then you \fBwill\fP have 10 minutes left even if your
battery is growing old and the capacity decreases.
.SH IBaM and multiple batteries
-Currently IBaM is not able to handle multiple batteries seperatly. It always
+Currently IBaM is not able to handle multiple batteries separately. It always
sums up all batteries in system and calculates with the result. Therefore the
IBaM statistics will be influenced if you change your battery configuration
(adding or removing batteries).
Index: pbbuttonsd-0.8.1/pbbuttonsd.cnf.5
===================================================================
--- pbbuttonsd-0.8.1.orig/pbbuttonsd.cnf.5
+++ pbbuttonsd-0.8.1/pbbuttonsd.cnf.5
@@ -579,7 +579,7 @@ also set differently dependent on the po
.in +7
This options could be used to limit the working range of the automatic
brightness controller in general or depending on the power source, which
-is very usefull most of the time. It might help to save energy when running
+is very useful most of the time. It might help to save energy when running
on battery.
.TP
\fBLCD_IllumUpKey\fR = \fIkey\fR (default: KEY_BRIGHTNESSUP)
@@ -689,7 +689,7 @@ backlight will be switched off on blank.
.in +7
Recent kernel versions will do this automatically because the backlight
controller is part of the framebuffer or graphics card driver. If you
-relialize any problems with the backlight, like the diplay remains dark
+relialize any problems with the backlight, like the display remains dark
after wakeup or cover open, set this option to \'no\'.
.TP
\fBDimFullyDark\fR = \fI[yes | no]\fR (default: no)
@@ -882,7 +882,7 @@ kernels might freeze once and again. The
please use this option with care.
.PP
.in +7
-This option is only usefull if \fBmouseemu\fR is not running. \fBMouseemu\fR
+This option is only useful if \fBmouseemu\fR is not running. \fBMouseemu\fR
offer this and some more trackpad related functions. Set this option
to \'no\', if you have \fBmouseemu\fR running.
.TP

View file

@ -0,0 +1,69 @@
Description: Do not powersave if gnome-power-manager is running
Ignore lid and power change events if gnome-power-manager is running,
since that already handles power management.
Author: Martin Pitt <martin.pitt@ubuntu.com>
=== modified file 'src/module_powersave.c'
Index: pbbuttonsd-0.8.1/src/module_powersave.c
===================================================================
--- pbbuttonsd-0.8.1.orig/src/module_powersave.c
+++ pbbuttonsd-0.8.1/src/module_powersave.c
@@ -28,6 +28,7 @@
#include <utmp.h>
#include <sys/time.h>
#include <sys/ioctl.h>
+#include <sys/wait.h>
#include <sys/kd.h>
#include "pbbinput.h"
@@ -283,6 +284,23 @@ power_handle_tags (int cfgure, struct ta
struct moddata_power *base = &modbase_power;
int err, val;
+ /* check whether gnome-power-manager is running */
+ int gpm_running = 0;
+ pid_t killall_pid = fork();
+ if (killall_pid == 0) {
+ execl ("/usr/bin/killall", "killall", "-q", "-s", "0", "gnome-power-manager", NULL);
+ perror("could not execute killall");
+ exit (1);
+ } else if (killall_pid > 0) {
+ int status;
+ if (wait (&status) > 0) {
+ if (WIFEXITED(status) && WEXITSTATUS(status) == 0)
+ gpm_running = 1;
+ } else
+ perror("wait on killall");
+ } else
+ perror ("forking killall");
+
while (taglist->tag != TAG_END) {
switch (taglist->tag) {
case TAG_REINIT:
@@ -555,7 +573,7 @@ power_handle_tags (int cfgure, struct ta
taglist->data = base->flags.heartbeat_enable;
break;
case TAG_POWERCHANGED: /* private tag */
- if (cfgure) {
+ if (cfgure && !gpm_running) {
if (taglist->data)
base->activeProfile = &base->onAC;
else
@@ -603,7 +621,7 @@ power_handle_tags (int cfgure, struct ta
/* PMCS-script will be called in power_suspend() so that it's nothing left to do here */
break;
case TAG_WAKEUPFROMSLEEP: /* private tag */
- if (cfgure) {
+ if (cfgure && !gpm_running) {
power_awake ();
val = base->powersource;
power_sync (); /* syncronise redundant data from module_pmac */
@@ -616,7 +634,7 @@ power_handle_tags (int cfgure, struct ta
}
break;
case TAG_COVERSTATUS: /* private tag */
- if (cfgure) {
+ if (cfgure && !gpm_running) {
base->flags.coveropen = taglist->data & 1;
val = base->activeProfile->coveraction;
if (val == ACTION_BLANK || ((val == ACTION_TORAM) && !base->flags.sleep_supported))

View file

@ -0,0 +1,17 @@
Description: Disable autorescan, this is done by the udev rule.
Author: Colin Watson <cjwatson@ubuntu.com>
=== renamed file 'pbbuttonsd.conf' => 'pbbuttonsd.conf'
Index: pbbuttonsd-0.8.1/pbbuttonsd.cnf.in
===================================================================
--- pbbuttonsd-0.8.1.orig/pbbuttonsd.cnf.in
+++ pbbuttonsd-0.8.1/pbbuttonsd.cnf.in
@@ -6,7 +6,7 @@
[SYSTEM]
#userallowed=paranoid
CmdTimeout=8
-autorescan=true
+autorescan=false
[MODULE DISPLAY]
#LCD_Brightness=90

View file

@ -0,0 +1,28 @@
Description: pbbuttonsd is not rewritten for kernel 3.2
Author: Mathieu Malaterre <malat@debian.org>
Origin: https://bugs.gentoo.org/show_bug.cgi?id=429306#c1
Bug-Debian: http://bugs.debian.org/711685
Reviewed-by: Mathieu Malaterre <malat@debian.org>
Index: pbbuttonsd-0.7.9/scripts/scripts.d/cpufreq
===================================================================
--- pbbuttonsd-0.7.9.orig/scripts/scripts.d/cpufreq
+++ pbbuttonsd-0.7.9/scripts/scripts.d/cpufreq
@@ -18,7 +18,7 @@ KVER=`uname -r`
case "$1" in
powersave|custom)
case "$KVER" in
- 2.6.*)
+ "2.6."*|"3."*)
if [ -d /sys ]; then
echo -n "userspace" > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
cat /sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_min_freq > /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq
@@ -41,7 +41,7 @@ case "$1" in
;;
performance)
case "$KVER" in
- 2.6.*)
+ "2.6."*|"3."*)
if [ -d /sys ]; then
echo -n "userspace" > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
cat /sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_min_freq > /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq

View file

@ -0,0 +1,37 @@
Description: pbbuttonsd is not rewritten for kernel 3.2
Author: Mathieu Malaterre <malat@debian.org>
Origin: https://bugs.gentoo.org/show_bug.cgi?id=429306#c2
Bug-Debian: http://bugs.debian.org/711685
Reviewed-by: Mathieu Malaterre <malat@debian.org>
Index: pbbuttonsd-0.7.9/scripts/scripts.d/laptopmode.sh
===================================================================
--- pbbuttonsd-0.7.9.orig/scripts/scripts.d/laptopmode.sh
+++ pbbuttonsd-0.7.9/scripts/scripts.d/laptopmode.sh
@@ -122,7 +122,7 @@ KLEVEL=$(
)
)
case "$KLEVEL" in
- "2.4"|"2.6")
+ "2.4"|"2.6"|"3."*)
true
;;
*)
@@ -222,7 +222,7 @@ case "$1" in
echo "1" > /proc/sys/vm/laptop_mode
echo "30 500 0 0 $AGE $AGE 60 20 0" > /proc/sys/vm/bdflush
;;
- "2.6")
+ "2.6"|"3."*)
echo "5" > /proc/sys/vm/laptop_mode
echo "$AGE" > /proc/sys/vm/dirty_writeback_centisecs
echo "$AGE" > /proc/sys/vm/dirty_expire_centisecs
@@ -268,7 +268,7 @@ case "$1" in
"2.4")
echo "30 500 0 0 $U_AGE $B_AGE 60 20 0" > /proc/sys/vm/bdflush
;;
- "2.6")
+ "2.6"|"3."*)
echo "$U_AGE" > /proc/sys/vm/dirty_writeback_centisecs
echo "$B_AGE" > /proc/sys/vm/dirty_expire_centisecs
echo "$DEF_DIRTY_RATIO" > /proc/sys/vm/dirty_ratio

View file

@ -0,0 +1,18 @@
Description: OnAC_KeyAction not implemented on Mac Mini G4
Author: Mathieu Malaterre <malat@debian.org>
Bug-Debian: http://bugs.debian.org/774634
Index: pbbuttonsd-0.8.1/src/module_pmac.c
===================================================================
--- pbbuttonsd-0.8.1.orig/src/module_pmac.c
+++ pbbuttonsd-0.8.1/src/module_pmac.c
@@ -552,7 +552,8 @@ pmac_pmu_handler (int fd, gpointer user_
/* n = 2 && intr[1] = 0x0c = %01100 power button on mac-mini */
/* n = 6 && intr[1] = 0x1c = %11100 if power button is pressed */
/* n = 6 && intr[1] = 0x15 = %10101 after cover close */
- if (n == 6 && ((intr[1] >> 3) & 1) != PBpressed) {
+ if ((n == 2 && intr[1] == 0x0c)
+ || (n == 6 && ((intr[1] >> 3) & 1) != PBpressed)) {
PBpressed = (intr[1] >> 3) & 1;
taglist_init (taglist);
taglist_add (taglist, TAG_KEYCODE, KEY_POWER);

View file

@ -0,0 +1,30 @@
Description: pbbuttonsd, fnmode and kernel 2.6.28
Author: Joseph Jezak <josejx@gentoo.org>
Bug-Debian: http://bugs.debian.org/786532
Reviewed-By: Mathieu Malaterre <malat@debian.org>
Index: pbbuttonsd-0.8.1/src/module_pmac.c
===================================================================
--- pbbuttonsd-0.8.1.orig/src/module_pmac.c
+++ pbbuttonsd-0.8.1/src/module_pmac.c
@@ -991,7 +991,9 @@ keyboard_get_config ()
}
} else {
if ((fd = open ("/sys/module/usbhid/parameters/pb_fnmode", O_RDONLY)) < 0)
- fd = open ("/sys/module/hid/parameters/pb_fnmode", O_RDONLY);
+ if ((fd = open ("/sys/module/hid/parameters/pb_fnmode", O_RDONLY)) < 0)
+ fd = open("/sys/module/hid_apple/parameters/fnmode", O_RDONLY);
+
if (fd >= 0) {
if ((n = read (fd, ADBBuffer, ADB_BUFSIZE-1)) > 0) {
@@ -1026,7 +1028,8 @@ keyboard_set_config (int config)
}
} else {
if ((fd = open ("/sys/module/usbhid/parameters/pb_fnmode", O_WRONLY)) < 0)
- fd = open ("/sys/module/hid/parameters/pb_fnmode", O_WRONLY);
+ if ((fd = open ("/sys/module/hid/parameters/pb_fnmode", O_WRONLY)) < 0)
+ fd = open ("/sys/module/hid_apple/parameters/fnmode", O_WRONLY);
if (fd >= 0) {
sprintf ((char*)ADBBuffer, "%d", config);

View file

@ -0,0 +1,346 @@
Description: Fix compilation warnings
Taken directly from the latest CVS
Author: Mathieu Malaterre <malat@debian.org>
Origin: vendor
Forwarded: not-needed
--- pbbuttonsd-0.8.1a.orig/ChangeLog
+++ pbbuttonsd-0.8.1a/ChangeLog
@@ -2,6 +2,9 @@
CHANGELOG
==========
+2007-11-17 0.8.1-1
+ * fix all warnings reported by GCC 4.1 with -Wall and -Wextra
+
2007-07-27 0.8.1a (public release)
* remove hdparm option -p because the option does not do
what it is supposed to and anyway the kernel does a good
--- pbbuttonsd-0.8.1a.orig/doc/index.html
+++ pbbuttonsd-0.8.1a/doc/index.html
@@ -1,7 +1,18 @@
<html>
- <head><title>pbbuttonsd</title></head>
- <frameset frameborder="0" framespacing="0" border="0">
- <frame src="html/index.html">
- </frameset>
- <body></body>
+ <head>
+ <title>PBButtons program documentation</title>
+ <script language="JavaScript">
+ <!--
+ if(top.frames.length> 0)
+ top.location.href=self.location;
+ //-->
+ </script>
+ </head>
+ <frameset cols="220,*" frameborder="0" framespacing="0" border="0">
+ <frame src="toc.html" name="Inhalt" scrolling="no">
+ <frame src="introduction.html" name="Anzeige">
+ </frameset>
+ <body>
+ To watch these pages your browser needs support for frames.
+ </body>
</html>
--- pbbuttonsd-0.8.1a.orig/pbbcmd/pbbcmd.c
+++ pbbuttonsd-0.8.1a/pbbcmd/pbbcmd.c
@@ -496,4 +496,5 @@ int main(int argc, char *argv[])
return rc;
}
-void peep_ipc (struct tagitem *taglist) { }
+void peep_ipc (struct tagitem *taglist __attribute__ ((unused))) { }
+
--- pbbuttonsd-0.8.1a.orig/src/driver_mixer_oss.c
+++ pbbuttonsd-0.8.1a/src/driver_mixer_oss.c
@@ -292,6 +292,9 @@ ossmixer_set_volume (enum valueinc type,
case VALUE_ABS_PERCENT:
inc = volume - base->volume;
if (inc == 0) return;
+ break;
+ default:
+ return;
}
if ((ossmixer_increment_master_volume (inc)) != -1)
--- pbbuttonsd-0.8.1a.orig/src/input_manager.c
+++ pbbuttonsd-0.8.1a/src/input_manager.c
@@ -218,6 +218,8 @@ inputmanager_init ()
void
cbFreeInputSource (gpointer data, gpointer user_data)
{
+ (void) user_data; /* avoid warning about unused parameter */
+
InputSource *src = data;
g_source_remove (src->watch);
}
@@ -435,8 +437,8 @@ register_function (int queueid, void (*f
return -1;
}
-long
-process_queue_single (int queueid, long tag, long data)
+tag_t
+process_queue_single (int queueid, tag_t tag, tag_t data)
{
struct tagitem taglist[2];
@@ -552,6 +554,8 @@ ipc_handler ()
gboolean
input_event_handler (int fd, gpointer user_data)
{
+ (void) user_data; /* avoid warning about unused parameter */
+
struct input_event inp;
struct tagitem taglist[10];
gboolean rc = FALSE;
@@ -640,17 +644,19 @@ mice_handler (int fd, gpointer user_data
gboolean
cb_timer100 (gpointer data)
{
- struct moddata_inputmanager *base = &modbase_inputmanager;
- struct tagitem taglist[] = { { TAG_END, 0 } };
- int mod;
+ (void) data; /* avoid warning about unused parameter */
+
+ struct moddata_inputmanager *base = &modbase_inputmanager;
+ struct tagitem taglist[] = { { TAG_END, 0 } };
+ int mod;
- process_queue (T100QUEUE, taglist);
+ process_queue (T100QUEUE, taglist);
- mod = get_modifier();
- if ((mod == 0) && (base->lastkey == 0))
- process_queue (SECUREQUEUE, taglist);
+ mod = get_modifier();
+ if ((mod == 0) && (base->lastkey == 0))
+ process_queue (SECUREQUEUE, taglist);
- return TRUE;
+ return TRUE;
}
/**
@@ -665,9 +671,11 @@ cb_timer100 (gpointer data)
gboolean
cb_timer1000 (gpointer data)
{
- struct tagitem taglist[] = { { TAG_END, 0 } };
- process_queue (T1000QUEUE, taglist);
- return TRUE;
+ (void) data; /* avoid warning about unused parameter */
+
+ struct tagitem taglist[] = { { TAG_END, 0 } };
+ process_queue (T1000QUEUE, taglist);
+ return TRUE;
}
/* @} */
--- pbbuttonsd-0.8.1a.orig/src/input_manager.h
+++ pbbuttonsd-0.8.1a/src/input_manager.h
@@ -67,7 +67,7 @@ void destroyInputSource (gpointer data);
gboolean handleInputSource (GIOChannel *io, GIOCondition condition, gpointer data);
InputSource *addInputSource (int fd, int (*handler)(), gpointer user_data, gboolean close_on_exit);
int register_function (int queueid, void (*func)());
-long process_queue_single (int queueid, long tag, long data);
+tag_t process_queue_single (int queueid, tag_t tag, tag_t data);
int process_queue (int queueid, struct tagitem *taglist);
void ipc_handler ();
gboolean input_event_handler (int fd, gpointer user_data);
--- pbbuttonsd-0.8.1a.orig/src/module_acpi.c
+++ pbbuttonsd-0.8.1a/src/module_acpi.c
@@ -87,7 +87,7 @@ int
acpi_init ()
{
struct moddata_acpi *base = &modbase_acpi;
- int val, rc;
+ int rc;
/* is ACPI available on this machine? */
if ((rc = check_devorfile (PATH_ACPI"/info", TYPE_FILE))) {
@@ -234,9 +234,11 @@ acpi_handle_tags (int cfgure, struct tag
gboolean
acpi_event_handler (int fd, gpointer user_data)
{
+ (void) user_data; /* avoid warning about unused parameter */
+
struct moddata_acpi *base = &modbase_acpi;
struct tagitem taglist[2];
- struct acpi_event acpi;
+ struct acpi_event acpi = { NULL, NULL, 0, 0 };
GString *buffer;
gboolean status;
char *cur, *next, *tmp;
@@ -337,6 +339,8 @@ out:
void
acpi_timer1000 (struct tagitem *taglist)
{
+ (void) taglist; /* avoid warning about unused parameter */
+
struct moddata_acpi *base = &modbase_acpi;
struct tagitem args[6];
int val;
@@ -810,6 +814,8 @@ acpi_get_file_list (char *startdir)
void
acpi_free_file (GString *file, gpointer data)
{
+ (void) data; /* avoid warning about unused parameter */
+
g_string_free (file, TRUE);
}
--- pbbuttonsd-0.8.1a.orig/src/module_display.c
+++ pbbuttonsd-0.8.1a/src/module_display.c
@@ -409,6 +409,8 @@ display_keyboard (struct tagitem *taglis
gboolean
display_lcdtimer (gpointer data)
{
+ (void) data; /* avoid warning about unused parameter */
+
struct moddata_display *base = &modbase_display;
struct display_light *illu = &base->lcdlight;
int preambient, postambient;
@@ -483,6 +485,8 @@ display_lcdtimer (gpointer data)
gboolean
display_kbdtimer (gpointer data)
{
+ (void) data; /* avoid warning about unused parameter */
+
struct moddata_display *base = &modbase_display;
struct display_light *illu = &base->kbdlight;
@@ -571,6 +575,8 @@ display_kbdtimer (gpointer data)
void
display_ambienttimer (struct tagitem *taglist)
{
+ (void) taglist; /* avoid warning about unused parameter */
+
struct moddata_display *base = &modbase_display;
struct display_light *illu;
int ambient, ambientmax, level, pwrsource;
@@ -1027,10 +1033,10 @@ display_calc_brightness (struct display_
double a,b,x,y;
x = (double) ambient * 100 / (double) ambientmax;
+ y = 0;
switch (illu->autoadj_mode) {
case AUTOADJ_OFF:
- y = 0;
break;
case AUTOADJ_LIN:
if (x < params->ambient1)
--- pbbuttonsd-0.8.1a.orig/src/module_imac.c
+++ pbbuttonsd-0.8.1a/src/module_imac.c
@@ -82,7 +82,6 @@ int
imac_init ()
{
struct moddata_imac *base = &modbase_imac;
- int val;
#if defined(DEBUG) && SIMU_AMBIENT
base->ambient = 0;
@@ -304,7 +303,8 @@ int
getRawAmbient ()
{
FILE *fd;
- unsigned char buffer[16], *p, *buf;
+ unsigned char buffer[16];
+ char *p, *buf;
int left = -1, right = -1;
#if defined(DEBUG) && SIMU_AMBIENT
@@ -316,7 +316,7 @@ getRawAmbient ()
/* return immediately, if no ambient light sensor is available */
if (haveAmbient()) {
if ((fd = fopen(SYSFS_AMBIENT, "r"))) {
- if ((buf = fgets(buffer, sizeof(buffer), fd))) {
+ if ((buf = fgets((char *)buffer, sizeof(buffer), fd))) {
if ((p = strchr(buf, ','))) {
*p++ = '\0';
right = atoi (p);
@@ -348,13 +348,13 @@ void
setKBDIllumination (unsigned short level)
{
FILE *fd;
- unsigned char buffer[8];
+ char buffer[8];
/* return immediately, if keyboard illumination is not supported */
if (!haveKBDIllumination()) return;
if ((fd = fopen(SYSFS_KEYBLIGHT, "w"))) {
- if ((snprintf(buffer, sizeof(buffer), "%d", level)) < sizeof(buffer))
+ if ((snprintf(buffer, sizeof(buffer), "%d", level)) < (int) sizeof(buffer))
fputs(buffer, fd);
fclose(fd);
return;
@@ -365,14 +365,14 @@ setKBDIllumination (unsigned short level
buffer[0] = level & 0xFF;
buffer[1] = 0x00;
- writeSMCKey(SMC_BACKLIGHT_KEY, 2, buffer);
+ writeSMCKey(SMC_BACKLIGHT_KEY, 2, (unsigned char *)buffer);
}
/************************ Apple SMC interface *********************/
static struct timeval lasttv;
static struct timeval newtv;
-void inline ssleep(const int usec) {
+inline void ssleep(const int usec) {
gettimeofday(&lasttv, NULL);
while (1) {
gettimeofday(&newtv, NULL);
--- pbbuttonsd-0.8.1a.orig/src/module_peep.c
+++ pbbuttonsd-0.8.1a/src/module_peep.c
@@ -328,7 +328,7 @@ peep_taglist (char *source, struct tagit
mark = ' ';
printf ("%-10s: %c %-25s: ", source, mark, tt->tagname);
- if (taglist->data == -1) {
+ if (taglist->data == (unsigned int) -1) {
printf ("tag not filled");
} else if (tt->tag == TAG_SKIP) {
tt2 = findttentry (tagtab, taglist->data);
--- pbbuttonsd-0.8.1a.orig/src/module_powersave.c
+++ pbbuttonsd-0.8.1a/src/module_powersave.c
@@ -199,6 +199,8 @@ power_exit ()
void
power_mouse (struct tagitem *taglist)
{
+ (void) taglist; /* avoid warning about unused parameter */
+
struct moddata_power *base = &modbase_power;
if (base->flags.coveropen)
@@ -680,6 +682,8 @@ power_handle_tags (int cfgure, struct ta
void
power_timer (struct tagitem *taglist)
{
+ (void) taglist; /* avoid warning about unused parameter */
+
struct moddata_power *base = &modbase_power;
int n;
@@ -717,6 +721,8 @@ power_timer (struct tagitem *taglist)
void
power_timer1000 (struct tagitem *taglist)
{
+ (void) taglist; /* avoid warning about unused parameter */
+
struct moddata_power *base = &modbase_power;
static int cputimer = 0, nettimer = 0, beeptimer = 0;
int cpuload = 0, netload = 0;
--- pbbuttonsd-0.8.1a.orig/src/module_system.c
+++ pbbuttonsd-0.8.1a/src/module_system.c
@@ -162,6 +162,8 @@ system_handle_tags (int cfgure, struct t
void
system_timer1000 (struct tagitem *taglist)
{
+ (void) taglist; /* avoid warning about unused parameter */
+
struct moddata_system *base = &modbase_system;
if (base->autorescan) {

View file

@ -0,0 +1,38 @@
Description: Do not use /var/run
Author: Mathieu Malaterre <malat@debian.org>
Origin: vendor
Forwarded: not-needed
--- pbbuttonsd-0.8.1a.orig/pbbuttonsd.1
+++ pbbuttonsd-0.8.1a/pbbuttonsd.1
@@ -530,7 +530,7 @@ after connecting new input devices. Scan
signal to the server:
.PP
.ad c
-kill \-HUP \`cat /var/run/pbbuttonsd.pid\`
+kill \-HUP \`cat /run/pbbuttonsd.pid\`
.PP
.ad b
Be aware that the configuration file will also be reloaded in this case.
--- pbbuttonsd-0.8.1a.orig/src/init.h
+++ pbbuttonsd-0.8.1a/src/init.h
@@ -23,7 +23,7 @@
#define ARG_QUIET 'q'
#define DEFAULT_CONFIG SYS_CONF_DIR "/pbbuttonsd.cnf"
-#define DEFAULT_PIDFILE "/var/run/" PACKAGE ".pid"
+#define DEFAULT_PIDFILE "/run/" PACKAGE ".pid"
#define MODULECOUNT 15
/**
--- pbbuttonsd-0.8.1a.orig/src/module_acpi.h
+++ pbbuttonsd-0.8.1a/src/module_acpi.h
@@ -21,7 +21,7 @@
# define PATH_ACPI "/proc/acpi"
#endif
-#define ACPID_SOCKET "/var/run/acpid.socket"
+#define ACPID_SOCKET "/run/acpid.socket"
/**
* @brief Battery data

View file

@ -0,0 +1,39 @@
# Template file for 'pbbuttonsd'
pkgname=pbbuttonsd
version=0.8.1a
revision=1
archs="ppc ppc-musl"
build_style=gnu-configure
# enabling ibam requires /var/lib/ibam to exist for it to start
# also we don't package ibam, so keep it disabled at least for now
configure_args="--with-oss=no --with-alsa=yes --with-ibam=no
--with-doxygen-docs=no"
hostmakedepends="pkg-config gettext"
makedepends="alsa-lib-devel libglib-devel"
depends="procps-ng"
short_desc="PBButtons daemon to handle special hotkeys of Apple computers"
maintainer="q66 <daniel@octaforge.org>"
license="GPL-2.0-or-later"
homepage="https://www.berlios.de/software/pbbuttons"
distfiles="${SOURCEFORGE_SITE}/pbbuttons/pbbuttonsd-${version}.tar.gz"
checksum=254cc391bcb0a4a58a62224b4cca2b29fdf9ca174c1dc18ab0784f1a86465ed1
patch_args="-Np1"
post_extract() {
# fix cross builds (small build-only tool built with this)
vsed -i '/HOSTCC=/s/${CC}/cc/' configure
}
post_install() {
vsv pbbuttonsd
vinstall ${FILESDIR}/85-pbbuttonsd.rules 644 usr/lib/udev/rules.d/
}
pbbuttonsd-devel_package() {
depends="pbbuttonsd>=${version}_${revision}"
short_desc+=" - development files"
pkg_install() {
vmove usr/include
vmove "usr/lib/*.a"
}
}