File bitcoin-arbitrage.spec of Package bitcoin-arbitrage

#
# spec file for package bitcoin-arbitrage
#
# Copyright (c) 2024 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via https://bugs.opensuse.org/
#


Name:           bitcoin-arbitrage
Version:        0.1_git20241020
Release:        0
Summary:        Bitcoin arbitrage opportunity detector
License:        MIT
Group:          Productivity/Networking/Other
URL:            https://github.com/maxme/%{name}
Source0:        %{name}-%{version}.tar.xz
BuildArch:      noarch
BuildRequires:  python3-devel
BuildRequires:  python3-setuptools
Recommends:     python3-sleekxmpp

%description
The detector gets order books from supported exchanges and calculates arbitrage opportunities between each markets. It takes market depth into account.

%prep
%setup -q
%{__mv} docs doc
echo -e "#!/bin/sh\n" > %{name}
echo -e "config_folder=\$HOME/.bitcoin-arbitrage" >> %{name}
echo -e "if ! [ -d \$config_folder ]" >> %{name}
echo -e "then" >> %{name}
echo -e "\tmkdir -p \$config_folder" >> %{name}
%{__sed} 's/"/\\"/g' arbitrage/config.py-example | %{__sed} 's/^\(.*\)$/\techo -e "\1" >> \$config_folder\/config.py/g' >> %{name}
echo -e "fi\n" >> %{name}
echo -e "cd %{python3_sitelib}/arbitrage" >> %{name}
echo -e "python3 arbitrage.py \"\${@}\"" >> %{name}

%build
python3 setup.py build

%install
python3 setup.py install --prefix=%{_prefix} --root=%{buildroot}
%{__install} -dm 0755 %{buildroot}%{_bindir}
%{__install} -m 0755 %{name} %{buildroot}%{_bindir}/%{name}

%files
%defattr(-,root,root,-)
%attr(755,root,root) %{_bindir}/%{name}
%{python3_sitelib}/*
%doc README.md

%changelog
openSUSE Build Service is sponsored by