+#
+%bcond_without gnome # dont build gnome configurator
+#
%define _name trackpoint
-Summary: GNOME TrackPoint configuration tool for IBM laptops
-Summary(pl): Narzêdzie konfiguracyjne TrackPointa do laptopów IBM
+Summary: TrackPoint configuration service for IBM laptops
+Summary(pl): Us³uga konfiguruj±ca TrackPointa do laptopów IBM
Name: configure-trackpoint
Version: 0.3.3
-Release: 1
+Release: 2
License: GPL v2
Group: X11/Applications
Source0: http://dl.sourceforge.net/tpctl/%{name}-%{version}.tar.gz
URL: http://tpctl.sourceforge.net/http://tpctl.sourceforge.net/
BuildRequires: autoconf
BuildRequires: automake
-BuildRequires: libgnomeui-devel
+%{?with_gnome:BuildRequires: libgnomeui-devel}
Requires(post,preun): /sbin/chkconfig
#Requires: kernel >= 2.6.11 (with trackpoint subsystem via sysfs)
ExclusiveArch: %{ix86}
BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
%description
-GNOME TrackPoint configuration tool for IBM laptops.
+TrackPoint configuration service for IBM laptops.
%description -l pl
+Us³uga konfiguruj±ca TrackPointa do laptopów IBM.
+
+%package gnome
+Summary: GNOME TrackPoint configuration tool for IBM laptops
+Summary(pl): Narzêdzie konfiguracyjne TrackPointa do laptopów IBM
+Group: X11/Applications
+Requires: %{name} = %{version}-%{release}
+
+%description gnome
+GNOME TrackPoint configuration tool for IBM laptops.
+
+%description gnome -l pl
Narzêdzie konfiguracyjne TrackPointa do laptopów IBM.
%prep
%patch1 -p1
%build
+%if %{with gnome}
%{__aclocal}
%{__autoconf}
%{__automake}
%configure
%{__make}
+%endif
%install
rm -rf $RPM_BUILD_ROOT
install -d $RPM_BUILD_ROOT{/etc/rc.d/init.d,%{_sysconfdir}/%{_name}}
+%if %{with gnome}
%{__make} install \
DESTDIR=$RPM_BUILD_ROOT
+ln -sf %{name}/%{_name}.png $RPM_BUILD_ROOT%{_pixmapsdir}/%{name}.png
+%endif
+
install %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/%{_name}
install etc/trackpoint/trackpoint.conf $RPM_BUILD_ROOT%{_sysconfdir}/%{_name}/%{_name}.conf
> $RPM_BUILD_ROOT%{_sysconfdir}/%{_name}/%{_name}.conf.bak
-ln -sf %{name}/%{_name}.png $RPM_BUILD_ROOT%{_pixmapsdir}/%{name}.png
%clean
rm -rf $RPM_BUILD_ROOT
%dir %{_sysconfdir}/%{_name}
%attr (754,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{_name}/%{_name}.conf
%attr (754,root,root) %ghost %{_sysconfdir}/%{_name}/%{_name}.conf.bak
+
+%if %{with gnome}
+%files gnome
+%defattr(644,root,root,755)
%attr(755,root,root) %{_bindir}/*
%{_desktopdir}/*
%{_pixmapsdir}/*
+%endif