summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorGoliathLabs2020-06-09 13:18:31 +0200
committerGoliathLabs2020-06-09 13:18:31 +0200
commit4198e37a18edc76e267cadd9ba9159df4ee05001 (patch)
treec97f6ce3fb1facd53d908f52c9f206099e81350f
parentede2f74eda4214db394d296dc9838ac8d547a539 (diff)
downloadaur-4198e37a18edc76e267cadd9ba9159df4ee05001.tar.gz
Updated: PKGBUILD + service + sysusers
-rw-r--r--.SRCINFO10
-rw-r--r--PKGBUILD46
-rw-r--r--homebridge-system.service8
-rw-r--r--homebridge-user.service6
-rw-r--r--homebridge.install9
-rw-r--r--homebridge.sysusers2
6 files changed, 45 insertions, 36 deletions
diff --git a/.SRCINFO b/.SRCINFO
index 9840d9cb910..c3e97ca3184 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,6 +1,6 @@
pkgbase = homebridge-git
pkgdesc = HomeKit support for the impatient
- pkgver = 0.4.53.r9.g8a2a122
+ pkgver = 0.4.46.r222.g721ff2c
pkgrel = 1
url = https://github.com/nfarina/homebridge
install = homebridge.install
@@ -17,11 +17,13 @@ pkgbase = homebridge-git
source = git+https://github.com/nfarina/homebridge.git
source = homebridge-system.service
source = homebridge-user.service
+ source = homebridge.sysusers
source = homebridge.install
sha512sums = SKIP
- sha512sums = 56eb3b04e0a84753b98cfd91a2f3b96d33e20639e3b38faa1c0388fcf55025ea8776efee6723b61b2ad8bc55689708f2fce5f6387eb3e23429b9feac44e521d1
- sha512sums = b9ea4a2597b54eb3bfa427d48bb5bb807c4b629bd07c73501a3778fcc8ddbc4cba3f1557f55fc76d40d5085cf73e54b11cc631d1962814641a17242487440468
- sha512sums = de43f228bdfbf88ec92adaa46a32c772c6bb1f265899d56c4e9a70b2e9bd3381f45be0345b1bd55e8ec2f3b61fa1f903d823162293464b3e1b43aab8b772b6dd
+ sha512sums = 16f923855946b1ff7fd6b70da035a304634c7dd42bd2e86c5877718fd5e3a22a7177fd8d850e7ffa4826cdd2fc2b30f727bd182809ddb9faade626f87ed792bc
+ sha512sums = 2fc28db38b231caf8021bd6109e1c4cee65dd68e2128e9f2bfe712fd61867328dd6b6be642a6431b2c92657a5e7f23991be8dcf1ea0c23e3cfa120341ee090bc
+ sha512sums = 18277a981c2e6f68ed6433d9afc89fb59019b763c253dd135bb3662baba2185245a7eb476b3eed36f5458386447ed766b89dd0e307c5c1ab277900a01c625c7d
+ sha512sums = 20e373e99d814ea23b5fa0c966cafdc7e8bf116443c475d08870bffc36027ae512fa2e0c6996802f04e9703a9df52bacf2e25ecadb04b137c798524e50e6817d
pkgname = homebridge-git
diff --git a/PKGBUILD b/PKGBUILD
index c134c0d029b..8f757e64db1 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -1,8 +1,9 @@
-# Maintainer: ahrs <Forward dot to at hotmail dot co dot uk>
+# Maintainer: Felix Golatofski <contact@xdfr.de>
+# Contributor: ahrs <Forward dot to at hotmail dot co dot uk>
-pkgname=homebridge-git
-_gitname=homebridge
-pkgver=0.4.53.r9.g8a2a122
+_pkgname=homebridge
+pkgname=$_pkgname-git
+pkgver=0.4.46.r222.g721ff2c
pkgrel=1
pkgdesc="HomeKit support for the impatient"
arch=('any')
@@ -19,39 +20,44 @@ conflicts=('homebridge')
options=(!emptydirs)
source=(
"git+${url}.git"
- "${_gitname}-system.service"
- "${_gitname}-user.service"
- "${_gitname}.install"
+ "${_pkgname}-system.service"
+ "${_pkgname}-user.service"
+ "${_pkgname}.sysusers"
+ "${_pkgname}.install"
)
sha512sums=('SKIP'
- '56eb3b04e0a84753b98cfd91a2f3b96d33e20639e3b38faa1c0388fcf55025ea8776efee6723b61b2ad8bc55689708f2fce5f6387eb3e23429b9feac44e521d1'
- 'b9ea4a2597b54eb3bfa427d48bb5bb807c4b629bd07c73501a3778fcc8ddbc4cba3f1557f55fc76d40d5085cf73e54b11cc631d1962814641a17242487440468'
- 'de43f228bdfbf88ec92adaa46a32c772c6bb1f265899d56c4e9a70b2e9bd3381f45be0345b1bd55e8ec2f3b61fa1f903d823162293464b3e1b43aab8b772b6dd')
+ '16f923855946b1ff7fd6b70da035a304634c7dd42bd2e86c5877718fd5e3a22a7177fd8d850e7ffa4826cdd2fc2b30f727bd182809ddb9faade626f87ed792bc'
+ '2fc28db38b231caf8021bd6109e1c4cee65dd68e2128e9f2bfe712fd61867328dd6b6be642a6431b2c92657a5e7f23991be8dcf1ea0c23e3cfa120341ee090bc'
+ '18277a981c2e6f68ed6433d9afc89fb59019b763c253dd135bb3662baba2185245a7eb476b3eed36f5458386447ed766b89dd0e307c5c1ab277900a01c625c7d'
+ '20e373e99d814ea23b5fa0c966cafdc7e8bf116443c475d08870bffc36027ae512fa2e0c6996802f04e9703a9df52bacf2e25ecadb04b137c798524e50e6817d')
-install="${_gitname}.install"
+install="${_pkgname}.install"
pkgver() {
- cd "${srcdir}/${_gitname}"
- git describe --long --tags | sed -r 's/^v//;s/([^-]*-g)/r\1/;s/-/./g'
+ cd "${srcdir}/${_pkgname}"
+ # cutting off 'v' prefix that presents in the git tag
+ git describe --long | sed 's/^v//;s/\([^-]*-g\)/r\1/;s/-/./g'
}
prepare() {
cd "${srcdir}"
# Fix error with npm5 issue
- tar -czf homebridge.tar.gz homebridge
+ tar -czf homebridge.tgz homebridge
}
package() {
- cd "${srcdir}/${_gitname}"
+ cd "${srcdir}/${_pkgname}"
- install -Dm644 LICENSE -t "${pkgdir}/usr/share/licenses/${_gitname}"
- npm install --cache ../cache --user root -g --prefix "${pkgdir}/usr" ../*.tar.gz
+ install -Dm644 LICENSE -t "${pkgdir}/usr/share/licenses/${_pkgname}"
+ npm install -g --user root --prefix "$pkgdir"/usr "$srcdir"/$_pkgname.tgz
- [ -z "$HOMEBRIDGE_KEEP_GIT_HISTORY" ] && rm -rf "${pkgdir}/usr/lib/node_modules/${_gitname}/.git"
+ [ -z "$HOMEBRIDGE_KEEP_GIT_HISTORY" ] && rm -rf "${pkgdir}/usr/lib/node_modules/${_pkgname}/.git"
+
+ install -Dm644 "${srcdir}/${_pkgname}-system.service" "$pkgdir/usr/lib/systemd/system/${_pkgname}.service"
+ install -Dm644 "${srcdir}/${_pkgname}-user.service" "$pkgdir/usr/lib/systemd/user/${_pkgname}.service"
+ install -Dm644 "${srcdir}/${_pkgname}.sysusers" "$pkgdir/usr/lib/sysusers.d/${_pkgname}.conf"
- install -D -m644 "${srcdir}/${_gitname}-system.service" "$pkgdir/usr/lib/systemd/system/${_gitname}.service"
- install -D -m644 "${srcdir}/${_gitname}-user.service" "$pkgdir/usr/lib/systemd/user/${_gitname}.service"
}
# vim:set ts=2 sw=2 et:
diff --git a/homebridge-system.service b/homebridge-system.service
index df41d0567bb..ecb5a9ddf49 100644
--- a/homebridge-system.service
+++ b/homebridge-system.service
@@ -1,12 +1,14 @@
[Unit]
Description=Node.js HomeKit Server
-Requires=avahi-daemon.service
+Requires=network.target avahi-daemon.service
After=network.target avahi-daemon.service
[Service]
-User=homebridge
Type=simple
ExecStart=/usr/bin/homebridge -U /var/lib/homebridge
+User=homebridge
+Group=homebridge
+Restart=always
[Install]
-WantedBy=multi-user.target
+WantedBy=default.target
diff --git a/homebridge-user.service b/homebridge-user.service
index f7b0ca1f797..d0295dee0ae 100644
--- a/homebridge-user.service
+++ b/homebridge-user.service
@@ -1,8 +1,14 @@
[Unit]
Description=Node.js HomeKit Server
+Requires=network.target
+After=network.target
[Service]
+Type=simple
ExecStart=/usr/bin/homebridge -U %h/.homebridge
+User=homebridge
+Group=homebridge
+Restart=always
[Install]
WantedBy=default.target
diff --git a/homebridge.install b/homebridge.install
index 77f8cac0458..ead9914727b 100644
--- a/homebridge.install
+++ b/homebridge.install
@@ -1,10 +1,6 @@
_NAME=homebridge
post_install() {
- mkdir -p /var/lib/${_NAME}
- getent passwd ${_NAME} > /dev/null || useradd -d /var/lib/${_NAME} -s /bin/false -r ${_NAME} > /dev/null
- chown -R ${_NAME}:${_NAME} /var/lib/${_NAME}
-
echo ""
echo "A sample configuration file is provided at /usr/lib/node_modules/homebridge/config-sample.json"
echo "Copy this to /var/lib/${_NAME}/config.json and edit accordingly"
@@ -22,8 +18,3 @@ post_install() {
post_upgrade() {
post_install
}
-
-post_remove() {
- echo "Some files have not been removed because they are created by ${_NAME} itself."
- userdel -f ${_NAME}
-}
diff --git a/homebridge.sysusers b/homebridge.sysusers
new file mode 100644
index 00000000000..79f3a13131a
--- /dev/null
+++ b/homebridge.sysusers
@@ -0,0 +1,2 @@
+g homebridge /var/lib/homebridge
+u homebridge - "homebridge user" /var/lib/homebridge /bin/false