File monodevelop.spec of Package monodevelop

#
# spec file for package monodevelop
#
# 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:           monodevelop
BuildRequires:  mono-data
BuildRequires:  pkgconfig(glade-sharp-2.0)
BuildRequires:  pkgconfig(glib-sharp-2.0)
BuildRequires:  pkgconfig(gnome-sharp-2.0)
BuildRequires:  pkgconfig(gtk-sharp-2.0)
BuildRequires:  pkgconfig(libgnomeui-2.0)
BuildRequires:  pkgconfig(libssh2)
%if 0%{?suse_version} > 1100
BuildRequires:  pkgconfig(gconf-sharp-2.0)
BuildRequires:  pkgconfig(gnome-vfs-sharp-2.0)
%endif
BuildRequires:  autoconf
BuildRequires:  automake
BuildRequires:  cmake
BuildRequires:  dos2unix
BuildRequires:  fdupes
BuildRequires:  git
BuildRequires:  hicolor-icon-theme
BuildRequires:  intltool
BuildRequires:  libtool
BuildRequires:  shared-mime-info
BuildRequires:  update-desktop-files
BuildRequires:  mono(Newtonsoft.Json) >= 7.0.0
BuildRequires:  pkgconfig(mono)
# mono-find-requires searches for libmono-2.0.so.1:
BuildRequires:  pkgconfig(mono-2)
BuildRequires:  pkgconfig(mono-addins)
BuildRequires:  pkgconfig(mono-nuget) >= 2.8.3
BuildRequires:  pkgconfig(monodoc)
BuildRequires:  pkgconfig(nunit) >= 2.6.3
BuildRequires:  pkgconfig(system.web.mvc3)
BuildRequires:  pkgconfig(wcf)
# Mono.Cecil.dll requires rsync after it's build
BuildRequires:  rsync
Url:            http://www.monodevelop.com/
Version:        5.10.0
Release:        0
Summary:        Full-Featured IDE for Mono and Gtk-Sharp
License:        LGPL-2.1 and MIT
Group:          Development/Tools/IDE
Source:         http://download.mono-project.com/sources/%{name}/%{name}-%{version}.871.tar.bz2
Source2:        monodevelop-rpmlintrc
Source3:        FakeNuget.cs
Patch0:         downgrade_to_mvc3.patch
Patch1:         fix-monodevelop-pc.patch
# PATCH-FEATURE-UPSTREAM https://github.com/mono/monodevelop/pull/1575
Source4:        monodevelop.appdata.xml
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
Requires:       mono-basic
Requires:       mono-web
Requires:       nunit
Requires:       pkgconfig
Requires:       xsp
Provides:       mono(Mono.Debugging) = 0.0.0.0
Provides:       mono(Mono.TextEditor) = 1.0.0.0
Provides:       mono(MonoDevelop.Core) = 2.6.0.0
Provides:       mono(MonoDevelop.Debugger) = 2.6.0.0
Provides:       mono(MonoDevelop.Ide) = 2.6.0.0
Provides:       mono(MonoDevelop.SourceEditor2) = 2.6.0.0
Provides:       mono(Xwt) = 0.1.0.0
Provides:       mono(libstetic) = 0.0.0.0
Provides:       mono(libsteticui) = 0.0.0.0
Recommends:     mono-devel
Recommends:     mono-tools
Recommends:     git
Suggests:       monodevelop-database
# Maybe we should make following 3 requirements mandatory, because of error or silent crash at startup when some of them are missing:
Recommends:     libgnomeui
Recommends:     mono(gnome-sharp)
Recommends:     mono(gconf-sharp)

%define _use_internal_dependency_generator 0
%define __find_provides env sh -c 'filelist=($(cat)) && { printf "%s\\n" "${filelist[@]}" | /usr/lib/rpm/find-provides && printf "%s\\n" "${filelist[@]}" | /usr/bin/mono-find-provides ; } | sort | uniq'
%define __find_requires env sh -c 'filelist=($(cat)) && { printf "%s\\n" "${filelist[@]}" | /usr/lib/rpm/find-requires && printf "%s\\n" "${filelist[@]}" | /usr/bin/mono-find-requires ; } | sort | uniq'

%description
MonoDevelop is a full-featured integrated development
environment (IDE) for Mono and Gtk-Sharp primarily designed
for C-Sharp and other .NET languages. It allows to quickly
create desktop and ASP.NET Web applications. Support
for Visual Studio file formats eases porting to Linux.

%package devel
Summary:        Development files for MonoDevelop
Group:          Development/Languages/Mono
Requires:       monodevelop = %{version}

%description devel
MonoDevelop is a full-featured integrated development
environment (IDE) for Mono and Gtk-Sharp. It was originally
a port of SharpDevelop 0.98.

This package contains development files for the IDE and plugins.

%prep
%setup -q -n monodevelop-5.10
%patch0 -p 1
%patch1 -p 1

%build
%{?env_options}

# deploy with nuget will not work in obs, so compile fake NuGet.exe mono executable that only logs command line options
mcs %{S:3} -out:NuGet.exe
mv NuGet.exe external/nuget-binary

#create fake nuget binary, needed at early build stage
nuget_dir=`mktemp -d`
echo "#!/bin/sh" > $nuget_dir/nuget
echo "mono \"$PWD/external/nuget-binary/NuGet.exe\" \"\$@\"" >> $nuget_dir/nuget
chmod 755 $nuget_dir/nuget
export PATH="$nuget_dir:$PATH"

# manually build external/libgit2sharp/Lib/CustomBuildTasks library, fixes external/libgit2sharp/LibGit2Sharp build failure
pushd external/libgit2sharp/Lib/CustomBuildTasks
xbuild /property:Configuration=Release
cp bin/Release/*.dll .
popd

# perform configuration and build
%configure --enable-tests=no --enable-gnomeplatform=yes --enable-subversion=yes --enable-git=yes --libdir=%{_prefix}/lib --disable-update-mimedb
make

%install
%{?env_options}

make install DESTDIR=%{buildroot} GACUTIL_FLAGS="/package monodevelop /root %{buildroot}%{_prefix}/lib"
#
mkdir -p %{buildroot}%{_datadir}/pkgconfig
mv %{buildroot}%{_prefix}/lib/pkgconfig/* %{buildroot}%{_datadir}/pkgconfig

mkdir -p %{buildroot}%{_datadir}/appdata/
cp -a %{S:4} %{buildroot}%{_datadir}/appdata/

cp -a %{_prefix}/lib/mono/nuget/NuGet.Core.dll %{buildroot}%{_prefix}/lib/monodevelop/AddIns/MonoDevelop.PackageManagement/
cp -a %{_prefix}/lib/mono/nuget/Microsoft.Web.XmlTransform.dll %{buildroot}%{_prefix}/lib/monodevelop/AddIns/MonoDevelop.PackageManagement/

ln -s %{_prefix}/lib/mono/nunit/nunit.core.dll %{buildroot}%{_prefix}/lib/monodevelop/AddIns/NUnit/
ln -s %{_prefix}/lib/mono/nunit/nunit.core.interfaces.dll %{buildroot}%{_prefix}/lib/monodevelop/AddIns/NUnit/
ln -s %{_prefix}/lib/mono/nunit/nunit.framework.dll %{buildroot}%{_prefix}/lib/monodevelop/AddIns/NUnit/
ln -s %{_prefix}/lib/mono/nunit/nunit.util.dll %{buildroot}%{_prefix}/lib/monodevelop/AddIns/NUnit/
%find_lang %{name}

# show fake nuget logfile
cat /tmp/fake-nuget.log

%if 0%{?suse_version} > 1220
%fdupes %{buildroot}%{_prefix}
%endif

%post
%desktop_database_post
%icon_theme_cache_post
%mime_database_post

%postun
%desktop_database_postun
%icon_theme_cache_postun
%mime_database_postun

%files -f %{name}.lang
%defattr(-,root,root)
%{_bindir}/*
%defattr(0644,root,root)
%{_datadir}/applications/monodevelop.desktop
%{_datadir}/icons/hicolor/*/apps/monodevelop.png
%{_datadir}/icons/hicolor/scalable/apps/monodevelop.svg
%{_prefix}/lib/monodevelop
%{_mandir}/man1/mdtool.1%ext_man
%{_mandir}/man1/monodevelop.1%ext_man
%{_datadir}/mime/packages/monodevelop.xml
%dir %{_datadir}/appdata/
%{_datadir}/appdata/monodevelop.appdata.xml

%files devel
%defattr(-,root,root)
%{_datadir}/pkgconfig/*.pc

%changelog
openSUSE Build Service is sponsored by