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..6f2acf8ed1ed3eda04ea6c0bb2e31aa5720830fc --- /dev/null +++ b/sources @@ -0,0 +1 @@ +SHA512 (ubutils.tar.gz) = c7682022172dfe0395bc587e3da91f1b917b677963110ef8606e6a70749913116383bc6897da582bbe89ef6e02d204a2c776ae33f0347071c65a2aa709f21296 diff --git a/ubutils.spec b/ubutils.spec new file mode 100644 index 0000000000000000000000000000000000000000..7c1c35f3661b5786cc949b0dba255e16218d682f --- /dev/null +++ b/ubutils.spec @@ -0,0 +1,60 @@ +Summary: Implementation of ubutils +Name: ubutils +Version: 1.0.2 +Release: 1%{?dist} +License: MIT +URL: https://gitee.com/openeuler/ubutils +Source0: %{name}.tar.gz + +BuildRequires: cmake +BuildRequires: gcc-c++ +BuildRequires: make + +%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 +%autosetup -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 +%license LICENSE +%config %{_prefix}/share/hwdata/ub.ids +%attr(0644, root, man) %{_prefix}/share/man/man8/* + +%clean +rm -rf %{buildroot} + +%changelog +* Mon May 11 2026 huwentao - 1.0.2-1 +- [Type] sync +- [DESC] Init package