[med-svn] [galileo] 02/02: Create a package galileo-daemon

Dylan Aïssi bob.dybian-guest at moszumanska.debian.org
Sun Sep 4 21:57:45 UTC 2016


This is an automated email from the git hooks/post-receive script.

bob.dybian-guest pushed a commit to branch master
in repository galileo.

commit 919e32cc9a7929f00e1c9050aee58daabf04f6f6
Author: Dylan Aïssi <bob.dybian at gmail.com>
Date:   Wed Aug 31 22:31:45 2016 +0200

    Create a package galileo-daemon
---
 debian/NEWS.Debian            | 10 ++++++++++
 debian/changelog              |  1 +
 debian/control                | 22 +++++++++++++++++++++-
 debian/galileo-daemon.install |  1 +
 debian/galileo-daemon.service | 16 ++++++++++++++++
 debian/galileo-daemon.udev    |  7 +++++++
 debian/galileo.docs           |  1 +
 debian/galileo.examples       |  5 +----
 debian/galileo.udev           | 10 +++++-----
 debian/galileorc              | 18 ++++++++++++++++++
 debian/rules                  | 14 +++++++++++---
 11 files changed, 92 insertions(+), 13 deletions(-)

diff --git a/debian/NEWS.Debian b/debian/NEWS.Debian
new file mode 100644
index 0000000..5f16715
--- /dev/null
+++ b/debian/NEWS.Debian
@@ -0,0 +1,10 @@
+galileo (0.5.0-2) unstable; urgency=medium
+
+  The package "galileo" install an udev rule to run it manually.
+
+  The package "galileo-daemon" install an udev rule to run it as a
+  daemon and disable the rule to run it manually. So, if you want to
+  run galileo manually, you should not install the package
+  "galileo-daemon".
+
+ -- Dylan Aïssi <bob.dybian at gmail.com>  Mon, 22 Aug 2016 22:37:45 +0200
diff --git a/debian/changelog b/debian/changelog
index 30b22e8..749a82a 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -2,6 +2,7 @@ galileo (0.5.0-2) UNRELEASED; urgency=medium
 
   * Install the udev rule using dh_installudev.
   * Switch Build-Dep to python3 from python3-all.
+  * Build a new binary package: galileo-daemon.
 
  -- Dylan Aïssi <bob.dybian at gmail.com>  Mon, 22 Aug 2016 22:37:45 +0200
 
diff --git a/debian/control b/debian/control
index b3e9b93..9debe6c 100644
--- a/debian/control
+++ b/debian/control
@@ -3,8 +3,9 @@ Section: science
 Priority: optional
 Maintainer: Debian Med Packaging Team <debian-med-packaging at lists.alioth.debian.org>
 Uploaders: Dylan Aïssi <bob.dybian at gmail.com>
-Build-Depends: debhelper (>= 9),
+Build-Depends: debhelper (>= 9.20160709),
  dh-python,
+ dh-sysuser,
  python3,
  python3-setuptools,
  python3-usb (>= 1.0.0~b2),
@@ -35,3 +36,22 @@ Description: Utility to securely synchronize a Fitbit device with the Fitbit web
   - Fitbit Charge
   - Fitbit Charge HR
 
+Package: galileo-daemon
+Architecture: all
+Depends: ${misc:Depends},
+ galileo (= ${binary:Version})
+Description: Utility to securely synchronize a Fitbit device - daemon
+ Galileo is a Python utility to securely synchronize a Fitbit device with the
+ Fitbit web service. It allows you to browse your data on their website, and
+ compatible applications. The main features of Galileo are: Synchronize your
+ fitbit tracker with the fitbit server using the provided dongle; Securely
+ communicate (using HTTPS) with the fitbit server; Save all your dumps locally
+ for possible later analyse. Galileo supports the following trackers:
+  - Fitbit One
+  - Fitbit Zip
+  - Fitbit Flex
+  - Fitbit Force
+  - Fitbit Charge
+  - Fitbit Charge HR
+ .
+ This package installs galileo as a systemd daemon.
diff --git a/debian/galileo-daemon.install b/debian/galileo-daemon.install
new file mode 100644
index 0000000..7317603
--- /dev/null
+++ b/debian/galileo-daemon.install
@@ -0,0 +1 @@
+debian/galileorc etc/ 
diff --git a/debian/galileo-daemon.service b/debian/galileo-daemon.service
new file mode 100644
index 0000000..2d9479f
--- /dev/null
+++ b/debian/galileo-daemon.service
@@ -0,0 +1,16 @@
+# Unit file for Galileo
+#
+# See systemd.service(5) for further information.
+
+[Unit]
+Description=Synchronisation utility for Bluetooth LE-based Fitbit trackers
+Documentation=man:galileo(1) man:galileorc(5)
+Documentation=https://bitbucket.org/benallard/galileo
+After=network.target
+
+[Service]
+User=galileo
+ExecStart=/usr/bin/galileo --config /etc/galileorc daemon
+
+[Install]
+WantedBy=network.target
diff --git a/debian/galileo-daemon.udev b/debian/galileo-daemon.udev
new file mode 100644
index 0000000..2dea93b
--- /dev/null
+++ b/debian/galileo-daemon.udev
@@ -0,0 +1,7 @@
+# These udev rules are for the Fitbit Bluetooth-LE USB synchronization dongle which is
+# used by Galileo to securely synchronize a Fitbit device with the Fitbit web service.
+
+# This file (99-galileo-daemon.rules) is installed by the package "galileo-daemon".
+# The rule below disable the rule in the file "98-galileo.rules" and it allow to run galileo as a daemon under the "galileo" account.
+
+SUBSYSTEM=="usb", ATTR{idVendor}=="2687", ATTR{idProduct}=="fb01", SYMLINK+="fitbit", MODE="0660", OWNER="galileo"
diff --git a/debian/galileo.docs b/debian/galileo.docs
index 71dfd5b..756681c 100644
--- a/debian/galileo.docs
+++ b/debian/galileo.docs
@@ -1 +1,2 @@
 README.txt
+debian/NEWS.Debian
diff --git a/debian/galileo.examples b/debian/galileo.examples
index 9e51112..8feb178 100644
--- a/debian/galileo.examples
+++ b/debian/galileo.examples
@@ -1,5 +1,2 @@
-# Example files to run Galileo as a daemon
-contrib/*
-
 # Example configuration file for Galileo
-galileorc.sample
\ No newline at end of file
+galileorc.sample
diff --git a/debian/galileo.udev b/debian/galileo.udev
index 5d204a5..e5deb28 100644
--- a/debian/galileo.udev
+++ b/debian/galileo.udev
@@ -1,11 +1,11 @@
 # These udev rules are for the Fitbit Bluetooth-LE USB synchronization dongle which is
 # used by Galileo to securely synchronize a Fitbit device with the Fitbit web service.
 
-# Please do not activate these rules at the same time!
-# In the opposite case, only the last rule will be activated!
+# This file (98-galileo.rules) is installed by the package "galileo".
+# The rule below allow to run galileo as a non-privileged user and not as a daemon.
 
-# Rule for running galileo as a non-privileged user and not as a daemon.
 SUBSYSTEM=="usb", ATTR{idVendor}=="2687", ATTR{idProduct}=="fb01", SYMLINK+="fitbit", MODE="0666"
 
-# Rule for running galileo as a daemon under the "galileo" account.
-#SUBSYSTEM=="usb", ATTR{idVendor}=="2687", ATTR{idProduct}=="fb01", SYMLINK+="fitbit", MODE="0660", OWNER="galileo", GROUP="galileo"
+# The package "galileo-daemon" install another rule with a higher priority (99-galileo-daemon.rules).
+# The rule in the file (99-galileo-daemon.rules) will disable the rule above.
+# This new rule allow to run galileo as a daemon under the "galileo" account.
diff --git a/debian/galileorc b/debian/galileorc
new file mode 100644
index 0000000..8710d31
--- /dev/null
+++ b/debian/galileorc
@@ -0,0 +1,18 @@
+# Default settings for galileo.py. Settings may be changed here or
+# overridden using command-line switches to galileo.py.
+
+# if in daemon mode, delay between sync runs
+# specified in milliseconds
+daemon-period: 900000
+
+# keep dump files
+keep-dumps: false
+
+# upload data to Fitbit
+do-upload: true
+
+# logging (default/verbose/debug)
+logging: verbose
+
+# synchronize even if trackers were recently synchronized
+force-sync: false
diff --git a/debian/rules b/debian/rules
index 911c335..b938b74 100755
--- a/debian/rules
+++ b/debian/rules
@@ -1,13 +1,21 @@
 #!/usr/bin/make -f
 
-export PYBUILD_NAME=galileo
 export LC_ALL=C.UTF-8
+export PYBUILD_NAME=galileo
+export PYBUILD_DESTDIR_python3=debian/galileo/
 
 %:
-	dh $@ --with python3 --buildsystem=pybuild
+	dh $@ --with python3,systemd,sysuser --buildsystem=pybuild
+
+override_dh_sysuser:
+	dh_sysuser -pgalileo-daemon galileo
 
 override_dh_installudev:
-	dh_installudev -pgalileo --name=galileo --priority=98
+	dh_installudev -pgalileo --priority=98
+	dh_installudev -pgalileo-daemon --priority=99
+
+override_dh_installinit:
+	dh_installinit --noscripts
 
 get-orig-source-git-snapshot:
 	wget https://bitbucket.org/benallard/galileo/get/tip.tar.gz

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-med/galileo.git



More information about the debian-med-commit mailing list