Sophie

Sophie

distrib > Mageia > 7 > armv7hl > by-pkgid > a1ed5df172a1b6a6bb1e6434c4471a47 > files > 3

newtonsoft-json-8.0.3-2.mga7.src.rpm

%global libname Newtonsoft.Json

# mono is without any packagable debuginfo
%global debug_package %{nil}

%bcond_with tests

Name:           newtonsoft-json
Version:        8.0.3
Release:        %mkrel 2
Summary:        Popular high-performance JSON framework
Group:          Development/Other

# almost all files are licensed as MIT/X11, but BSD for LinqBridge.cs
# (and LGPLv2.1+ for Tools/7-Zip, not used)
License:        MIT and BSD
URL:            http://www.newtonsoft.com/json
Source0:        https://github.com/JamesNK/%{libname}/archive/%{version}.tar.gz#/%{name}-%{version}.tar.gz
Patch10:         %{name}-tests-skip-samples.patch

BuildRequires:  pkgconfig(mono)
# versioned binary enforces nunit version
BuildRequires:  nunit = 2.6.4

%description
%{libname} aka Json.NET is a popular high-performance JSON framework


%package devel
Summary:        Development files for %{name}
Requires:       %{name}%{?_isa} = %{version}-%{release}

%description devel
%{summary}.


%prep
%setup -qn%{libname}-%{version}
# E: wrong-script-interpreter
rm README.md
# sign the assembly to get a strong name, https://msdn.microsoft.com/en-us/library/xc31ft41.aspx
# mind the whitespace at beginning to emulate line break
echo ' [assembly: AssemblyKeyFileAttribute("Dynamic.snk")]' \
 >> Src/Newtonsoft.Json/Properties/AssemblyInfo.cs
sn -k myKey.snk
sed -i /InternalsVisibleTo/d Src/%{libname}/Properties/AssemblyInfo.cs
%if %{with tests}
# skip files with unmet dependencies (FSharp etc.), FIXME use nuget
%patch10
sed -i /DiscriminatedUnionConverterTests.cs/d Src/%{libname}.Tests/%{libname}.Tests.csproj
sed -i /Serialization.DependencyInjectionTests.cs/d Src/%{libname}.Tests/%{libname}.Tests.csproj
sed -i /Serialization.FSharpTests.cs/d Src/%{libname}.Tests/%{libname}.Tests.csproj
sed -i /Serialization.ImmutableCollectionsTests.cs/d Src/%{libname}.Tests/%{libname}.Tests.csproj
sed -i /TestObjects.Currency.cs/d Src/%{libname}.Tests/%{libname}.Tests.csproj
sed -i /TestObjects.Shape.cs/d Src/%{libname}.Tests/%{libname}.Tests.csproj
sed -i /Schema.JsonSchemaBuilderTests.cs/d Src/%{libname}.Tests/%{libname}.Tests.csproj
sed -i /Schema.JsonSchemaNodeTests.cs/d Src/%{libname}.Tests/%{libname}.Tests.csproj
sed -i /Utilities.StringUtilsTests.cs/d Src/%{libname}.Tests/%{libname}.Tests.csproj
%endif


%build
pushd Src/%{libname}
xbuild %{libname}.csproj


%install
mkdir -p %{buildroot}/%{_monogacdir}
gacutil -i Src/%{libname}/bin/Debug/Net45/%{libname}.dll -f -package %{name} -root %{buildroot}/usr/lib
# pkgconfig
mkdir -p %{buildroot}/%{_libdir}/pkgconfig
cat <<EOT >>%{buildroot}/%{_libdir}/pkgconfig/%{name}.pc
Name: %{libname}
Description: %{summary}
Version: %{version}
Requires: mono 
Libs: -r:%{_monodir}/%{name}/%{libname}.dll
Libraries=%{_monodir}/%{name}/%{libname}.dll
EOT


%check
%if %{with tests}
pushd Src/%{libname}.Tests
# FIXME unmet dependencies prevent many tests (Linq, Utilities etc.)
xbuild %{libname}.Tests.csproj
nunit-console26 -labels -stoponerror bin\Debug\Net45\*.dll
#rm -r obj bin
%endif


%files
%license Doc/license.txt
%doc *.md Doc/readme.txt
%{_monogacdir}/%{libname}
%{_monodir}/%{name}

%files devel
%{_libdir}/pkgconfig/%{name}.pc




%changelog
* Sun Sep 23 2018 umeabot <umeabot> 8.0.3-2.mga7
  (not released yet)
+ Revision: 1299733
- Mageia 7 Mass Rebuild

* Fri Apr 08 2016 tv <tv> 8.0.3-1.mga6
+ Revision: 999376
- new release

* Sat Jan 02 2016 neoclust <neoclust> 7.0.1-1.mga6
+ Revision: 918549
- imported package newtonsoft-json


* Thu Dec 17 2015 Raphael Groner <projects.rg@smart.ms> - 7.0.1-3
- readd pkgconfig, split into devel subpackage

* Thu Nov 26 2015 Raphael Groner <projects.rg@smart.ms> - 7.0.1-2
- fix folders ownership
- remove obsolete generation of pkgconfig file 

* Fri Oct 09 2015 Raphael Groner <projects.rg@smart.ms> - 7.0.1-1
- initial