File valencia.spec of Package valencia

#
# spec file for package valencia
#
# 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/
#


%if 0%{?favor_gtk2}
%define gedit_plugindir %{_libdir}/gedit-2/plugins
%else
%define gedit_plugindir %{_libdir}/gedit/plugins
%endif

Name:           valencia
%if 0%{?favor_gtk2}
Version:        0.4.0
Release:        0
%else
Version:        0.4.0
Release:        0
%endif
%define _version 0.3.0
Summary:        GEdit plugin to use GEdit as a lightweight IDE for Vala
License:        LGPL-2.1+
Group:          Development/Tools/IDE
Url:            http://yorba.org/valencia/
Source:         http://yorba.org/download/valencia/0.4/%{name}-%{version}.tar.xz
# PATCH-FIX-UPSTREAM valencia-vala-0_20.patch http://redmine.yorba.org/issues/6505 dimstar@opensuse.org -- Allow building with Vala 0.20
Patch0:         valencia-vala-0_20.patch
# PATCH-FIX-UPSTREAM valencia-gedit-3_7.patch http://redmine.yorba.org/issues/6505 dimstar@opensuse.org -- Fix build with gedit >= 3.7.2
Patch1:         valencia-gedit-3_7.patch
BuildRequires:  update-desktop-files
BuildRequires:  vala
BuildRequires:  pkgconfig(gedit) >= 3.7.2
BuildRequires:  pkgconfig(gee-1.0)
BuildRequires:  pkgconfig(gtk+-3.0)
BuildRequires:  pkgconfig(gtksourceview-3.0)
BuildRequires:  pkgconfig(libvala-0.22)
BuildRequires:  pkgconfig(vte-2.90)
BuildRoot:      %{_tmppath}/%{name}-%{version}-build

%description
Valencia is a gedit plugin that turns gedit into a lightweight IDE for Vala.
Using Valencia, you can easily browse between symbols in a Vala program. You
can build a Vala program inside gedit and can easily jump to lines with
build errors. You can also get tooltips for methods and get autocompletion
suggestions by invoking autocomplete in the appropriate context.

%package -n gedit-plugin-valencia
Summary:        GEdit plugin to use GEdit as a lightweight IDE for Vala
Group:          Development/Tools/IDE
Requires:       gedit >= 3.7.2
Provides:       %{name} = %{version}

%description -n gedit-plugin-valencia
Valencia is a gedit plugin that turns gedit into a lightweight IDE for Vala.
Using Valencia, you can easily browse between symbols in a Vala program. You
can build a Vala program inside gedit and can easily jump to lines with
build errors. You can also get tooltips for methods and get autocompletion
suggestions by invoking autocomplete in the appropriate context.

%prep
%setup -q
%patch0 -p1
%patch1 -p1

%build
export CFLAGS="%{optflags}"
make %{?_smp_mflags}

%install
install -D libvalencia.so %{buildroot}%{gedit_plugindir}/libvalencia.so
install -D valencia.plugin %{buildroot}%{gedit_plugindir}/valencia.plugin
install -D valencia.png %{buildroot}%{_datadir}/icons/hicolor/128x128/apps/valencia.png
make install

%clean
rm -rf %{buildroot}

%post -n gedit-plugin-valencia
%icon_theme_cache_post

%postun -n gedit-plugin-valencia
%icon_theme_cache_postun

%files -n gedit-plugin-valencia
%defattr(-,root,root)
%doc AUTHORS COPYING NEWS README THANKS
%{gedit_plugindir}/libvalencia.so
%{gedit_plugindir}/valencia.plugin
%{_datadir}/icons/hicolor/128x128/apps/valencia.png

%changelog
openSUSE Build Service is sponsored by