%define pkg_version 2.32.1
%define pkg_release 1%{?_dist_release}

Summary:	Mouse accessibility enhancements for GNOME desktop
Summary(ja):	GNOME デスクトップ用マウス利便性強化ツール
Name:		mousetweaks
Version:	%{pkg_version}
Release:	%{pkg_release}
Source0:	http://ftp.gnome.org/pub/GNOME/sources/mousetweaks/2.32/%{name}-%{version}.tar.bz2
License:	GPLv3, FDL
Group:		User Interface/Desktops
URL:		http://live.gnome.org/Mousetweaks/Home 

BuildRequires:	gtk2-devel
BuildRequires:	GConf2-devel
BuildRequires:	dbus-glib-devel
BuildRequires:	at-spi-devel
BuildRequires:	libXcursor-devel
BuildRequires:	libXfixes-devel
BuildRequires:	libXtst-devel
BuildRequires:	gnome-panel-devel
BuildRequires:	gnome-doc-utils

Requires(post):		GConf2
Requires(pre):		GConf2
Requires(preun):	GConf2

BuildRoot: %{_tmppath}/%{name}-%{version}-root

Vendor: Project Vine
Distribution: Vine Linux
Packager: Takemikaduchi


%description
The Mousetweaks package provides mouse accessibility enhancements for 
the GNOME desktop. These enhancements are:
	
1. It offers a way to perform the various clicks without using any 
hardware button.

2. It allows users to perform a right click by doing a click&hold 
of the left mousebutton. (For a left-handed mouse user, the termes 
left and right have to be inverted.) 

3. It provides an applet that the user can install on a panel. This
applet creates an area on the panel into which the pointer can 
be captured until the user releases it with a predefined button
and modifier combination.

The options can be accessed through the Accessibility tab of the
Mouse Preferences of GNOME Control Center or through command-line.


%prep
%setup -q


%build
%configure --disable-scrollkeeper
%{__make} %{?_smp_mflags}


%install
%{__rm} -rf ${RPM_BUILD_ROOT}
export GCONF_DISABLE_MAKEFILE_SCHEMA_INSTALL=1
%{__make} install DESTDIR=${RPM_BUILD_ROOT}
unset export GCONF_DISABLE_MAKEFILE_SCHEMA_INSTALL

%find_lang %{name} --with-gnome


%clean
%{__rm} -rf ${RPM_BUILD_ROOT}

%post
export GCONF_CONFIG_SOURCE=`gconftool-2 --get-default-source`
gconftool-2 --makefile-install-rule %{_sysconfdir}/gconf/schemas/mousetweaks.schemas > /dev/null
gconftool-2 --makefile-install-rule %{_sysconfdir}/gconf/schemas/pointer-capture-applet.schemas > /dev/null

%pre
if [ "$1" -gt 1 ]; then
    export GCONF_CONFIG_SOURCE=`gconftool-2 --get-default-source`
    gconftool-2 --makefile-uninstall-rule %{_sysconfdir}/gconf/schemas/mousetweaks.schemas > /dev/null
    gconftool-2 --makefile-uninstall-rule %{_sysconfdir}/gconf/schemas/pointer-capture-applet.schemas > /dev/null
fi

%preun
if [ "$1" -eq 0 ]; then
    export GCONF_CONFIG_SOURCE=`gconftool-2 --get-default-source`
    gconftool-2 --makefile-uninstall-rule %{_sysconfdir}/gconf/schemas/mousetweaks.schemas > /dev/null
    gconftool-2 --makefile-uninstall-rule %{_sysconfdir}/gconf/schemas/pointer-capture-applet.schemas > /dev/null
fi


%files -f %{name}.lang
%defattr(-,root,root)
%doc COPYING COPYING.FDL COPYING.GPL ChangeLog NEWS README
%{_sysconfdir}/gconf/schemas/mousetweaks.schemas
%{_sysconfdir}/gconf/schemas/pointer-capture-applet.schemas
%{_bindir}/dwell-click-applet
%{_bindir}/mousetweaks
%{_bindir}/pointer-capture-applet
%{_libdir}/bonobo/servers/DwellClick_Factory.server
%{_libdir}/bonobo/servers/PointerCapture_Factory.server
%{_datadir}/mousetweaks
%{_mandir}/man1/*


%changelog
* Sat Nov 20 2010 Yoji TOYODA <bsyamato@sea.plala.or.jp> 2.32.1-1
- new upstream release

* Tue Oct 05 2010 Yoji TOYODA <bsyamato@sea.plala.or.jp> 2.32.0-1
- new upstream release
- change BuildRequires: gnome-panel-devel instead of gnome-panel

* Sat Jun 26 2010 Yoji TOYODA <bsyamato@sea.plala.or.jp> 2.30.2-1
- new upstream release

* Sun May 09 2010 Yoji TOYODA <bsyamato@sea.plala.or.jp> 2.30.1-1
- initial build for Vine Linux

