diff options
author | everyx | 2022-12-05 16:07:36 +0800 |
---|---|---|
committer | everyx | 2022-12-05 16:07:36 +0800 |
commit | 6e4383b069b4471bfef7b5bb75a9fe5823c40c81 (patch) | |
tree | 83fa0aef5df2cfd39711c5013cc2900b62405d62 /PKGBUILD | |
parent | 55ed14d729aabc872c89dade35807a0eb4f45f9c (diff) | |
download | aur-6e4383b069b4471bfef7b5bb75a9fe5823c40c81.tar.gz |
fix: systemd WorkingDirectory
Diffstat (limited to 'PKGBUILD')
-rw-r--r-- | PKGBUILD | 15 |
1 files changed, 8 insertions, 7 deletions
@@ -2,7 +2,7 @@ pkgname=sing-box pkgver=1.1 -pkgrel=3 +pkgrel=4 pkgdesc='The universal proxy platform.' arch=('x86_64' 'i686') @@ -18,11 +18,11 @@ conflicts=("${pkgname}-git" "${pkgname}-beta") optdepends=('sing-geosite: sing-geosite database' 'sing-geoip: sing-geoip database') -backup=('etc/sing-box/config.json') +backup=("etc/${pkgname}/config.json") _tags=with_gvisor,with_quic,with_wireguard,with_utls,with_clash_api build(){ - cd $pkgname-$pkgver + cd "$pkgname-$pkgver" export CGO_CPPFLAGS="${CPPFLAGS}" export CGO_CFLAGS="${CFLAGS}" @@ -39,18 +39,19 @@ build(){ -ldflags '-linkmode=external -w -s' \ ./cmd/sing-box - sed -i '/^\[Service\]$/a User=sing-box' release/config/${pkgname}*.service + sed -i "/^\[Service\]$/a User=${pkgname} + s/WorkingDirectory=\(.*\)$/WorkingDirectory=-\1\nExecStartPre=+install -o ${pkgname} -g ${pkgname} -d -m 0700 \1/" release/config/${pkgname}*.service - echo 'u sing-box - "Sing-box Service" - -' > release/config/${pkgname}.sysusers + echo "u ${pkgname} - \"Sing-box Service\" - -" > "release/config/${pkgname}.sysusers" } package() { - cd $pkgname-$pkgver + cd "$pkgname-$pkgver" install -Dm755 "${pkgname}" -t "${pkgdir}/usr/bin" install -Dm644 "LICENSE" -t "${pkgdir}/usr/share/licenses/${pkgname}" install -Dm644 "release/config/config.json" -t "${pkgdir}/etc/${pkgname}" install -Dm644 "release/config/${pkgname}.service" -t "${pkgdir}/usr/lib/systemd/system" install -Dm644 "release/config/${pkgname}@.service" -t "${pkgdir}/usr/lib/systemd/system" - install -Dm644 "release/config/${pkgname}.sysusers" "${pkgdir}/usr/lib/sysusers.d//${pkgname}.conf" + install -Dm644 "release/config/${pkgname}.sysusers" "${pkgdir}/usr/lib/sysusers.d/${pkgname}.conf" } |