File kdevelop4-plugin-python.spec of Package kdevelop4-plugin-python

#
# spec file for package kdevelop4-plugin-python
#
# Copyright (c) 2016 SUSE LINUX 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:           kdevelop4-plugin-python
Version:        1.7.3
Release:        0
%define kdevver 4.7.3
%define platver 1.7.3
Summary:        Python support for KDevelop
License:        GPL-2.0+
Group:          Development/Tools/IDE
Url:            http://www.kdevelop.org
Source0:        http://download.kde.org/stable/kdevelop/%{kdevver}/src/kdev-python-%{version}.tar.bz2
BuildRequires:  fdupes
BuildRequires:  kdevelop4-devel >= %{kdevver}
BuildRequires:  kdevelop4-pg-qt
BuildRequires:  libkde4-devel
BuildRequires:  libkdevplatform4-devel >= %{platver}
BuildRequires:  python-kde4-devel
Requires:       kdevelop4
Requires:       python-kde4
Requires:       python-qt4
Recommends:     python-pep8
Recommends:     %{name}-lang
Provides:       %{name}-doc = %{version}
Obsoletes:      %{name}-doc < %{version}
Provides:       %{name}-devel = %{version}
Obsoletes:      %{name}-devel < %{version}
Conflicts:      kdevelop4-plugin-python3
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
%kde4_runtime_requires

%description
A KDevelop plugin which provides Python language support.

This version only supports Python 2.x and conflicts with the
KDevelop plugin supporting Python 3.x, kdevelop4-plugin-python3.

# We need an explicit lang package so we can conflict with kdevelop4-plugin-python3-lang

%package lang
Summary:        Languages for package %{name}
Group:          Development/Tools/IDE
Requires:       %{name} = %{version}
Conflicts:      kdevelop4-plugin-python3-lang

%description lang
Provides translations to the package %{name}.

%prep
%setup -q -n kdev-python-%{version}
%if 0%{?suse_version} <= 1320 && !0%{?is_opensuse}
# fix build with older cmake versions (i.e. on 13.2 and below) by
# readding "cmake_policy(SET CMP0002 OLD)" to po/CMakeLists.txt
# (was in there before but has been removed in 1.7.3)
sed -i -e "1s/^/cmake_policy(SET CMP0002 OLD)\n/" po/CMakeLists.txt
%endif

%build
  %cmake_kde4 -d build
  make %{?_smp_mflags} parser
  %make_jobs

%install
  pushd build
  %kde4_makeinstall
  %kde_post_install
  popd
  %fdupes -s %{buildroot}
  %find_lang kdevpython %{name}.lang

%post   -p /sbin/ldconfig
%postun -p /sbin/ldconfig

%files lang -f %{name}.lang

%files
%defattr(-,root,root)
%{_kde4_appsdir}/kdevappwizard/
# don't move documentation to -doc package, it's parser data
%{_kde4_appsdir}/kdevpythonsupport/
%{_kde4_configdir}/kdev_python_docfiles.knsrc
%{_kde4_libdir}/libkdev4python*.so
%{_kde4_libdir}/libpython2.7-kdevelop.so.*
%{_kde4_modulesdir}/kcm_docfiles.so
%{_kde4_modulesdir}/kcm_pep8.so
%{_kde4_modulesdir}/kdevpdb.so
%{_kde4_modulesdir}/kdevpythonlanguagesupport.so
%{_kde4_servicesdir}/kcm_kdevpythondocfiles.desktop
%{_kde4_servicesdir}/kcm_kdevpythonpep8.desktop
%{_kde4_servicesdir}/kdevpdb.desktop
%{_kde4_servicesdir}/kdevpythonsupport.desktop

%changelog
openSUSE Build Service is sponsored by