summaryrefslogtreecommitdiff
path: root/pcr/openrc-base/PKGBUILD
blob: 1c2440f482ef3b8a917460127b83f58bd63d8f51 (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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
# Maintainer (Manjaro): artoo <artoo@manjaro.org>
# Maintainer: Omar Vega Ramos <ovruni@gnu.org.pe>

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

_uscript_ver=30

pkgbase=openrc-base
pkgname=('cronie-openrc'
        'cryptsetup-openrc'
        'dhcpcd-openrc'
        'device-mapper-openrc'
        'glibc-openrc'
        'inetutils-openrc'
        'lvm2-openrc'
        'mdadm-openrc'
        'udev-openrc')
        #'dbus-openrc')
pkgver=20151014
pkgrel=1
pkgdesc="OpenRC init scripts"
arch=('any')
url="https://github.com/manjaro/packages-openrc"
license=('GPL2')
groups=('openrc-base')
conflicts=('systemd-sysvcompat')
source=("cronie.initd::${_gentoo_uri}/sys-process/cronie/files/cronie-1.3-initd"
		"dmcrypt.confd::${_gentoo_uri}/sys-fs/cryptsetup/files/1.6.7-dmcrypt.confd"
		"dmcrypt.initd::${_gentoo_uri}/sys-fs/cryptsetup/files/1.6.7-dmcrypt.rc"
		"nscd.initd::${_gentoo_uri}/sys-libs/glibc/files/nscd"
		"device-mapper.confd::${_gentoo_uri}/sys-fs/lvm2/files/device-mapper.conf-1.02.22-r3"
		"device-mapper.initd::${_gentoo_uri}/sys-fs/lvm2/files/device-mapper.rc-2.02.105-r2"
		"dmeventd.initd::${_gentoo_uri}/sys-fs/lvm2/files/dmeventd.initd-2.02.67-r1"
		"lvm.confd::${_gentoo_uri}/sys-fs/lvm2/files/lvm.confd-2.02.28-r2"
		"lvm.initd::${_gentoo_uri}/sys-fs/lvm2/files/lvm.rc-2.02.105-r2"
		"lvm-monitoring.initd::${_gentoo_uri}/sys-fs/lvm2/files/lvm-monitoring.initd-2.02.105-r2"
		"lvmetad.initd::${_gentoo_uri}/sys-fs/lvm2/files/lvmetad.initd-2.02.105-r2"
		"mdadm.confd::${_gentoo_uri}/sys-fs/mdadm/files/mdadm.confd"
		"mdadm.initd::${_gentoo_uri}/sys-fs/mdadm/files/mdadm.rc"
		"mdraid.confd::${_gentoo_uri}/sys-fs/mdadm/files/mdraid.confd"
		"mdraid.initd::${_gentoo_uri}/sys-fs/mdadm/files/mdraid.rc"
		"dhcpcd.initd::${_gentoo_uri}/net-misc/dhcpcd/files/dhcpcd.initd"
		'ftpd.confd'
		'ftpd.initd'
		"http://dev.gentoo.org/~williamh/dist/udev-init-scripts-${_uscript_ver}.tar.gz"
		"kmod-static-nodes.initd::${_gentoo_uri}/sys-apps/kmod/files/kmod-static-nodes-r1")
		#"dbus.initd::${_gentoo_uri}/sys-apps/dbus/files/dbus.initd")
sha256sums=('316753fd55bcc196aaee034f14a25f2324545749bf7bdd44fd3762d11ab18d05'
            '3d933a54abe62a547294b83208dbf5d7615d9c7f380d6504c91fff3620530803'
            'd0a55d31c713bbddf7d05634018623586e69d43281bc5019b5b821a745f9a57f'
            '7da9311c50f432d425549288288e0952d50e08644a06af6b8e2f886039f682fe'
            '57777904f12a35617e5a4193c964ebb32396452487fd02353e71e16e7b46bc22'
            'eb5c194b5e70a6fef95d5b1064771e37384d0972494a500fc22c3265eb9064e4'
            '63e45f4a86c9c0be27d455999289f0dd62d912c04f12a38e3fa0257fafe293fb'
            '28370c089c39c248d7ded0960b8d8a9256bada44d44c22ce3cec87d512ef6844'
            '53aaa87749be5cc89942e2485ea76491e3f2ca98de4f9a392fac4cd88c87f548'
            '258b913654312e39ab8db4aa43584cbeee8d654621f357810e6dac744312fb62'
            '84fe3d786652a0d73f3626923feffa1fcb0a0b0054260cb5f73b0485d99fa168'
            'ec55674955af7a31da51b8b72b599e8519809287dad796a9b16155bcba471b79'
            'b686fbc31b85a9dbf2f8569ce9158858e7f96a0ee02b21f68c36cb38eedbf927'
            'b489ced10391d4295bb8ca29e128b0d4217c290f1b4e37b05f5a9275048d289d'
            '9681b6bc6358dd80f6add0a115faa0113afa2be1784de4e07dbf31c460ac4252'
            '72b42c9939fda3fb56666813513029ed36194c1708bddce06bcb3e131e547492'
            '59fe1aa68c43f4958afc397a0d6b35da263a20fcdb457005123a0d64cb1f7477'
            '7f46e5e9ac9f204fb1564560c506a5bb4cede8823b89e3f1844e4f8be258e9ef'
            '4de998d68e28f8ce4c1d4c9955aec0fa4cfe84673cbf3bfe1be71a1e9918693f'
            'b9452437b06aae67e19e2cade37e89398ab5a7162318e15d1ed083606b1fe7e0')

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' \
            -i ${pkgdir}/etc/init.d/$1
}

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

package_cronie-openrc() {
	pkgdesc="OpenRC cronie init script"
	groups=('openrc-base' 'openrc-desktop')
	depends=('openrc' 'cronie')
	provides=('openrc-cron')
	conflicts=('fcron'
                    'fcron-openrc'
                    'systemd-sysvcompat')
	backup=('etc/init.d/cronie')
	install=cronie.install

	_inst_initd 'cronie'

	sed -e 's|/usr/sbin|/usr/bin|g' -i ${pkgdir}/etc/init.d/cronie
}

# package_dbus-openrc() {
#     pkgdesc="OpenRC dbus init script"
#     groups=('openrc-base' 'openrc-desktop')
#     depends=('openrc' 'dbus')
#     install=dbus.install
#
#     _inst_initd 'dbus'
#
#     sed -e 's|dbus.pid|dbus/pid|g' -i "${pkgdir}/etc/init.d/dbus"
# }

package_dhcpcd-openrc() {
	pkgdesc="OpenRC dhcpcd init script"
	groups=('openrc-base' 'openrc-desktop')
	depends=('openrc' 'dhcpcd')
	install=dhcpcd.install

	_inst_initd 'dhcpcd'

	sed -e 's|/sbin|/usr/bin|g' -i "${pkgdir}/etc/init.d/dhcpcd"
}

package_device-mapper-openrc() {
	pkgdesc="OpenRC device-mapper init script"
	depends=('openrc' 'device-mapper')
	backup=('etc/conf.d/device-mapper')
	install=device-mapper.install

	_inst_confd 'device-mapper'
	_inst_initd 'device-mapper'
	_inst_initd 'dmeventd'

	for f in ${pkgdir}/etc/init.d/*; do
		sed -e 's|/sbin|/usr/bin|g' -i $f
	done
}

package_cryptsetup-openrc() {
	pkgdesc="OpenRC cryptsetup init script"
	depends=('device-mapper-openrc' 'cryptsetup')
	backup=('etc/conf.d/dmcrypt')
	install=cryptsetup.install

	_inst_confd 'dmcrypt'
	_inst_initd 'dmcrypt'

	sed -e 's|/usr/sbin|/usr/bin|g' -i "${pkgdir}/etc/init.d/dmcrypt"
}

package_glibc-openrc() {
	pkgdesc="OpenRC nscd init script"
	depends=('openrc' 'glibc')
	optdepends=('openldap-openrc'
			'bind-openrc')
	install=glibc.install

	_inst_initd 'nscd'

	sed -e 's|/usr/sbin|/usr/bin|g' -i "${pkgdir}/etc/init.d/nscd"
}

package_inetutils-openrc() {
	pkgdesc="OpenRC ftpd init script"
	depends=('openrc' 'inetutils')
	backup=('etc/conf.d/ftpd')
	install=inetutils.install

	_inst_confd 'ftpd'
	_inst_initd 'ftpd'
}

package_lvm2-openrc() {
	pkgdesc="OpenRC lvm2 init script"
	depends=('device-mapper-openrc' 'lvm2')
	backup=('etc/conf.d/lvm')
	install=lvm2.install

	_inst_confd 'lvm'
	_inst_initd 'lvm'
	_inst_initd 'lvm-monitoring'
	_inst_initd 'lvmetad'

	for f in ${pkgdir}/etc/init.d/*; do
		sed -e 's|/sbin|/usr/bin|g' -i $f
	done
}

package_mdadm-openrc() {
	pkgdesc="OpenRC mdadm init script"
	depends=('openrc' 'mdadm')
	optdepends=('bind-openrc')
	backup=('etc/conf.d/mdadm')
	install=mdadm.install

        for f in mdadm mdraid;do
            _inst_confd $f
            _inst_initd $f
        done
}

package_udev-openrc(){
        pkgver=${_uscript_ver}
        pkgrel=3
        pkgdesc="udev startup scripts for openrc"
        groups=('openrc-base' 'openrc-desktop')
        depends=('openrc' 'udev')

        cd "${srcdir}/udev-init-scripts-${_uscript_ver}"
	make DESTDIR="${pkgdir}" install
	for f in ${pkgdir}/etc/init.d/*;do
		sed -e "s|#!/sbin/openrc-run|#!/usr/bin/openrc-run|" \
                    -e "s|#!/sbin/runscript|#!/usr/bin/openrc-run|" \
			-e "s|/bin/udevadm|/usr/bin/udevadm|g" \
			-e "s|/sbin/udevd|/usr/bin/udevd|g" \
			-i "$f"
	done
	install -d "${pkgdir}/etc/runlevels/sysinit"
	ln -sf "/etc/init.d/udev" "${pkgdir}/etc/runlevels/sysinit/udev"
	ln -sf "/etc/init.d/udev-trigger" "${pkgdir}/etc/runlevels/sysinit/udev-trigger"

	# kmod-static-nodes
	_inst_initd 'kmod-static-nodes'

	ln -sf "/etc/init.d/kmod-static-nodes" "${pkgdir}/etc/runlevels/sysinit/kmod-static-nodes"
}