Name:		system-setup-keyboard
Version:	0.8.5
Release:        1%{?_dist_release}
Summary:	xorg.conf keyboard layout daemon

Group:		Applications/System
License:	MIT
URL:		http://git.fedorahosted.org/git/system-setup-keyboard.git/
Source0:	https://fedorahosted.org/released/%{name}/%{name}-%{version}.tar.bz2
Source10:	system-setup-keyboard.init
BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root

BuildRequires:	glib2-devel
BuildRequires:	system-config-keyboard >= 1.3.1

Requires:	xorg-x11-server-Xorg >= 1.8.0-2
#Requires:	upstart
Conflicts:	xorg-x11-server-Xorg < 1.6.0

%description
system-setup-keyboard is a daemon that monitors /etc/sysconfig/keyboard
and writes out an xorg.conf.d snippet based on this file's contents.
Whenever the file is updated, system-setup-keyboard writes out the
matching XKB configuration for the selected layout. This configuration
applies to all keyboards but may be overwritten by other xorg.conf.d
snippets or entries in the xorg.conf configuration file.

%prep
%setup -q

%build
make CFLAGS="%{optflags}" %{?_smp_mflags}


%install
rm -rf $RPM_BUILD_ROOT
make install DESTDIR=$RPM_BUILD_ROOT
install -D -m775 %{SOURCE10} $RPM_BUILD_ROOT%{_sysconfdir}/rc.d/init.d/%{name}


%clean
rm -rf $RPM_BUILD_ROOT


%post
if [ "$1" == "1" ]; then
        /sbin/chkconfig --add %{name}
fi
		
%preun
if [ $1 -eq 0 ]; then
    /sbin/service %{name} stop >/dev/null 2>&1
    /sbin/chkconfig --del %{name}
fi
			    
%files
%defattr(-,root,root,-)
%doc COPYING
%{_bindir}/%{name}
%{_sysconfdir}/init/%{name}.conf
%{_sysconfdir}/rc.d/init.d/%{name}
%{_mandir}/man1/system-setup-keyboard.1*


%changelog
* Sat Apr 17 2010 Daisuke SUZUKI <daisuke@linux.or.jp> 	0.8.5-1
- new upstream release
- use /etc/X11/xorg.conf.d for snippet directory.
- require xorg-x11-server-Xorg >= 1.8.0-2

* Tue Mar 16 2010 Daisuke SUZUKI <daisuke@linux.or.jp> 	0.8.2-2
- add initscripts

* Fri Mar 12 2010 Daisuke SUZUKI <daisuke@linux.or.jp> 	0.8.2-1
- initial build for Vine Linux

* Sat Feb 27 2010 Adel Gadllah <adel.gadllah@gmail.com> 0.8.2-1
- 0.8.2 release
- Actually install the upstart config file

* Thu Feb 18 2010 Peter Hutterer <peter.hutterer@redhat.com> 0.8.1-1
- 0.8.1 release (makefile fixes)

* Tue Feb 16 2010 Peter Hutterer <peter.hutterer@redhat.com> 0.8-1
- 0.8 release (xorg.conf.d support)
- drop HAL requires.

* Tue Feb 09 2010 Peter Hutterer <peter.hutterer@redhat.com> 0.7-1
- Rename to system-setup-keyboard, update the URL and Source0 accordingly.
  Obsoletes fedora-setup-keyboard.

* Sat Dec 26 2009 Adel Gadllah <adel.gadllah@gmail.com> 0.6-1
- 0.6 release
- Fixes RH #545970

* Fri Nov 20 2009 Adel Gadllah <adel.gadllah@gmail.com> 0.5-1
- Patch merged upstream

* Fri Nov 20 2009 Peter Hutterer <peter.hutterer@redhat.com> 0.4-4
- rhpl was replaced by system-config-keyboard.

* Fri Jul 24 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.4-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild

* Wed May 27 2009 Adel Gadllah <adel.gadllah@gmail.com> 0.4-2
- Rebuild to pick up rhpl changes

* Mon Apr 13 2009 Adel Gadllah <adel.gadllah@gmail.com> 0.4-1
- 0.4 release
- Dropped patch, merged upstream

* Thu Apr 09 2009 Peter Hutterer <peter.hutterer@redhat.com> 0.3-4
- fedora-setup-keyboard-0.3-merge-terminate.patch: merge xkb options for
  termination.

* Thu Mar 05 2009 Peter Hutterer <peter.hutterer@redhat.com> 0.3-3
- Conflict xorg-x11-server-Xorg < 1.6.0-7 (10-x11-keymap.fdi and
  fedora-setup-keyboard up to 1.6.0-5)

* Mon Mar 02 2009 Adel Gadllah <adel.gadllah@gmail.com> 0.3-2
- Fix license tag

* Wed Feb 25 2009 Adel Gadllah <adel.gadllah@gmail.com> 0.3-1
- 0.3 release
- Require hal

* Sat Feb 21 2009 Adel Gadllah <adel.gadllah@gmail.com> 0.2-1
- Initial package
