summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorLouis Opter2015-09-13 18:38:36 -0700
committerLouis Opter2015-09-13 18:38:36 -0700
commitb67dadfd5108ec8f67a7ea2f96a67ad2725be18c (patch)
treec51a815cab28cd9f8fc5d267e51d432f92964ddf
parentefd732062455746eed3b7f300fca6dcd49d42a4b (diff)
downloadaur-b67dadfd5108ec8f67a7ea2f96a67ad2725be18c.tar.gz
lightsd 0.9.2
lightsd now know how to drop privileges, so let's create an user/group for it. This allows us to integrate more nicely with systemd.
-rw-r--r--.SRCINFO10
-rw-r--r--PKGBUILD15
-rw-r--r--lightsd.install22
3 files changed, 36 insertions, 11 deletions
diff --git a/.SRCINFO b/.SRCINFO
index b841774aa129..0687a8b868b5 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,19 +1,19 @@
pkgbase = lightsd
pkgdesc = Daemon to control your LIFX smart bulbs via a JSON-RPC API
- pkgver = 0.9.1
- pkgrel = 4
+ pkgver = 0.9.2
+ pkgrel = 1
epoch = 1
url = https://www.github.com/lopter/lightsd/
+ install = lightsd.install
arch = i686
arch = x86_64
license = GPL3
makedepends = cmake>=2.8.11
depends = libevent>=2.0.19
- depends = libbsd>=0.5.0
optdepends = python: to run the interactive lightsc.py example client
optdepends = ipython: makes lightsc.py more user-friendly
- source = https://github.com/lopter/lightsd/archive/0.9.1.tar.gz
- sha256sums = 72eba6074ed18609fb0caf7b7429e1b8f6c3564ca6f81357be22c06ac00956b6
+ source = https://github.com/lopter/lightsd/archive/0.9.2.tar.gz
+ sha256sums = 2d785ede7c2e3b603ad33c11c3e44b5c634ee17e745d39296125025eddbbf420
pkgname = lightsd
diff --git a/PKGBUILD b/PKGBUILD
index 340c7d75af4d..f4f43d764112 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -1,29 +1,32 @@
# Maintainer: Louis Opter <kalessin@kalessin.fr>
pkgname=lightsd
-pkgver=0.9.1
-pkgrel=4
+pkgver=0.9.2
+pkgrel=1
epoch=1
pkgdesc="Daemon to control your LIFX smart bulbs via a JSON-RPC API"
arch=("i686" "x86_64")
url="https://www.github.com/lopter/lightsd/"
license=("GPL3")
-depends=("libevent>=2.0.19" "libbsd>=0.5.0")
+depends=("libevent>=2.0.19")
optdepends=(
"python: to run the interactive lightsc.py example client"
"ipython: makes lightsc.py more user-friendly"
)
makedepends=("cmake>=2.8.11")
source=("https://github.com/lopter/lightsd/archive/${pkgver}.tar.gz")
-sha256sums=("72eba6074ed18609fb0caf7b7429e1b8f6c3564ca6f81357be22c06ac00956b6")
+sha256sums=("2d785ede7c2e3b603ad33c11c3e44b5c634ee17e745d39296125025eddbbf420")
+#source=("src/${pkgname}-${pkgver}::hg+file:///home/kal/projs/lightsd")
+#sha256sums="SKIP"
+install=lightsd.install
build() {
cd "$srcdir/$pkgname-$pkgver"
- cmake \
+ cmake . \
-DCMAKE_BUILD_TYPE=RELEASE \
-DCMAKE_INSTALL_PREFIX=/usr \
- .
+ -DLGTD_RUNTIME_DIRECTORY=/run/lightsd
make
}
diff --git a/lightsd.install b/lightsd.install
new file mode 100644
index 000000000000..8917fb8f0dee
--- /dev/null
+++ b/lightsd.install
@@ -0,0 +1,22 @@
+post_install() {
+ getent group lightsd >/dev/null || groupadd -r lightsd
+ getent passwd lightsd >/dev/null || useradd -r -d / -g lightsd lightsd
+
+ cat << 'EOF'
+
+lightsd runs under the `lightsd' user and group by default; add yourself to
+this group to be able to open lightsd's socket and pipe under /run/lightsd:
+
+ gpasswd -a $USER lightsd
+
+Re-open your current desktop or ssh session for the change to take effect.
+Then use systemctl to start lightsd; you can start playing with lightsd with:
+
+ `lightsd --prefix`/share/doc/lightsd/examples/lightsc.py
+
+EOF
+}
+
+post_remove() {
+ getent passwd lightsd >/dev/null && userdel lightsd
+}