File xf86-input-nextwindow.spec of Package xf86-input-nextwindow

%define module_name xf86-input-nextwindow

Name:       %{module_name}
Version:    0.3.6
Release:    1
Summary:    NextWindow Fermi Xorg Input Driver
License:    MIT/X11
URL:        http://launchpad.net/nwfermi
Source:     %{module_name}-%{version}.tar.bz2
Group:      System/Kernel and hardware
%if 0%{?suse_version}
BuildRequires: autoconf, automake, xorg-x11-proto-devel, xorg-x11-server-sdk, libtool
Requires:   xorg-x11-server
%else
BuildRequires: autoconf, automake, xorg-x11-util-macros, xorg-x11-server-devel
Requires:   xorg-x11-server-Xorg
%endif
Conflicts:  nwfermi <= 0.5.8
Buildroot:  %{_tmppath}/%{name}-%{version}-root

%description
NextWindow Fermi Xorg Input Driver

%prep
%setup -q -n %module_name-%version

%build

%clean
rm -fr $RPM_BUILD_ROOT

%install
rm -rf $RPM_BUILD_ROOT

%if 0%{?suse_version}
mkdir -p $RPM_BUILD_ROOT/etc/X11/xorg.conf.d
install -m 644 ./70-nw-fermi.conf $RPM_BUILD_ROOT/etc/X11/xorg.conf.d/70-nw-fermi.conf
%else
mkdir -p $RPM_BUILD_ROOT/usr/share/X11/xorg.conf.d
install -m 644 ./70-nw-fermi.conf $RPM_BUILD_ROOT/usr/share/X11/xorg.conf.d/70-nw-fermi.conf
%endif

chmod +x autogen.sh
./autogen.sh --prefix=$(pwd) --exec-prefix=$(pwd)
make
make install

%ifarch i386 i486 i586 i686
mkdir -p $RPM_BUILD_ROOT/usr/lib/xorg/modules/input
install -m 644 ./lib/xorg/modules/input/nextwindow_drv.so $RPM_BUILD_ROOT/usr/lib/xorg/modules/input/nextwindow_drv.so
%else
mkdir -p $RPM_BUILD_ROOT/usr/lib64/xorg/modules/input
install -m 644 ./lib/xorg/modules/input/nextwindow_drv.so $RPM_BUILD_ROOT/usr/lib64/xorg/modules/input/nextwindow_drv.so
%endif

%files
%defattr(-,root,root)
%if 0%{?suse_version}
%dir /etc/X11/xorg.conf.d
/etc/X11/xorg.conf.d/70-nw-fermi.conf
%else
/usr/share/X11/xorg.conf.d/70-nw-fermi.conf
%endif
%ifarch i386 i486 i586 i686
%dir /usr/lib/xorg/modules/input
/usr/lib/xorg/modules/input/nextwindow_drv.so
%else
%dir /usr/lib64/xorg/modules/input
/usr/lib64/xorg/modules/input/nextwindow_drv.so
%endif

%changelog
* Tue Sep 24 2013 - Daniel Newton <djpnewton@gmail.com>
- Update for xserver 1.6.5 (compatibility for Suse Linux Enterprise Desktop 11)
* Wed Oct 31 2012 - Daniel Newton <djpnewton@gmail.com>
- Update for xserver 1.12
* Mon Mar 19 2012 - Daniel Newton <djpnewton@gmail.com>
- Fix OpenSuse packaging issues
* Wed Jun 08 2011 - Daniel Newton <djpnewton@gmail.com>
- split Xorg input driver into separate source package