rpmbuild: Add helper functions for copying files into the spec
Signed-off-by: Michal Berger <michal.berger@intel.com> Change-Id: Ic53bd1733e2462c8d5c5d0ff057405fbcb20c19b Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/14799 Tested-by: SPDK CI Jenkins <sys_sgci@intel.com> Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com> Reviewed-by: Konrad Sztyber <konrad.sztyber@intel.com> Reviewed-by: Krzysztof Karas <krzysztof.karas@intel.com>
This commit is contained in:
parent
3884539699
commit
5e75ad20d0
@ -57,6 +57,15 @@ make clean %{make} &>/dev/null || :
|
|||||||
%setup
|
%setup
|
||||||
|
|
||||||
%build
|
%build
|
||||||
|
cfs() {
|
||||||
|
(($# > 1)) || return 0
|
||||||
|
|
||||||
|
local dst=$1 f
|
||||||
|
|
||||||
|
mkdir -p "$dst"
|
||||||
|
shift; for f; do [[ -e $f ]] && cp -a "$f" "$dst"; done
|
||||||
|
}
|
||||||
|
|
||||||
%if %{deps}
|
%if %{deps}
|
||||||
./scripts/pkgdep.sh --docs --pmem --rdma --uring
|
./scripts/pkgdep.sh --docs --pmem --rdma --uring
|
||||||
%endif
|
%endif
|
||||||
@ -68,15 +77,14 @@ make DESTDIR=%{buildroot} install %{make}
|
|||||||
|
|
||||||
# Include DPDK libs in case --with-shared is in use.
|
# Include DPDK libs in case --with-shared is in use.
|
||||||
%if %{dpdk}
|
%if %{dpdk}
|
||||||
mkdir -p %{buildroot}/usr/local/lib/dpdk
|
cfs %{buildroot}/usr/local/lib/dpdk %{dpdk_build_path}/lib/*
|
||||||
cp -a %{dpdk_build_path}/lib/* %{buildroot}/usr/local/lib/dpdk/
|
|
||||||
# Special case for SPDK_RUN_EXTERNAL_DPDK setup
|
# Special case for SPDK_RUN_EXTERNAL_DPDK setup
|
||||||
[[ -e %{dpdk_path}/intel-ipsec-mb ]] && find %{dpdk_path}/intel-ipsec-mb/ -name '*.so*' -exec cp -a {} %{buildroot}/usr/local/lib/dpdk/ ';'
|
cfs %{buildroot}/usr/local/lib/dpdk $(find %{dpdk_path}/intel-ipsec-mb/ -name '*.so*')
|
||||||
[[ -e %{dpdk_path}/isa-l/build/lib ]] && cp -a %{dpdk_path}/isa-l/build/lib/*.so* %{buildroot}/usr/local/lib/dpdk/
|
cfs %{buildroot}/usr/local/lib/dpdk $(find %{dpdk_path}/isa-l/ -name '*.so*')
|
||||||
%endif
|
%endif
|
||||||
|
|
||||||
# Try to include extra binaries that were potentially built
|
# Try to include extra binaries that were potentially built
|
||||||
[[ -e build/fio ]] && cp -a build/fio %{buildroot}/usr/local/bin/fio
|
cfs %{buildroot}/usr/local/bin build/fio
|
||||||
|
|
||||||
# And some useful setup scripts SPDK uses
|
# And some useful setup scripts SPDK uses
|
||||||
mkdir -p %{buildroot}/usr/libexec/spdk
|
mkdir -p %{buildroot}/usr/libexec/spdk
|
||||||
@ -97,8 +105,8 @@ PATH=$PATH:/usr/libexec/spdk/test/common/config
|
|||||||
export PATH
|
export PATH
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
cp -a scripts %{buildroot}/usr/libexec/spdk/scripts
|
cfs %{buildroot}/usr/libexec/spdk scripts
|
||||||
cp -a python/spdk %{buildroot}%{python3_sitelib}
|
cfs %{buildroot}%{python3_sitelib} python/spdk
|
||||||
ln -s /usr/libexec/spdk/scripts/bash-completion/spdk %{buildroot}/etc/bash_completion.d/
|
ln -s /usr/libexec/spdk/scripts/bash-completion/spdk %{buildroot}/etc/bash_completion.d/
|
||||||
|
|
||||||
# We need to take into the account the fact that most of the scripts depend on being
|
# We need to take into the account the fact that most of the scripts depend on being
|
||||||
|
Loading…
Reference in New Issue
Block a user