File pbbuttonsd.spec of Package pbbuttonsd

# spec file for package pbbuttonsd (Version 0.8.1a)
# Copyright (c) 2007 SUSE LINUX Products GmbH, Nuernberg, Germany.
# This file and all modifications and additions to the pristine
# package are under the same license as the package itself.
# Please submit bugfixes or comments via

Name:           pbbuttonsd
BuildRequires:  alsa-devel gcc-c++ glib2-devel
%ifarch %ix86 x86_64
BuildRequires:  libsmbios libsmbios-devel pciutils-devel
License:        LGPL v2 or later
Group:          System/Daemons
Summary:        Daemon for the special keys on Apple laptops
Version:        0.8.1a
Release:        1
PreReq:         %{insserv_prereq}
Source:         pbbuttonsd-%{version}.tar.gz
Source1:        %{name}.init
Source2:        run-parts.c
Source3:        run-parts.8
Patch1:         %{name}-0.5.9-fpic.patch
Patch2:         %{name}-0.5.9-initreq.patch
Patch3:         %{name}-0.5.11-eject.patch
Patch4:         %{name}-0.8.0-pci_lz.patch
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
ExclusiveArch:  ppc ppc64 %ix86 x86_64

PBButtons is a programm suite to handle the special hotkeys of an Apple
iBook, PowerBook or MacBook.

With this programm the keys for the display brightness, the volume of
speaker and headphone, the mute key and the eject key will do their job
as expected.

    Matthias Grimm <>

%setup -q
%patch1 -p1
%patch3 -p1

AUTOPOINT=true autoreconf -i -f
%ifarch %ix86 x86_64
export LAPTOP=macbook
CFLAGS="$RPM_OPT_FLAGS" CXXFLAGS="$RPM_OPT_FLAGS" ac_cv_header_initreq_h=yes \
./configure \
	--prefix=/usr \
	--libdir=%{_libdir} \
	--infodir=%{_infodir} \
	--mandir=%{_mandir} \
	--sysconfdir=/etc \
	--enable-nls \
make %{?jobs:-j%jobs}
gcc $RPM_OPT_FLAGS -DPACKAGE_VERSION=\"2.9\" %{S:2} -o run-parts

install -d $RPM_BUILD_ROOT/etc/init.d $RPM_BUILD_ROOT%{_prefix}/sbin
install -m 755 %{S:1} $RPM_BUILD_ROOT/etc/init.d/%{name}
ln -s /etc/init.d/%{name} $RPM_BUILD_ROOT%{_prefix}/sbin/rc%{name}
install -m 755 run-parts $RPM_BUILD_ROOT%{_prefix}/bin/run-parts
install -m 755 -d $RPM_BUILD_ROOT%{_mandir}/man8
install -m 644 %{S:3} $RPM_BUILD_ROOT%{_mandir}/man8/run-parts.8
%find_lang %{name}

%fillup_and_insserv -f %{name}




%files -f %{name}.lang
%defattr(-, root, root)
%dir /etc/power
%config(noreplace) /etc/pbbuttonsd.cnf
%dir /var/lib/ibam
%dir /var/lib/pbbuttons

* Mon Jul 30 2007 -
- Update to pbbuttonsd 0.8.1a.
  * remove hdparm option -p because the option does not do
  what it is supposed to and anyway the kernel does a good
  controlling the IDE speed settings.
* Mon Jul 09 2007 -
- Update to pbbuttonsd 0.8.1.
  * fix typo in module_pmac.c that prevents pbbuttonsd from
  loading the trackpad mode from the config file. Thanks
  to Fernando J. Pereda <> for his patch.
  * apply a patch from ubuntu for module_cdrom to use
  eject in first approach and fall back to umount if eject
  fails. Thanks to Martin Pitt <>
  for his patch.
  * remove bash specific commands from the script files.
  Thanks to Colin Watson <> for his
  * fixing some English texts. Tanks to Martin Pitt
  <> for his patch.
* Fri Jun 01 2007 -
- Don't force initscript.
* Mon May 07 2007 -
- Delint start script.
- pmud does not exist any more.
* Mon Apr 02 2007 -
- make it build on x86/x86_64 for macbooks
* Mon Feb 12 2007 -
- Update to pbbuttonsd 0.8.0.
  * update program (doxygen) documentation
* Mon Oct 09 2006 -
- Update to pbbuttonsd 0.7.9.
  * class backlight will always succeed, even if there is no
  backlight controller available.
  * PMU backlight driver checks for availibility now.
  * added chapter about pbbuttonsd's capabilities in man page
  * set debug.h back to default
  * ATTENTION: Configuration changed:
  The options LCD_FadingSpeed and KBD_FadingSpeed got a new
  meaning to make the configuration device independent. See
  man pages pbbuttonsd.conf.5 or pbbcmd.1 for details.
  * fix a bug in the pbbcmd man page. The decription of
  TAG_KBDMODE was outdated.
  * man pages updated.
  * german locale updated
  * TAG_SYSINFO got two new machine dependent flags:
  SYSINFO_PB_USB_KBD  - machine has an USB keyboard
  SYSINFO_PB_USB_TPAD - machine has an USB trackpad
  This flags are only available on PowerBooks/iBooks and
  control certain elements in PowerPrefs.
  * SysFS backlight interface suported with kernel >= 2.6.18
  * new class backlight: It got two low level backlight driver:
  sysfs and pmu with autodetection.
  If the Sysfs driver should be used it is recommended to
  compile the kernel without CONFIG_PMAC_BACKLIGHT_LEGACY to
  prevent interferences between ancient kernel code and the new
  sysfs interface.
  * ATTENTION: The client interface has changed:
  The following tags use values in percent now instead of the
  device dependent physical value:
  The following tags are deprecated and shouldn't be used any
  Clients have to be adapted to this changes. It is recommended
  to use new versions of GTKPbbuttons and PowerPrefs with this
  * ATTENTION: The change of the client interface has also an impact
  on the configuration file. According to the tags above following
  configuration options use percent values now:
  * set default status of option UseFBBlank to 'no' because it
  might collide with the backlight controll in recent kernels
  the man page pbbuttonsd.conf was updated accordingly.
  * rewind input handler change from 2006-07-30 because the
  code doesn't do the trick.
  * disabling optional packages often didn't unbound all
  dependencies. For example after disabling IBAM pbbuttonsd
  will still be compiled with libstdc++ even if it is not
  needed any longer. The compile scripts have been modified
  to handle this cleanly. Thanks to Luca Barbato
  <> for his patch.
  * cleaned up
  * laptopmode script parses fstab correctly now, even if it
  contains tabs instead of spaces. Thanks to S. Lockwood-Childs
  <> who found this patch in the gentoo
  * fix warnings reported by -Wextra
* Tue Aug 08 2006 -
- Run gettextize.
* Tue Aug 01 2006 -
- Update to pbbuttonsd 0.7.8.
  * adding input handler for /dev/input/mice to work around the
  problem with synaptics trackpad driver.
  * fixing problem with unstable autoconf package
* Sun Jul 23 2006 -
- Don't truncate mount point.
* Tue Jul 04 2006 -
- Update to pbbuttonsd 0.7.6.
  * increase KBD_BRIGHTNESS_MIN from 1 to 16 in respect of the new
  scale. Man page changed accordingly.
  * the static 10ms timer has been removed. The timer function will
  be dynamically created whenever it is needed and only for the
  time it is needed. This will permanently decrease context
  switches independent of configuration.
  * Despite of runing on bash only the script ''
  referenced '/bin/sh' - fixed.
  * change keyboard illumination to use 255 brightness steps during
  fading. keyboard up/down still uses 16 steps.
  Thanks to Paul Collins <>.
  * moved low priority request functions in module_pmac.c like read
  battery status, read AC status and read Cover status into an one
  second timer routine. (debian bug #372760)
  * increase poll interval of IPC messages from 10ms to 100ms
  * module_display will only register a 10ms task if fading (LCD or
  KBD) is configured (fadingspeed > 0). Otherwise it will register
  a 100ms task.
  * The 10ms queue will terminate itself if it was found empty.
  This will decrease the count of context switches.
  (debian bug #372760)
  * Powerbooks before Pismo still weren't detected correctly
  because the field 'machine' from /proc/cpuinfo was used.
  This was changed to 'motherboard' and now it works.
  * bug in alsamixer caused a segfault - fixed. Reported to ubuntu.
  Thanks to John Steele Scott <>, who reported
  it to me :-)
  * bug in machine detection routine. PowerBooks before Pismo weren't
  detected correctly - fixed.
  * fix some warnings in module_pmac.c: keyboard_getconfig(),
  * added some debug code to track pbbuttonsd communication with the
  PMU in /var/log/pbbuttonsd. Set PMUTALK in debug.h to activate
  * PowerBook 6,7 has a USB Trackpad which was not correctly reported
  by pbbuttonsd - fixed.
* Mon Jun 05 2006 -
- Use RPM_OPT_FLAGS also for C++.
* Mon May 15 2006 -
- Update to pbbuttonsd 0.7.5.
  * default value for LCD_FadingSpeed in config file changed from 5 to
  4 to make fading smoother.
  * SIMUABIENT code was broken - fixed
  * added sync() before calling any suspend mode. (debian bug #357595)
  * allow the user to dim the display until it's dark (brightness
  level zero) even if autoadjusting is active. The former minimum
  level was one. (debian bug #345314)
  * the vendor and product identifier from USB devices are not unique
  so that selecting input devices based on product/vendor will miss
  some devices. The code has been changed to use the device identifier
* Sat Jan 28 2006 -
- Update to pbbuttonsd 0.7.4.
* Wed Jan 25 2006 -
- converted neededforbuild to BuildRequires
* Mon Jan 09 2006 -
- Update to pbbuttonsd 0.7.3.
* Thu Oct 20 2005 -
- Fix file list.
* Wed Oct 05 2005 -
- Update to pbbuttonsd 0.7.2.
* Mon Aug 29 2005 -
- Fix syntax error in script.
* Mon Jul 18 2005 -
- Update to pbbuttonsd 0.7.1.
* Mon Jul 11 2005 -
- Update to pbbuttonsd 0.7.0.
* Mon May 30 2005 -
- Update to pbbuttonsd 0.6.10.
* Wed Apr 06 2005 -
- update -> 0.6.9
* Sun Mar 27 2005 -
- Update to pbbuttonsd 0.6.8.
* Sat Feb 05 2005 -
- Remove obsolete patch.
* Sat Feb 05 2005 -
- Update to pbbuttonsd 0.6.7a.
* Wed Jan 26 2005 -
- Update to pbbuttonsd 0.6.7.
* Mon Sep 27 2004 -
- Distribute cover status after wakeup.
* Mon Sep 20 2004 -
- Add run-parts from debianutils.
* Sat Sep 18 2004 -
- Update to 0.6.5
* Wed Jul 14 2004 -
- Don't unmount subfs mountpoints.
* Mon Jun 14 2004 -
- Start pbbuttonsd after alsasound.
* Sun Apr 18 2004 -
- Update to 0.5.11.
* Sun Mar 28 2004 -
- Don't accumulate zombies.
* Sun Mar 14 2004 -
- Add init script.
* Tue Mar 09 2004 -
- update -> 0.5.9
* Sat Mar 06 2004 -
- fixed libdir for ppc64.
* Sun Jan 18 2004 -
- added -fPIC for static library, since it gets
  linked into a KDE DSO later.
- Added some stuff to make autoreconf -i -f possible.
* Mon Jul 21 2003 -
- remove directory entries from filelist
* Wed Mar 19 2003 -
- update to 0.5.3
* Fri Aug 16 2002 -
- fix the eject key keycode in the config file
* Fri Aug 16 2002 -
- inital SuSE package with version 0.5.0alpha