Name: spicctrl
Summary: Sony Vaio SPIC Control Program
Version: 1.6
Release: 3
License: GPL
Group: Applications/System
URL: http://popies.net/sonypi/
Source0: %{name}-%{version}.tar.bz2
BuildRoot: %{_builddir}/%{name}-root

%description
This utility allows one to query and set a variety of parameters on your
Sony Vaio laptop computer, including:

 * AC Power status
 * Battery status 
 * Screen brightness
 * Bluetooth device power status

%prep
%setup -q

%build
make

%clean
rm -fr %{buildroot}

%install
rm -fr %{buildroot}
mkdir -p %{buildroot}/usr/sbin
install %{_builddir}/%{name}-%{version}/spicctrl %{buildroot}/usr/sbin

%post
if [ ! -c /dev/sonypi ]; then
	rm -f /dev/sonypi
	mknod /dev/sonypi c 10 250
fi
grep 'alias char-major-10-250 sonypi' /etc/modules.conf > /dev/null
RETVAL=$?
if [ $RETVAL -ne 0 ]; then
	echo 'alias char-major-10-250 sonypi' >> /etc/modules.conf
	echo 'options sonypi minor=250' >> /etc/modules.conf
fi

%files
%defattr(-,root,root)
/usr/sbin/spicctrl
%doc AUTHORS LICENSE CHANGES

%changelog
* Sun Nov 16 2003 Jonathan C. Sitte <jcsitte@staticnull.org>
- Spec file cleanup

* Sat Nov 15 2003 Jonathan C. Sitte <jcsitte@staticnull.org>
- Initial spec file
