File lonote.spec of Package lonote

#
# spec file for package lonote
#
# Copyright (c) 2013 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/
#


Name:           lonote
Version:        3.2.7
Release:        0
Summary:        A personal note-taking application by Python3-qt4
License:        GPL-3.0 and Apache-2.0
Group:          Productivity/Office/Organizers
Url:            http://code.google.com/p/lonote
Source0:        %{name}-%{version}.zip
BuildRequires:  fdupes
BuildRequires:  python3-devel
BuildRequires:  python3-qt4-devel
BuildRequires:  update-desktop-files
BuildRequires:	unzip
Requires:       python3-dbm
Requires:       python3-qt4
Requires:       python3-xml
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
BuildArch:      noarch

%description
Lonote is a personal note-taking application by Python3-qt4.
It features in well interact UI, minimal design, structural notes,
auto reloading, archiving and versioning.

%prep
%setup -q
sed -i "s|#!/usr/bin/python3||" lonotelib/diff_match_patch.py # Fix non-executable script

%build
python3 setup.py build

%install
python3 setup.py install --prefix=%{_prefix} --root=%{buildroot}
# Remove wrongly installed docs
rm -rf %{buildroot}%{_datadir}/doc/%{name}/ 
# Fix Categories in desktop file
sed -i "s/Development;//" %{buildroot}%{_datadir}/applications/%{name}.desktop
%suse_update_desktop_file %{name} Office ProjectManagement
# Fix locale
find %{buildroot}%{_datadir}/locale -type f -name "*.po" -delete
%find_lang %{name}
# Fix pixmaps
rm -rf %{buildroot}%{_datadir}/pixmaps/%{name}.ico
# Hidden file for dir
find %{buildroot} -type f -name "*.swp" -delete
find %{buildroot} -type f -name ".DS_Store" -delete
find %{buildroot} -type f -name ".hgempty" -delete

%fdupes %{buildroot}

%files -f %{name}.lang
%defattr(-,root,root)
%doc README.rst doc/{Apache_License,CHANGELOG.rst,LICENSE.rst}
%{_bindir}/lonote
%{python3_sitelib}/*
%{_datadir}/applications/%{name}.desktop
%{_mandir}/man1/lonote.*
%{_datadir}/%{name}/
%{_datadir}/pixmaps/%{name}.png

%changelog
openSUSE Build Service is sponsored by