Skip to content

Commit

Permalink
files to build debian package
Browse files Browse the repository at this point in the history
  • Loading branch information
ondra-novak committed Sep 23, 2020
1 parent 3829ba0 commit c205785
Show file tree
Hide file tree
Showing 32 changed files with 152 additions and 20 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,5 @@ Makefile
/www/fav_*.png
generated
/errors.log
*.deb
/install_manifest.txt
16 changes: 13 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,18 @@ add_subdirectory (src/brokers/poloniex)
add_subdirectory (src/brokers/simplefx)
add_subdirectory (src/brokers/trainer)


install(DIRECTORY conf DESTINATION ".")
install(DIRECTORY www DESTINATION ".")
if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
set(CMAKE_INSTALL_PREFIX "/opt/mmbot" CACHE PATH "Default path to install" FORCE)
endif()

install(PROGRAMS bin/mmbot DESTINATION bin)
install(DIRECTORY bin/brokers DESTINATION bin USE_SOURCE_PERMISSIONS)
install(FILES conf/mmbot.conf conf/brokers.conf DESTINATION "conf")
install(FILES conf/mmbot.pkg.conf DESTINATION "conf" RENAME "local.conf")
install(FILES www/index.html www/manifest.json www/sw.js DESTINATION "www")
install(DIRECTORY www/admin DESTINATION "www")
install(DIRECTORY www/res DESTINATION "www")
install(DIRECTORY DESTINATION "data")
install(DIRECTORY DESTINATION "secure_data")
install(DIRECTORY DESTINATION "run")
install(DIRECTORY DESTINATION "log")
1 change: 1 addition & 0 deletions conf/mmbot.conf
Original file line number Diff line number Diff line change
Expand Up @@ -108,3 +108,4 @@ sliding_zero_reverse=0.9


@include brokers.conf

6 changes: 6 additions & 0 deletions conf/mmbot.pkg.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
@include mmbot.conf

[service]
listen=localhost:11223


3 changes: 3 additions & 0 deletions deb_build
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/bash
dpkg-buildpackage -b --no-sign -nc
mv ../*.deb ./
8 changes: 8 additions & 0 deletions debian/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
/mmbot/
/.debhelper
/debian/
files
*.debhelper
*.substvars
substvars
/debhelper-build-stamp
11 changes: 11 additions & 0 deletions debian/changelog
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
mmbot (2:20.9) unstable; urgency=medium

* Final release debian package

-- Ondra Novak <[email protected]> Wed, 23 Sep 2020 20:03:00 +0200

mmbot (1.0.0) unstable; urgency=medium

* Initial Release.

-- Ondra Novak <[email protected]> Wed, 23 Sep 2020 11:22:33 +0200
1 change: 1 addition & 0 deletions debian/compat
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
11
3 changes: 3 additions & 0 deletions debian/conffiles
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
/opt/mmbot/conf/brokers.conf
/opt/mmbot/conf/mmbot.conf
/opt/mmbot/conf/local.conf
14 changes: 14 additions & 0 deletions debian/control
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
Source: mmbot
Section: unbound
Priority: optional
Maintainer: Ondrej Novak <[email protected]>
Standards-Version: 4.4.1
Homepage: https://github.com/ondra-novak/mmbot

Package: mmbot
Architecture: any
Depends: ${shlibs:Depends}, ${misc:Depends}
Description: mmbot - market making trading bot
After installation, open a browser at:
http://localhost:11223/

30 changes: 30 additions & 0 deletions debian/copyright
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
Upstream-Name: mmbot
Upstream-Contact: [email protected]
Source: https://github.com/ondra-novak/mmbot

Files: *
Copyright: 2020 Ondrej Novak <[email protected]>
License: MIT

License: MIT
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.
2 changes: 2 additions & 0 deletions debian/mmbot.install
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
debian/conffiles DEBIAN

27 changes: 27 additions & 0 deletions debian/mmbot.postinst
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#!/bin/sh

set -e


case "$1" in
configure)
adduser --system --no-create-home mmbot
chown -R mmbot /opt/mmbot
echo "Configuration interface is available at url: http://localhost:11223/ (if not changed)"
;;

abort-upgrade|abort-remove|abort-deconfigure)
;;

*)
echo "postinst called with unknown argument \`$1'" >&2
exit 1
;;
esac

# dh_installdeb will replace this with shell code automatically
# generated by other debhelper scripts.

#DEBHELPER#

exit 0
16 changes: 16 additions & 0 deletions debian/mmbot.service
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
[Unit]
Description=MMBot
After=network-online.target

[Service]
Type=simple
User=mmbot
ExecStart=/opt/mmbot/bin/mmbot -f /opt/mmbot/conf/local.conf run
ExecStop=/opt/mmbot/bin/mmbot -f /opt/mmbot/conf/local.conf stop
RemainAfterExit=no
Restart=on-abnormal
RestartSec=1s


[Install]
WantedBy=multi-user.target
13 changes: 13 additions & 0 deletions debian/rules
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/usr/bin/make -f


%:
dh $@

override_dh_auto_configure:
echo disabled
override_dh_auto_build:
./build nodialog
override_dh_strip:
echo no_strip

1 change: 0 additions & 1 deletion src/brokers/binance/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,3 @@ set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_SOURCE_DIR}/bin/brokers/)

add_executable (binance main.cpp proxy.cpp )
target_link_libraries (binance LINK_PUBLIC brokers_common simpleServer imtjson )
install(TARGETS binance DESTINATION "bin/brokers")
1 change: 0 additions & 1 deletion src/brokers/bitfinex/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,3 @@ add_executable (bitfinex main.cpp
structs.cpp
)
target_link_libraries (bitfinex LINK_PUBLIC brokers_common simpleServer imtjson )
install(TARGETS bitfinex DESTINATION "bin/brokers")
1 change: 0 additions & 1 deletion src/brokers/bitmex/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,3 @@ set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_SOURCE_DIR}/bin/brokers/)

add_executable (bitmex main.cpp proxy.cpp )
target_link_libraries (bitmex LINK_PUBLIC brokers_common simpleServer imtjson)
install(TARGETS bitmex DESTINATION "bin/brokers")
1 change: 0 additions & 1 deletion src/brokers/coinbase/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,3 @@ set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_SOURCE_DIR}/bin/brokers/)

add_executable (coinbase main.cpp )
target_link_libraries (coinbase LINK_PUBLIC brokers_common simpleServer imtjson)
install(TARGETS coinbase DESTINATION "bin/brokers")
1 change: 0 additions & 1 deletion src/brokers/coingi/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,3 @@ set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_SOURCE_DIR}/bin/brokers/)

add_executable (coingi main.cpp )
target_link_libraries (coingi LINK_PUBLIC brokers_common simpleServer imtjson)
install(TARGETS coingi DESTINATION "bin/brokers")
1 change: 0 additions & 1 deletion src/brokers/coinmate/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,3 @@ set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_SOURCE_DIR}/bin/brokers/)

add_executable (coinmate main.cpp proxy.cpp )
target_link_libraries (coinmate LINK_PUBLIC brokers_common simpleServer imtjson)
install(TARGETS coinmate DESTINATION "bin/brokers")
1 change: 0 additions & 1 deletion src/brokers/deribit/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,3 @@ set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_SOURCE_DIR}/bin/brokers/)

add_executable (deribit main.cpp proxy.cpp )
target_link_libraries (deribit LINK_PUBLIC brokers_common simpleServer imtjson )
install(TARGETS deribit DESTINATION "bin/brokers")
1 change: 0 additions & 1 deletion src/brokers/ftx/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,3 @@ add_executable (ftx main.cpp
interface.cpp
)
target_link_libraries (ftx LINK_PUBLIC brokers_common simpleServer imtjson )
install(TARGETS ftx DESTINATION "bin/brokers")
1 change: 0 additions & 1 deletion src/brokers/kraken/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,3 @@ add_executable (kraken main.cpp

)
target_link_libraries (kraken LINK_PUBLIC brokers_common simpleServer imtjson )
install(TARGETS kraken DESTINATION "bin/brokers")
1 change: 0 additions & 1 deletion src/brokers/poloniex/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,3 @@ set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_SOURCE_DIR}/bin/brokers/)

add_executable (poloniex main.cpp proxy.cpp )
target_link_libraries (poloniex LINK_PUBLIC brokers_common simpleServer imtjson )
install(TARGETS poloniex DESTINATION "bin/brokers")
1 change: 0 additions & 1 deletion src/brokers/simplefx/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,3 @@ add_executable (simplefx

)
target_link_libraries (simplefx LINK_PUBLIC brokers_common simpleServer imtjson)
install(TARGETS simplefx DESTINATION "bin/simplefx")
1 change: 0 additions & 1 deletion src/brokers/trainer/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,3 @@ add_custom_command(OUTPUT generated/index.html.cpp COMMAND ./txt2cpp.sh index.ht

add_executable (trainer main.cpp ../bitfinex/structs.cpp generated/index.html.cpp)
target_link_libraries (trainer LINK_PUBLIC brokers_common imtjson simpleServer)
install(TARGETS trainer DESTINATION "bin/trainer")
2 changes: 1 addition & 1 deletion src/imtjson
1 change: 0 additions & 1 deletion src/main/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,3 @@ add_executable (mmbot
swap_broker.cpp
)
target_link_libraries (mmbot LINK_PUBLIC simpleServer imtjson )
install(TARGETS mmbot DESTINATION "bin")
1 change: 0 additions & 1 deletion src/report_broker/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,3 @@ set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_SOURCE_DIR}/bin/brokers/)

add_executable (report_broker main.cpp )
target_link_libraries (report_broker LINK_PUBLIC brokers_common imtjson simpleServer)
install(TARGETS report_broker DESTINATION "bin/ext_report")
1 change: 0 additions & 1 deletion src/storage_broker/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,3 @@ set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_SOURCE_DIR}/bin/brokers/)

add_executable (storage_broker main.cpp )
target_link_libraries (storage_broker LINK_PUBLIC brokers_common imtjson simpleServer)
install(TARGETS storage_broker DESTINATION "bin/storage_broker")

0 comments on commit c205785

Please sign in to comment.