%define name_project mono %define name_subpackage llvm %define version_package_major 5 %define version_package_minor 12 %define version_package_revision 0 %define version_subpackage_major 3 %define version_subpackage_minor 6 %define version_subpackage_revision 0 %define version_file %{nil} %define version_git 38603e0a3d6448b0b9edeb1a06ea78501515cec8 %define version_git 0b3cb8ac12cd839f8110775d4085e822e8af4d7b # 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 %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} 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 ################################################################################ # enable to create devel package # disable to include devel files in main package %define separated_devel %{nil} %define separated_devel 1 ################################################################################ # define python %define python python %if 0%{?rhel}%{?fedora} %if 0%{?rhel} %if 0%{?rhel} < 6 %define python python26 %endif %endif %endif %define path_python %{_bindir}/%{?python}%{!?python:python} ################################################################################ %define enable_debuginfo %{nil} %define enable_debuginfo 1 ################################################################################ Name: %{name} Version: %{version} Release: 10%{?dist} Summary: Mono LLVM Group: Development/Languages License: NCSA Vendor: LLVM Team Packager: Tomasz Tomasik URL: http://www.mono-project.com/docs/advanced/mono-llvm/ # JIT only available on these: ExclusiveArch: %{mono_arches} Source0: https://github.com/mono/llvm/archive/%{version_git}.tar.gz#/%{name_subpackage}-%{version_git}.tar.gz Patch0: LLVM_NOEXCEPT.patch %if 0%{?buildroot_manual} #BuildRoot: /tmp/buildroot BuildRoot: %{?buildroot_manual_directory}%{!?buildroot_manual_directory:/tmp/buildroot} %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 %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 BuildRequires: %{?python}%{!?python:python} >= 2.5 %if 0%{?devtoolset} #Requires: devtoolset-%{?devtoolset}%{!?devtoolset:7}-runtime %endif Requires: pkgconfig Requires: glib2 Requires: bzip2 dos2unix Requires: gettext libicu libgdiplus >= 2.10 valgrind zlib Requires: %{?python}%{!?python:python} >= 2.5 %if 0%{?separated_devel} # Build devel package. %else Obsoletes: %{name}-devel %endif %description Mono LLVM backend %if 0%{?separated_devel} %package devel License: NCSA Summary: Development files for Mono LLVM #Group: Development/Libraries #Group: Development/Languages/Mono Group: Development/Languages Requires: %{name} = %{version} Requires: pkgconfig Requires: glib2-devel %description devel Development files for Mono LLVM backend. %endif %prep %setup -q -n %{?name_subpackage}%{!?name_subpackage:llvm}-%{version_git} %patch0 -p1 %build %if 0%{?devtoolset} %{?devtoolset_setup} %endif %{?rhscl:rhscl enable %%{rhscl} - << \EOF} # Configure and make source #./configure --prefix=%{path_package} --enable-optimized --enable-targets=host --with-python="%{path_python}" ./configure \ %if %{?_host:1} --host=%{_host} \ %endif %if %{?_build:1} --build=%{_build} \ %endif --enable-optimized \ --enable-targets=host \ --with-python="%{?path_python}%{!?path_python:/usr/bin/python}" \ %if 0%{?enable_debuginfo} --enable-debug-runtime \ --enable-debug-symbols \ --enable-keep-symbols \ %endif --prefix="%{path_package}" %if 0%{?disable_smp} make %else make %{?_smp_mflags} %endif %{?rhscl:EOF} %install %if 0%{?buildroot_manual} %{?buildroot_manual_cleansetup} %endif make DESTDIR="%{buildroot}" install shopt -s nullglob chmod a-x "%{buildroot}/%{path_package}/lib"/*.a chmod a-x "%{buildroot}/%{path_package}/lib"/*.so %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 %files %defattr(-,root,root) %if 0%{?separated_devel} %exclude %{path_package}/include %exclude %{path_package}/lib/*.a %exclude %{path_package}/lib/*.so %endif %{path_package} %if 0%{?separated_devel} %files devel %defattr(-,root,root,-) %{path_package}/include %{path_package}/lib/*.so %{path_package}/lib/*.a %endif %changelog * Fri Jul 06 2018 Tomasz Tomasik - 3.6.0-10 - Fix macros * Mon Jun 18 2018 Tomasz Tomasik - 3.6.0-9 - Enable debug symbols * Mon Jun 18 2018 Tomasz Tomasik - 3.6.0-8 - Initial build for Mono 5 LLVM * Tue Mar 07 2017 Tomasz Tomasik - 3.6.0-7 - Initial build for Mono 2 LLVM opt package based on mono-llvm-opt-4.2.1-6.src.rpm from tpokorra-mono-opt by Timotheus Pokorra