Accepting request 648806 from home:luke_nukem

- Initial packaging

OBS-URL: https://build.opensuse.org/request/show/648806
OBS-URL: https://build.opensuse.org/package/show/devel:languages:rust/rust-cbindgen?expand=0&rev=1
This commit is contained in:
Luke Jones 2018-11-14 01:23:39 +00:00 committed by Git OBS Bridge
commit e1ab28eef2
6 changed files with 109 additions and 0 deletions

23
.gitattributes vendored Normal file
View File

@ -0,0 +1,23 @@
## Default LFS
*.7z filter=lfs diff=lfs merge=lfs -text
*.bsp filter=lfs diff=lfs merge=lfs -text
*.bz2 filter=lfs diff=lfs merge=lfs -text
*.gem filter=lfs diff=lfs merge=lfs -text
*.gz filter=lfs diff=lfs merge=lfs -text
*.jar filter=lfs diff=lfs merge=lfs -text
*.lz filter=lfs diff=lfs merge=lfs -text
*.lzma filter=lfs diff=lfs merge=lfs -text
*.obscpio filter=lfs diff=lfs merge=lfs -text
*.oxt filter=lfs diff=lfs merge=lfs -text
*.pdf filter=lfs diff=lfs merge=lfs -text
*.png filter=lfs diff=lfs merge=lfs -text
*.rpm filter=lfs diff=lfs merge=lfs -text
*.tbz filter=lfs diff=lfs merge=lfs -text
*.tbz2 filter=lfs diff=lfs merge=lfs -text
*.tgz filter=lfs diff=lfs merge=lfs -text
*.ttf filter=lfs diff=lfs merge=lfs -text
*.txz filter=lfs diff=lfs merge=lfs -text
*.whl filter=lfs diff=lfs merge=lfs -text
*.xz filter=lfs diff=lfs merge=lfs -text
*.zip filter=lfs diff=lfs merge=lfs -text
*.zst filter=lfs diff=lfs merge=lfs -text

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
.osc

3
cbindgen-0.6.7.tar.gz Normal file
View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:ceafbe2c6d8f7d473db39fb8458081fee2d15b7699ebd114396d5247fb029532
size 89831

4
rust-cbindgen.changes Normal file
View File

@ -0,0 +1,4 @@
-------------------------------------------------------------------
Wed Nov 14 00:34:16 UTC 2018 - Luke Jones <jones_ld@protonmail.com>
- Initial packaging

75
rust-cbindgen.spec Normal file
View File

@ -0,0 +1,75 @@
#
# spec file for package rust-cbindgen
#
# Copyright (c) 2018 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.
# Please submit bugfixes or comments via http://bugs.opensuse.org/
#
# Use hardening ldflags.
%global crate_name cbindgen
%global rustflags -Clink-arg=-Wl,-z,relro,-z,now
Name: rust-%{crate_name}
Version: 0.6.7
Release: 0
Summary: A tool for generating C bindings from Rust code
License: MPL-2.0
Group: Development/Languages/Rust
Url: https://crates.io/crates/cbindgen
Source0: %{crate_name}-%{version}.tar.gz
Source1: vendor.tar.xz
BuildRequires: cargo >= 1.30.0
BuildRequires: rust >= 1.30.0
BuildRequires: rust-std-static >= 1.30.0
%description
A tool for generating C bindings from Rust code.
%prep
%setup -q -T -b 0 -n %{crate_name}-%{version}
%setup -q -D -T -a 1 -n %{crate_name}-%{version}
mkdir cargo-home
cat >cargo-home/config <<EOF
[source.crates-io]
registry = 'https://github.com/rust-lang/crates.io-index'
replace-with = 'vendored-sources'
[source.vendored-sources]
directory = './vendor'
EOF
%build
# This should eventually migrate to distro policy
# Enable optimization, debuginfo, and link hardening.
export RUSTFLAGS="%{rustflags}"
export CARGO_HOME=`pwd`/cargo-home/
cargo build --release
%install
# rustflags must be exported again at install as cargo build will
# rebuild the project if it detects flags have changed (to none or other)
export RUSTFLAGS="%{rustflags}"
# install stage also requires re-export of 'cargo-home' or cargo
# will try to download source deps and rebuild
export CARGO_HOME=`pwd`/cargo-home/
# cargo install appends /bin to the path
cargo install --root=%{buildroot}%{_prefix}
# remove spurious file
rm %{buildroot}%{_prefix}/.crates.toml
%files
%license LICENSE
%{_bindir}/cbindgen
%changelog

3
vendor.tar.xz Normal file
View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:e2a488faac1ed2d4b5b64a087ed43ef191dc6fdcf21994800a136fbf931160b8
size 4824188