File workrave.spec of Package workrave

#
# spec file for package workrave (Version 1.9.0)
#
# Copyright (c) 2008 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/
#

# norootforbuild


Name:           workrave
BuildRequires:  doxygen fdupes gdome2-devel gnet-devel gnome-panel-devel gnutls-devel gstreamer-devel intltool kdebase3 kdelibs3-devel kdesdk3 libgnomeprintui-devel libgnomeuimm-devel libidl libwnck-devel perl-XML-Parser
Version:        1.9.0
Release:        3
Url:            http://www.workrave.org/
Group:          Productivity/Other
License:        GPL v2 or later
Summary:        Assist in the Recovery and Prevention of Repetitive Strain Injury
Source:         %{name}-%{version}-3.tar.bz2
# PATCH-FIX-UPSTREAM workrave-kde-errors.patch sbrabec@suse.cz workrave#777 -- Fix compile errors in KDE bindings.
Patch:          workrave-kde-errors.patch
BuildRoot:      %{_tmppath}/%{name}-%{version}-build

%description
Workrave is a program that assists in the recovery and prevention of
Repetitive Strain Injury (RSI). The program frequently alerts you to
take micro-pauses and rest breaks and restricts you to your daily
limit.



Authors:
--------
    ob Caelers <robc@krandor.org>
    Raymond Penners <raymond@dotsphinx.com>

%package gnome
License:        GPL v2 or later
Summary:        Assist in the Recovery and Prevention of Repetitive Strain Injury - GNOME Version
Group:          Productivity/Other
Provides:       %name = %version
Requires:       workrave-gnome-lang = %{version}

%description gnome
Workrave is a program that assists in the recovery and prevention of
Repetitive Strain Injury (RSI). The program frequently alerts you to
take micro-pauses, rest breaks and restricts you to your daily limit.



Authors:
--------
    ob Caelers <robc@krandor.org>
    Raymond Penners <raymond@dotsphinx.com>

%lang_package -n workrave-gnome
%package kde
License:        GPL v2 or later
Summary:        Assist in the Recovery and Prevention of Repetitive Strain Injury - KDE3 Version
Group:          Productivity/Other
Requires:       kdebase3
Requires:       workrave-kde-lang = %{version}

%description kde
Workrave is a program that assists in the recovery and prevention of
Repetitive Strain Injury (RSI). The program frequently alerts you to
take micro-pauses, rest breaks and restricts you to your daily limit.



Authors:
--------
    ob Caelers <robc@krandor.org>
    Raymond Penners <raymond@dotsphinx.com>

%lang_package -n workrave-kde
%prep
%setup -q -c %{name}-%{version}
%patch
cd %{name}-%{version}
# for %%doc
cp -a AUTHORS COPYING NEWS README ..
cd ..
cp -a %{name}-%{version} %{name}-%{version}-gnome
cd %{name}-%{version}-gnome
cd ..
cp -a %{name}-%{version} %{name}-%{version}-kde
cd %{name}-%{version}-kde
cp /opt/kde3/share/apps/kdelibs/admin/acinclude.m4.in m4/kdelibs.m4
cp /opt/kde3/share/apps/kapptemplate/admin/acinclude.m4.in m4/kapptemplate.m4
cd ..

%build
cd %{name}-%{version}-gnome
rm -v m4/libtool.m4 m4/lt*.m4
touch ChangeLog ; libtoolize -f ; ACLOCAL="aclocal -I m4" autoreconf -f -i ; intltoolize -f
%configure\
	--libexecdir=%{_prefix}/lib/gnome-applets\
	--disable-static\
%if %_lib == lib64
	--enable-libsuffix=64\
%endif
	--enable-gconf\
	--enable-dbus\
	--enable-xml
# FIXME: Text GUI does not compile.
#	--enable-app-text
make %{?jobs:-j %jobs}
cd ../%{name}-%{version}-kde
rm -v m4/libtool.m4 m4/lt*.m4
touch ChangeLog ; ACLOCAL="aclocal -I m4" autoreconf -f -i ; intltoolize -f
./configure\
	--prefix=/opt/kde3\
	--sysconfdir=/etc/opt/kde3\
	--libdir=/opt/kde3/%{_lib}/kde3\
	--disable-static\
%if %_lib == lib64
	--enable-libsuffix=64\
%endif
	--disable-gconf\
	--disable-gnome\
	--disable-gnomemm\
	--enable-dbus\
	--enable-kde\
	--enable-xml
make %{?jobs:-j %jobs}

%install
cd %{name}-%{version}-kde
%makeinstall
%find_lang %{name}
cd ../%{name}-%{version}-gnome
%makeinstall
# FIXME: Without calling aclocal, translations are incorrectly
# installed.
rm -rf $RPM_BUILD_ROOT%{_prefix}/share/locale
# FIXME: Duplicate installation of sounds.
#rm -r $RPM_BUILD_ROOT/opt/kde3/share/sounds/workrave
cp -a $RPM_BUILD_ROOT/opt/kde3/share/locale $RPM_BUILD_ROOT%{_prefix}/share/
# FIXME: No use for pixmap in KDE applet.
rm -r $RPM_BUILD_ROOT/opt/kde3/share/pixmaps
# dbus-1 files are correctly installed by GNOME applet to /usr, so we can reuse them:
rm -r $RPM_BUILD_ROOT/opt/kde3/share/dbus-1
%find_lang %{name}
sed -i /kde/d %{name}.lang
%fdupes $RPM_BUILD_ROOT
ln -s workrave/workrave-icon-huge.png $RPM_BUILD_ROOT%{_datadir}/pixmaps/
# FIXME: I see no better fit than Accessibility in the Desktop Menu Specification:
%suse_update_desktop_file -c %{name} "Workrave" "Repetitive Strain Injury Recovery and Prevention" %{name} workrave-icon-huge Utility Accessibility

%clean
rm -rf $RPM_BUILD_ROOT

%files gnome
%defattr (-, root, root)
%doc AUTHORS COPYING NEWS README
/etc/sound/events/*.soundlist
%{_libdir}/bonobo/servers/*.server
%{_prefix}/bin/*
%dir %{_prefix}/lib/gnome-applets
%{_prefix}/lib/gnome-applets/workrave-applet
%{_datadir}/applications/*.desktop
%{_datadir}/gnome-2.0/ui/*.xml
%{_datadir}/pixmaps/workrave
%{_datadir}/pixmaps/*.png
%{_datadir}/sounds/workrave
%{_datadir}/workrave
%{_datadir}/dbus-1/services/*.service

%files gnome-lang -f %{name}-%{version}-gnome/%{name}.lang

%files kde
%defattr (-, root, root)
%doc AUTHORS COPYING NEWS README
/opt/kde3/bin/*
/opt/kde3/%{_lib}/kde3/libkworkraveapplet*
/opt/kde3/share/applications/workrave.desktop
/opt/kde3/share/apps/kicker/applets/kworkraveapplet.desktop
/opt/kde3/share/apps/kworkrave
/opt/kde3/share/sounds/workrave
/opt/kde3/share/workrave
%{_datadir}/dbus-1/services/*.service
%{_datadir}/pixmaps/*.png

%files kde-lang -f %{name}-%{version}-kde/%{name}.lang

%changelog
* Thu Oct 16 2008 sbrabec@suse.cz
- Call intltoolize as last action to prevent build failures.
* Wed Sep 17 2008 ro@suse.de
- fix build regardless of libtool version
* Mon Sep 01 2008 sbrabec@suse.cz
- Updated to version 1.9.0:
  * Fixed transparency of tray icon
  * improved 64 bit support
  * exercises are now randomized
  * extended DBUS support
  * networking support can now be enabled without accepting
  incoming connections from other Workraves
  * sound has been added
* Tue Apr 29 2008 sbrabec@suse.cz
- Added Fedora patches:
  * fix locking/unlocking with gnome-screensaver (redhat#207058)
  * build with gcc-4.3
  * build GNOME applet with the latest libsigc++2
- Fixed build of KDE applet with the latest libsigc++2.
- Added desktop file.
* Mon Oct 29 2007 sbrabec@suse.cz
- Updated to version 1.8.5:
  * Task manager is never blocked by Workrave
  * Many bug fixes, the most visible ones:
  * Fixed breaks that have 'suspend timer when inactive' disabled
  * Mode menu fixed.
  * Gnome applet no longer 'hangs'.
  * Gnome applet no longer crashes Workrave.
  * Fixed 'end-of-microbreak' sound.
  * Fixed bug in multi-head support where Workrave showed multiple
  windows on a single screen.
  * Fixed locking on Gnome with xscreensaver installed
  * Polish on the applets
  * Translations updated
- Fixed gcc 4.3 errors.
* Thu Oct 11 2007 sbrabec@suse.cz
- Removed bogus dependency on mDNSResponder.
* Sun Aug 12 2007 mrueckert@suse.de
- switch to %%lang_package -n
- fixed typo in requires of workrave-kde
* Tue Aug 07 2007 maw@suse.de
- Use %%fdupes
- Split off -lang subpackages.
* Mon Jan 29 2007 ro@suse.de
- make it build after GNOME moved to /usr
* Mon Oct 23 2006 sbrabec@suse.cz
- Updated to version 1.8.3:
  * 100%% CPU load fix.
  * GNOME screen saver support added.
  * The applet popup menu is now accessible when all timers hidden.
  * Translations updated.
  * Bug fixes.
* Wed Jan 25 2006 mls@suse.de
- converted neededforbuild to BuildRequires
* Fri Dec 23 2005 ro@suse.de
- provide main package name in one subpackage
  (needed for debuginfo since we do not have a main package here)
* Thu Dec 15 2005 sbrabec@suse.cz
- New SuSE package, version 1.8.1.
openSUSE Build Service is sponsored by