diff --git a/README.ch.md b/README.ch.md new file mode 100644 index 0000000000000000000000000000000000000000..3c13f0a5735fd6427424daa344462b55ed4bcbb6 --- /dev/null +++ b/README.ch.md @@ -0,0 +1,102 @@ +# UMDK +#### 一、UMDK介绍 +灵衢内存语义开发包(UMDK)是一套以内存语义为核心的分布式通信软件库。 +为数据中心网络、超节点内、服务器内的卡与卡之间提供高性能的通信接口,使能和释放灵衢总线的硬件能力。 +![UMDK组件图](./doc/images/UMDK_component_image.ch.png) + +#### 二、组件介绍 +1. URMA +UB通信基础库,提供了单边、双边、原子操作等远端内存操作方式,是应用之间通信的基础。 +提供两类接口,一是北向应用编程接口,为应用提供通信API,二是南向驱动编程接口,为驱动开发者提供接入UMDK的API。 + +2. URPC +统一远程过程调用,支持灵衢原生高性能主机间和设备间RPC通信,以及RPC加速。 + +3. ULOCK + 统一状态同步,支持灵衢原生高性能状态同步,包含分布式锁DLock等,加速数据库等分布式应用全局资源分配。 + +4. USOCK + UB通信生态构建,兼容标准Socket编程接口,使能TCP应用零修改提升网络通信性能。 + +#### 三、编译运行 +1. 编译环境要求 +- 编译环境:kernel 6.6 +- 同时你需要安装以下依赖包: + +```bash + yum install -y rpm-build + yum install -y make + yum install -y cmake + yum install -y gcc + yum install -y gcc-c++ + yum install -y glibc-devel + yum install -y openssl-devel + yum install -y glib2-devel + yum install -y libnl3-devel + yum install -y kernel-devel # ubcore is necessary from openEuler kernel +``` + +2. 编译指导 +- 您可以通过以下方式构建和安装umdk rpm包: + +```bash + mkdir -p /root/rpmbuild/SOURCES/ + tar -czf /root/rpmbuild/SOURCES/umdk-25.12.0.tar.gz --exclude=.git `ls -A` + rpmbuild -ba umdk.spec +``` + +- RPM 编译选项 +```bash + $ --with asan option, i.e. disable asan by default + $ --with test option, i.e. disable test by default + $ --with urma option, i.e. disable urma by default + $ --with urpc option, i.e. disable urpc by default + $ --with dlock option, i.e. disable dlock by default + $ --with ums option, i.e. disable ums by default + $ --define 'kernel_version 6.6.92' option, specify kernel version + $ --define 'rpm_release 0' option, specify release version +``` + +3. 部署指导 +- 运行时依赖请检查前置驱动已加载,如未加载请手动加载 +```bash +cd /lib/modules/$(uname -r)/kernel/drivers +insmod ub/ubfi/ubfi.ko.xz cluster=1 # 使用vf网卡时需要将cluster=1参数去除 +insmod iommu/ummu-core/ummu-core.ko.xz +cd /lib/modules/$(uname -r)/kernel/drivers/ub/hisi-ub/kernelspace +insmod ummu/drivers/ummu.ko.xz ipver=609 +insmod ubus/ubus.ko.xz ipver=609 cc_en=0 um_entry_size=1 +insmod ubus/vendor/hisi/hisi_ubus.ko.xz msg_wait=2000 fe_msg=1 um_entry_size1=0 cfg_entry_offset=512 +insmod ubase/ubase.ko.xz +insmod unic/unic.ko.xz tx_timeout_reset_bypass=1 +insmod cdma/cdma.ko.xz + +``` +- 安装rpm包 +```bash +rpm -ivh /root/rpmbuild/RPMS/*/umdk*.rpm +cp -f /usr/bin/urma_perftest /usr/local/bin/ +modprobe ubcore +modprobe uburma +cd /lib/modules/$(uname -r)/kernel/drivers +insmod ub/hisi-ub/kernelspace/udma/udma.ko.xz dfx_switch=1 ipver=609 fast_destroy_tp=0 jfc_arm_mode=2 +modprobe ubagg #如果需要使能多路径 +modprobe ums # 如果需要使能ums +``` +- 添加权限 +```bash +#如果没有权限,需要手动添加权限 +chmod -R 777 /usr/lib64/urma +chmod 777 /dev/ummu/tid +chmod 755 /usr/lib64/liburma* +``` + +#### 四、参与贡献 + +我们非常欢迎开发者提交贡献, 如果您发现了一个bug或者有一些想法想要交流,欢迎[发邮件到dev列表](https://openeuler.org/zh/community/mailing-list) 或者[提交一个issue](https://gitee.com/openeuler/umdk/issues) 。 + +#### 五、许可 + +代码使用的许可证详见[LICENSES](./LICENSES/README) + +doc目录下的文档使用许可证详见[LICENSE](./doc/LICENSE) \ No newline at end of file diff --git a/README.md b/README.md deleted file mode 100644 index 5c65e690aca03a632b83fd3c56066b3147877e6a..0000000000000000000000000000000000000000 --- a/README.md +++ /dev/null @@ -1,37 +0,0 @@ -# umdk - -#### 介绍 -The Unified Memory Development Kit(UMDK) is a set of distributed communication software stack with memory semantics as the core. It aims to design a new-generation network architecture through software-hardware collaboration, subvert the traditional communication form, and build a computing native network centered on memory semantic interconnection. - -#### 软件架构 -软件架构说明 - - -#### 安装教程 - -1. xxxx -2. xxxx -3. xxxx - -#### 使用说明 - -1. xxxx -2. xxxx -3. xxxx - -#### 参与贡献 - -1. Fork 本仓库 -2. 新建 Feat_xxx 分支 -3. 提交代码 -4. 新建 Pull Request - - -#### 特技 - -1. 使用 Readme\_XXX.md 来支持不同的语言,例如 Readme\_en.md, Readme\_zh.md -2. Gitee 官方博客 [blog.gitee.com](https://blog.gitee.com) -3. 你可以 [https://gitee.com/explore](https://gitee.com/explore) 这个地址来了解 Gitee 上的优秀开源项目 -4. [GVP](https://gitee.com/gvp) 全称是 Gitee 最有价值开源项目,是综合评定出的优秀开源项目 -5. Gitee 官方提供的使用手册 [https://gitee.com/help](https://gitee.com/help) -6. Gitee 封面人物是一档用来展示 Gitee 会员风采的栏目 [https://gitee.com/gitee-stars/](https://gitee.com/gitee-stars/) diff --git a/umdk-25.12.0.tar.gz b/umdk-25.12.0.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..d6281548c2d22a46acc0178b80a97a757a398040 Binary files /dev/null and b/umdk-25.12.0.tar.gz differ diff --git a/umdk-urma-1.3.0.tar.gz b/umdk-urma-1.3.0.tar.gz deleted file mode 100644 index 8af7bfed6e6fe76129b15c088df06ba025fc7e9e..0000000000000000000000000000000000000000 Binary files a/umdk-urma-1.3.0.tar.gz and /dev/null differ diff --git a/umdk-urma.spec b/umdk-urma.spec deleted file mode 100644 index a5ac5f53153929c40f1ff92e6f1da7a20aaeb200..0000000000000000000000000000000000000000 --- a/umdk-urma.spec +++ /dev/null @@ -1,229 +0,0 @@ -# add --with transport_service_disable option, i.e. enable TPS by default -%bcond_with transport_service_disable - -# add --with hw_disable option, i.e. enable HW by default -%bcond_with hw_disable - -%if %{defined kernel_version} - %define kernel_build_path /lib/modules/%{kernel_version}/build -%else - %define kernel_version %(uname -r) - %define kernel_build_path /lib/modules/%{kernel_version}/build -%endif -%define kernel_requires_version %(echo %{kernel_version} | awk -F"." 'OFS="."{$NF="";print}' | sed 's/\.$//g') - -%if %{undefined rpm_version} - %define rpm_version 1.3.0 -%endif - -%if %{undefined rpm_release} - %define rpm_release B016 -%endif - -Name : umdk-urma -Summary : Unified memory development kit -Version : %{rpm_version} -Release : %{rpm_release} -Group : nStack -License : GPL-2.0-only -Provides : Huawei Technologies Co., Ltd -Source0 : %{name}-%{version}.tar.gz -BuildRoot : %{_buildirootdir}/%{name}-%{version}-build -BuildArch : x86_64 aarch64 -ExclusiveArch : aarch64 -BuildRequires : rpm-build, make, cmake, gcc, gcc-c++, glibc-devel -BuildRequires : glib2-devel, systemd, libnl3-devel, openssl-devel -Requires: glibc, glib2 -%if %{with asan} -Requires: libasan -%endif - -%description -A new system interconnect architecture - -%package lib -Summary: Basic URMA libraries of UMDK - -%description lib -This package contains basic URMA libraries of UMDK, such as liburma.so. - -%if %{without hw_disable} -%package compat-hns-lib -Summary: Libraries of hns - -%description compat-hns-lib -This pachage contains libraries of hns, such as liburma-hns3.so. -%endif - -%package devel -Summary: Include Files and Libraries mandatory for URMA -Requires: umdk-urma-lib = %{version} -AutoReqProv: on - -%description devel -This package contains all necessary include files and libraries needed -to develop applications that require the provided includes and -libraries. - -%package tools -Summary: tools of urma -Requires: umdk-urma-lib = %{version} -%description tools -tools of urma, contains urma_perftest, urma_admin. - -%if %{without transport_service_disable} -%package bin -Summary: binary file of urma -BuildRequires: gcc -Requires: glibc -%description bin -binary file of urma, contains tpsa_daemon, uvs_admin -%endif - -%prep -%setup -c -n %{name}-%{version} - -%build - cmake ./ -DCMAKE_INSTALL_PREFIX=/usr \ -%if %{with transport_service_disable} - -DTPS="disable" \ -%endif -%if %{with hw_disable} - -DHW="disable" \ -%endif -%if %{defined kernel_version} - -DKERNEL_RELEASE=%{kernel_version} \ - -DKERNEL_PATH=%{kernel_build_path} \ -%endif - -make %{?_smp_mflags} - -%install -%{__rm} -rf %{buildroot} -make install DESTDIR=%{buildroot} - -%clean -%{__rm} -rf %{buildroot} - -%files lib -%defattr(-,root,root) - %{_libdir}/liburma.so - %{_libdir}/liburma.so.0 - %{_libdir}/liburma.so.0.0.1 - %{_libdir}/liburma_common.so - %{_libdir}/liburma_common.so.0 - %{_libdir}/liburma_common.so.0.0.1 - /etc/rsyslog.d/urma.conf - /etc/logrotate.d/urma - -%post lib -if [ -x %{_bindir}/systemctl ] && [ -x %{_sbindir}/rsyslogd ]; then - %{_bindir}/systemctl restart rsyslog >/dev/null 2>&1 -fi - -%if %{without hw_disable} -%files compat-hns-lib -%defattr(-,root,root) - %dir %{_libdir}/urma - %{_libdir}/urma/liburma-hns3.so -%endif - -%files devel -%defattr(-,root,root) - %dir %{_includedir}/umdk - %dir %{_includedir}/umdk/common - %{_includedir}/umdk/urma_*.h - %{_includedir}/umdk/ub_errno.h - %{_includedir}/umdk/urma_provider.h - %{_includedir}/umdk/common/ub_*.h - %{_includedir}/umdk/common/urma_*.h - -%files tools -%defattr(-,root,root) - %{_bindir}/urma_perftest - %{_bindir}/urma_admin - /etc/rsyslog.d/urma_admin.conf - -%post tools -if [ -x %{_bindir}/systemctl ] && [ -x %{_sbindir}/rsyslogd ]; then - %{_bindir}/systemctl restart rsyslog >/dev/null 2>&1 -fi - -%if %{without transport_service_disable} -%files bin -%defattr(-,root,root) - %{_sbindir}/tpsa_daemon - %{_sbindir}/uvs_daemon - %attr(0700,-,-) %{_bindir}/uvs_admin - /etc/rsyslog.d/tpsa.conf - /etc/rsyslog.d/uvs_admin.conf - /etc/logrotate.d/tpsa - %dir /etc/tpsa - %{_libdir}/libtpsa.so - %{_libdir}/libtpsa.so.0 - %{_libdir}/libtpsa.so.0.0.1 - %attr(0644,-,-) %{_unitdir}/uvsd.service -%config(noreplace) /etc/tpsa/tpsa.ini -%post bin -if [ -x %{_bindir}/systemctl ]; then - %{_bindir}/systemctl daemon-reload >/dev/null 2>&1 -fi -if [ -x %{_bindir}/systemctl ] && [ -x %{_sbindir}/rsyslogd ]; then - %{_bindir}/systemctl restart rsyslog >/dev/null 2>&1 -fi -%endif - -%changelog -* Mon Oct 14 2024 Chen Yutao <884071658@qq.com> - 1.3.0-B016 -- Bugfix: Do not show cc_alg in tp_mode_flag of vport_table - -* Tue Sep 24 2024 Weibo Zhao - 1.3.0-B015 -- Bugfix: add prefix of hns3 to udma - -* Tue Aug 27 2024 Weibo Zhao - 1.3.0-B014 -- Bugfix: support dynamic qp function - -* Thu Jul 18 2024 Weibo Zhao - 1.3.0-B013 -- Bugfix: add log for udma - -* Thu Jun 20 2024 Weibo Zhao - 1.3.0-B012 -- Bugfix: hns3 add rq mode for um - -* Thu Jun 20 2024 WenChen - 1.3.0-B011 -- Bugfix: urma tool information error - -* Wed Jun 5 2024 WenChen - 1.3.0-B010 -- fix bugs urma_perftest init - -* Wed May 22 2024 WenChen - 1.3.0-B009 -- add sync urma_tag - -* Fri Mar 22 2024 panchenbo - 1.3.0-B008 -- add BuildRequires:systemd for %{_unitdir} Macros - -* Wed Nov 29 2023 Yizhen Fan - 1.3.0-B007 -- Type:bugfix -- DESC:modify SO_REUSEADDR to SO_REUSEPORT - -* Tue Nov 28 2023 Yizhen Fan - 1.3.0-B006 -- Type:bugfix -- DESC:fix bugs detected in urma - -* Thu Nov 23 2023 Yizhen Fan - 1.3.0-B005 -- Type:feature -- DESC:add new feature for urma. - -* Fri Oct 13 2023 Yizhen Fan - 1.3.0-B004 -- Type:feature -- DESC:update source code, add hw hns3 lib - -* Wed Oct 11 2023 Yizhen Fan - 1.3.0-B003 -- Type:bugfix -- DESC:change name of spec to umdk-urma - -* Wed Oct 11 2023 Yizhen Fan - 1.3.0-B002 -- Type:bugfix -- DESC:change name of spec to umdk; change arch that only support aarch64 - -* Tue Oct 10 2023 Yizhen Fan - 1.3.0-B001 -- Package init diff --git a/umdk.spec b/umdk.spec new file mode 100644 index 0000000000000000000000000000000000000000..9ae97026b93c9336f3235b7731581e473ab01a87 --- /dev/null +++ b/umdk.spec @@ -0,0 +1,495 @@ +# add --with asan option, i.e. disable asan by default +%bcond_with asan + +# add --with tsan option, i.e. disable tsan by default +%bcond_with tsan + +# add --with gcov option, i.e. disable gcov by default +%bcond_with gcov + +# add --with test option, i.e. disable test by default +%bcond_with test + +# add --with ubagg_disable option, i.e. enable ubagg by default +%bcond_with ubagg_disable + +# add --with release_enable option, i.e. disable release by default +%bcond_with release_enable + +# add --with urma option, i.e. disable urma by default +%bcond_with urma + +# add --with ums option, i.e. disable ums by default +%bcond_with ums + +# add --with urpc option, i.e. disable urpc by default +%bcond_with urpc + +# add --with dlock option, i.e. disable dlock by default +%bcond_with dlock + +%define build_all 1 + +%if %{with ums} || %{with urma} || %{with urpc} || %{with dlock} + %define build_all 0 +%endif + +%if %{defined kernel_version} + %define kernel_build_path /lib/modules/%{kernel_version}/build +%else + %define kernel_version %(uname -r) + %define kernel_build_path /lib/modules/%{kernel_version}/build +%endif +%define kernel_requires_version %(echo %{kernel_version} | awk -F"." 'OFS="."{$NF="";print}' | sed 's/\.$//g') + +%if %{undefined rpm_release} + %define rpm_release 0 +%endif + +Name : umdk +Summary : Unified memory development kit +Version : 25.12.0 +Release : %{rpm_release}%{?dist} +Group : umdk +License : Proprietary +Vendor : Huawei Technologies Co., Ltd +Source0 : %{name}-%{version}.tar.gz +BuildRoot : %{_buildirootdir}/%{name}-%{version}-build +buildArch : x86_64 aarch64 + +BuildRequires : rpm-build, make, cmake, gcc, gcc-c++, glibc-devel, openssl-devel, glib2-devel, libnl3-devel, kernel-devel, libummu-devel +Requires: glibc, glib2, libummu +%if %{with asan} +Requires: libasan +%endif +%if %{with tsan} +Requires: libtsan +%endif + +%description +A new system interconnect architecture + +%if %{build_all} || %{with urma} || %{with urpc} +%package urma-lib +Requires: libummu +Summary: Basic URMA libraries of UMDK + +%description urma-lib +This package contains basic URMA libraries of UMDK, such as liburma.so. + +%package urma-devel +Summary: Include Files and Libraries mandatory for URMA +AutoReqProv: on + +%description urma-devel +This package contains all necessary include files and libraries needed +to develop applications that require the provided includes and +libraries. + +%package urma-tools +Summary: tools of urma +Requires: umdk-urma-lib = %{version} +%description urma-tools +tools of urma, contains urma_perftest, urma_admin, ubagg_cli. + +%package urma-bin +Summary: binary file of urma +BuildRequires: gcc +Requires: glibc +%description urma-bin +binary file of urma + +%package urma-example +Summary: UMDK examples +Requires: umdk-urma-lib = %{version} +AutoReqProv: on +%description urma-example +This package contains all the executable examples of UMDK. + +%if %{with test} +%package urma-test +Summary: Include Libraries for URMA test +Requires: umdk-urma-lib = %{version} +AutoReqProv: on +%description urma-test +This package contains all necessary libraries needed +to develop applications based on urma_test. +%endif +%endif + +%if %{build_all} || %{with dlock} +%package dlock-lib +Summary: Library files of dlock +Requires: umdk-urma-lib = %{version} + +%description dlock-lib +This package contains the libdlock*.so files for the distributed lock feature. + +%package dlock-devel +Summary: Include development libraries and headers for dlock +Requires: umdk-dlock-lib = %{version} +AutoReqProv: on + +%description dlock-devel +This package contains all necessary include files and libraries needed +to develop applications based on dlock. + +%package dlock-example +Summary: Executable examples of dlock +Requires: umdk-dlock-lib = %{version} +AutoReqProv: on + +%description dlock-example +This package contains all the executable examples of dlock. + +%files dlock-example +%defattr(-,root,root) + %{_bindir}/dlock_primary_test + %{_bindir}/dlock_client_test + %{_bindir}/dlock_client_object_test +%endif + +%if %{build_all} || %{with urpc} +%package urpc-framework +Summary: URPC framework shared library +Requires: umdk-urma-lib +%description urpc-framework +This package contains the URPC framework shared libraries (e.g. liburpc.so). + +%package urpc-umq +Summary: URPC umq shared library +Requires: umdk-urma-lib +%description urpc-umq +This package contains the URPC umq shared libraries (e.g. libumq.so). + +%package urpc-framework-devel +Summary: URPC framework development headers +Requires: umdk-urpc-framework = %{version} +AutoReqProv: on +%description urpc-framework-devel +This package contains all necessary headers for URPC framework development. + +%package urpc-umq-devel +Summary: UMQ development headers +Requires: umdk-urpc-umq = %{version} +AutoReqProv: on +%description urpc-umq-devel +This package contains all necessary headers for UMQ development. + +%package urpc-framework-example +Summary: URPC framework example +Requires: umdk-urma-lib umdk-urpc-framework-devel = %{version} +AutoReqProv: on +%description urpc-framework-example +This package contains example for URPC framework. + +%package urpc-umq-example +Summary: UMQ example +Requires: umdk-urma-lib umdk-urpc-umq-devel = %{version} +AutoReqProv: on +%description urpc-umq-example +This package contains example for URPC umq. + +%package urpc-framework-tools +Summary: URPC framework tools +Requires: umdk-urma-lib umdk-urpc-framework-devel = %{version} +AutoReqProv: on +%description urpc-framework-tools +This package contains urpc_admin and related URPC framework tools. + +%package urpc-umq-tools +Summary: UMQ tools +Requires: umdk-urma-lib umdk-urpc-umq-devel = %{version} +AutoReqProv: on +%description urpc-umq-tools +This package contains umq_perftest and related UMQ tools. +%endif + +%if %{with ums} +%package ums +Summary: kmod file of ums +BuildRequires: glib2-devel, libnl3-devel +Requires: glib2, libnl3 +%description ums +kmod file of ums + +%package ums-tools +Summary: tools of ums +%description ums-tools +tools of ums, contains ums_run +%endif + +%if "%{build_all}" == "0" + %global debug_package %{nil} +%endif + +%prep +%setup -c -n %{name}-%{version} + +%build + cmake ./src/ -DCMAKE_INSTALL_PREFIX=/usr\ + -DBUILD_DATE=%{rpm_build_date} \ +%if %{with asan} + -DASAN="enable" \ +%endif +%if %{with tsan} + -DTSAN="enable" \ +%endif +%if %{with gcov} + -DCODE_COVERAGE="enable" \ +%endif +%if %{with release_enable} + -DRELEASE_ENABLE="enable" \ +%endif +%if %{with test} + -DURMA_TEST="enable" \ + -DRELEASE_ENABLE="disable" \ +%endif +%if %{defined kernel_version} + -DKERNEL_RELEASE=%{kernel_version} \ + -DKERNEL_PATH=%{kernel_build_path} \ +%endif +%if %{without ubagg_disable} + -DUB_AGG="enable" \ +%endif +%if %{with dfx_tool} + -DDFX_TOOL="enable" \ +%endif +%if %{build_all} + -DBUILD_ALL="enable" \ +%else + -DBUILD_ALL="disable" \ +%endif +%if %{build_all} || %{with urma} || %{with urpc} + -DBUILD_URMA="enable" \ +%else + -DBUILD_URMA="disable" \ +%endif +%if %{with ums} + -DBUILD_UMS="enable" \ +%endif +%if %{build_all} || %{with urpc} + -DBUILD_URPC="enable" \ +%else + -DBUILD_URPC="disable" \ +%endif +%if %{with dlock} + -DBUILD_DLOCK="enable" \ +%endif +%if %{without udma_stb64_disable} + -DUDMA_ST64B="enable" \ +%endif + +make %{?_smp_mflags} + +%install +%{__rm} -rf %{buildroot} +make install DESTDIR=%{buildroot} + +%if %{with gcov} + mkdir -p %{buildroot}/var/lib/umdk/gcov/%{name} + find %{_builddir} -name '*.gcno' -exec cp --parents {} %{buildroot}/var/lib/umdk/gcov/%{name} \; +%endif + +%clean +%{__rm} -rf %{buildroot} + +%if %{build_all} || %{with urma} || %{with urpc} +%files urma-lib +%defattr(-,root,root) + %{_libdir}/liburma.so.* + %{_libdir}/liburma_common.so.* + %{_libdir}/urma/liburma_ubagg.so.* + %{_libdir}/urma/liburma-udma.so + /etc/rsyslog.d/urma.conf + /etc/logrotate.d/urma + +%post urma-lib +if [ -x %{_bindir}/systemctl ] && [ -x %{_sbindir}/rsyslogd ]; then + %{_bindir}/systemctl restart rsyslog >/dev/null 2>&1 +fi + +%files urma-devel +%defattr(-,root,root) + %{_libdir}/liburma.so + %{_libdir}/liburma_common.so + %{_libdir}/urma/liburma_ubagg.so + %{_libdir}/urma/liburma-udma.so + %dir %{_includedir}/ub/umdk/urma + %dir %{_includedir}/ub/umdk/urma/udma + %{_includedir}/ub/umdk/urma/urma_*.h + %{_includedir}/ub/umdk/urma/uvs_api.h + %{_includedir}/ub/umdk/urma/udma/udma_u_ctl.h +%if %{with gcov} + %dir /var/lib/ub/umdk/urma/gcov/%{name} + /var/lib/ub/umdk/urma/gcov/%{name}/ +%endif + +%files urma-tools +%defattr(-,root,root) + %{_bindir}/urma_admin + /etc/rsyslog.d/urma_admin.conf + %{_bindir}/urma_perftest + %{_bindir}/ubagg_cli + +%post urma-tools +if [ -x %{_bindir}/systemctl ] && [ -x %{_sbindir}/rsyslogd ]; then + %{_bindir}/systemctl restart rsyslog >/dev/null 2>&1 +fi + +%files urma-bin +%defattr(-,root,root) + /etc/rsyslog.d/tpsa.conf + /etc/logrotate.d/tpsa + %{_libdir}/libtpsa.so + %{_libdir}/libtpsa.so.* +%post urma-bin +if [ -x %{_bindir}/systemctl ]; then + %{_bindir}/systemctl daemon-reload >/dev/null 2>&1 +fi +if [ -x %{_bindir}/systemctl ] && [ -x %{_sbindir}/rsyslogd ]; then + %{_bindir}/systemctl restart rsyslog >/dev/null 2>&1 +fi + +%files urma-example +%defattr(-,root,root) + %{_bindir}/urma_sample + %dir %{_docdir}/umdk-examples + %dir %{_docdir}/umdk-examples/urma_example + %{_docdir}/umdk-examples/urma_example/README.md +%endif + +%if %{build_all} || %{with urpc} +%files urpc-framework +%defattr(-,root,root) + %{_libdir}/liburpc_framework.so.* + /etc/rsyslog.d/urpc_framework.conf + /etc/logrotate.d/urpc_framework + +%files urpc-umq +%defattr(-,root,root) + %{_libdir}/libumq.so.* + %{_libdir}/libumq_buf.so.* + %{_libdir}/libumq_ub.so.* + %{_libdir}/libumq_ipc.so.* + /etc/rsyslog.d/umq.conf + /etc/logrotate.d/umq + +%files urpc-framework-devel +%defattr(-,root,root) + %{_libdir}/liburpc_framework.so + %dir %{_includedir}/ub + %dir %{_includedir}/ub/umdk + %dir %{_includedir}/ub/umdk/urpc + %{_includedir}/ub/umdk/urpc/urpc_framework_api.h + %{_includedir}/ub/umdk/urpc/urpc_framework_types.h + %{_includedir}/ub/umdk/urpc/urpc_framework_errno.h + +%files urpc-umq-devel +%defattr(-,root,root) + %{_libdir}/libumq.so + %{_libdir}/libumq_buf.so + %{_libdir}/libumq_ub.so + %{_libdir}/libumq_ipc.so + %dir %{_includedir}/ub + %dir %{_includedir}/ub/umdk + %dir %{_includedir}/ub/umdk/urpc + %dir %{_includedir}/ub/umdk/urpc/umq + %{_includedir}/ub/umdk/urpc/umq/umq_api.h + %{_includedir}/ub/umdk/urpc/umq/umq_errno.h + %{_includedir}/ub/umdk/urpc/umq/umq_pro_api.h + %{_includedir}/ub/umdk/urpc/umq/umq_pro_types.h + %{_includedir}/ub/umdk/urpc/umq/umq_types.h + +%files urpc-framework-example +%defattr(-,root,root) + %{_bindir}/urpc_framework_example + %dir %{_docdir}/umdk-examples/urpc_example/urpc_framework_example + +%files urpc-umq-example +%defattr(-,root,root) + %{_bindir}/umq_example + %dir %{_docdir}/umdk-examples/urpc_example/umq_example + +%files urpc-framework-tools +%defattr(-,root,root) + %{_bindir}/urpc_admin + %{_bindir}/urpc_framework_perftest + +%files urpc-umq-tools +%defattr(-,root,root) + %{_bindir}/umq_perftest +%endif + +%if %{build_all} || %{with dlock} +%files dlock-lib +%defattr(-,root,root) + %{_libdir}/libdlockm.so.* + %{_libdir}/libdlocks.so.* + %{_libdir}/libdlockc.so.* + +%files dlock-devel +%defattr(-,root,root) + %{_libdir}/libdlockm.so + %{_libdir}/libdlocks.so + %{_libdir}/libdlockc.so + %dir %{_includedir}/ub + %dir %{_includedir}/ub/umdk + %dir %{_includedir}/ub/umdk/ulock + %dir %{_includedir}/ub/umdk/ulock/dlock + %{_includedir}/ub/umdk/ulock/dlock/dlock_client_api.h + %{_includedir}/ub/umdk/ulock/dlock/dlock_types.h + %{_includedir}/ub/umdk/ulock/dlock/dlock_server_api.h +%endif + +%if %{with ums} +%files ums +%defattr(-,root,root) + %dir /lib/modules/%{kernel_version}/extra/ums/ + /lib/modules/%{kernel_version}/extra/ums/ums.ko + /etc/modules-load.d/ums.conf + +%post ums +if [ -d /lib/modules/$(uname -r)/kernel/net/smc ]; then + %{__rm} -rf /lib/modules/$(uname -r)/kernel/net/smc +fi +if [[ %{kernel_version} != $(uname -r) ]]; then + %dir /lib/modules/$(uname -r)/weak-updates/drivers/ums/ + echo "/lib/modules/%{kernel_version}/extra/ums/ums.ko" | /sbin/weak-modules --add-module --no-initramfs --verbose +fi + +echo "omit_drivers+=\" ums \"" > /etc/dracut.conf.d/ums.conf + +/sbin/depmod -a $(uname -r) + +%postun ums +if [ $1 -eq 0 ]; then + if [[ %{kernel_version} != $(uname -r) ]]; then + if [ -d /lib/modules/$(uname -r)/weak-updates/drivers ]; then + %{__rm} -rf /lib/modules/$(uname -r)/weak-updates/drivers/ums/ums.ko + %{__rm} -rf /lib/modules/$(uname -r)/weak-updates/drivers/ums/ + else + %{__rm} -rf /lib/modules/$(uname -r)/weak-updates/ums/ums.ko + %{__rm} -rf /lib/modules/$(uname -r)/weak-updates/ums/ + fi + fi +fi +/sbin/depmod -a $(uname -r) + +%files ums-tools +%defattr(-,root,root) + /usr/lib/libums-preload.so + /usr/bin/ums_run + +%post ums-tools + +%postun ums-tools +if [ $1 -eq 0 ]; then + [ -f /usr/lib/libums-preload.so ] && %{__rm} -f /usr/lib/libums-preload.so || : + [ -f /usr/bin/ums_run ] && %{__rm} -f /usr/bin/ums_run || : +fi +%endif + +%changelog +* Tue Dec 30 2025 umdk +-Initial UMDK-25.12.0 rpm spec file.