diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..bacb7796a69564a1e4b64d49cb14d980ca8c8106 --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2025 HiSilicon Technologies Co., Ltd. All rights reserved. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/sources b/sources new file mode 100644 index 0000000000000000000000000000000000000000..e79af1825a7e825b70114b98d9114d4685bf9728 --- /dev/null +++ b/sources @@ -0,0 +1 @@ +SHA512 (ubctl.tar.gz) = 157a30e0144c90936ef682d62a041c382bfc968bdaad9b056d9f617a38080c40b9983c592d6507888a6e1a3dab55e68139867f23732d6d3a97762ae27d14348c diff --git a/ubctl.spec b/ubctl.spec new file mode 100644 index 0000000000000000000000000000000000000000..d324703f80d7043aa5a67bab64a6b46df5273576 --- /dev/null +++ b/ubctl.spec @@ -0,0 +1,73 @@ +Summary: Implementation of ubctl +Name: ubctl +Version: 1.0.1 +Release: 1%{?dist} +License: MIT +URL: https://gitee.com/openeuler/ubctl +Source0: %{name}.tar.gz + +BuildRequires: cmake +BuildRequires: gcc-c++ +BuildRequires: make + +%description +This implementation provides ubctl sending and reception. + +%package devel +Summary: Implementation of ubctl(UB) - Tools and header files for developers +Group: Development/Libraries/C +BuildRequires: pkgconfig +Requires: libubctl = %{version}-%{release} + +%description devel +This package is required to develop alternate clients for ubctl. + +The ubctl tool implements UB-related DFX functions by invoking the +ub_fwctl deriver. +This tool is mainly used to parse the command line input by the user and +send query commands to the kernel state. After the kernel state returns +the query results, it parses and prints the expected results. + +%prep +%autosetup -n ubctl + +# %build +# mkdir ubctl/build +# cd ubctl/build +# cmake ../src +# make + +%build +rm -rf build +cmake -S . -B build \ + -DCMAKE_INSTALL_PREFIX=/usr \ + -DCMAKE_BUILD_TYPE=RelWithDebInfo + +cmake --build build -- -j$(nproc) + +%install +rm -rf %{buildroot} + +mkdir -p %{buildroot} +mkdir -p %{buildroot}%{_docdir}/ub/%{name}/ +mkdir -p %{buildroot}%{_mandir}/man8/ +pod2man doc/ubctl.pod ./ubctl.8 +install -m 644 README.md %{buildroot}%{_docdir}/ub/%{name}/ +install -m 644 ./ubctl.8 %{buildroot}%{_mandir}/man8/ubctl.8 +gzip -f9n %{buildroot}%{_mandir}/man8/ubctl.8 + +DESTDIR=%{buildroot} cmake --install build + +%files +%{_bindir}/ubctl +%license LICENSE +%doc %{_docdir}/ub/%{name}/* +%{_mandir}/man8/ubctl.8.gz + +%clean +rm -rf $RPM_BUILD_ROOT + +%changelog +* Mon May 11 2026 huwentao - 1.0.1-1 +- [Type] sync +- [DESC] Init package