File retext.spec of Package retext

#
# spec file for package retext
#
# Copyright (c) 2010 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:           retext
Version:	3.1.0
Release:	0
License:	GPL-3.0+
Summary:	Text editor for Markdown and reStructuredText
Url:		http://sourceforge.net/p/retext/home/ReText
Group:		Productivity/Editors/Other
Source:		%{name}-%{version}.tar.bz2
Source1:	%{name}.desktop
BuildRequires:	update-desktop-files
BuildRequires:	rsvg-view
Requires:	python-qt4
Requires:	python-markdown
Requires:	python-docutils			
Provides:	ReText = %{version}
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
BuildArch:	noarch

%description
ReText is a simple but powerful text editor for Markdown and reStructuredText.

%prep
%setup -q

%build

%install
%{__mkdir} -pv %{buildroot}%{_datadir}/icons/hicolor/scalable/apps/
%{__mkdir} -pv %{buildroot}%{_bindir}
%{__mkdir} -pv %{buildroot}%{_datadir}/%{name}/
%{__mkdir} -pv %{buildroot}%{_datadir}/applications/

%{__cp} -r * %{buildroot}%{_datadir}/%{name}/
%{__rm} -rf %{buildroot}%{_datadir}/%{name}/icons
%{__rm} -rf %{buildroot}%{_datadir}/%{name}/LICENSE_GPL
%{__cp} -r icons/*.svg %{buildroot}%{_datadir}/icons/hicolor/scalable/apps/
ICONSIZE="16 22 32 48 64 128 256"
pushd %{buildroot}%{_datadir}/icons/hicolor/
for i in $ICONSIZE; do
  mkdir -pv ${i}x${i}/apps/
  rsvg-convert -h $i -w $i scalable/apps/%{name}.svg -o ${i}x${i}/apps/%{name}.png
done
popd
ln -sf %{_datadir}/%{name}/retext.py %{buildroot}%{_bindir}/retext
%{__cp} -r %{S:1} %{buildroot}%{_datadir}/applications/

%suse_update_desktop_file %{name}


%files
%defattr(-,root,root)
%{_bindir}/%{name}
%{_datadir}/icons/hicolor/*/apps/%{name}.png
%{_datadir}/icons/hicolor/scalable/apps/%{name}.svg
%{_datadir}/%{name}/
%{_datadir}/applications/%{name}.desktop

%changelog
openSUSE Build Service is sponsored by