%define name_project mono %define name_subpackage libgdiplus %define version_package_major 2 %define version_package_minor 10 %define version_package_revision 8 %define version_subpackage_major 2 %define version_subpackage_minor 10 %undefine version_subpackage_revision %define version_file %{nil} %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} ################################################################################ # if not defined %if 0%{!?mono_arches:1} %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 monodir %{path_package}/lib/mono %define gac_dll(dll) %{monodir}/gac/%{1} \ %{monodir}/?.?/%{1}.dll \ %{nil} %define mono_bin(bin) %{monodir}/bin/%{1} \ %{monodir}/?.0/%{1}.exe \ %{monodir}/?.0/%{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 liberationfonts %define liberationfonts liberation-mono-fonts %if 0%{?rhel}%{?fedora} %define liberationfonts liberation-mono-fonts %else %if 0%{?suse_version} %define liberationfonts liberation-fonts %else %define liberationfonts fonts-ttf-liberation %endif %endif ################################################################################ Name: %{name} Version: %{version} Release: 4%{?dist} Summary: Links for libgdiplus for Mono #Group: Development Group: Development/Languages License: MIT Vendor: Mono Project Packager: Tomasz Tomasik URL: http://www.mono-project.com/Main_Page # JIT only available on these: ExclusiveArch: %{mono_arches} %if 0%{?buildroot_manual} #BuildRoot: /tmp/buildroot BuildRoot: %{?buildroot_manual_directory}%{!?buildroot_manual_directory:/tmp/buildroot} %endif BuildRequires: pkgconfig BuildRequires: %{?name_full}%{!?name_full:mono2} BuildRequires: %{?name_subpackage}%{!?name_subpackage:libgdiplus} >= 2.10 BuildRequires: %{?liberationfonts}%{!?liberationfonts:liberation-mono-fonts} Requires: pkgconfig Requires: %{?name_full}%{!?name_full:mono2} Requires: %{?name_subpackage}%{!?name_subpackage:libgdiplus} >= 2.10 Requires: %{?liberationfonts}%{!?liberationfonts:liberation-mono-fonts} %description Links for libgdiplus for Mono. %prep %build %install %if 0%{?buildroot_manual} %{?buildroot_manual_cleansetup} %endif target_base="%{name_subpackage}.so" target_file="${target_base}.0" target_path="%{_libdir}/${target_file}" if [[ ! -f "${target_path}" ]]; then echo "Error: Target file not exist." >&2 exit 1 fi mkdir -p "%{buildroot}/%{path_package}/lib/" ln -sf ../../.."${target_path}" "%{buildroot}/%{path_package}/lib/${target_file}" ln -sf "${target_file}" "%{buildroot}/%{path_package}/lib/${target_base}" %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 %{path_package}/lib/%{name_subpackage}.so* %changelog * Tue Mar 07 2017 Tomasz Tomasik - 2.10-4 - Initial build for Mono 2 LLVM opt package based on mono-libgdiplus-opt-4.2-3.src.rpm from tpokorra-mono-opt by Timotheus Pokorra