summaryrefslogtreecommitdiff
path: root/pcr/openrc-base/PKGBUILD
blob: 69296e2a75d5b2b8c0b4a7974f9f8df16fc48389 (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
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
# Maintainer          : freaj <freaj@riseup.net>
# Maintainer (Manjaro): artoo <artoo@manjaro.org>

_Icron1=cronie-1.3-initd
_Icron2=anacron-1.0-initd
_Ccrypt=1.0.6-dmcrypt.confd
_Icrypt=1.5.1-dmcrypt.rc
_Idbus=dbus.initd
_Inscd=nscd
_Cdm=device-mapper.conf-1.02.22-r3
_Idm1=device-mapper.rc-2.02.105-r2
_Idm2=dmeventd.initd-2.02.67-r1
_Clvm=lvm.confd-2.02.28-r2
_Ilvm1=lvm.rc-2.02.105-r2
_Ilvm2=lvm-monitoring.initd-2.02.105-r2
_Ilvm3=lvmetad.initd-2.02.105-r2
_Cmdadm=mdadm.confd
_Imdadm=mdadm.rc
_Idhcpcd=dhcpcd.initd
_Cmdraid=mdraid.confd
_Imdraid=mdraid.rc
_Ieudev=udev-postmount

_gentoo_uri="http://sources.gentoo.org/cgi-bin/viewvc.cgi/gentoo-x86"


# set false if you want building without eudev(leaving systemd)
_is_eudev=true

pkgbase=openrc-base
_pkgname=('cronie-openrc'
	'cryptsetup-openrc'
	'dbus-openrc'
	'dhcpcd-openrc'
	'device-mapper-openrc'
	'glibc-openrc'
	'inetutils-openrc'
	'lvm2-openrc'
	'mdadm-openrc')
if ${_is_eudev};then
    pkgname=( ${_pkgname[@]} 'eudev-openrc')
else
    pkgname=( ${_pkgname[@]} )
fi
pkgver=20150323
pkgrel=1
pkgdesc="OpenRC init scripts"
arch=('any')
url="https://github.com/manjaro/packages-openrc"
license=('GPL2')
groups=('openrc' 'openrc-base')
conflicts=('initscripts'
	  'systemd-sysvcompat'
	  'openrc'
	  'openrc-git'
	  'openrc-sysvinit')
source=("${_gentoo_uri}/sys-process/cronie/files/${_Icron1}"
	"${_gentoo_uri}/sys-process/cronie/files/${_Icron2}"
	"${_gentoo_uri}/sys-fs/cryptsetup/files/${_Ccrypt}"
	"${_gentoo_uri}/sys-fs/cryptsetup/files/${_Icrypt}"
	"${_gentoo_uri}/sys-apps/dbus/files/${_Idbus}"
	"${_gentoo_uri}/sys-libs/glibc/files/${_Inscd}"
	"${_gentoo_uri}/sys-fs/lvm2/files/${_Cdm}"
	"${_gentoo_uri}/sys-fs/lvm2/files/${_Idm1}"
	"${_gentoo_uri}/sys-fs/lvm2/files/${_Idm2}"
	"${_gentoo_uri}/sys-fs/lvm2/files/${_Clvm}"
	"${_gentoo_uri}/sys-fs/lvm2/files/${_Ilvm1}"
	"${_gentoo_uri}/sys-fs/lvm2/files/${_Ilvm2}"
	"${_gentoo_uri}/sys-fs/lvm2/files/${_Ilvm3}"
	"${_gentoo_uri}/sys-fs/mdadm/files/${_Cmdadm}"
	"${_gentoo_uri}/sys-fs/mdadm/files/${_Imdadm}"
	"${_gentoo_uri}/sys-fs/mdadm/files/${_Cmdraid}"
	"${_gentoo_uri}/sys-fs/mdadm/files/${_Imdraid}"
	"${_gentoo_uri}/net-misc/dhcpcd/files/${_Idhcpcd}"
	"${_gentoo_uri}/sys-fs/eudev/files/${_Ieudev}"
	'inetutils.confd'
	'inetutils.initd')

_shebang='s|#!/sbin/runscript|#!/usr/bin/openrc-run|'
_runpath='s|/var/run|/run|g'
_binpath=('s|/usr/sbin|/usr/bin|g' 's|/sbin|/usr/bin|g')

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

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

	install -Dm755 "${srcdir}/${_Icron1}" "${pkgdir}/etc/init.d/cronie"
	install -Dm755 "${srcdir}/${_Icron2}" "${pkgdir}/etc/init.d/anacron"

	for f in ${pkgdir}/etc/init.d/*; do
		sed -e "${_shebang}" \
		    -e "${_binpath[0]}" \
		    -e "${_runpath}" \
		    -i $f
	done
}

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

	install -Dm755 "${srcdir}/${_Idhcpcd}" "${pkgdir}/etc/init.d/dhcpcd"

	sed -e "${_shebang}" \
	    -e "${_binpath[1]}" \
	    -e "${_runpath}" \
	    -i "${pkgdir}/etc/init.d/dhcpcd"
}

package_dbus-openrc() {
	pkgdesc="OpenRC dbus init script"
	groups=('openrc' 'openrc-base' 'openrc-desktop')
	depends=('openrc-core' 'dbus')
	install=dbus.install

	install -Dm755 "${srcdir}/${_Idbus}" "${pkgdir}/etc/init.d/dbus"

	local _p1='s|dbus.pid|dbus/pid|g'
	sed -e "${_shebang}" -e "${_runpath}" \
	    -e "${_p1}" \
	    -i "${pkgdir}/etc/init.d/dbus"
}

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

	install -Dm755 "${srcdir}/${_Cdm}" "${pkgdir}/etc/conf.d/device-mapper"
	install -Dm755 "${srcdir}/${_Idm1}" "${pkgdir}/etc/init.d/device-mapper"
	install -Dm755 "${srcdir}/${_Idm2}" "${pkgdir}/etc/init.d/dmeventd"

	for f in ${pkgdir}/etc/init.d/*; do
		sed -e "${_shebang}" \
		    -e "${_binpath[1]}" \
		    -e "${_runpath}" \
		    -i $f
	done
}

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

	install -Dm755 "${srcdir}/${_Ccrypt}" "${pkgdir}/etc/conf.d/dmcrypt"
	install -Dm755 "${srcdir}/${_Icrypt}" "${pkgdir}/etc/init.d/dmcrypt"

	sed -e "${_shebang}" \
	    -e "${_binpath[0]}" \
	    -e "${_runpath}" \
	    -i "${pkgdir}/etc/init.d/dmcrypt"
}

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

	install -Dm755 "${srcdir}/${_Inscd}" "${pkgdir}/etc/init.d/nscd"

	sed -e "${_shebang}" \
	    -e "${_binpath[0]}" \
	    -e "${_runpath}" \
	    -i "${pkgdir}/etc/init.d/nscd"
}

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

	install -Dm755 "${srcdir}/inetutils.confd" "${pkgdir}/etc/conf.d/ftpd"
	install -Dm755 "${srcdir}/inetutils.initd" "${pkgdir}/etc/init.d/ftpd"
}

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

	install -Dm755 "${srcdir}/${_Clvm}" "${pkgdir}/etc/conf.d/lvm"
	install -Dm755 "${srcdir}/${_Ilvm1}" "${pkgdir}/etc/init.d/lvm"
	install -Dm755 "${srcdir}/${_Ilvm2}" "${pkgdir}/etc/init.d/lvm-monitoring"
	install -Dm755 "${srcdir}/${_Ilvm3}" "${pkgdir}/etc/init.d/lvmetad"

	for f in ${pkgdir}/etc/init.d/*; do
		sed -e "${_shebang}" \
		    -e "${_binpath[1]}" \
		    -e "${_runpath}" \
		    -i $f
	done
}

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

	install -Dm755 "${srcdir}/${_Cmdadm}" "${pkgdir}/etc/conf.d/mdadm"
	install -Dm755 "${srcdir}/${_Imdadm}" "${pkgdir}/etc/init.d/mdadm"

	install -Dm755 "${srcdir}/${_Cmdraid}" "${pkgdir}/etc/conf.d/mdraid"
	install -Dm755 "${srcdir}/${_Imdraid}" "${pkgdir}/etc/init.d/mdraid"

	sed -e "${_shebang}" \
	    -e "${_runpath}" \
	    -i "${pkgdir}/etc/init.d/mdadm"
	sed -e "${_shebang}" \
	    -i "${pkgdir}/etc/init.d/mdraid"
}

package_eudev-openrc(){
	pkgdesc="OpenRC eudev postmount script"
	groups=('eudev-base')
	depends=('openrc-core' 'eudev')
	install=eudev.install

	install -Dm755 "${srcdir}/${_Ieudev}" "${pkgdir}/etc/init.d/udev-postmount"

	sed -e "${_shebang}" -i "${pkgdir}/etc/init.d/udev-postmount"
}

sha256sums=('292a7b20fe33bd027357475fea6aa1194afa7e5c1c47a85299db945b9d1c847e'
            '7ff283ee8b492929d33831461b72e872fe9d3a98344cf39af442f575875b0132'
            '9696d70a49296113a9ae3dff1b023b859df984bfb3572426ba199a630b628ce8'
            '1010666cfb3cd2c662032c3e8f3c2aec35316fc376d0ce30f2c821b581ae2c6d'
            '98e37b8b6ed25004e48c5855d74c9361eea06d3fee13cefcc0ed10ccf452aa01'
            '6165db3a2fcb251d4f3655c0461e018ce9c92a37f7f22a8fd2b75178b5435bc8'
            '57777904f12a35617e5a4193c964ebb32396452487fd02353e71e16e7b46bc22'
            '036b6de05e6cbd921a667d6fc6b01d30c8f9b720e1a0d0e2453ecd62d32573fb'
            '0c051388991ba69afbf2f6baf36ba227d7c26fc8f0d7588d8de76d9a74886d79'
            '28370c089c39c248d7ded0960b8d8a9256bada44d44c22ce3cec87d512ef6844'
            'a5754ffa0a05a0c29a9f6b5acf1b21dd313581fd6156c1ef722dc620e0114676'
            'd7655cadd3a3a9d3683a540413365310ca9503c38fd21a9bfccec40630ca72f1'
            '60accb4b6114753232f2db0adf3fc3f46d4459bfedf79b888801a13c55d79fa9'
            'ec55674955af7a31da51b8b72b599e8519809287dad796a9b16155bcba471b79'
            '3073b14619cb7b2c99c33f2d6cfd1e59ce5557899bffebaa65fa52f3caffadc7'
            '1b7918c4bdd024607bcb49d7cea0a77cb70502d2fbb4dbe07024bb5b5699c8e0'
            '73303ec32b7010c7f6d4fd66dde1a5baea07e73c79d3e516dce31000abdb4089'
            '72b42c9939fda3fb56666813513029ed36194c1708bddce06bcb3e131e547492'
            '0220e949b1f31832a205021c0a8615e77b27b73b7c9b16ef4a61bbd2774aeecb'
            '59fe1aa68c43f4958afc397a0d6b35da263a20fcdb457005123a0d64cb1f7477'
            '7f46e5e9ac9f204fb1564560c506a5bb4cede8823b89e3f1844e4f8be258e9ef')