summary history branches tags files
commit:393bb2549f39563997fcf9ffa1903c57d5ef09aa
author:Trevor Bentley
committer:Trevor Bentley
date:Wed Nov 15 22:16:25 2017 +0100
parents:63947ce2cc780e339158e7334d5244dc43f0e991
systemd service file and support for debian packaging with cargo-deb
diff --git a/Cargo.toml b/Cargo.toml
line changes: +18/-0
index cb5d2e9..1d6bdee
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -10,6 +10,24 @@ repository = "https://github.com/mrmekon/circadian"
 documentation = "https://github.com/mrmekon/circadian"
 license = "GPL-3.0"
 
+[package.metadata.deb]
+maintainer = "Trevor Bentley <trevor@trevorbentley.com>"
+copyright = "Copyright 2017 Trevor Bentley"
+license-file = ["LICENSE"]
+extended-description = """\
+Circadian is a power management daemon for automatically suspending machines \
+when they are idle, and optionally waking them back up at set times."""
+depends = "$auto, systemd"
+revision = "1"
+section = "admin"
+priority = "optional"
+assets = [
+       ["target/release/circadian", "usr/bin/", "755"],
+       ["resources/circadian.conf.in", "etc/circadian.conf", "644"],
+       ["resources/circadian.service", "etc/systemd/system/", "644"],
+]
+
+
 [profile.release]
 lto = true
 

diff --git a/resources/circadian.service b/resources/circadian.service
line changes: +11/-0
index 0000000..3e7338e
--- /dev/null
+++ b/resources/circadian.service
@@ -0,0 +1,11 @@
+[Unit]
+Description=Circadian power management service
+
+[Service]
+Type=simple
+User=root
+ExecStart=/usr/bin/circadian
+Restart=on-failure
+
+[Install]
+WantedBy=multi-user.target