dpu-utilities/dpu-utilities.spec
Weifeng Su fe851cd555 Sync patches from source
The change in patches:
1. Fix cache issue when recreate file
2. Introduce CMAKE to build userspace apps
3. CleanCode

Signed-off-by: Weifeng Su <suweifeng1@huawei.com>
2023-06-12 08:24:22 +00:00

173 lines
6.6 KiB
RPMSpec

Name: dpu-utilities
Summary: openEuler dpu utilities
Version: 1.4
Release: 2
License: GPL-2.0
Source: https://gitee.com/openeuler/dpu-utilities/repository/archive/v%{version}.tar.gz
ExclusiveOS: linux
URL: https://gitee.com/openeuler/dpu-utilities
BuildRoot: %{_tmppath}/%{name}-%{version}-root
Conflicts: %{name} < %{version}-%{release}
Provides: %{name} = %{version}-%{release}
%define kernel_version %(ver=`rpm -qa|grep kernel-devel`;echo ${ver#*kernel-devel-})
BuildRequires: kernel-devel >= 5.10, gcc, make, json-c-devel, glib2-devel
Patch1: 0001-rewrite-client-rexec_run.patch
Patch2: 0002-uds-add-vsock-mode.patch
Patch3: 0003-fix-a-rexec_server-bug-on-child-process.patch
Patch4: 0004-add-uds-test-mode-in-engine-compile.patch
Patch5: 0005-modify-qtfs_dentry_revalidate.patch
Patch6: 0006-add-cmake-compile-for-user-binary-and-so.patch
Patch7: 0007-uds-remove-MSG_WAITALL-flags-to-timeout.patch
Patch8: 0008-Modify-the-logic-of-rexec-proxy-process-exit-by-mist.patch
Patch9: 0009-Keep-doc-same-with-docs-in-openEuler.patch
Patch10: 0010-update-libvirt-doc.patch
Patch11: 0011-ioctl-enhance-and-rewrite-duplicate-code.patch
Patch12: 0012-port-in-use.patch
Patch13: 0013-ioctl-add-cmd.patch
Patch14: 0014-engine-running-lock.patch
%description
This package contains the software utilities on dpu.
%package -n dpuos-imageTailor-config
Summary: dpuos imageTailor configrations
Requires: imageTailor
%description -n dpuos-imageTailor-config
imageTailor configration files for dpuos
%package -n qtfs-client
Summary: Client of qtfs
Requires: json-c, glib2
%description -n qtfs-client
qtfs is a shared file system, this is the client of qtfs.
%package -n qtfs-server
Summary: Server of qtfs
Requires: json-c, glib2
%description -n qtfs-server
qtfs is a shared file system, this is the server of qtfs.
%prep
%autosetup -n %{name}-v%{version} -p1
%build
sed -i "s#KBUILD=.*#KBUILD=/lib/modules/%{kernel_version}/build#" %_builddir/%{name}-v%{version}/qtfs/qtfs/Makefile
sed -i "s#KBUILD=.*#KBUILD=/lib/modules/%{kernel_version}/build#" %_builddir/%{name}-v%{version}/qtfs/qtfs_server/Makefile
cd %_builddir/%{name}-v%{version}/qtfs/qtfs
make
cd %_builddir/%{name}-v%{version}/qtfs/qtfs_server
make
cd %_builddir/%{name}-v%{version}/qtfs/rexec
make
cd %_builddir/%{name}-v%{version}/qtfs/ipc
make
cd %_builddir/%{name}-v%{version}/qtfs/qtinfo
export role=client
make qtcfg
mv qtcfg qtcfg_client
make clean
export role=server
make qtcfg
%install
mkdir -p $RPM_BUILD_ROOT/lib/modules/%{kernel_version}//extra
mkdir -p $RPM_BUILD_ROOT/usr/bin/
mkdir -p $RPM_BUILD_ROOT/usr/lib/
mkdir -p $RPM_BUILD_ROOT/usr/local/bin
mkdir -p $RPM_BUILD_ROOT/etc/qtfs
mkdir -p $RPM_BUILD_ROOT/etc/rexec
install %_builddir/%{name}-v%{version}/qtfs/qtfs/qtfs.ko $RPM_BUILD_ROOT/lib/modules/%{kernel_version}/extra
install %_builddir/%{name}-v%{version}/qtfs/qtfs_server/qtfs_server.ko $RPM_BUILD_ROOT/lib/modules/%{kernel_version}/extra
install -m 0700 %_builddir/%{name}-v%{version}/qtfs/qtfs_server/engine $RPM_BUILD_ROOT/usr/bin/
install -m 0700 %_builddir/%{name}-v%{version}/qtfs/rexec/rexec ${RPM_BUILD_ROOT}/usr/bin/
install -m 0700 %_builddir/%{name}-v%{version}/qtfs/rexec/rexec_server ${RPM_BUILD_ROOT}/usr/bin/
install -m 0700 %_builddir/%{name}-v%{version}/qtfs/ipc/udsproxyd ${RPM_BUILD_ROOT}/usr/bin/
install -m 0700 %_builddir/%{name}-v%{version}/qtfs/ipc/libudsproxy.so ${RPM_BUILD_ROOT}/usr/lib/
install -m 0700 %_builddir/%{name}-v%{version}/qtfs/qtinfo/qtcfg ${RPM_BUILD_ROOT}/usr/bin/
install -m 0700 %_builddir/%{name}-v%{version}/qtfs/qtinfo/qtcfg_client ${RPM_BUILD_ROOT}/usr/local/bin/qtcfg
install -m 0400 %_builddir/%{name}-v%{version}/qtfs/config/rexec/whitelist ${RPM_BUILD_ROOT}/etc/rexec
install -m 0400 %_builddir/%{name}-v%{version}/qtfs/config/qtfs/whitelist ${RPM_BUILD_ROOT}/etc/qtfs
mkdir -p $RPM_BUILD_ROOT/opt/imageTailor
cp -rf %_builddir/%{name}-v%{version}/dpuos/image_tailor_cfg/custom $RPM_BUILD_ROOT/opt/imageTailor
cp -rf %_builddir/%{name}-v%{version}/dpuos/image_tailor_cfg/kiwi $RPM_BUILD_ROOT/opt/imageTailor
%clean
rm -rf ${RPM_BUILD_ROOT}
%post -n qtfs-client
if [[ "$1" = "1" || "$1" = "2" ]] ; then #1: install 2: update
/sbin/depmod -a > /dev/null 2>&1 || true
fi
%post -n qtfs-server
if [[ "$1" = "1" || "$1" = "2" ]] ; then #1: install 2: update
/sbin/depmod -a > /dev/null 2>&1 || true
fi
%postun -n qtfs-client
if [ "$1" = "0" ] ; then #0: uninstall
/sbin/depmod -a > /dev/null 2>&1 || true
fi
%postun -n qtfs-server
if [ "$1" = "0" ] ; then #0: uninstall
/sbin/depmod -a > /dev/null 2>&1 || true
fi
%files -n qtfs-client
%attr(0644, root, root) /lib/modules/%{kernel_version}/extra/qtfs.ko
%attr(0500, root, root) /usr/bin/rexec_server
%attr(0500, root, root) /usr/bin/rexec
%attr(0500, root, root) /usr/lib/libudsproxy.so
%attr(0500, root, root) /usr/bin/udsproxyd
%attr(0500, root, root) /usr/local/bin/qtcfg
%files -n qtfs-server
%attr(0644, root, root) /lib/modules/%{kernel_version}/extra/qtfs_server.ko
%attr(0500, root, root) /usr/bin/engine
%attr(0500, root, root) /usr/bin/rexec_server
%attr(0500, root, root) /usr/bin/rexec
%attr(0500, root, root) /usr/bin/qtcfg
%attr(0400, root, root) /etc/qtfs/whitelist
%attr(0400, root, root) /etc/rexec/whitelist
%files -n dpuos-imageTailor-config
/opt/imageTailor/custom/*
/opt/imageTailor/kiwi/*
%post -n dpuos-imageTailor-config
sed -i '/# product_name product_type/a\dpuos PANGEA EMBEDDED DISK ISO install_mode=install install_media=CD install_repo=CD selinux=0' /opt/imageTailor/kiwi/eulerkiwi/product.conf
sed -i '/# product cut_conf/a\dpuos kiwi/minios/cfg_dpuos yes' /opt/imageTailor/kiwi/eulerkiwi/minios.conf
sed -i '/<repository_rule>/a\dpuos 1 rpm-dir euler_base' /opt/imageTailor/repos/RepositoryRule.conf
%changelog
* Mon Jun 12 2023 Weifeng Su <suweifeng1@huawei.com> 1.4-2
- Sync patches from source
* Fri Jun 2 2023 Weifeng Su <suweifeng1@huawei.com> 1.4-1
- Upgrade dpu-utilities version to 1.4
* Tue Mar 21 2023 Weifeng Su <suweifeng1@huawei.com> 1.3-1
- Upgrade dpu-utilities version to 1.3
* Thu Dec 15 2022 YangXin <245051644@qq.com> 1.1-4
- Fix inode sync error between client and server.
* Thu Dec 8 2022 Weifeng Su <suweifeng1@huawei.com> 1.1-3
- Sync patches from master
* Thu Dec 1 2022 Weifeng Su <suweifeng1@huawei.com> 1.1-2
- add path put in xattr set
* Mon Nov 28 2022 Weifeng Su <suweifeng1@huawei.com> 1.1-1
- Upgrade dpu-utilities version to 1.1
* Wed Aug 17 2022 yangxin <245051644@qq.com> 1.0-2
- Split dpu-utilities into three packages.
* Fri Aug 12 2022 yangxin <245051644@qq.com> 1.0-1
- First Spec Version Include qtfs shared filesystem Driver Code