File wader.spec of Package Wader

%define name wader
%define version 0.3.0
%define release 1
%define waderroot %{_datadir}/%{name}
%define python_sitearch %(%{__python} -c 'from distutils import sysconfig; print sysconfig.get_python_lib()')

Name:           %{name}
Version:        %{version}
Release:        %{release}
Summary:        Wader
Source:         ftp://ftp.noexists.org/pub/wader/%{name}-%{version}.tar.gz
Group:          Applications/Telephony
License:        GPL

%description
Wader is a fork of the core of "Vodafone Mobile Connect Card driver for Linux",
with some of its parts rewritten and improved to be able to interact via DBus
with other applications of the Linux/OSX desktop. Wader has two main
components, a core and a simple UI. The core can be extended to support more
devices and distros/OSes through plugins.

%package core
Summary:        The core of Wader
Group:          Applications/Telephony
BuildArch:      noarch
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
Provides:       %{name}-core
BuildRequires:  python-devel, python-setuptools, python-pydoctor
Requires:       python-twisted, python-twisted-conch, python-axiom, lsb

%description core
The core of Wader. The core can be extended to support more devices and
distros/OSes through plugins.

%if 0%{?suse_version}
# dependencies for SUSE
Requires: python-serial, dbus-1-python
%else
# dependencies for Fedora
Requires: pyserial, dbus-python
%endif

%prep
%setup -n %{name}-%{version}

%build

%install
%{__rm} -rf %{buildroot}
%{__python} setup.py install --root=%{buildroot} --prefix=%{_prefix}
%{__python} setup-gtk.py install --root=%{buildroot} --prefix=%{_prefix}
%{__mkdir_p} %{buildroot}%{_datadir}/dbus-1/system-services/
%{__mkdir_p} %{buildroot}%{_sysconfdir}/dbus-1/system.d/
%{__install} -m0644 resources/dbus/org.freedesktop.ModemManager.service %{buildroot}%{_datadir}/dbus-1/system-services/org.freedesktop.ModemManager.service
%{__install} -m0644 resources/dbus/org.freedesktop.ModemManager.conf %{buildroot}%{_sysconfdir}/dbus-1/system.d/org.freedesktop.ModemManager.conf
%{__mkdir_p} %{buildroot}/usr/share/doc/wader/guide/devel/api

lore --config template=doc/devel/template.tpl \
     --config baseurl=api/%s.html doc/devel/*.xhtml
cp doc/devel/*.html doc/devel/*.css %{buildroot}/usr/share/doc/wader/guide/devel
rm doc/devel/*.html
pydoctor --system-class=pydoctor.twistedmodel.TwistedSystem \
         --project-name=wader-core \
         --html-output=%{buildroot}/usr/share/doc/wader/guide/devel/api \
         --make-html \
         --html-write-function-pages \
         --add-package wader

%clean
%{__rm} -rf %{buildroot}

%files core
%defattr(-,root,root)
%doc LICENSE README

%defattr(-,root,root)
%{waderroot}
%{python_sitearch}/Wader*
%{python_sitearch}/wader/*
%{python_sitearch}/plugins
%{_bindir}/restart-wader-core
%defattr(-,root,root,0644)
%{_datadir}/dbus-1/system-services/org.freedesktop.ModemManager.service
%{_sysconfdir}/dbus-1/system.d/org.freedesktop.ModemManager.conf

%changelog
* Mon Nov 24 2008 Pablo Marti <pmarti@warp.es> 0.3
- 0.3 Release

%package gtk
Summary:        GTK+ UI for Wader
Group:          Applications/Telephony
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
BuildArch:      noarch
Provides:       %{name}-gtk
Requires:       wader-core, python-gtk, python-gobject2, python-gnome-extras, wmctrl, python-notify, python-gtkmvc

%description gtk
A simple GTK+ UI for Wader.

%files gtk
%defattr(-,root,root)
%{python_sitearch}/wader/gtk
%{_bindir}/wader-gtk

%changelog
* Mon Nov 24 2008 Pablo Marti <pmarti@warp.es> 0.3
- 0.3 Release

%package doc
Summary:        The doc of Wader
Group:          Applications/Telephony
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
BuildArch:      noarch
Provides:       %{name}-doc
BuildRequires:  python-twisted-lore, python-twisted-web, python-nevow

%description doc
Documentation for Wader: Development guide and API.

%files doc
%defattr(-,root,root)
/usr/share/doc/wader
openSUSE Build Service is sponsored by