summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorBruno Pagani2017-01-11 00:15:11 +0100
committerBruno Pagani2017-01-11 00:15:38 +0100
commitbb94ae1cfcdbfcc8bfd30ba0e407eee519c340f2 (patch)
treec3c3bb1c032c0336ffa4d58e96804902519d504f
parent111ad48b7c129a53f0ca77db5f5c1cbcba0f297c (diff)
downloadaur-bb94ae1cfcdbfcc8bfd30ba0e407eee519c340f2.tar.gz
Move systemd unit file changes into prepare()
Thanks to anthraxx for this cleaner suggestion. Also make them a one liner thanks to Eli Schwartz suggestion.
-rw-r--r--PKGBUILD9
1 files changed, 6 insertions, 3 deletions
diff --git a/PKGBUILD b/PKGBUILD
index 2d21fd82aedc..34b0edfd2d0d 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -25,6 +25,12 @@ sha256sums=('48e9dde0f5c22dc26ff36e8d13e3dc575a1ee7558b5537a064f78a3b9dee1619'
'f40f68205834ca53cea3372e930bfe6c2f9ecc9df3b1605df2fec63a658b2e03')
validpgpkeys=('0392335A78083894A4301C43236E8A58C6DB4512') # Max Kellermann <max@musicpd.org>
+prepare() {
+ cd ${_pkgname}-${pkgver}
+
+ sed -e '/\[Service\]/a User=mpd' -e '/WantedBy=/c WantedBy=default.target' -i systemd/system/${_pkgname}.service.in
+}
+
build() {
cd ${_pkgname}-${pkgver}
@@ -113,7 +119,4 @@ package() {
install -Dm644 "${srcdir}"/${_pkgname}.conf "${pkgdir}"/etc/${_pkgname}.conf
install -Dm644 "${srcdir}"/${_pkgname}.tmpfiles "${pkgdir}"/usr/lib/tmpfiles.d/${_pkgname}.conf
install -Dm644 "${srcdir}"/${_pkgname}.sysusers "${pkgdir}"/usr/lib/sysusers.d/${_pkgname}.conf
-
- sed '/\[Service\]/a User=mpd' -i "${pkgdir}"/usr/lib/systemd/system/${_pkgname}.service
- sed '/WantedBy=/c WantedBy=default.target' -i "${pkgdir}"/usr/lib/systemd/system/${_pkgname}.service
}