Fix packaging issues
* Add debuginfos * Make sure proper CFLAGS and LDFLAGS are used Resolves: RHEL-57078
This commit is contained in:
parent
1c8142b753
commit
b8de93da35
@ -2,7 +2,7 @@
|
|||||||
# Copyright (C) 2011-2017 Red Hat, Inc
|
# Copyright (C) 2011-2017 Red Hat, Inc
|
||||||
#
|
#
|
||||||
%bcond_without check
|
%bcond_without check
|
||||||
%global debug_package %{nil}
|
#%%global debug_package %%{nil}
|
||||||
|
|
||||||
#%%global version_suffix -rc2
|
#%%global version_suffix -rc2
|
||||||
#%%global release_suffix .test3
|
#%%global release_suffix .test3
|
||||||
@ -10,7 +10,7 @@
|
|||||||
Summary: Device-mapper Persistent Data Tools
|
Summary: Device-mapper Persistent Data Tools
|
||||||
Name: device-mapper-persistent-data
|
Name: device-mapper-persistent-data
|
||||||
Version: 1.0.9
|
Version: 1.0.9
|
||||||
Release: 3%{?dist}%{?release_suffix}
|
Release: 3%{?dist}%{?release_suffix}.1
|
||||||
License: GPLv3+
|
License: GPLv3+
|
||||||
URL: https://github.com/jthornber/thin-provisioning-tools
|
URL: https://github.com/jthornber/thin-provisioning-tools
|
||||||
#Source0: https://github.com/jthornber/thin-provisioning-tools/archive/thin-provisioning-tools-%%{version}.tar.gz
|
#Source0: https://github.com/jthornber/thin-provisioning-tools/archive/thin-provisioning-tools-%%{version}.tar.gz
|
||||||
@ -48,15 +48,53 @@ snapshot eras
|
|||||||
#%%cargo_prep
|
#%%cargo_prep
|
||||||
#%%cargo_generate_buildrequires
|
#%%cargo_generate_buildrequires
|
||||||
tar xf %{SOURCE1}
|
tar xf %{SOURCE1}
|
||||||
mkdir -p .cargo
|
(
|
||||||
cat > .cargo/config <<END
|
# Part from %%cargo_prep:
|
||||||
[source.crates-io]
|
set -euo pipefail
|
||||||
replace-with = "vendored-sources"
|
%{__mkdir} -p target/rpm
|
||||||
|
/usr/bin/ln -s rpm target/release
|
||||||
|
%{__rm} -rf .cargo/
|
||||||
|
%{__mkdir} -p .cargo
|
||||||
|
cat > .cargo/config.toml << EOF
|
||||||
|
[build]
|
||||||
|
rustc = "%{__rustc}"
|
||||||
|
rustdoc = "%{__rustdoc}"
|
||||||
|
|
||||||
|
[profile.rpm]
|
||||||
|
inherits = "release"
|
||||||
|
opt-level = 3 # %%{rustflags_opt_level}
|
||||||
|
codegen-units = 1 # %%{rustflags_codegen_units}
|
||||||
|
debug = 2 # %%{rustflags_debuginfo}
|
||||||
|
strip = "none"
|
||||||
|
|
||||||
|
[env]
|
||||||
|
CFLAGS = "%{build_cflags}"
|
||||||
|
CXXFLAGS = "%{build_cxxflags}"
|
||||||
|
LDFLAGS = "%{build_ldflags}"
|
||||||
|
|
||||||
|
[install]
|
||||||
|
root = "%{buildroot}%{_prefix}"
|
||||||
|
|
||||||
|
[term]
|
||||||
|
verbose = true
|
||||||
|
|
||||||
|
[net]
|
||||||
|
offline = true
|
||||||
|
|
||||||
|
EOF
|
||||||
|
cat >> .cargo/config.toml << EOF
|
||||||
[source.vendored-sources]
|
[source.vendored-sources]
|
||||||
directory = "vendor"
|
directory = "vendor"
|
||||||
|
|
||||||
END
|
[source.crates-io]
|
||||||
|
registry = "https://crates.io"
|
||||||
|
replace-with = "vendored-sources"
|
||||||
|
|
||||||
|
EOF
|
||||||
|
%{__rm} -f Cargo.toml.orig
|
||||||
|
cat .cargo/config.toml
|
||||||
|
)
|
||||||
|
|
||||||
echo %{version}-%{release} > VERSION
|
echo %{version}-%{release} > VERSION
|
||||||
|
|
||||||
%generate_buildrequires
|
%generate_buildrequires
|
||||||
@ -73,7 +111,7 @@ RUST_BACKTRACE=1 %%cargo_test -- --nocapture --test-threads=1 || true
|
|||||||
%endif
|
%endif
|
||||||
|
|
||||||
%install
|
%install
|
||||||
make DESTDIR=%{buildroot} MANDIR=%{_mandir} install
|
%make_install MANDIR=%{_mandir} STRIP=true
|
||||||
|
|
||||||
%files
|
%files
|
||||||
%doc COPYING README.md
|
%doc COPYING README.md
|
||||||
|
Loading…
Reference in New Issue
Block a user