From 859ecec951befaf446b34a186886864c8db70ed3a6716372d04d548ba2ef4cc8 Mon Sep 17 00:00:00 2001 From: Soc Virnyl Estela Date: Thu, 24 Nov 2022 15:24:52 +0000 Subject: [PATCH] OBS-URL: https://build.opensuse.org/package/show/science/juliaup?expand=0&rev=57 --- juliaup.spec | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/juliaup.spec b/juliaup.spec index 01fc30e..d74a436 100644 --- a/juliaup.spec +++ b/juliaup.spec @@ -18,7 +18,6 @@ %global oldest_supported_julia_version 0.7.0 %global latest_julia_version 1.8.3 -%global rustflags -Clink-arg=-Wl,-z,relro,-z,now -C debuginfo=2 # Based on the latest stable release in the https://julialang.org/ website # Juliaup follows the versions too in the following permalink: @@ -82,14 +81,15 @@ URL: https://github.com/JuliaLang/juliaup Source0: %{name}-%{version}.tar.gz Source1: vendor.tar.gz Source2: cargo_config -%if 0%{?rhel} > 7 || 0%{?fedora} -BuildRequires: cargo -%else +BuildRequires: rust+cargo + +%if 0%{?suse_version} BuildRequires: cargo-packaging %endif -Conflicts: julia + %provides_julia_versioned julia -Obsoletes: julia < %{oldest_supported_julia_version} +Provides: julia = %{latest_julia_version} +Obsoletes: julia < %{latest_julia_version} %if 0%{?suse_version} PreReq: update-alternatives %endif @@ -112,7 +112,9 @@ cp %{SOURCE2} .cargo/config unset LIBSSH2_SYS_USE_PKG_CONFIG export RUSTFLAGS="%{rustflags}" cargo build --offline --release --no-default-features -%else +%endif + +%if 0%{?suse_version} %{cargo_build} --no-default-features %endif @@ -121,16 +123,19 @@ cargo build --offline --release --no-default-features unset LIBSSH2_SYS_USE_PKG_CONFIG export RUSTFLAGS="%{rustflags}" cargo install --offline --release --no-default-features --no-track --root="%{buildroot}%{_prefix}" --path . -%else +%endif + +%if 0%{?suse_version} %{cargo_install} --no-default-features %endif -mkdir -p %{buildroot}%{_sysconfdir}/alternatives %if 0%{?rhel} > 7 || 0%{?fedora} ln -sf %{_bindir}/julia %{buildroot}%{_bindir}/julialauncher %endif %if 0%{?suse_version} +mkdir -p %{buildroot}%{_sysconfdir}/alternatives +ln -sf %{_sysconfdir}/alternatives/julia %{buildroot}%{_bindir}/julia %post "%_sbindir/update-alternatives" --install \ "%{_bindir}/julia" julia "%{_bindir}/julialauncher" $(printf %{latest_julia_version} | sed 's/\.//g')