File g15daemon.spec of Package g15daemon

#
# spec file for package g15daemon
#
# Copyright (c) 2012 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via http://bugs.opensuse.org/
#


BuildRequires:  freetype2-devel
BuildRequires:  libg15-devel
BuildRequires:  libg15render-devel
BuildRequires:  libusb-devel
BuildRequires:  systemd
Requires:       systemd
Name:           g15daemon
Url:            http://g15tools.sourceforge.net/
Version:        1.9.5.3
Release:        0
Summary:        The G15daemon is a userspace driver/multiplexer for the keyboard and its LCD
License:        GPL-2.0+
Group:          Hardware/Other
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
ExclusiveArch:  %ix86 x86_64 ppc ppc64 ia64
Source0:        %{name}-%{version}.tar.bz2
Source1:        %{name}.service
Patch0:         open-missing-mode.patch
Patch1:         fix-buffer-overflow.patch
%{?systemd_requires}

%description
The G15daemon is a userspace driver/multiplexer for the keyboard and its LCD, using libg15 for low-level keyboard control. Some of the features of g15daemon are:
  *Allows all extra G15 keys to be used in applications.
  *It allows for multiple simultaneous LCD clients.
  *Virtualises the LCD, the user can select which application is displayed with a simple keypress.
  *Clients talk to the daemon via a simple protocol.
  *Client applications have full control over LCD backlight and contrast.
  *Perl and Python bindings are available in the archive. 
  *Lcdproc 5.1 contains a driver to talk to the daemon.
  *A patch is available in the archive for version 1.3 of libgraphlcd, which allows any application using graphlcd to now use the keyboard's LCD via the daemon.  [The SVN version of graphlcd now includes the driver this patch provided].
  *Shell scripts can talk to the daemon via g15composer.
  *G15daemon now has Mac OS X support. Check out the download section for some binary files. A Mac OS X howto is also available (Thanks to Fabrizio Sestito).  

%package devel
Summary:        Header files, libraries and development documentation for g15daemon
Group:          Development/Libraries/C and C++
Requires:       %{name} = %{version}
Requires:       freetype2-devel
Requires:       glibc-devel
Requires:       libg15-devel
Requires:       libg15render-devel
Requires:       libusb-devel

%description devel
This package contains the header files, static libraries and
development documentation for g15daemon. If you like to develop
programs using g15daemon, you will need to install this package.

%prep
%setup -q
%patch0 -p1
%patch1 -p1

%build
%{configure}
make

%install
%{makeinstall}
mkdir -p $RPM_BUILD_ROOT/%{_unitdir}
cp %{S:1} $RPM_BUILD_ROOT/%{_unitdir}/%{name}.service

%files
%defattr(-, root, root)
%doc %{_prefix}/share/doc/g15daemon-%{version}/
%doc %{_prefix}/share/doc/g15daemon-%{version}/AUTHORS
%doc %{_prefix}/share/doc/g15daemon-%{version}/ChangeLog
%doc %{_prefix}/share/doc/g15daemon-%{version}/FAQ
%doc %{_prefix}/share/doc/g15daemon-%{version}/LICENSE
%doc %{_prefix}/share/doc/g15daemon-%{version}/NEWS
%doc %{_prefix}/share/doc/g15daemon-%{version}/README*
%doc %{_prefix}/share/doc/g15daemon-%{version}/TODO
%{_unitdir}/%{name}.service
%{_sbindir}/g15daemon
%{_libdir}/libg15daemon_client.so.1
%{_libdir}/libg15daemon_client.so.1.0.2
%dir %{_libdir}/g15daemon/
%dir %{_libdir}/g15daemon/%{version}/
%dir %{_libdir}/g15daemon/%{version}/plugins/
%{_libdir}/g15daemon/%{version}/plugins/g15plugin_clock.so
%{_libdir}/g15daemon/%{version}/plugins/g15plugin_uinput.so
%{_libdir}/g15daemon/%{version}/plugins/g15plugin_tcpserver.so
%dir %{_prefix}/share/g15daemon/
%dir %{_prefix}/share/g15daemon/splash/
%{_prefix}/share/g15daemon/splash/g15logo2.wbmp
%{_mandir}/man1/*

%files devel
%defattr(-, root, root)
%{_includedir}/*
%{_libdir}/libg15daemon_client.so
%{_libdir}/libg15daemon_client.a
%{_libdir}/libg15daemon_client.la
%{_libdir}/g15daemon/%{version}/plugins/g15plugin_clock.a
%{_libdir}/g15daemon/%{version}/plugins/g15plugin_clock.la
%{_libdir}/g15daemon/%{version}/plugins/g15plugin_tcpserver.a
%{_libdir}/g15daemon/%{version}/plugins/g15plugin_tcpserver.la
%{_libdir}/g15daemon/%{version}/plugins/g15plugin_uinput.a
%{_libdir}/g15daemon/%{version}/plugins/g15plugin_uinput.la
%{_mandir}/man3/*

%pre
%service_add_pre g15daemon.service 

%post
%{run_ldconfig}
%service_add_post g15daemon.service 
#/bin/systemctl enable --system g15daemon.service
#exit 0

%preun
%service_del_preun g15daemon.service 

%postun
%{run_ldconfig}
%service_del_postun g15daemon.service 

%changelog
openSUSE Build Service is sponsored by