Skip to content

Cross-platform agent uploading dives from dive computers to Diveboard

License

Notifications You must be signed in to change notification settings

Diveboard/DC-agent

Repository files navigation

HOW TO COMPILE THE AGENT
========================

1/ Fetch and compile third party libraries
------------------------------------------
Boost and wxwidgets take quite a lot of time.

  cd ..../diveboard-agent
  cd 3rd-party
  ./mac-build-all.sh


2/ Create build directory and build using Makefile
-------------------------------------------------
Tested so far on Mac only

  cd ..../diveboard-agent
  mkdir build
  cd build
  cmake ..
  make


3/ Check the built binaries
---------------------------
Mac : The binaries are in build/bin


4/ Package the result
---------------------
  sudo ./makeMacPkg.sh



---------------------
HOW TO BUILD ON LINUX FOR WINDOWS
1) Preparations:

  sudo apt-get install mingw-w64 binutils-mingw-w64 cmake nsis
  //ONLY FOR OLD VERSIONS OF CMAKE:
  //replace the file FindwxWidgets.cmake in folder /usr/share/cmake-2.8/Modules/ by the one in 3rd-party/windows-build/


2 Building libraries:

  cd <project root>/3rd-party
  //IF YOU WANT FASTER COMPILING: export MAKEFLAGS=-j(number of process(optional)), e.g.:
  export MAKEFLAGS=-j8
  ./win-build-all.sh


3 Create build directory and build using Makefile

  cd <project root>
  mkdir build
  cd build 
  cmake -DCMAKE_TOOLCHAIN_FILE=../3rd-party/windows-build/toolchain-mingw32.cmake -DCMAKE_SYSTEM_NAME=Windows ..
  make


4 Building setup.
  cd ..
  makensis platforms/windows/diveboard.nsi



HOW TO BUILD ON LINUX

1) install package

  sudo apt-get install dpkg-sig imagemagick rpm mesa-common-dev freeglut3-dev libwebkitgtk-3.0-dev cmake imagemagick rpm dpkg-sig autoconf libtool libjpeg-dev libtiff-dev libconfig++-dev

  //ONLY ON UBUNTU
  sudo apt-get install libappindicator3-dev

2) build libraries

  cd <project root>/3rd-party
  //IF YOU WANT FASTER COMPILING: export MAKEFLAGS=-j(number of process(optional)), e.g.:
  export MAKEFLAGS=-j8
  ./lin-build-all.sh


3) build Diveboard agent

  cd <project root>/
  mkdir build
  cd <project root>/build
  cmake ..
  make


4) build package

  cd <project root>/
  cp pgp/* ~/.gnupg/
  gpg --export -a 'Diveboard Tech' > RPM-GPG-KEY-diveboard
  sudo rpm --import RPM-GPG-KEY-diveboard
  echo "%_signature gpg
  %_gpg_name  Diveboard Tech" > ~/.rpmmacros
  ./makeLinuxPkg.sh

  //SIGNED ON REPREPRO SO THIS IS JUST TO FORCE SIGNING
  //WARNING: this needs to be adapted to the actual name of debian file
  fakeroot dpkg-sig -k "Diveboard Tech" --sign builder build/packages/diveboard-agent-1.0.0-i386.deb 



HOW TO PUSH ON SERVER

- connect on diveboard server and upload all the package
- Get a terminal on the server
  - For windows, Mac and TGZ, only copy/paste the package on the good folder
    - cp setup.exe package/win
    - cp DiveboardAgent.dmg package/osx
    - cp DiveboardAgent.tgz package/tgz
  - For Fedora copy the package in the folder and launch the createrepo command
    - cp DiveboardAgent.rpm package/rpm
    - createrepo .
  - For Ubuntu/Debian
    - cd package/deb
    - reprepro includedeb stable "PATH TO DEB FILE/DiveboardAgent.deb"
    - Signing of deb file is during the reprepro add so the command ask you for the gnupg key password.



HOW TO UPDATE THE SERVER
  - Change the version number in the method "versions" line 1487 of the api_controller.rb
  - You need to make this change for each platform.