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/ubutils.spec b/ubutils.spec new file mode 100644 index 0000000000000000000000000000000000000000..bb88884413f1f2a6b944a7b4ce2f5d5b9eebb2f2 --- /dev/null +++ b/ubutils.spec @@ -0,0 +1,66 @@ +Summary: Implementation of ubutils +Name: ubutils +Version: 1.0.2 +Release: 1 +License: MIT +URL: https://gitee.com/openeuler/ubutils +Source0: %{name}.tar.gz + +BuildRequires: cmake +BuildRequires: gcc-c++ +BuildRequires: make + +BuildRoot: %{name}-%{version}-%{release} + +%description +This implementation provides ubutils sending and reception. + +%package devel +Summary: Implementation of ubutils(UB) - Tools and header files for developers +Group: Development/Libraries/C +BuildRequires: pkgconfig +Requires: ubutils = %{version}-%{release} + +%description devel +This package is required to develop alternate clients for ubutils. + +Ubutils is the basic debug tool of ubus, including setub and lsub. + +%prep +%setup -q -n ubutils + +%build +rm -rf build +cmake -S . -B build \ + -DCMAKE_INSTALL_PREFIX=%{_prefix} \ + -DCMAKE_BUILD_TYPE=RelWithDebInfo +cmake --build build --config Release -- -j$(nproc) + +%install +rm -rf %{buildroot} +cmake --install build --prefix=%{buildroot}%{_prefix} +mkdir -p $RPM_BUILD_ROOT%{_prefix}/share/hwdata +install -m 644 ub.ids $RPM_BUILD_ROOT%{_prefix}/share/hwdata +M=`echo $DATE | sed 's/-01-/-January-/;s/-02-/-February-/;s/-03-/-March-/;s/-04-/-April-/;s/-05-/-May-/;s/-06-/-June-/;s/-07-/-July-/;s/-08-/-August-/;s/-09-/-September-/;s/-10-/-October-/;s/-11-/-November-/;s/-12-/-December-/;s/\(.*\)-\(.*\)-\(.*\)/\3 \2 \1/'` ; sed setub.8 "s/@TODAY@/$M/;s/@VERSION@/ubutils-1.0.1/;s#@IDSDIR@#/usr/share/hwdata#" +M=`echo $DATE | sed 's/-01-/-January-/;s/-02-/-February-/;s/-03-/-March-/;s/-04-/-April-/;s/-05-/-May-/;s/-06-/-June-/;s/-07-/-July-/;s/-08-/-August-/;s/-09-/-September-/;s/-10-/-October-/;s/-11-/-November-/;s/-12-/-December-/;s/\(.*\)-\(.*\)-\(.*\)/\3 \2 \1/'` ; sed lsub.8 "s/@TODAY@/$M/;s/@VERSION@/ubutils-1.0.1/;s#@IDSDIR@#/usr/share/hwdata#" +mkdir -p $RPM_BUILD_ROOT%{_prefix}/share/man/man8 +install -m 644 lsub.8 setub.8 $RPM_BUILD_ROOT%{_prefix}/share/man/man8 + +%files +%{_bindir}/lsub +%{_bindir}/setub +%config %{_prefix}/share/hwdata/ub.ids +%attr(0644, root, man) %{_prefix}/share/man/man8/* + +%clean +rm -rf %{buildroot} + +%changelog +* Wed Dec 24 2025 laz - 1.0.2-1 +- Change lsub print format. + +* Tue Nov 4 2025 laz - 1.0.1.rc1-1 +- Add ubutils document and fix setub write. + +* Tue Aug 12 2025 laz - 1.0.0-1 +- Support the basic debug tool(Ubutils) of ubus, including setub, lsub and ub.ids. diff --git a/ubutils.tar.gz b/ubutils.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..4228d6418fb67ab8abd388317567d35794c92e2e Binary files /dev/null and b/ubutils.tar.gz differ