File fspc.spec of Package fspc

#
# spec file for package fspc
#
# Copyright (c) 2011 SUSE LINUX Products GmbH, Nuernberg, Germany.
# Copyright (c) 2011 Guido Berhoerster.
#
# 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/
#

Name:           fspc
Version:        1.0.1.99_svn20110525
Release:        1
License:        BSD
Summary:        Sentelic Finger-sensing Pad Configuration Tool
Url:            http://sourceforge.net/projects/fsp-lnxdrv/
Group:          Hardware/Other
# svn co https://fsp-lnxdrv.svn.sourceforge.net/svnroot/fsp-lnxdrv/trunk fsp-lnxdrv-<VERSION>
Source:         fsp-lnxdrv-%{version}.tar.bz2
# PATCH-FIX-UPSTREAM fspc-fix-linking.patch gber@opensuse.org -- Fixes an underlinking issue
Patch0:         fspc-fix-linking.patch
BuildRequires:  update-desktop-files
BuildRequires:  gcc-c++
BuildRequires:  cmake
BuildRequires:  wxWidgets-devel
BuildRoot:      %{_tmppath}/%{name}-%{version}-build

%description
The Finger-sensing Pad Configuration Tool is a small tool to configure Sentelic
"Finger-sensing Pad" touchpads.

%prep
%setup -q -n fsp-lnxdrv-%{version}
%patch0 -p1

%build
export CFLAGS='%{optflags}'
export CXXFLAGS='%{optflags}'
(
    cd src/libfsp
    make CFLAGS="${CFLAGS} -I../kernel-driver" lib
)
(
    cd src/fspc
    cmake -DCMAKE_INSTALL_PREFIX="%{_prefix}" \
          -DCMAKE_SKIP_RPATH=1 \
          .
    make %{?_smp_mflags} VERBOSE=1 fspc
)

%install
cd src/fspc
for file in fspcui.xrc fspcui_zh_CN.xrc fspcui_zh_TW.xrc pic/*; do
    install -D -p -m 644 "${file}" "%{buildroot}%{_datadir}/fspc/${file}"
done
install -D -p -m 755 fspc %{buildroot}%{_bindir}/fspc
install -d -m 755 %{buildroot}%{_datadir}/pixmaps
ln -sf "../fspc/pic/panelDeclaration.png" "%{buildroot}%{_datadir}/pixmaps/%{name}.png"
%suse_update_desktop_file -c %{name} %{name} 'Sentelic Finger-sensing Pad Configuration Tool' %{name} %{name} Settings HardwareSettings

%if 0%{?suse_version} >= 1140
%post
%desktop_database_post

%postun
%desktop_database_postun
%endif

%clean
rm -rf %{buildroot}

%files
%defattr(-,root,root,-)
%{_bindir}/fspc
%{_datadir}/fspc
%{_datadir}/pixmaps/fspc.png
%{_datadir}/applications/fspc.desktop

%changelog