%define name_project mono %undefine name_subpackage %define version_package_major 5 %define version_package_minor 12 %define version_package_revision 0 %undefine version_subpackage_major %undefine version_subpackage_minor %undefine version_subpackage_revision %define version_file %{version} %define version_git %{nil} # do not touch this: %define version_package %{?version_package_major:%{version_package_major}.%{?version_package_minor}%{!?version_package_minor:0}%{?version_package_revision:.%{version_package_revision}}} %define version_subpackage %{?version_subpackage_major:%{version_subpackage_major}.%{?version_subpackage_minor}%{!?version_subpackage_minor:0}%{?version_subpackage_revision:.%{version_subpackage_revision}}} %define version_major %{?version_subpackage_major:%{version_subpackage_major}}%{!?version_subpackage_major:%{version_package_major}} %define version_minor %{?version_subpackage_major:%{version_subpackage_minor}}%{!?version_subpackage_major:%{version_package_minor}} %define version_revision %{?version_subpackage_major:%{version_subpackage_revision}}%{!?version_subpackage_major:%{version_package_revision}} %define version %{?version_subpackage_major:%{version_subpackage}}%{!?version_subpackage_major:%{version_package}} %define version_project %{version_package_major} %define name_base %{name_project}%{?version_project} %define name_postfix opt %undefine name_postfix %define name_full %{name_base}%{?name_postfix:-%{name_postfix}} %define name_package %{name_base} %define name %{name_base}%{?name_subpackage:-%{name_subpackage}}%{?name_postfix:-%{name_postfix}} %define path_package /opt/%{name_base} ################################################################################ # force redefine mono_arches # # rpm --eval "%{mono_arches}" # i386 i486 i586 i686 pentium3 pentium4 athlon geode x86_64 sparc sparcv9 ia64 armv3l armv4b armv4l armv4tl armv5tel armv5tejl armv6l armv7l armv7hl armv7hnl alpha s390x ppc ppc64 # # rpm --eval "%{ix86} x86_64 sparc sparcv9 ia64 %{arm} alpha s390x ppc ppc64 ppc64le" # i386 i486 i586 i686 pentium3 pentium4 athlon geode x86_64 sparc sparcv9 ia64 armv3l armv4b armv4l armv4tl armv5tel armv5tejl armv6l armv7l armv7hl armv7hnl alpha s390x ppc ppc64 ppc64le # rpm --eval "%{mono_arches}" # FC26 # i386 i486 i586 i686 pentium3 pentium4 athlon geode x86_64 sparc sparcv9 ia64 armv3l armv4b armv4l armv4tl armv5tel armv5tejl armv6l armv6hl armv7l armv7hl armv7hnl aarch64 alpha s390x ppc ppc64 ppc64le %define mono_arches_force %{nil} %define mono_arches_force 1 # if not defined %if 0%{!?mono_arches:1} || 0%{?mono_arches_force} %global mono_arches %{ix86} x86_64 sparc sparcv9 ia64 %{arm} aarch64 alpha s390x ppc ppc64 ppc64le %endif %if 0%{!?_monodir:1} %global _monodir %{_prefix}/lib/mono %endif %if 0%{!?_monogacdir:1} %global _monogacdir %{_monodir}/gac %endif %define dotnet_version ?.? %define dotnet_version 4.5 %define monodir %{path_package}/lib/mono %define gac_dll(dll) %{monodir}/gac/%{1} \ %{monodir}/%{dotnet_version}/%{1}.dll \ %{nil} %define mono_bin(bin) %{monodir}/bin/%{1} \ %{monodir}/%{dotnet_version}/%{1}.exe \ %{monodir}/%{dotnet_version}/%{1}.exe.* \ %{nil} ################################################################################ %define buildroot_manual %{nil} %if 0%{?rhel}%{?fedora} %if 0%{?rhel} %if 0%{?rhel} < 6 %define buildroot_manual 1 %endif %endif %endif %define buildroot_manual_directory %{nil} %if "%{?buildroot}" != "" %define buildroot_manual_directory %{?buildroot} %else %if %{!?_topdir} %define _topdir %{getenv:HOME}/rpmbuild %endif %if %{!?_buildrootdir} %define _buildrootdir %{_topdir}/BUILDROOT %endif %define buildroot_manual_directory %{?buildroot}%{!?buildroot:%{_buildrootdir}/%{name}-%{version}-%{release}.%{_arch}} %define buildroot %{buildroot_manual_directory} %endif %define buildroot_manual_clean [ -d "%{buildroot}" ] && [ "/" != "%{buildroot}" ] && rm -rf "%{buildroot}" %define buildroot_manual_setup mkdir -p "%{buildroot}" %define buildroot_manual_cleansetup %{?buildroot_manual_clean:%{buildroot_manual_clean} ; }%{?buildroot_manual_setup} ################################################################################ %define gcc_version_major %{nil} %define gcc_version_minor %{nil} %define gcc_version %{nil} %define gcc_major %{nil} %define gcc_minor %{nil} %define gcc %{nil} # Set GCC minimum version for Mono %define gcc_version_major 0 %define gcc_version_minor 0 %if 0%{?version_package_major} >= 2 %define gcc_version_major 4 %define gcc_version_minor 0 %endif %if 0%{?version_package_major} >= 4 %define gcc_version_major 4 %define gcc_version_minor 7 %endif %define gcc_version %{?gcc_version_major}%{!?gcc_version_major:0}.%{?gcc_version_minor}%{!?gcc_version_minor:0} %define gcc_major %{?gcc_version_major}%{!?gcc_version_major:0} %if 0%{?gcc_major} < 10 %define gcc_major 0%{?gcc_version_major}%{!?gcc_version_major:0} %endif %define gcc_minor %{?gcc_version_minor}%{!?gcc_version_minor:0} %if 0%{?gcc_minor} < 10 %define gcc_minor 0%{?gcc_version_minor}%{!?gcc_version_minor:0} %endif %define gcc %{?gcc_major}%{!?gcc_major:00}%{?gcc_minor}%{!?gcc_minor:00} %define gcc_pkg %{nil} %define gcc_pkg 0000 %if 0%{?rhel}%{?fedora} %if 0%{?rhel} %if 0%{?rhel} >= 2 %define gcc_pkg 0296 %endif %if 0%{?rhel} >= 3 %define gcc_pkg 0302 %endif %if 0%{?rhel} >= 4 %define gcc_pkg 0304 %endif %if 0%{?rhel} >= 5 %define gcc_pkg 0401 %endif %if 0%{?rhel} >= 6 %define gcc_pkg 0405 %endif %if 0%{?rhel} >= 7 %define gcc_pkg 0408 %endif %else %if 0%{?fedora} >= 1 %define gcc_pkg 0303 %endif %if 0%{?fedora} >= 2 %define gcc_pkg 0303 %endif %if 0%{?fedora} >= 3 %define gcc_pkg 0304 %endif %if 0%{?fedora} >= 4 %define gcc_pkg 0400 %endif %if 0%{?fedora} >= 5 %define gcc_pkg 0401 %endif %if 0%{?fedora} >= 6 %define gcc_pkg 0401 %endif %if 0%{?fedora} >= 7 %define gcc_pkg 0401 %endif %if 0%{?fedora} >= 8 %define gcc_pkg 0401 %endif %if 0%{?fedora} >= 9 %define gcc_pkg 0403 %endif %if 0%{?fedora} >= 10 %define gcc_pkg 0403 %endif %if 0%{?fedora} >= 11 %define gcc_pkg 0404 %endif %if 0%{?fedora} >= 12 %define gcc_pkg 0404 %endif %if 0%{?fedora} >= 13 %define gcc_pkg 0404 %endif %if 0%{?fedora} >= 14 %define gcc_pkg 0405 %endif %if 0%{?fedora} >= 15 %define gcc_pkg 0406 %endif %if 0%{?fedora} >= 16 %define gcc_pkg 0406 %endif %if 0%{?fedora} >= 17 %define gcc_pkg 0407 %endif %if 0%{?fedora} >= 18 %define gcc_pkg 0407 %endif %if 0%{?fedora} >= 19 %define gcc_pkg 0408 %endif %if 0%{?fedora} >= 20 %define gcc_pkg 0408 %endif %if 0%{?fedora} >= 21 %define gcc_pkg 0409 %endif %if 0%{?fedora} >= 22 %define gcc_pkg 0409 %define gcc_pkg 0500 %define gcc_pkg 0501 %define gcc_pkg 0503 %endif %if 0%{?fedora} >= 23 %define gcc_pkg 0500 %define gcc_pkg 0501 %define gcc_pkg 0502 %define gcc_pkg 0503 %endif %if 0%{?fedora} >= 24 %define gcc_pkg 0601 %define gcc_pkg 0602 %define gcc_pkg 0603 %endif %if 0%{?fedora} >= 25 %define gcc_pkg 0602 %define gcc_pkg 0603 %endif %if 0%{?fedora} >= 26 %define gcc_pkg 0700 %define gcc_pkg 0701 %define gcc_pkg 0702 %define gcc_pkg 0703 %endif %if 0%{?fedora} >= 27 %define gcc_pkg 0700 %define gcc_pkg 0701 %define gcc_pkg 0702 %define gcc_pkg 0703 %endif %if 0%{?fedora} >= 28 %define gcc_pkg 0702 %define gcc_pkg 0703 %define gcc_pkg 0800 %define gcc_pkg 0801 %endif %if 0%{?fedora} >= 29 %define gcc_pkg 0800 %define gcc_pkg 0801 %endif %endif %endif ################################################################################ %define disable_rhscl %{nil} %define disable_rhscl 1 # Minimum version of supported devtoolset %define devtoolset_min %{nil} %define devtoolset_min 3 # Maximum version of supported devtoolset %define devtoolset_max %{nil} %define devtoolset_max 7 # EL6: For GCC > 4.4 # EL7: For GCC > 4.8 # Use GCC from RH DevToolset (e.g. 3, 4, 6, etc.) # Use 0 for disable %define devtoolset %{nil} %if 0%{?gcc} > 0%{?gcc_pkg} %if 0%{?rhel} %if 0%{?rhel} >= 5 # gcc-c++ == 4.8.5-11.el7 # devtoolset-3-gcc-c++ == 4.9.2-6.el7 # devtoolset-4-gcc-c++ == 5.3.1-6.1.el7 # devtoolset-6-gcc-c++ == 6.3.1-3.1.el7 # devtoolset-7-gcc-c++ == 7.3.1-5.4.el7 %define devtoolset %{?devtoolset_max}%{!?devtoolset_max:7} # Try to use possible lowest version of devtoolset %if 0%{?gcc} <= 0703 # https://access.redhat.com/documentation/en-us/red_hat_developer_toolset/7/html/7.0_release_notes/dts7.0_release#changes-upgrades # https://access.redhat.com/documentation/en-us/red_hat_developer_toolset/7/html/7.1_release_notes/dts7.1_release#changes-upgrades %define devtoolset 7 %endif %if 0%{?gcc} <= 0603 # https://access.redhat.com/documentation/en-US/Red_Hat_Developer_Toolset/6/html/User_Guide/sect-Red_Hat_Developer_Toolset-About.html %define devtoolset 6 %endif %if 0%{?gcc} <= 0503 # https://access.redhat.com/documentation/en-US/Red_Hat_Developer_Toolset/4/html/User_Guide/sect-Red_Hat_Developer_Toolset-About.html %define devtoolset 4 %endif %if 0%{?gcc} <= 0409 # https://access.redhat.com/documentation/en-US/Red_Hat_Developer_Toolset/3/html/User_Guide/sect-Red_Hat_Developer_Toolset-About.html %define devtoolset 3 %endif %if 0%{?gcc} <= 0408 # https://access.redhat.com/documentation/en-US/Red_Hat_Developer_Toolset/2/html/User_Guide/chap-Red_Hat_Developer_Toolset.html %define devtoolset 2 %endif %if 0%{?gcc} <= 0407 # https://access.redhat.com/documentation/en-US/Red_Hat_Developer_Toolset/1/html/User_Guide/sect-Red_Hat_Developer_Toolset-Features.html %define devtoolset 1 %endif %endif %endif %endif # Use only supported version of devtoolset %if 0%{?devtoolset} %if 0%{?devtoolset} < 0%{?devtoolset_min} %define devtoolset %{?devtoolset_min}%{!?devtoolset_min:3} %endif %endif %define devtoolset_setup PATH="/opt/rh/devtoolset-%{?devtoolset}%{!?devtoolset:7}/root/usr/bin:${PATH}" ; CC="/opt/rh/devtoolset-%{?devtoolset}%{!?devtoolset:7}/root/usr/bin/gcc" ; CPP="/opt/rh/devtoolset-%{?devtoolset}%{!?devtoolset:7}/root/usr/bin/cpp" ; CXX="/opt/rh/devtoolset-%{?devtoolset}%{!?devtoolset:7}/root/usr/bin/c++" %{?scl:%define rhscl %%{scl}} %if 0%{?devtoolset} %define rhscl devtoolset-%{devtoolset} %endif %if 0%{?disable_rhscl} %undefine rhscl %endif ################################################################################ # Disable SMP %define disable_smp %{nil} # Keep SMP enabled %define disable_smp 0 # Disable SMP for Mono <= 2 # http://lists.ximian.com/pipermail/mono-devel-list/2011-March/037128.html # You cannot use parallel build (usually make -j) with Mono 2.10 %if 0%{?version_package_major} <= 2 %define disable_smp 1 %endif ################################################################################ # enable to create devel package # disable to include devel files in main package %define separated_devel %{nil} %define separated_devel 1 # enable to create local package # disable to include local files in main package %define separated_local %{nil} %define separated_local 1 ################################################################################ # Enable bootstrap - monolite %define bootstrap 1 %if 0%{?rhel}%{?fedora} %if 0%{?fedora} %if 0%{?fedora} >= 30 %define bootstrap 0 %endif %endif %if 0%{?rhel} %if 0%{?rhel} >= 7 %define bootstrap 0 %endif %endif %endif # Force re-enable bootstrap # mkdir -p -- build/deps # touch build/deps/.stamp # make[6]: Entering directory `~/rpmbuild/BUILD/mono-2.10.8/mcs' # make[6]: gmcs: Command not found # make[6]: *** [build/deps/basic-profile-check.exe] Error 127 # make[6]: Leaving directory `~/rpmbuild/BUILD/mono-2.10.8/mcs' # *** The compiler 'gmcs' doesn't appear to be usable. # *** You need Mono version 2.4 or better installed to build MCS # *** Read INSTALL.txt for information on how to bootstrap a Mono installation. %define bootstrap 1 ################################################################################ # Enable LLVM %define enable_llvm %{nil} %define enable_llvm 0 # http://www.mono-project.com/docs/advanced/runtime/docs/llvm-backend/ %ifarch %{ix86} x86_64 %{arm} aarch64 %define enable_llvm 1 %endif # Enable including mono.snk key %define include_key %{nil} %define include_key 0 # Enable clearing: removing obsoleted and unnecessary files %define build_clear %{nil} %define build_clear 0 ################################################################################ %define require_libunwind %{nil} %ifarch ia64 %define require_libunwind 1 %endif %define require_timezone %{nil} %if 0%{?suse_version} %define require_timezone 1 %endif ################################################################################ # replace internal dependency generator %define deps_manual %{nil} %define deps_manual 1 ################################################################################ # enable extra args in configure %define configure_extra_args %{nil} %define configure_extra_args 1 %define configure_extra_args 0 ################################################################################ # enable to avoid error on CentOS7, in mono/mini/mini.c # ./.libs/libmono-static.a(libmono_static_la-mini.o): In function `mono_get_jit_tls_offset': # ~/rpmbuild/BUILD/mono-2.10.8/mono/mini/mini.c:2481: undefined reference to `mono_jit_tls' # ~/rpmbuild/BUILD/mono-2.10.8/mono/mini/mini.c:2481: undefined reference to `mono_jit_tls' # links: # * http://mono.1490590.n4.nabble.com/Failing-building-mono-on-musl-td4668645.html # * https://patchwork.ozlabs.org/patch/626832/ # see also: # * http://mono.1490590.n4.nabble.com/No-rule-to-make-target-mini-libmono-2-0-la-needed-by-monograph-td3839568.html %define fix_configure_rhdts %{nil} %if 0%{?rhel}%{?fedora} %if 0%{?rhel} %if 0%{?rhel} < 8 %define fix_configure_rhdts 1 %endif %endif %endif # turn off this patch %define fix_configure_rhdts 0 # enable to avoid error on CentOS5, in mono/utils %define fix_config_cpucount %{nil} %if 0%{?rhel}%{?fedora} %if 0%{?rhel} %if 0%{?rhel} < 6 %define fix_config_cpucount 1 %endif %endif %endif ################################################################################ # Mono specific patches %define fix_macro_mono %{nil} %define fix_macro_mono 0 %define fix_macro_mono 1 %if 0%{?fix_macro_mono} %ifarch ppc64 ppc64le # workaround #1224945 %undefine _hardened_build %endif %if 0%{?rhel}%{?fedora} %if 0%{?rhel} %if 0%{?rhel} < 8 # to resolve: "ERROR: No build ID note found" %undefine _missing_build_ids_terminate_build %endif %endif %endif %endif ################################################################################ %global xamarinrelease 226 ################################################################################ Name: %{name} Version: %{version} Release: 1.8%{?dist} #Summary: Mono #Summary: A .NET runtime environment Summary: Cross-platform, Open Source, .NET development framework #Group: Development/Languages/Mono Group: Development/Languages #License: GPL License: MIT Vendor: Mono Project Packager: Tomasz Tomasik URL: http://www.mono-project.com # JIT only available on these: ExclusiveArch: %{mono_arches} #Source0: http://origin-download.mono-project.com/sources/mono/mono-%{version_file}.tar.bz2 Source0: http://download.mono-project.com/sources/mono/mono-%{version}.%{xamarinrelease}.tar.bz2 # This key was generated by Tom "spot" Callaway on Dec 1, 2009 # by running the following command: # sn -k mono.snk # You should not regenerate this unless you have a really, really, really good reason. Source1: mono.snk # For Mono 2 Patch0: mono-2.8-ppc-thread.patch Patch1: mono-281-libgdiplusconfig.patch Patch2: mono-2.10-monodis.patch Patch3: mono-2.10-armhfp.patch Patch4: mono-2.10-CVE-2009-0689.patch # For Mono 4 Patch5: mono-4.2-fix-winforms-trayicon.patch ### Patch6: mono-4.2.1-ppc.patch Patch7: mono-4.6.1-aarch64.patch Patch8: mono-4.8.0-aarch64-glibc-2.26.patch Patch9: mono-4.0.0-ignore-reference-assemblies.patch Patch10: mono-4.3.2-find-provides.patch # For Mono 5 #Patch0: mono-5.10.0-ignore-reference-assemblies.patch #Patch1: mono-4.2.1-ppc.patch #Patch2: mono-5.10.0-find-provides.patch #Patch3: mono-4.2-fix-winforms-trayicon.patch #Patch4: mono-4.6.1-aarch64.patch #Patch5: mono-4.8.0-aarch64-glibc-2.26.patch Patch11: mono-5.10.0-ignore-reference-assemblies.patch Patch12: mono-5.10.0-find-provides.patch %if 0%{bootstrap} # for bootstrap, use bundled monolite instead of local mono %else BuildRequires: %{?name_project}%{!?name_project:mono}-core >= %{version_package_major}%{?version_package_minor:.%{version_package_minor}} %endif %if 0%{?buildroot_manual} #BuildRoot: /tmp/buildroot BuildRoot: %{?buildroot_manual_directory}%{!?buildroot_manual_directory:/tmp/buildroot} %endif %if 0%{?enable_llvm} BuildRequires: %{name_base}-llvm%{?name_postfix:-%{name_postfix}} %{name_base}-llvm%{?name_postfix:-%{name_postfix}}-devel %endif BuildRequires: pkgconfig BuildRequires: glib2-devel BuildRequires: bison make automake patch BuildRequires: cmake BuildRequires: bzip2 dos2unix BuildRequires: gettext libicu libgdiplus >= 2.10 valgrind zlib BuildRequires: gettext-devel libicu-devel libgdiplus-devel >= 2.10 valgrind-devel zlib-devel BuildRequires: libtool BuildRequires: python2 #BuildRequires: perl-Getopt-Long BuildRequires: perl(Getopt::Long) perl(Getopt::Long::CallBack) perl(Getopt::Long::Parser) perl(newgetopt.pl) %if 0%{?devtoolset} # need newer gcc version BuildRequires: devtoolset-%{?devtoolset}%{!?devtoolset:7}-gcc >= %{?gcc_version}%{!?gcc_version:4.0} devtoolset-%{?devtoolset}%{!?devtoolset:7}-gcc-c++ >= %{?gcc_version}%{!?gcc_version:4.0} BuildRequires: devtoolset-%{?devtoolset}%{!?devtoolset:7}-binutils BuildRequires: devtoolset-%{?devtoolset}%{!?devtoolset:7}-runtime %if %{?devtoolset} >= 6 BuildRequires: devtoolset-%{?devtoolset}%{!?devtoolset:7}-make %endif %else BuildRequires: gcc >= %{?gcc_version}%{!?gcc_version:4.0} gcc-c++ >= %{?gcc_version}%{!?gcc_version:4.0} BuildRequires: binutils %endif %if 0%{?require_libunwind} BuildRequires: libunwind BuildRequires: libunwind-devel %endif %if 0%{?require_timezone} BuildRequires: timezone %endif %if 0%{?devtoolset} #Requires: devtoolset-%{?devtoolset}%{!?devtoolset:7}-runtime %endif %if 0%{?enable_llvm} Requires: %{name_base}-llvm%{?name_postfix:-%{name_postfix}} %endif Requires: pkgconfig Requires: glib2 Requires: bzip2 dos2unix Requires: gettext libicu libgdiplus >= 2.10 valgrind zlib %if 0%{?require_libunwind} Requires: libunwind %endif %if 0%{?require_timezone} Requires: timezone %endif %if 0%{?separated_devel} # Build devel package. %else Obsoletes: %{name}-devel %endif %if 0%{?separated_local} # Build local package. %else Obsoletes: %{name}-local %endif %if 0%{?deps_manual} %global _use_internal_dependency_generator 0 #%%global __find_provides env sh -c 'filelist=($(cat)) && { printf "%s\\n" "${filelist[@]}" | /usr/lib/rpm/redhat/find-provides && printf "%s\\n" "${filelist[@]}" | prefix=%{buildroot}%{_prefix} %{buildroot}%{_bindir}/mono-find-provides; } | sort | uniq' %global __find_provides env sh -c 'filelist=($(cat)) && { printf "%s\\n" "${filelist[@]}" | /usr/lib/rpm/redhat/find-provides && printf "%s\\n" "${filelist[@]}" | prefix=%{buildroot}%{path_package} %{buildroot}%{path_package}/bin/mono-find-provides; } | sed -r "s/^mono\\(/%{name}\\(/" | sort | uniq' #%%global __find_requires env sh -c 'filelist=($(cat)) && { printf "%s\\n" "${filelist[@]}" | /usr/lib/rpm/redhat/find-requires && printf "%s\\n" "${filelist[@]}" | prefix=%{buildroot}%{_prefix} %{buildroot}%{_bindir}/mono-find-requires; } | sort | uniq | grep ^...' %global __find_requires env sh -c 'filelist=($(cat)) && { printf "%s\\n" "${filelist[@]}" | /usr/lib/rpm/redhat/find-requires && printf "%s\\n" "${filelist[@]}" | prefix=%{buildroot}%{path_package} %{buildroot}%{path_package}/bin/mono-find-requires; } | sed -r "s/^mono\\(/%{name}\\(/" | sort | uniq | grep ^...' #dependency requiered for install Provides: %{name}(System.Collections.Immutable) = 1.2.0.0 Provides: %{name}(System.Diagnostics.StackTrace) = 4.0.2.0 Provides: %{name}(System.IO) = 4.0.10.0 Provides: %{name}(System.IO.Compression) = 4.1.1.0 Provides: %{name}(System.Linq.Expressions) = 4.0.10.0 Provides: %{name}(System.Reflection) = 4.0.10.0 Provides: %{name}(System.Runtime) = 4.0.20.0 Provides: %{name}(System.Runtime.Extensions) = 4.0.10.0 Provides: %{name}(System.Runtime.InteropServices) = 4.0.20.0 Provides: %{name}(System.Runtime.Loader) = 4.0.0.0 Provides: %{name}(System.Text.Encoding.CodePages) = 4.0.2.0 Provides: %{name}(System.ValueTuple) = 4.0.1.0 Provides: %{name}(System.Collections) = 4.0.0.0 Provides: %{name}(System.Diagnostics.Debug) = 4.0.0.0 Provides: %{name}(System.Globalization) = 4.0.0.0 Provides: %{name}(System.IO) = 4.0.0.0 Provides: %{name}(System.Linq) = 4.0.0.0 Provides: %{name}(System.Reflection) = 4.0.0.0 Provides: %{name}(System.Runtime) = 4.0.0.0 Provides: %{name}(System.Runtime.Extensions) = 4.0.0.0 Provides: %{name}(System.Runtime.InteropServices) = 4.0.0.0 Provides: %{name}(System.Security.Cryptography.Algorithms) = 4.0.0.0 Provides: %{name}(System.Text.Encoding) = 4.0.0.0 Provides: %{name}(System.Text.Encoding.Extensions) = 4.0.0.0 Provides: %{name}(System.Threading) = 4.0.0.0 Provides: %{name}(System.Xml.XPath.XDocument) = 4.0.1.0 ### Provides: %{name}(System.Text.RegularExpressions) = 4.0.10.0 Provides: %{name}(System.Diagnostics.Process) = 4.0.0.0 ### Provides: %{name}(System.Security.Principal.Windows) = 4.0.0.0 Provides: %{name}(System.Security.AccessControl) = 4.0.0.0 %endif %description The Mono runtime implements a JIT engine for the ECMA CLI virtual machine (as well as a byte code interpreter, the class loader, the garbage collector, threading system and metadata access libraries. %if 0%{?separated_devel} %package devel #License: GPL License: MIT #Summary: development files for Mono #Summary: Development tools for Mono Summary: Development files for Mono #Group: Development/Libraries #Group: Development/Languages/Mono Group: Development/Languages Requires: %{name} = %{version} Requires: pkgconfig Requires: glib2-devel %description devel Development files for Mono. #This package completes the Mono developer toolchain with the mono profiler, #assembler and other various tools. %endif %if 0%{?separated_local} %package local License: MIT Summary: Symlinks for %{name} #Group: Development/Libraries Group: Development/Languages Requires: %{name} = %{version} Requires: pkgconfig %description local Symlinks for %{name} This package provides symlinks for %{name} in %{_prefix}/local/bin/ directory. %endif %prep #%%setup -q -n %{?name_project}%{!?name_project:mono}-%{version} %setup -q -n %{?name_project}%{!?name_project:mono}-%{version}.%{xamarinrelease} echo "RPM SPEC: " %if 0%{?version_package_major} == 2 %patch0 -p1 -b .ppc-threading %patch1 -F 1 -p1 -b .libgdiplus %patch2 -p1 -b .monodis %ifarch armv7hl %patch3 -p1 -b .armhfp %endif %patch4 -p1 %endif %if 0%{?version_package_major} >= 4 %patch5 -p1 %ifarch ppc ppc64 ppc64le %patch6 -p1 %endif %patch7 -p1 %patch8 -p1 %if 0%{?version_package_major} == 4 %patch9 -p1 %patch10 -p1 # Mono >= 5 %else %patch11 -p1 %patch12 -p1 %endif %endif echo "RPM SPEC: " echo "RPM SPEC: " %if 0%{?version_package_major} <= 4 # Add undeclared Arg sed -i "61a #define ARG_MAX _POSIX_ARG_MAX" mono/io-layer/wapi_glob.h # Remove prebuilt binaries #rm -rf mcs/class/lib/monolite/* %endif %if 0%{?version_package_major} >= 5 # Remove hardcoded lib directory for libMonoPosixHelper.so from the config sed -i -r 's|\$mono_libdir/||g' "data/config.in" %endif # Remove prebuilt binaries %if 0%{?version_package_major} <= 4 find . -name "*.dll" -not -path "./mcs/class/lib/monolite/*" -print -delete find . -name "*.exe" -not -path "./mcs/class/lib/monolite/*" -print -delete %else find . -name "*.dll" -not -path "./mcs/class/lib/monolite-linux/*" -not -path "./external/roslyn-binaries/Microsoft.Net.Compilers/Microsoft.Net.Compilers.2.6.0/*" -not -path "./external/binary-reference-assemblies/v4.7.1/System.Net.Http.dll" -not -path "./external/binary-reference-assemblies/v4.7.1/System.Numerics.dll" -print -delete find . -name "*.exe" -not -path "./mcs/class/lib/monolite-linux/*" -not -path "./external/roslyn-binaries/Microsoft.Net.Compilers/Microsoft.Net.Compilers.2.6.0/*" -print -delete %endif %if 0%{bootstrap} # for bootstrap, keep monolite. Mono 2.10 is too old to compile Mono 4.0 %else %if 0%{?version_package_major} <= 4 rm -rf mcs/class/lib/monolite/* %else rm -rf mcs/class/lib/monolite-linux/* %endif %endif echo "RPM SPEC: " %build echo "RPM SPEC: " %if 0%{?devtoolset} %{?devtoolset_setup} %endif %{?rhscl:rhscl enable %%{rhscl} - << \EOF} %if 0%{?version_package_major} == 4 %ifarch s390x # workaround a gcc bug - https://bugzilla.redhat.com/show_bug.cgi?id=1397948 RPM_OPT_FLAGS="$( echo "${RPM_OPT_FLAGS}" | sed -e 's/-march=z[[:alnum:]]\+/-march=z9-109/g' -e 's/-mtune=z[[:alnum:]]\+/-mtune=z10/g' )" %endif %endif export CFLAGS="${RPM_OPT_FLAGS} -fno-strict-aliasing" %if 0%{?version_package_major} == 2 %ifarch ia64 export CFLAGS="-O2 -fno-strict-aliasing" %endif %endif %if 0%{?enable_llvm} export MONO_USE_LLVM=1 export PATH="%{path_package}/bin:${PATH}" export LLVM_CONFIG="%{path_package}/bin/llvm-config" %endif echo "RPM SPEC: " echo "RPM SPEC: " # Configure and make source #./configure --prefix=%{path_package} --enable-llvm --with-llvm=%{path_package} ./configure \ %if %{?_host:1} --host=%{_host} \ %endif %if %{?_build:1} --build=%{_build} \ %endif %if 0%{?configure_extra_args} %ifnarch %{ix86} x86_64 --disable-system-aot \ %endif --with-ikvm-native=yes \ --with-xen_opt=yes \ --with-monotouch=no \ --with-libgdiplus=installed \ --with-sgen=no \ %if 0%{?version_package_major} <= 4 --with-profile4=yes \ %else --with-profile4_x=yes \ %endif %endif %ifarch ppc --with-mcs-docs=no \ %endif %if 0%{?version_package_major} <= 2 --with-jit=yes \ %endif %if 0%{?version_package_major} <= 3 --with-moonlight=no \ %endif %if 0%{?version_package_major} >= 3 --disable-rpath \ %endif %if 0%{?version_package_major} >= 5 --with-csc=mcs \ %endif %if 0%{?enable_llvm} --enable-llvm \ %if 0%{?version_package_major} >= 4 --with-llvm="%{path_package}" \ %endif %endif %if 0%{?fix_configure_rhdts} --with-tls=pthread \ --disable-boehm --without-sigaltstack \ --disable-mcs-build --enable-static \ --with-shared_mono=yes \ %endif --prefix="%{path_package}" echo "RPM SPEC: " echo "RPM SPEC: " %if 0%{?fix_config_cpucount} # to avoid error on CentOS5, in mono/utils: # mono-proclib.c:746:4: error: implicit declaration of function ‘CPU_COUNT’ [-Werror=implicit-function-declaration] sed -i "s/#define HAVE_SCHED_GETAFFINITY 1/#undef HAVE_SCHED_GETAFFINITY/g" config.h %endif %if 0%{?version_package_major} >= 4 sed -i 's|^hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=""|g' "libtool" sed -i 's|^runpath_var=LD_RUN_PATH|runpath_var=DIE_RPATH_DIE|g' "libtool" %endif echo "RPM SPEC: " echo "RPM SPEC: " %if 0%{?disable_smp} make %else make %{?_smp_mflags} %endif echo "RPM SPEC: " %{?rhscl:EOF} %install echo "RPM SPEC: " %if 0%{?buildroot_manual} %{?buildroot_manual_cleansetup} %endif echo "RPM SPEC: " echo "RPM SPEC: " make DESTDIR="%{buildroot}" install echo "RPM SPEC: " echo "RPM SPEC: " shopt -s nullglob %if 0%{?include_key} # copy the mono.snk key into /etc/pki/mono5/mono5.snk mkdir -p "%{buildroot}/%{_sysconfdir}/pki/%{?name_base}%{!?name_base:mono5}" install -p -m0644 "%{SOURCE1}" "%{buildroot}/%{_sysconfdir}/pki/%{?name_base}%{!?name_base:mono5}/%{?name_base}%{!?name_base:mono5}.snk" %endif find "%{buildroot}" -iname "*.dll.so" -exec rm '{}' ';' find "%{buildroot}" -iname "*.exe.so" -exec rm '{}' ';' # fix problem with symbolic link for mono pointing at absolute path if [[ ! -e "%{buildroot}/%{path_package}/bin/mono" || -h "%{buildroot}/%{path_package}/bin/mono" ]]; then ln -sf mono-sgen "%{buildroot}/%{path_package}/bin/mono" fi if [[ -d "%{buildroot}/%{path_package}/lib/mono/xbuild/12.0/bin" ]]; then # fix problems with wrong symbolic link # ERROR: link target doesn't exist (neither in build root nor in installed system): # /opt/mono2/lib/mono/xbuild/12.0/bin/Mono.XBuild.Tasks.dll -> /opt/mono2/lib/mono/xbuild/12.0/gac/Mono.XBuild.Tasks/4.0.0.0__0738eb9f132ed756/Mono.XBuild.Tasks.dll cd "%{buildroot}/%{path_package}/lib/mono/xbuild/12.0/bin"; ln -sf ../../../gac/Mono.XBuild.Tasks/4.0.0.0__0738eb9f132ed756/Mono.XBuild.Tasks.dll ln -sf ../../../gac/Microsoft.Build.Tasks.v12.0/12.0.0.0__b03f5f7f11d50a3a/Microsoft.Build.Tasks.v12.0.dll ln -sf ../../../gac/Microsoft.Build.Framework/12.0.0.0__b03f5f7f11d50a3a/Microsoft.Build.Framework.dll ln -sf ../../../gac/Microsoft.Build/12.0.0.0__b03f5f7f11d50a3a/Microsoft.Build.dll ln -sf ../../../gac/Microsoft.Build.Engine/12.0.0.0__b03f5f7f11d50a3a/Microsoft.Build.Engine.dll ln -sf ../../../gac/Microsoft.Build.Utilities.v12.0/12.0.0.0__b03f5f7f11d50a3a/Microsoft.Build.Utilities.v12.0.dll cd - fi echo "RPM SPEC: " echo "RPM SPEC: " #cp "../../SOURCES/env.sh" "%{buildroot}/%{path_package}/" cat > "%{buildroot}/%{path_package}/env.sh" << EOF #!/usr/bin/env bash export MONO_HOME="%{path_package}" export PATH="\${MONO_HOME}/bin:\${PATH}" export LD_LIBRARY_PATH="\${MONO_HOME}/lib:\${LD_LIBRARY_PATH}" export PKG_CONFIG_PATH="\${MONO_HOME}/lib/pkgconfig:\${PKG_CONFIG_PATH}" %if 0%{?enable_llvm} export LLVM_CONFIG="\${MONO_HOME}/bin/llvm-config" %endif EOF chmod a+x "%{buildroot}/%{path_package}/env.sh" echo "RPM SPEC: " echo "RPM SPEC: " # remove readme files for other systems #rm -f "%{buildroot}/%{path_package}"/share/libgc-mono/README.OS2 #rm -f "%{buildroot}/%{path_package}"/share/libgc-mono/README.Mac #rm -f "%{buildroot}/%{path_package}"/share/libgc-mono/README.win32 # remove the mono-nunit files #rm -f "%{buildroot}%{_bindir}"/nunit-console #rm -f "%{buildroot}%{_bindir}"/nunit-console2 #rm -f "%{buildroot}%{_bindir}"/nunit-console4 rm -f "%{buildroot}/%{_bindir}"/nunit-console* #rm -f "%{buildroot}%{_monodir}"/4.5/nunit* rm -f "%{buildroot}/%{_monodir}"/?.?{,-api}/nunit* rm -Rf "%{buildroot}/%{_monodir}"/gac/nunit* rm -f "%{buildroot}/%{_libdir}"/pkgconfig/mono-nunit.pc # do not make cecil publicly available. other packages should use the mono-cecil package instead rm -f "%{buildroot}/%{_libdir}"/pkgconfig/cecil.pc # remove msbuild / microsoft binary files rm -rf "%{buildroot}%{_libdir}"/mono/msbuild %if 0%{?build_clear} #rm "%{buildroot}%{_libdir}"/*.la rm "%{buildroot}/%{path_package}"/lib/*.la #rm "%{buildroot}%{_libdir}"/*.a rm "%{buildroot}/%{path_package}"/lib/*.a # We put these inside rpm #rm "%{buildroot}%{_bindir}"/mono-find-provides #rm "%{buildroot}%{_bindir}"/mono-find-requires # This was removed upstream: rm -rf "%{buildroot}/%{monodir}"/gac/Mono.Security.Win32 #rm -rf "%{buildroot}%{monodir}"/2.0/Mono.Security.Win32.dll #rm -rf "%{buildroot}%{monodir}"/4.0/Mono.Security.Win32.dll rm -rf "%{buildroot}/%{monodir}"/?.?{,-api}/Mono.Security.Win32.dll #rm "%{buildroot}%{_datadir}"/libgc-mono/README* rm -f "%{buildroot}/%{path_package}"/share/libgc-mono/README* #rm "%{buildroot}%{_datadir}"/libgc-mono/barrett_diagram rm -f "%{buildroot}/%{path_package}"/share/libgc-mono/barrett_diagram #rm "%{buildroot}%{_datadir}"/libgc-mono/*.html rm -f "%{buildroot}/%{path_package}"/share/libgc-mono/*.html #rm "%{buildroot}%{_datadir}"/libgc-mono/gc.man rm -f "%{buildroot}/%{path_package}"/share/libgc-mono/gc.man #rm -f "%{buildroot}%{monodir}"/2.0/mscorlib.dll.so rm -f "%{buildroot}/%{monodir}"/?.?{,-api}/mscorlib.dll.so #rm -f "%{buildroot}%{monodir}"/2.0/mcs.exe.so rm -f "%{buildroot}/%{monodir}"/?.?{,-api}/mcs.exe.so #rm -f "%{buildroot}%{monodir}"/2.0/gmcs.exe.so rm -f "%{buildroot}/%{monodir}"/?.?{,-api}/gmcs.exe.so rm -rf "%{buildroot}/%{monodir}"/xbuild/Microsoft #rm -f "%{buildroot}%{monodir}"/4.0/mscorlib.dll.so ##rm -f "%{buildroot}/%{monodir}"/?.?{,-api}/mscorlib.dll.so #rm -f "%{buildroot}%{monodir}"/4.0/dmcs.exe.so rm -f "%{buildroot}/%{monodir}"/?.?{,-api}/dmcs.exe.so #rm -rf "%{buildroot}%{monodir}"/4.0/Mono.Security.Win32 rm -rf "%{buildroot}/%{monodir}"/?.?{,-api}/Mono.Security.Win32 #rm -rf "%{buildroot}%{_bindir}"/mono-configuration-crypto rm -rf "%{buildroot}/%{path_package}"/bin/mono-configuration-crypto #rm -rf "%{buildroot}%{_mandir}"/man?/mono-configuration-crypto* rm -rf "%{buildroot}/%{path_package}"/share/man/man?/mono-configuration-crypto* %endif echo "RPM SPEC: " echo "RPM SPEC: " mkdir -p "%{buildroot}/%{_prefix}/local/bin/" pushd "%{buildroot}/%{path_package}/bin" >/dev/null 2>&1 #while read -r file ; do for file in * ; do f="$( basename "${file}" )" [[ -f "${file}" && -x "${file}" ]] || continue # create "links" in /usr/local/bin for mono opt apps cat << EOF > "%{buildroot}/%{_prefix}/local/bin/%{name_base}-${f}" #!/usr/bin/env bash # %{name_base}-${f} base_dir="%{path_package}" env_dir="\${base_dir}" env_file="env.sh" env_path="\${env_dir}/\${env_file}" app_dir="\${base_dir}/bin" app_name="${f}" app_path="\${app_dir}/\${app_name}" [[ -x "\${env_path}" ]] && source "\${env_path}" [[ -x "\${app_path}" ]] && "\${app_path}" "\${@}" EOF # skip mono-gdb.py and mono-sgen-gdb.py #done < <( find * -mindepth 0 -maxdepth 0 -xtype f -executable | sort -V ) done popd >/dev/null 2>&1 pushd "%{buildroot}/%{_prefix}/local/bin/" >/dev/null 2>&1 # give exec perms chmod a+x * # create symlink in /usr/local/bin: mono5 -> mono5-mono if [ -e "%{?name_base}%{!?name_base:mono5}-%{?project_name}%{!?project_name:mono}" ]; then if [ ! -e "%{?name_base}%{!?name_base:mono5}" ]; then ln -s "%{?name_base}%{!?name_base:mono5}-%{?project_name}%{!?project_name:mono}" "%{?name_base}%{!?name_base:mono5}" fi fi popd >/dev/null 2>&1 echo "RPM SPEC: " %if 0%{?buildroot_manual} %clean # Clean up after ourselves, but be careful in case someone sets a bad buildroot %{?buildroot_manual_clean} %endif %post -p /sbin/ldconfig %postun -p /sbin/ldconfig %if 0%{?separated_devel} %post devel -p /sbin/ldconfig %postun devel -p /sbin/ldconfig %endif %if 0%{?separated_local} %post local -p /sbin/ldconfig %postun local -p /sbin/ldconfig %endif %files %doc NEWS README.md %license COPYING.LIB %if 0%{?separated_devel} %exclude %{path_package}/include %exclude %{path_package}/lib/pkgconfig %exclude %{path_package}/lib/*.a %exclude %{path_package}/lib/*.so %endif %if 0%{?separated_local} %exclude %{_prefix}/local/bin/%{name_base} %exclude %{_prefix}/local/bin/%{name_base}-* %endif %if 0%{?include_key} %{_sysconfdir}/pki/%{?name_base}%{!?name_base:mono5}/%{?name_base}%{!?name_base:mono5}.snk %endif %{path_package} %if 0%{?separated_devel} %files devel %{path_package}/include %{path_package}/lib/pkgconfig %{path_package}/lib/*.so %{path_package}/lib/*.a %endif %if 0%{?separated_local} %files local %{_prefix}/local/bin/%{name_base} %{_prefix}/local/bin/%{name_base}-* %endif %changelog * Fri Jul 06 2018 Tomasz Tomasik - 5.12.0-1.8 - Fix macros * Mon Jun 18 2018 Tomasz Tomasik - 5.12.0-1.7 - Disable loadedllvm (runtime-loadable module) https://bugzilla.xamarin.com/show_bug.cgi?id=16203 * Mon Jun 18 2018 Tomasz Tomasik - 5.12.0-1.6 - Update mono_arches - Disable LLVM on some arches * Mon Jun 18 2018 Tomasz Tomasik - 5.12.0-1.5 - Enable LLVM * Sun Jun 17 2018 Tomasz Tomasik - 5.12.0-1.4 - Update requirements * Sun Jun 17 2018 Tomasz Tomasik - 5.12.0-1.3 - Redefine mono_arches * Sun Jun 17 2018 Tomasz Tomasik - 5.12.0-1.2 - Update URL * Sat Jun 16 2018 Tomasz Tomasik - 5.12.0-1.1 - Initial build for Mono 5 opt package based on mono-5.12.0-1.fc28.src.rpm from COPR repo tpokorra/mono-5.12 by Timotheus Pokorra