File wiipresent.spec of Package wiipresent

# vim: set ts=4 sw=4 et:

Name:           wiipresent
Version:        0.7.5.2
%define libwiimote_version 0.4
Release:        0
Summary:        Give Presentations with a Nintendo Wiimote
Source:         http://dag.wieers.com/home-made/wiipresent/wiipresent-%{version}.tar.bz2
# http://prdownloads.sourceforge.net/projects/libwiimote/libwiimote-%{libwiimote_version}.tgz
Source1:        libwiimote-%{libwiimote_version}.tar.bz2
Patch1:         libwiimote-optflags.patch
Patch2:         wiipresent-libwiimote_prefix.patch
Patch3:         libwiimote-hce_remote_name.patch
URL:            http://dag.wieers.com/home-made/wiipresent/
Group:          Hardware/Joystick
License:        GNU General Public License version 2 or later (GPLv2+)
BuildRoot:      %{_tmppath}/build-%{name}-%{version}
BuildRequires:  xorg-x11-devel
%if 0%{?suse_version} >= 1110
BuildRequires:  bluez-devel
%else
BuildRequires:  bluez-libs
%endif
BuildRequires:  gcc make glibc-devel pkgconfig
BuildRequires:  autoconf automake libtool update-desktop-files
PreReq:         desktop-file-utils

%description
WiiPresent is a small program that enables you to use a Nintendo Wiimote for
giving presentations using Open Office, xpdf, evince or Acrobat Reader. It was
designed as an off-the-shelf tool with no need to customize it.




Authors:
--------
    Dag Wieers <dag@wieers.com>
    Geerd-Dietger Hoffman <ribalba@gmail.com>

%prep
%setup -q -a 1
pushd "libwiimote-%{libwiimote_version}"
%patch1
if pkg-config bluez --atleast-version=2.14; then
%patch3
fi
popd #"libwiimote-%{libwiimote_version}"
%patch2

%build
LIBWIIMOTE_PREFIX="$PWD/libwiimote-install"
pushd "libwiimote-%{libwiimote_version}"
[ -e ./configure ] || autoreconf -v

CFLAGS="%{optflags} -fPIC" \
CC="%__cc" \
./configure \
     --prefix="$LIBWIIMOTE_PREFIX" \
     --disable-shared \
     --enable-static
# without -j:
%__make \
     OPTFLAGS="%{optflags} -D_DISABLE_NONBLOCK_UPDATES" \
     libwiimote_includedir="$LIBWIIMOTE_PREFIX/include"
%__make install \
     libwiimote_includedir="$LIBWIIMOTE_PREFIX/include"
popd #"libwiimote-%{libwiimote_version}"
%__rm "$LIBWIIMOTE_PREFIX/lib"/lib*.so.*

%__make %{?_smp_flags} \
     WIIMOTE_INC="-I${LIBWIIMOTE_PREFIX}/include" \
     WIIMOTE_LIB="${LIBWIIMOTE_PREFIX}/lib/libcwiimote.a" \
     lib="%{_lib}" \
     CC="%__cc" \
     CFLAGS="%{optflags}"

%install
%makeinstall \
     prefix="%{_prefix}" \
     sysconfdir="%{_sysconfdir}" \
     bindir="%{_bindir}" \
     datadir="%{_datadir}" \
     mandir="%{_mandir}" \
     lib="%{_lib}"

%suse_update_desktop_file -r "%{name}" Office Presentation

%__chmod 0644 wiipresent-xinit.sh

%post
/usr/bin/update-desktop-database -q || :

%postun
/usr/bin/update-desktop-database -q || :

%clean
%{?buildroot:%__rm -rf "%{buildroot}"}

%files
%defattr(-,root,root)
%doc AUTHORS COPYING README TODO ChangeLog
%doc docs/*.html docs/*.txt
%doc wiipresent-xinit.sh
%{_bindir}/wiipresent
%{_datadir}/applications/wiipresent.desktop
%{_datadir}/pixmaps/wiipresent.svg
%doc %{_mandir}/man1/wiipresent.1%{ext_man}

%changelog
openSUSE Build Service is sponsored by