%arch32 %{ix86} %{arm32} ppc sparc sparcv9
%arch64 %{x8664} %{arm64} ppc64 sparc64
+
+# architectures with support for 8-byte (64 bits) atomics
+%arch_with_atomics64 i586 i686 athlon pentium2 pentium3 pentium4 %{x8664} x32 %{armv7} %{armv8} aarch64 mips64 ppc64 sparcv9 sparc64
# insead of the system default
#%use_jdk icedtea6
+# Lower bound for JDK version.
+# In case of `%use_default_jdk %{expr:%min_jdk_version-1}` use %min_jdk_version
+%min_jdk_version 8
+
+# Default JDK provider and version
+%default_jdk_provider openjdk
+%default_jdk_version %min_jdk_version
+
+# Name of default JDK, takes requested minimum version as argument or if not
+# given defaults to %default_jdk_version. Result is is either:
+# - %{expand:%%default_jdk<requested version>}
+# - %{expand:%%default_jdk_provider}<requested version>
+#
+# Examples for overriding:
+# - specific JDK: --define 'default_jdk8 oracle8'
+# - JDK provider: --define 'default_jdk_provider oracle'
+# - JDK version: --define 'default_jdk_version 11'
+%default_jdk() %{expand:%%define __jdk_v %{?1}%{!?1:%default_jdk_version}}%{expand:%%define __jdk_vf %{expr:%__jdk_v < %min_jdk_version ? %min_jdk_version : %__jdk_v}}%{expand:%%{?default_jdk%{__jdk_vf}}}%{expand:%%{!?default_jdk%{__jdk_vf}:%default_jdk_provider%{__jdk_vf}}}%{expand:%%undefine __jdk_vf}%{expand:%%undefine __jdk_v}
+
+# Use default JDK in spec, optionally takes requested minimum version as argument
+%use_default_jdk() %{expand:%%global use_jdk %{default_jdk %{?*}}}
+
# expands to the value with right jdk for BuildRequires header
# 'jdk' if %%use_jdk is not defined, jdk(%%use_jdk) otherwise
# The requirement will not replace current 'default' JDK
%cargo_targetdir target
%cargo_objdir %{?buildsubdir:%{_builddir}/%{buildsubdir}/}%{cargo_targetdir}/%{rust_target}/%{!?debug:release}%{?debug:debug}
+%__rustc /usr/bin/rustc
%__cargo /usr/bin/cargo
%__cargo_common_opts -v --offline
%cargo_build \\\
CXXFLAGS="%{rpmcppflags} %{rpmcxxflags}" \\\
LDFLAGS="%{rpmldflags}" \\\
PKG_CONFIG_ALLOW_CROSS=1 \\\
+ RUSTC="${RUSTC:-%__rustc}" \\\
%{?rustc_wrapper:RUSTC_WRAPPER="${RUSTC_WRAPPER:-%rustc_wrapper}"} \\\
RUSTFLAGS="${RUSTFLAGS:-%rpmrustflags}" \\\
%{?__jobs:CARGO_BUILD_JOBS="${CARGO_BUILD_JOBS:-%{__jobs}}"} \\\
%{__cargo} %{__cargo_common_opts} build %{!?debug:--release} \\\
- --target %{rust_target} \\\
+ --target %rust_target \\\
--target-dir %{cargo_targetdir} \\\
%{nil}
CXXFLAGS="%{rpmcppflags} %{rpmcxxflags}" \\\
LDFLAGS="%{rpmldflags}" \\\
PKG_CONFIG_ALLOW_CROSS=1 \\\
+ RUSTC="${RUSTC:-%__rustc}" \\\
+ %{?rustc_wrapper:RUSTC_WRAPPER="${RUSTC_WRAPPER:-%rustc_wrapper}"} \\\
RUSTFLAGS="${RUSTFLAGS:-%rpmrustflags}" \\\
%{?__jobs:CARGO_BUILD_JOBS="${CARGO_BUILD_JOBS:-%{__jobs}}"} \\\
%{__cargo} %{__cargo_common_opts} install \\\
- --target %{rust_target} \\\
+ --target %rust_target \\\
--target-dir %{cargo_targetdir} \\\
%{nil}
%_lispdir %{_datadir}/emacs/site-lisp
%_initddir %{_sysconfdir}/rc.d/init.d
+%_metainfodir %{_datadir}/metainfo
+
%_defaultdocdir %{_usr}/share/doc
%_fmoddir %{_libdir}/gfortran/modules
%{__cmake} \\\
-DCMAKE_VERBOSE_MAKEFILE:BOOL=ON \\\
-DCMAKE_BUILD_TYPE=%{!?debug:TLD}%{?debug:Debug} \\\
+ -DCMAKE_SYSTEM_NAME=Linux \\\
+ -DCMAKE_CROSSCOMPILING:BOOL=FALSE \\\
+%ifarch x32\
+ -DCMAKE_SYSTEM_PROCESSOR=x86_64 \\\
+%else\
+ -DCMAKE_SYSTEM_PROCESSOR=%{_target_cpu} \\\
+%endif\
-DCMAKE_INSTALL_BINDIR:PATH=%{_bindir} \\\
-DCMAKE_INSTALL_SBINDIR:PATH=%{_sbindir} \\\
-DCMAKE_INSTALL_LIBEXECDIR:PATH=%{_libexecdir} \\\
CPPFLAGS="${CPPFLAGS:-%{rpmcppflags}}" \
CXXFLAGS="${CXXFLAGS:-%{rpmcxxflags}}" \
LDFLAGS="${LDFLAGS:-%{rpmldflags}}" \
+RUSTC="${RUSTC:-%{__rustc}}" \
+RUSTFLAGS="${RUSTFLAGS:-%{rpmrustflags} --target %rust_target}" \
LC_ALL=C.UTF-8 %{__meson} \
--buildtype=plain \
--bindir=%{_bindir} \
-%define rpm_macros_rev 2.019
+%define rpm_macros_rev 2.025
%define find_lang_rev 1.41
# split into individual X_prov_ver if there is a reason to desync
%define prov_ver 4.15
Summary(pl.UTF-8): Makra RPM dla Linuksa TLD
Name: rpm-tld-macros
Version: %{rpm_macros_rev}
-Release: 5
+Release: 1
License: GPL v2+
Group: Development/Building
Source0: macros.tld