# Generated by rust2rpm %bcond_without check ### # Cherry-pick some rust-packaging macros (from rust2rpm), # as the package is heavily entangled in modern py3 dependencies. # Source is at https://pagure.io/fedora-rust/rust2rpm/blob/master/f/data. # This section can be dropped on a buildroot where "rust-packaging" rpm # exists. %define rust_arches x86_64 i686 armv7hl aarch64 ppc64 ppc64le s390x %define __rustc %{_bindir}/rustc %define __rustdoc %{_bindir}/rustdoc %define __global_rustflags -Copt-level=3 -Cdebuginfo=2 -Clink-arg=-Wl,-z,relro,-z,now %define __cargo %{_bindir}/cargo %define __cargo_common_opts %{?_smp_mflags} %define __global_rustflags_toml [%{lua: for arg in string.gmatch(rpm.expand("%{__global_rustflags}"), "%S+") do print('"' .. arg .. '", ') end}] %define cargo_prep (\ set -eu \ %{__mkdir} -p .cargo \ %{__cat} > .cargo/config << EOF \ [build]\ rustc = "%{__rustc}"\ rustdoc = "%{__rustdoc}"\ rustflags = %{__global_rustflags_toml}\ \ [term]\ verbose = true\ \ [source]\ \ [source.local-registry]\ directory = "%{cargo_registry}"\ \ [source.crates-io]\ registry = "https://crates.io"\ replace-with = "local-registry"\ EOF\ %{__rm} -f Cargo.lock \ %if ! %{with check} \ # https://github.com/rust-lang/cargo/issues/3732 \ %{__awk} -i inplace -v INPLACE_SUFFIX=.orig '/^\\\[dev-dependencies/{f=1;next} /^\\\[/{f=0}; !f' Cargo.toml \ %endif \ ) ### %global crate overdrop-sebool %global cargo_registry ./vendor Name: rust-%{crate} Version: master Release: 1%{?dist} Summary: SELinux bool runtime License: ASL 2.0 URL: https://github.com/overdrop/overdrop-sebool Source0: https://github.com/overdrop/%{crate}/archive/%{version}.tar.gz Source1: https://users.developer.core-os.net/lucab/rhcos/cargo-vendor/%{name}-%{version}-01-vendor.tar.xz ExclusiveArch: %{rust_arches} #BuildRequires: rust-packaging BuildRequires: rust BuildRequires: cargo BuildRequires: systemd %description %{summary}. %package -n %{crate} Summary: %{summary} %description -n %{crate} %{summary}. %prep %setup -q -a 1 -n %{crate}-%{version} %cargo_prep %build ## This below is equivalent to: # %cargo_build %{__cargo} build \ %{__cargo_common_opts} \ --release \ %install mkdir -p %{buildroot}%{_libexecdir}/overdrop install -p -m 0755 -D -t %{buildroot}%{_libexecdir}/overdrop target/release/overdrop-sebool mkdir -p %{buildroot}%{_unitdir} install -p -m 0644 -D -t %{buildroot}%{_unitdir} dist/systemd/overdrop-sebool.service %if %{with check} %check ## This below is equivalent to: # %cargo_check %{__cargo} test \ %{__cargo_common_opts} \ --release \ --no-fail-fast %endif %files -n %{crate} #%license LICENSE #%doc README.md %{_libexecdir}/overdrop/overdrop-sebool %{_unitdir}/overdrop-sebool.service %changelog * Fri Sep 07 2018 Luca Bruno - master-1 - Initial package