summaryrefslogtreecommitdiff
path: root/pcr/openrc-accessible/PKGBUILD
blob: a1d1ca21d0fdfd592edc5b378fda590ddda64da3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
# Maintainer (Manjaro): artoo <artoo@manjaro.org>
# Maintainer: Omar Vega Ramos <ovruni@gnu.org.pe>

_url="https://raw.githubusercontent.com/gentoo/gentoo/master"

pkgbase=openrc-accessible
pkgname=('brltty-openrc'
        'espeakup-openrc')
pkgver=20160823
pkgrel=1
pkgdesc="OpenRC init scripts"
arch=('any')
url="https://github.com/manjaro/packages-openrc"
license=('GPL2')
groups=('openrc-accessible')
conflicts=('systemd-sysvcompat')
source=("brltty.initd::${_url}/app-accessibility/brltty/files/brltty.rc"
        "espeakup.confd::${_url}/app-accessibility/espeakup/files/espeakup.confd"
        "espeakup.initd::${_url}/app-accessibility/espeakup/files/espeakup.rc")
sha256sums=('df59d6b7b884207c09a098188b8418944581c47ed19a1fac9725f847e4281e7f'
            '32e6de11417ebb199a7bf46eb8cf77054b1af1c9f4bcc80b856b34758830eb9f'
            'ac7ea45ed050ba60b618e60c76b3c8c79496f7b837a34246ed328230cf5934cf')

pkgver() {
	date +%Y%m%d
}

_inst_initd(){
	install -Dm755 ${srcdir}/$1.initd ${pkgdir}/etc/init.d/$1

	sed -e 's|#!/sbin/runscript|#!/usr/bin/openrc-run|' \
            -e 's|#!/sbin/openrc-run|#!/usr/bin/openrc-run|' \
		-e 's|/var/run|/run|g' \
		-e 's|/usr/sbin|/usr/bin|g' \
		-i ${pkgdir}/etc/init.d/$1
}

_inst_confd(){
	install -Dm755 ${srcdir}/$1.confd ${pkgdir}/etc/conf.d/$1
}

package_espeakup-openrc() {
	pkgdesc="OpenRC espeakup init script"
	depends=('openrc' 'espeakup')
	optdepends=('alsa-utils-openrc: alsa support')
	backup=('etc/conf.d/espeakup')

	_inst_confd 'espeakup'
	_inst_initd 'espeakup'
}

package_brltty-openrc() {
	pkgdesc="OpenRC brltty init script"
	depends=('openrc' 'brltty')

	_inst_initd 'brltty'

	sed -e 's|/bin/brltty|/usr/bin/brltty|' \
		-i "${pkgdir}/etc/init.d/brltty"
}