The package rpms/rust-rd-agent.git has added or updated architecture specific content in its spec file (ExclusiveArch/ExcludeArch or %ifarch/%ifnarch) in commit(s): https://src.fedoraproject.org/cgit/rpms/rust-rd-agent.git/commit/?id=4fbdbd1....
Change: +ExclusiveArch: %{rust_arches}
Thanks.
Full change: ============
commit 4aa273cbf2626d446f83a6588d72378fbaa3161a Author: Davide Cavalca dcavalca@fedoraproject.org Date: Fri Oct 22 10:27:50 2021 -0700
Build for epel8
diff --git a/.gitignore b/.gitignore index 0907d6e..6195b17 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ /linux-5.8.11.tar.xz /rd-agent-2.1.2.crate +/rd-agent-2.1.2-vendor.tar.gz diff --git a/rust-rd-agent.spec b/rust-rd-agent.spec index 61a5e25..1d80f74 100644 --- a/rust-rd-agent.spec +++ b/rust-rd-agent.spec @@ -4,6 +4,13 @@
%global crate rd-agent
+%if 0%{?el8} +# el8 doesn't have these macros +%global __crates_url https://crates.io/api/v1/crates/ +%global crates_source %{__crates_url}%{crate}/%{version}/download#/%{crate}-%{version}.crate +%global version_no_tilde %{version} +%endif + %global selinuxtype targeted %bcond_without selinux
@@ -18,6 +25,8 @@ URL: https://crates.io/crates/rd-agent Source: %{crates_source} # Used as a data file by rd-agent for the compile sideload Source1: https://cdn.kernel.org/pub/linux/kernel/v5.x/linux-5.8.11.tar.xz +# Vendored dependencies for EPEL, update with ./update-vendor-tarball.sh +Source2: %{crate}-%{version}-vendor.tar.gz # SELinux policy Source10: %{crate}.fc Source11: %{crate}.if @@ -25,7 +34,12 @@ Source12: %{crate}.te
ExclusiveArch: %{rust_arches}
+%if 0%{?el8} +BuildRequires: rust-toolset +%else BuildRequires: rust-packaging +%endif + %if 0%{?with_selinux} BuildRequires: selinux-policy-devel %endif @@ -106,10 +120,14 @@ mkdir selinux cp -p %{SOURCE10} %{SOURCE11} %{SOURCE12} selinux %endif
+%if 0%{?el8} +%cargo_prep -V 2 +%else %cargo_prep
%generate_buildrequires %cargo_generate_buildrequires +%endif
%build %cargo_build diff --git a/sources b/sources index cc27c9f..314aeaa 100644 --- a/sources +++ b/sources @@ -1,2 +1,3 @@ -SHA512 (linux-5.8.11.tar.xz) = bb6994f09aabfb0076f3023dd8359c5c569a4b398d3a3c3c8d6b27052092cab56ad675f45dd6ceba7fe431f2a6a587858f3c21415b5a00adb346bd2c68d85b0f SHA512 (rd-agent-2.1.2.crate) = 15dae4e8d6cb2466130eeb208e387e5cc2bc1c0179dd1261057f657738c7f1dc5b54cb29d4a37074aba7196d535b91ee5058b90403c27a12115dfa1ce87712d0 +SHA512 (linux-5.8.11.tar.xz) = bb6994f09aabfb0076f3023dd8359c5c569a4b398d3a3c3c8d6b27052092cab56ad675f45dd6ceba7fe431f2a6a587858f3c21415b5a00adb346bd2c68d85b0f +SHA512 (rd-agent-2.1.2-vendor.tar.gz) = 67bbbd761c7788c3689f1d67e720e4cafc38442b2f64e3ff384927a90ccad458b0e648224e1fa46c41550a554e17819cc7a23606d2598d1e40589fe02377ed39 diff --git a/update-vendor-tarball.sh b/update-vendor-tarball.sh new file mode 100755 index 0000000..189ec61 --- /dev/null +++ b/update-vendor-tarball.sh @@ -0,0 +1,25 @@ +#!/bin/sh + +name='rd-agent' +specfile="rust-${name}.spec" +version=$(rpm -q --qf '%{VERSION}\n' --specfile "$specfile" | head -1) +nv="${name}-${version}" +crate="${nv}.crate" +vendor_tarball="${nv}-vendor.tar.gz" + +if [ -f "$vendor_tarball" ]; then + echo "${vendor_tarball} already exists, aborting" + exit 1 +fi + +[ -f "$crate" ] || spectool -g "$specfile" +tardir="$PWD" +workdir=$(mktemp -d) +trap 'rm -rf "$workdir"' EXIT + +tar xvzf "$tardir/$crate" -C "$workdir" +(cd "${workdir}/${nv}" && \ + cargo vendor && \ + tar cvzf "${tardir}/${vendor_tarball}" vendor/) + +exit 0
commit 4fbdbd183c5632fa3cc149664225a2ffee22ab38 Author: Davide Cavalca dcavalca@fedoraproject.org Date: Thu Oct 21 12:17:45 2021 -0700
Initial import; Fixes: RHBZ#1990930
diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..0907d6e --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +/linux-5.8.11.tar.xz +/rd-agent-2.1.2.crate diff --git a/rd-agent.fc b/rd-agent.fc new file mode 100644 index 0000000..f8a1a5c --- /dev/null +++ b/rd-agent.fc @@ -0,0 +1,4 @@ +/usr/bin/rd-agent -- gen_context(system_u:object_r:resctl_demo_exec_t,s0) + +/var/lib/resctl-demo/misc-bin(/.*)? gen_context(system_u:object_r:var_lib_resctl_demo_bin_t,s0) +/var/lib/resctl-demo/sideload-bin(/.*)? gen_context(system_u:object_r:var_lib_resctl_demo_bin_t,s0) diff --git a/rd-agent.if b/rd-agent.if new file mode 100644 index 0000000..2e81779 --- /dev/null +++ b/rd-agent.if @@ -0,0 +1,2 @@ +## +rd-agentd interface diff --git a/rd-agent.te b/rd-agent.te new file mode 100644 index 0000000..2940ea0 --- /dev/null +++ b/rd-agent.te @@ -0,0 +1,23 @@ +policy_module(rd-agent, 1.0.0) + +######################################## +# +# Declarations +# + +type resctl_demo_t; +type resctl_demo_exec_t; +init_daemon_domain(resctl_demo_t, resctl_demo_exec_t); + +type var_lib_resctl_demo_bin_t; +files_type(var_lib_resctl_demo_bin_t); + +######################################## +# +# rd-agent local policy +# + +allow resctl_demo_exec_t var_lib_resctl_demo_bin_t:file execute; + +manage_dirs_pattern(resctl_demo_exec_t, var_lib_resctl_demo_bin_t, var_lib_resctl_demo_bin_t); +manage_files_pattern(resctl_demo_exec_t, var_lib_resctl_demo_bin_t, var_lib_resctl_demo_bin_t); diff --git a/rust-rd-agent.spec b/rust-rd-agent.spec new file mode 100644 index 0000000..61a5e25 --- /dev/null +++ b/rust-rd-agent.spec @@ -0,0 +1,138 @@ +# Generated by rust2rpm 18 +%bcond_without check +%global __cargo_skip_build 0 + +%global crate rd-agent + +%global selinuxtype targeted +%bcond_without selinux + +Name: rust-%{crate} +Version: 2.1.2 +Release: %autorelease +Summary: Management agent for resctl-demo + +# Upstream license specification: Apache-2.0 +License: ASL 2.0 and MIT +URL: https://crates.io/crates/rd-agent +Source: %{crates_source} +# Used as a data file by rd-agent for the compile sideload +Source1: https://cdn.kernel.org/pub/linux/kernel/v5.x/linux-5.8.11.tar.xz +# SELinux policy +Source10: %{crate}.fc +Source11: %{crate}.if +Source12: %{crate}.te + +ExclusiveArch: %{rust_arches} + +BuildRequires: rust-packaging +%if 0%{?with_selinux} +BuildRequires: selinux-policy-devel +%endif + +%global _description %{expand: +Management agent for resctl-demo.} + +%description %{_description} + +%package -n %{crate} +Summary: %{summary} + +%if 0%{?with_selinux} +Requires: (%{crate}-selinux if selinux-policy-%{selinuxtype}) +%endif +Recommends: rd-hashd = %{version} +Recommends: %{crate}-data = %{version}-%{release} +Recommends: bcc +Recommends: fio +Recommends: oomd +Recommends: stress +Recommends: tar +Recommends: wget +Recommends: xz + +%description -n %{crate} %{_description} + +%files -n %{crate} +%license LICENSE +%doc README.md +%{_bindir}/rd-agent +%attr(2775, root, wheel) %dir %{_sharedstatedir}/resctl-demo + +%package -n %{crate}-data +Summary: Data files for %{crate} +BuildArch: noarch + +%description -n %{crate}-data +This package contains data files for %{crate}. + +%files -n %{crate}-data +%{_datadir}/resctl-demo + +%if 0%{?with_selinux} +%package -n %{crate}-selinux +Summary: SELinux policy for %{crate} +BuildArch: noarch +Requires: selinux-policy-%{selinuxtype} +Requires(post): selinux-policy-%{selinuxtype} +%{?selinux_requires} + +%description -n %{crate}-selinux +This package contains the SELinux policy for %{crate}. + +%pre -n %{crate}-selinux +%selinux_relabel_pre -s %{selinuxtype} + +%post -n %{crate}-selinux +%selinux_modules_install -s %{selinuxtype} %{_datadir}/selinux/packages/%{selinuxtype}/%{crate}.pp.bz2 +%selinux_relabel_post -s %{selinuxtype} + +%postun -n %{crate}-selinux +if [ $1 -eq 0 ]; then + %selinux_modules_uninstall -s %{selinuxtype} %{crate} + %selinux_relabel_post -s %{selinuxtype} +fi + +%files -n %{crate}-selinux +%{_datadir}/selinux/packages/%{selinuxtype}/%{crate}.pp.* +%ghost %verify(not md5 size mtime) %{_sharedstatedir}/selinux/%{selinuxtype}/active/modules/200/%{crate} +%endif + +%prep +%autosetup -n %{crate}-%{version_no_tilde} -p1 + +%if 0%{?with_selinux} +mkdir selinux +cp -p %{SOURCE10} %{SOURCE11} %{SOURCE12} selinux +%endif + +%cargo_prep + +%generate_buildrequires +%cargo_generate_buildrequires + +%build +%cargo_build + +%if 0%{?with_selinux} +make -C selinux -f %{_datadir}/selinux/devel/Makefile %{crate}.pp +bzip2 -9 selinux/%{crate}.pp +%endif + +%install +%cargo_install +install -Dpm0644 %SOURCE1 %{buildroot}%{_datadir}/resctl-demo/linux.tar.xz +mkdir -p %{buildroot}%{_sharedstatedir}/resctl-demo + +%if 0%{?with_selinux} +install -Dm0644 selinux/%{crate}.pp.bz2 \ + %{buildroot}%{_datadir}/selinux/packages/%{selinuxtype}/%{crate}.pp.bz2 +%endif + +%if %{with check} +%check +%cargo_test +%endif + +%changelog +%autochangelog diff --git a/sources b/sources new file mode 100644 index 0000000..cc27c9f --- /dev/null +++ b/sources @@ -0,0 +1,2 @@ +SHA512 (linux-5.8.11.tar.xz) = bb6994f09aabfb0076f3023dd8359c5c569a4b398d3a3c3c8d6b27052092cab56ad675f45dd6ceba7fe431f2a6a587858f3c21415b5a00adb346bd2c68d85b0f +SHA512 (rd-agent-2.1.2.crate) = 15dae4e8d6cb2466130eeb208e387e5cc2bc1c0179dd1261057f657738c7f1dc5b54cb29d4a37074aba7196d535b91ee5058b90403c27a12115dfa1ce87712d0
arch-excludes@lists.fedoraproject.org