File corrosion.spec of Package corrosion
# spec file for corrosion
#
# Copyright (c) 2021 SUSE LINUX GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
%global rustflags '-Clink-arg=-Wl,-z,relro,-z,now'
Name: corrosion
Version: 0.0.1.20220224
Release: 0
License: MIT
Summary: Rust/CMake integration
Url: https://github.com/AndrewGaspar/corrosion
Source0: corrosion-%{version}.tar.xz
Source1: vendor.tar.xz
Source2: cargo_config
BuildRequires: gcc
BuildRequires: gcc-c++
BuildRequires: cmake
BuildRequires: fdupes
BuildRequires: cargo
BuildRequires: rust-packaging
BuildRoot: %{_tmppath}/%{name}-%{version}-build
%description
Formerly known as cmake-cargo, it is a tool for integrating Rust into an existing CMake project;
capable of importing executables, static libraries, and dynamic libraries from a crate.
%prep
%setup -q -n corrosion-%{version}
%setup -qa1
mkdir .cargo
cp %{SOURCE2} .cargo/config
%build
export RUSTFLAGS=%{rustflags}
mkdir -p build
cd build
cmake .. -DCORROSION_BUILD_TESTS=OFF -DCORROSION_DEV_MODE=OFF
#%%cmake
%cmake_build
%install
%cmake_install
%fdupes %{buildroot}%{_prefix}
%files
%defattr(-,root,root,-)
%doc README.md
%license LICENSE
%{_prefix}/local/
#still gotta do something about this^
%changelog