Enable rust based tools

Related: RHEL-11409
This commit is contained in:
Dan Horák 2023-11-24 10:38:30 +01:00
parent d799a95209
commit 628bfaeb5e

View File

@ -9,6 +9,7 @@
%if 0%{?fedora}
%global with_pandoc 1
%endif
%bcond_without rust
Name: s390utils
Summary: Utilities and daemons for IBM z Systems
@ -66,6 +67,31 @@ Requires: s390utils-ziomon = %{epoch}:%{version}-%{release}
Requires: s390utils-cmsfs = %{epoch}:%{version}-%{release}
BuildRequires: gcc-c++
%if %{with rust}
BuildRequires: crate(anstream)
BuildRequires: crate(anstyle-query)
BuildRequires: crate(anyhow)
BuildRequires: crate(byteorder)
BuildRequires: crate(cfg-if)
BuildRequires: crate(clap)
BuildRequires: crate(clap_complete)
BuildRequires: crate(clap_derive)
BuildRequires: crate(colorchoice)
BuildRequires: crate(curl)
BuildRequires: crate(is-terminal)
BuildRequires: crate(libc)
BuildRequires: crate(log)
BuildRequires: crate(openssl)
BuildRequires: crate(openssl-probe)
BuildRequires: crate(serde)
BuildRequires: crate(serde_derive)
BuildRequires: crate(serde_yaml)
BuildRequires: crate(strsim)
BuildRequires: crate(terminal_size)
BuildRequires: crate(thiserror)
BuildRequires: crate(zerocopy)
BuildRequires: rust-packaging
%endif
%description
This is a meta package for installing the default s390-tools sub packages.
@ -113,6 +139,11 @@ popd
# remove --strip from install
find . -name Makefile | xargs sed -i 's/$(INSTALL) -s/$(INSTALL)/g'
%if %{with rust}
%cargo_prep
rm -rf ./rust/pvsecret/Cargo.lock
%endif
pushd cmsfs-%{cmsfsver}
# cmdfs: fix encoding
iconv -f ISO8859-1 -t UTF-8 -o README.new README
@ -127,7 +158,9 @@ popd
%build
make \
CFLAGS="%{build_cflags}" CXXFLAGS="%{build_cxxflags}" LDFLAGS="%{build_ldflags}" \
%if %{without rust}
HAVE_CARGO=0 \
%endif
HAVE_DRACUT=1 \
%if 0%{?with_pandoc}
ENABLE_DOC=1 \
@ -149,7 +182,9 @@ popd
%install
make install \
%if %{without rust}
HAVE_CARGO=0 \
%endif
HAVE_DRACUT=1 \
%if 0%{?with_pandoc}
ENABLE_DOC=1 \
@ -552,6 +587,9 @@ getent group zkeyadm > /dev/null || groupadd -r zkeyadm
%{_bindir}/mk-s390image
%{_bindir}/pvattest
%{_bindir}/pvextract-hdr
%if %{with rust}
%{_bindir}/pvsecret
%endif
%{_bindir}/zkey
%{_bindir}/zkey-cryptsetup
%{_unitdir}/dumpconf.service
@ -580,6 +618,16 @@ getent group zkeyadm > /dev/null || groupadd -r zkeyadm
%{_mandir}/man1/pvattest-create.1*
%{_mandir}/man1/pvattest-perform.1*
%{_mandir}/man1/pvattest-verify.1*
%if %{with rust}
%{_mandir}/man1/pvsecret-add.1*
%{_mandir}/man1/pvsecret-create-association.1*
%{_mandir}/man1/pvsecret-create-meta.1*
%{_mandir}/man1/pvsecret-create.1*
%{_mandir}/man1/pvsecret-list.1*
%{_mandir}/man1/pvsecret-lock.1*
%{_mandir}/man1/pvsecret-version.1*
%{_mandir}/man1/pvsecret.1*
%endif
%{_mandir}/man1/zkey.1*
%{_mandir}/man1/zkey-cryptsetup.1*
%{_mandir}/man1/zkey-ekmfweb.1*