File ste.spec of Package ste

#
# spec file for package ste
#
# Copyright (c) 2012 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:           ste
Version:        0.4.0
Release:        0
License:        GPL-2.0+
Summary:        Powerful Plain Text Editor
Url:            http://ste.sintegrial.com
Group:          Productivity/Text/Editors
Source0:        http://ste-editor.googlecode.com/files/%{name}-%{version}-src.7z
# PATCH-FIX-UPSTREAM ste-0.4.0-ste-uncrustify_includes.patch lazy.kent@opensuse.org -- add missing includes
Patch0:         ste-0.4.0-ste-uncrustify_includes.patch
# PATCH-FIX-UPSTREAM ste-0.4.0-gcc47.patch lazy.kent@opensuse.org -- fix compilation with GCC 4.7
Patch1:         ste-0.4.0-gcc47.patch
BuildRequires:  hicolor-icon-theme
BuildRequires:  icoutils
BuildRequires:  libcxxtools-devel
BuildRequires:  p7zip
BuildRequires:  update-desktop-files
BuildRequires:  pkgconfig(QtCore)
BuildRequires:  pkgconfig(QtGui)
BuildRequires:  pkgconfig(QtNetwork)
BuildRequires:  pkgconfig(QtWebKit)
BuildRequires:  pkgconfig(enca)
Requires:       enca
Requires:       tidy
Recommends:     astyle
Recommends:     csstidy
BuildRoot:      %{_tmppath}/%{name}-%{version}-build

%description
STE is easy-to-use and feature-rich plain text editor.

%prep
7za x -o%{_builddir} %{_sourcedir}/%{name}-%{version}-src.7z
%setup -DTqn %{name}-%{version}-src
%patch0
%patch1
icotool -x -o . application/ste.ico
sed -i 's/\r$//' LICENSE.GPL2

%build
qmake \
    QMAKE_CFLAGS+="%{optflags}" \
    QMAKE_CXXFLAGS+="%{optflags}" \
    QMAKE_STRIP=""
make %{?_smp_mflags}

%install
make INSTALL_ROOT=%{buildroot} install
# Create desktop-file
cat > %{name}.desktop << EOF
[Desktop Entry]
Name=STE
GenericName=Powerful Plain Text Editor
GenericName[ru]=Мощный текстовый редактор
Type=Application
Exec=ste %U
Icon=ste
Categories=Utility;TextEditor;Qt;
Comment=Feature-rich Plain Text Editor
Comment[ru]=Многофункциональный текстовый редактор
MimeType=text/plain;text/html;text/css;
StartupNotify=true
Terminal=false
EOF

install -Dm 0644 *_16x16x32.png \
    %{buildroot}%{_datadir}/icons/hicolor/16x16/apps/%{name}.png
install -Dm 0644 *_32x32x32.png \
    %{buildroot}%{_datadir}/icons/hicolor/32x32/apps/%{name}.png
install -Dm 0644 *_48x48x32.png \
    %{buildroot}%{_datadir}/icons/hicolor/48x48/apps/%{name}.png
rm -rf %{buildroot}{%{_datadir}/qt4,%{_includedir},%{_libdir}}
%suse_update_desktop_file -i %{name}

%post
%desktop_database_post
%icon_theme_cache_post

%postun
%desktop_database_postun
%icon_theme_cache_postun

%files
%defattr(-,root,root,-)
%doc LICENSE.GPL2 LICENSE.GPL3 README
%{_bindir}/%{name}
%{_datadir}/sintegrial
%{_datadir}/applications/%{name}.desktop
%{_datadir}/icons/hicolor/*/*/%{name}.png

%changelog
openSUSE Build Service is sponsored by