Summary: wmapm monitors the APM statistics
Summary(ja): APM 情報を表示する dock アプリケーション
%define version 3.1
Name: wmapm
Version: %{version}
Release: 4vl1
Copyright: GPL
Group: User Interface/Desktops
Source: ftp://leadbelly.lanl.gov/pub/mgh/%{name}-%{version}.tar.gz
Patch1: wmapm-3.1-ppc.patch
Vendor: Project Vine
Distribution: Vine
BuildRoot: %{_tmppath}/%{name}-%{version}-root
%ifnarch ppc
Requires: apmd
%endif
Excludearch: sparc sparc64

%description
WMAPM monitors the APM statistics through the APM support in
the Linux and FreeBSD Kernels.

For kernel-2.2 on OldWorld PowerBooks (eg. PowerBook2400/3400/3500(G3) 
WallStreet) WMPMU is provided.

You will need to make apm setuid before the suspend and standby
buttons will work.

%description -l ja
WMAPM は Linux や FreeBSD カーネルの APM サポートから
得られる情報を元に APM 情報を表示します。

PB2400/3400/3500(G3) WallStreet などの OldWorld のマシンで
kernel-2.2 系統を使う場合のために wmpmu を用意しました。

サスペンドやスタンバイボタンを動作させるためには
apm を setuid しておく必要があります。

%prep
%setup
%ifarch ppc
%patch1 -p1
%endif

%build
touch %{name}/%{name}.c
make -C %{name}

%install
rm -rf $RPM_BUILD_ROOT
mkdir -p $RPM_BUILD_ROOT/usr/X11R6/{bin,man/man1}
install -s -m 755 %{name}/%{name} $RPM_BUILD_ROOT/usr/X11R6/bin
install -m 444 %{name}/%{name}.1 $RPM_BUILD_ROOT/usr/X11R6/man/man1
%ifarch ppc
install -s -m 755 %{name}/wmpmu $RPM_BUILD_ROOT/usr/X11R6/bin
install -m 444 %{name}/wmpmu.1 $RPM_BUILD_ROOT/usr/X11R6/man/man1
%endif

%files
%defattr(-,root,root)
/usr/X11R6/bin/%{name}
/usr/X11R6/man/man1/%{name}.1*
%ifarch ppc
/usr/X11R6/bin/wmpmu
/usr/X11R6/man/man1/wmpmu.1*
%endif
%doc BUGS CHANGES COPYING HINTS INSTALL README TODO

%clean
rm -rf $RPM_BUILD_ROOT

%ifarch ppc
%post
chmod 4666 /dev/adb
if ! [ -c /dev/pmu ]; then
	mknod /dev/pmu c 10 154
fi
chmod 4666 /dev/pmu
%endif

%changelog
* Sat Jan 12 2002 KOBAYASHI R. Taizo <tkoba@vinelinux.org>
- 3.1-4vl1
- updated to wmapm-3.1
- provide wmpmu for kernel-2.2 on OldWorld PowerBooks

* Sat Oct 14 2000 Masato Bito <masato@nets.ce.hiroshima-cu.ac.jp>
- 3.01-3vl8
- added Excludearch: sparc sparc64

* Wed Oct 04 2000 MATSUBAYASHI 'Shaolin' Kohji <shaolin@rhythmaning.org>
- 3.01-3vl7
- rebuilt with kernel-2.2.17-0vl7 (especially for ppc)

* Fri Sep 08 2000 MATSUBAYASHI 'Shaolin' Kohji <shaolin@rhythmaning.org>
- 3.01-3vl6
- modified %files section to handle compressed man page(s)

* Tue May 09 2000 MATSUBAYASHI 'Shaolin' Kohji <shaolin@rhythmaning.org>
- fixed small typo in %post section

* Mon May  1 2000 T.R. Kobayashi <tkoba@ike-dyn.ritsumei.ac.jp>
- Fixed charge and timeleft estimation of PowerBooks. 
- added Japanese summary and description

* Sun Apr 30 2000 T.R. Kobayashi <tkoba@ike-dyn.ritsumei.ac.jp>
- PowerBooks PMU support added

* Wed Jan  5 2000 Jun Nishii <jun@vinelinux.org>
- change group

* Sun Feb 21 1998 Ian Macdonald <ianmacd@xs4all.nl>

- suid bit removed from wmapm
- apmd dependency added

* Tue Feb 9 1998 Ian Macdonald <ianmacd@xs4all.nl>

- first RPM release
