diff options
| author | CoprDistGit <infra@openeuler.org> | 2023-05-10 09:34:32 +0000 |
|---|---|---|
| committer | CoprDistGit <infra@openeuler.org> | 2023-05-10 09:34:32 +0000 |
| commit | 5313afc5b870ebc5176498e4f7240834d6af3212 (patch) | |
| tree | 159cbe9a3ddabdeb97c128dceed996ebb7ae648a | |
| parent | 88ec25a11d2bbfafe0298439c5a7dafa03be718e (diff) | |
automatic import of python-nettrarec
| -rw-r--r-- | .gitignore | 1 | ||||
| -rw-r--r-- | python-nettrarec.spec | 168 | ||||
| -rw-r--r-- | sources | 1 |
3 files changed, 170 insertions, 0 deletions
@@ -0,0 +1 @@ +/NetTraRec-0.1.12.tar.gz diff --git a/python-nettrarec.spec b/python-nettrarec.spec new file mode 100644 index 0000000..a09f9d5 --- /dev/null +++ b/python-nettrarec.spec @@ -0,0 +1,168 @@ +%global _empty_manifest_terminate_build 0 +Name: python-NetTraRec +Version: 0.1.12 +Release: 1 +Summary: 服务器流量监控小工具 +License: MIT License +URL: https://github.com/ga1008/net_tracfic_recorder +Source0: https://mirrors.nju.edu.cn/pypi/web/packages/40/6f/bd5084e42ee9b95357cba8989944382e58ec1aaa58b078d3a9f6b0b2fde3/NetTraRec-0.1.12.tar.gz +BuildArch: noarch + +Requires: python3-basecolors +Requires: python3-psutil +Requires: python3-redis +Requires: python3-requests +Requires: python3-numpy +Requires: python3-scipy + +%description +### 安装: +``` +$ pip install NetTraRec +``` +### 终端使用: +``` +$ netrec [-选项] +# 显示帮助 +$ netrec -h +# 结果推入 redis +$ netrec -pr +# 然后在启动后输入相关信息: +# target redis host(127.0.0.1): +# port(6379): +# db(0): +# password(123456): +# ... +# 目标 redis 可以是本地或远程 +# redis 信息也可以使用参数 "-kp now>>>>参数字典" 传入,方便远程调度 +# 例如: +$ netrec -pr -kp 'now>>>>{"host": ..., "port": ..., ...}' +``` +### 代码调用: +``` +from NetRecorder import NetTraRec as Nr +res = Nr.start(["eth0"], print_out=False, unit="auto") +print(res) +# {'eth0': ['126.00 Bytes/s', '132.00 Bytes/s', 'auto', '2020-07-08 09:51:17']} +``` +### 参数介绍: +懒得写了,看帮助吧 + +%package -n python3-NetTraRec +Summary: 服务器流量监控小工具 +Provides: python-NetTraRec +BuildRequires: python3-devel +BuildRequires: python3-setuptools +BuildRequires: python3-pip +%description -n python3-NetTraRec +### 安装: +``` +$ pip install NetTraRec +``` +### 终端使用: +``` +$ netrec [-选项] +# 显示帮助 +$ netrec -h +# 结果推入 redis +$ netrec -pr +# 然后在启动后输入相关信息: +# target redis host(127.0.0.1): +# port(6379): +# db(0): +# password(123456): +# ... +# 目标 redis 可以是本地或远程 +# redis 信息也可以使用参数 "-kp now>>>>参数字典" 传入,方便远程调度 +# 例如: +$ netrec -pr -kp 'now>>>>{"host": ..., "port": ..., ...}' +``` +### 代码调用: +``` +from NetRecorder import NetTraRec as Nr +res = Nr.start(["eth0"], print_out=False, unit="auto") +print(res) +# {'eth0': ['126.00 Bytes/s', '132.00 Bytes/s', 'auto', '2020-07-08 09:51:17']} +``` +### 参数介绍: +懒得写了,看帮助吧 + +%package help +Summary: Development documents and examples for NetTraRec +Provides: python3-NetTraRec-doc +%description help +### 安装: +``` +$ pip install NetTraRec +``` +### 终端使用: +``` +$ netrec [-选项] +# 显示帮助 +$ netrec -h +# 结果推入 redis +$ netrec -pr +# 然后在启动后输入相关信息: +# target redis host(127.0.0.1): +# port(6379): +# db(0): +# password(123456): +# ... +# 目标 redis 可以是本地或远程 +# redis 信息也可以使用参数 "-kp now>>>>参数字典" 传入,方便远程调度 +# 例如: +$ netrec -pr -kp 'now>>>>{"host": ..., "port": ..., ...}' +``` +### 代码调用: +``` +from NetRecorder import NetTraRec as Nr +res = Nr.start(["eth0"], print_out=False, unit="auto") +print(res) +# {'eth0': ['126.00 Bytes/s', '132.00 Bytes/s', 'auto', '2020-07-08 09:51:17']} +``` +### 参数介绍: +懒得写了,看帮助吧 + +%prep +%autosetup -n NetTraRec-0.1.12 + +%build +%py3_build + +%install +%py3_install +install -d -m755 %{buildroot}/%{_pkgdocdir} +if [ -d doc ]; then cp -arf doc %{buildroot}/%{_pkgdocdir}; fi +if [ -d docs ]; then cp -arf docs %{buildroot}/%{_pkgdocdir}; fi +if [ -d example ]; then cp -arf example %{buildroot}/%{_pkgdocdir}; fi +if [ -d examples ]; then cp -arf examples %{buildroot}/%{_pkgdocdir}; fi +pushd %{buildroot} +if [ -d usr/lib ]; then + find usr/lib -type f -printf "/%h/%f\n" >> filelist.lst +fi +if [ -d usr/lib64 ]; then + find usr/lib64 -type f -printf "/%h/%f\n" >> filelist.lst +fi +if [ -d usr/bin ]; then + find usr/bin -type f -printf "/%h/%f\n" >> filelist.lst +fi +if [ -d usr/sbin ]; then + find usr/sbin -type f -printf "/%h/%f\n" >> filelist.lst +fi +touch doclist.lst +if [ -d usr/share/man ]; then + find usr/share/man -type f -printf "/%h/%f.gz\n" >> doclist.lst +fi +popd +mv %{buildroot}/filelist.lst . +mv %{buildroot}/doclist.lst . + +%files -n python3-NetTraRec -f filelist.lst +%dir %{python3_sitelib}/* + +%files help -f doclist.lst +%{_docdir}/* + +%changelog +* Wed May 10 2023 Python_Bot <Python_Bot@openeuler.org> - 0.1.12-1 +- Package Spec generated @@ -0,0 +1 @@ +f4e7204dac945b6d865461040e27c9df NetTraRec-0.1.12.tar.gz |
