summaryrefslogtreecommitdiff
path: root/python-rcon.spec
diff options
context:
space:
mode:
Diffstat (limited to 'python-rcon.spec')
-rw-r--r--python-rcon.spec323
1 files changed, 323 insertions, 0 deletions
diff --git a/python-rcon.spec b/python-rcon.spec
new file mode 100644
index 0000000..7847e2c
--- /dev/null
+++ b/python-rcon.spec
@@ -0,0 +1,323 @@
+%global _empty_manifest_terminate_build 0
+Name: python-rcon
+Version: 2.3.9
+Release: 1
+Summary: An RCON client library.
+License: GPLv3
+URL: https://github.com/conqp/rcon
+Source0: https://mirrors.nju.edu.cn/pypi/web/packages/da/d0/834abaf5e2a788fac28d85c11675f4685ddff13898f582c716340af3e7ea/rcon-2.3.9.tar.gz
+BuildArch: noarch
+
+Requires: python3-pygobject
+Requires: python3-pygtk
+
+%description
+[![Documentation Status](https://readthedocs.org/projects/rcon/badge/?version=latest)](https://rcon.readthedocs.io/en/latest/)
+
+# rcon
+An RCON client implementation.
+* [Source RCON protocol](https://developer.valvesoftware.com/wiki/Source_RCON_Protocol)
+* [BattlEye RCon protocol](https://www.battleye.com/downloads/BERConProtocol.txt)
+
+## Requirements
+`rcon` requires Python 3.10 or higher.
+
+## Documentation
+Documentation is available on [readthedocs](https://rcon.readthedocs.io/en/latest/).
+
+## Installation
+Install rcon from the [AUR](https://aur.archlinux.org/packages/python-rcon/) or via:
+
+ pip install rcon
+
+## Quick start
+The `RCON` protocols are used to remotely control game servers, i.e. execute
+commands on a game server and receive the respective results.
+
+### Source RCON
+```python
+from rcon.source import Client
+
+with Client('127.0.0.1', 5000, passwd='mysecretpassword') as client:
+ response = client.run('some_command', 'with', 'some', 'arguments')
+
+print(response)
+```
+
+#### Async support
+If you prefer to use Source RCON in an asynchronous environment, you can use
+`rcon()`.
+
+```python
+from rcon.source import rcon
+
+response = await rcon(
+ 'some_command', 'with', 'some', 'arguments',
+ host='127.0.0.1', port=5000, passwd='mysecretpassword'
+)
+print(response)
+```
+
+### BattlEye RCon
+```python
+from rcon.battleye import Client
+
+with Client('127.0.0.1', 5000, passwd='mysecretpassword') as client:
+ response = client.run('some_command', 'with', 'some', 'arguments')
+
+print(response)
+```
+
+#### Handling server messages
+Since the BattlEye RCon server will also send server messages to the client
+alongside command responses, you can register an event handler to process
+those messages:
+
+```python
+from rcon.battleye import Client
+from rcon.battleye.proto import ServerMessage
+
+def my_message_handler(server_message: ServerMessage) -> None:
+ """Print server messages."""
+
+ print('Server message:', server_message)
+
+with Client(
+ '127.0.0.1',
+ 5000,
+ passwd='mysecretpassword',
+ message_handler=my_message_handler
+) as client:
+ response = client.run('some_command', 'with', 'some', 'arguments')
+
+print('Response:', response)
+```
+
+Have a look at `rcon.battleye.proto.ServerMessage` for details on the
+respective objects.
+
+
+%package -n python3-rcon
+Summary: An RCON client library.
+Provides: python-rcon
+BuildRequires: python3-devel
+BuildRequires: python3-setuptools
+BuildRequires: python3-pip
+%description -n python3-rcon
+[![Documentation Status](https://readthedocs.org/projects/rcon/badge/?version=latest)](https://rcon.readthedocs.io/en/latest/)
+
+# rcon
+An RCON client implementation.
+* [Source RCON protocol](https://developer.valvesoftware.com/wiki/Source_RCON_Protocol)
+* [BattlEye RCon protocol](https://www.battleye.com/downloads/BERConProtocol.txt)
+
+## Requirements
+`rcon` requires Python 3.10 or higher.
+
+## Documentation
+Documentation is available on [readthedocs](https://rcon.readthedocs.io/en/latest/).
+
+## Installation
+Install rcon from the [AUR](https://aur.archlinux.org/packages/python-rcon/) or via:
+
+ pip install rcon
+
+## Quick start
+The `RCON` protocols are used to remotely control game servers, i.e. execute
+commands on a game server and receive the respective results.
+
+### Source RCON
+```python
+from rcon.source import Client
+
+with Client('127.0.0.1', 5000, passwd='mysecretpassword') as client:
+ response = client.run('some_command', 'with', 'some', 'arguments')
+
+print(response)
+```
+
+#### Async support
+If you prefer to use Source RCON in an asynchronous environment, you can use
+`rcon()`.
+
+```python
+from rcon.source import rcon
+
+response = await rcon(
+ 'some_command', 'with', 'some', 'arguments',
+ host='127.0.0.1', port=5000, passwd='mysecretpassword'
+)
+print(response)
+```
+
+### BattlEye RCon
+```python
+from rcon.battleye import Client
+
+with Client('127.0.0.1', 5000, passwd='mysecretpassword') as client:
+ response = client.run('some_command', 'with', 'some', 'arguments')
+
+print(response)
+```
+
+#### Handling server messages
+Since the BattlEye RCon server will also send server messages to the client
+alongside command responses, you can register an event handler to process
+those messages:
+
+```python
+from rcon.battleye import Client
+from rcon.battleye.proto import ServerMessage
+
+def my_message_handler(server_message: ServerMessage) -> None:
+ """Print server messages."""
+
+ print('Server message:', server_message)
+
+with Client(
+ '127.0.0.1',
+ 5000,
+ passwd='mysecretpassword',
+ message_handler=my_message_handler
+) as client:
+ response = client.run('some_command', 'with', 'some', 'arguments')
+
+print('Response:', response)
+```
+
+Have a look at `rcon.battleye.proto.ServerMessage` for details on the
+respective objects.
+
+
+%package help
+Summary: Development documents and examples for rcon
+Provides: python3-rcon-doc
+%description help
+[![Documentation Status](https://readthedocs.org/projects/rcon/badge/?version=latest)](https://rcon.readthedocs.io/en/latest/)
+
+# rcon
+An RCON client implementation.
+* [Source RCON protocol](https://developer.valvesoftware.com/wiki/Source_RCON_Protocol)
+* [BattlEye RCon protocol](https://www.battleye.com/downloads/BERConProtocol.txt)
+
+## Requirements
+`rcon` requires Python 3.10 or higher.
+
+## Documentation
+Documentation is available on [readthedocs](https://rcon.readthedocs.io/en/latest/).
+
+## Installation
+Install rcon from the [AUR](https://aur.archlinux.org/packages/python-rcon/) or via:
+
+ pip install rcon
+
+## Quick start
+The `RCON` protocols are used to remotely control game servers, i.e. execute
+commands on a game server and receive the respective results.
+
+### Source RCON
+```python
+from rcon.source import Client
+
+with Client('127.0.0.1', 5000, passwd='mysecretpassword') as client:
+ response = client.run('some_command', 'with', 'some', 'arguments')
+
+print(response)
+```
+
+#### Async support
+If you prefer to use Source RCON in an asynchronous environment, you can use
+`rcon()`.
+
+```python
+from rcon.source import rcon
+
+response = await rcon(
+ 'some_command', 'with', 'some', 'arguments',
+ host='127.0.0.1', port=5000, passwd='mysecretpassword'
+)
+print(response)
+```
+
+### BattlEye RCon
+```python
+from rcon.battleye import Client
+
+with Client('127.0.0.1', 5000, passwd='mysecretpassword') as client:
+ response = client.run('some_command', 'with', 'some', 'arguments')
+
+print(response)
+```
+
+#### Handling server messages
+Since the BattlEye RCon server will also send server messages to the client
+alongside command responses, you can register an event handler to process
+those messages:
+
+```python
+from rcon.battleye import Client
+from rcon.battleye.proto import ServerMessage
+
+def my_message_handler(server_message: ServerMessage) -> None:
+ """Print server messages."""
+
+ print('Server message:', server_message)
+
+with Client(
+ '127.0.0.1',
+ 5000,
+ passwd='mysecretpassword',
+ message_handler=my_message_handler
+) as client:
+ response = client.run('some_command', 'with', 'some', 'arguments')
+
+print('Response:', response)
+```
+
+Have a look at `rcon.battleye.proto.ServerMessage` for details on the
+respective objects.
+
+
+%prep
+%autosetup -n rcon-2.3.9
+
+%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-rcon -f filelist.lst
+%dir %{python3_sitelib}/*
+
+%files help -f doclist.lst
+%{_docdir}/*
+
+%changelog
+* Wed May 10 2023 Python_Bot <Python_Bot@openeuler.org> - 2.3.9-1
+- Package Spec generated