summaryrefslogtreecommitdiff
path: root/pcr/openrc-devel/PKGBUILD
blob: f0cbb55e0b884884daf23492f217c4cc72ed0589 (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
# Maintainer (Manjaro): artoo <artoo@manjaro.org>
# Maintainer: Omar Vega Ramos <ovruni@gnu.org.pe>

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

pkgbase=openrc-devel
pkgname=('git-openrc'
        'mysql-openrc'
        'postgresql-openrc'
        'subversion-openrc'
        'distcc-openrc')
       # 'php-fpm-openrc')
pkgver=20160528
pkgrel=1
pkgdesc="OpenRC init scripts"
arch=('any')
url="https://github.com/manjaro/packages-openrc"
license=('GPL2')
groups=('openrc-devel')
conflicts=('systemd-sysvcompat')
source=("git-daemon.confd::${_url}/dev-vcs/git/files/git-daemon.confd"
        "git-daemon.initd::${_url}/dev-vcs/git/files/git-daemon-r1.initd"
        "mysql.confd::${_url}/dev-db/mysql-init-scripts/files/conf.d-2.0"
        "mysql.initd::${_url}/dev-db/mysql-init-scripts/files/init.d-2.0"
        "svn.confd::${_url}/dev-vcs/subversion/files/svnserve.confd"
        "svn.initd::${_url}/dev-vcs/subversion/files/svnserve.initd3"
        "postgresql.confd::${_url}/dev-db/postgresql/files/postgresql.confd"
        "postgresql.initd::${_url}/dev-db/postgresql/files/postgresql.init-9.3"
        "distccd.confd::${_url}/sys-devel/distcc/files/3.2/conf"
        "distccd.initd::${_url}/sys-devel/distcc/files/3.2/init")
       # "php-fpm.initd::${_url}/dev-lang/php/files/php-fpm-r4.init")
sha256sums=('4703ba2372c661fb674a29fea7f64983f8b1b3136d971663509249655bca6e21'
            'efa30f5db5b837ed9febd09af29f3740a9d479d098d5c3f8e4dcf334e01f77a3'
            '6f8720ccbb241b08e5f9abb4be0899f55c857f6308ac82c7f12417ee2c02c1a5'
            '7dba4a45d1c4d609576b9fe06fd5c8097941fa46da58242b9775eccdb608baa4'
            '45f2dc1a718aed885559e71d98112e670c92bd6b4f19c5cf593eced6cd2bbd97'
            '06dbad411ed4c0db67685143822a095549e85e54a5166c8e568b219e88c9839e'
            '57c1ad0b14e8458024c713dd8cc2390023b95c27ba4cbd637333b1020f11f398'
            'ae547732e2e1fd1adac40bd30fd79b83a5ba3bb1de4a553b8d0f09500cb2d082'
            '253cfaa5b53fe4943a9db83e76ff6d6e8855665f69c2f7beca124af3ec63c88a'
            '92a4931b0241b2ddb9d7771f14c880802bdff9c44fadb2c6671387e08cea0c7c')

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_git-openrc() {
	pkgdesc="OpenRC git-daemon init script"
	depends=('git' 'openrc')
	backup=('etc/conf.d/git-daemon')

	_inst_confd 'git-daemon'
	_inst_initd 'git-daemon'

	sed -e 's|/var/git|/srv/git|' -i "${pkgdir}/etc/conf.d/git-daemon"
}

package_mysql-openrc() {
	pkgdesc="OpenRC mysql init script"
	depends=('mysql' 'openrc')
	optdepends=('bind-openrc: bind initscript')
	backup=('etc/conf.d/mysql')
	install=mysql.install

	_inst_confd 'mysql'
	_inst_initd 'mysql'

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

# package_php-fpm-openrc() {
# 	pkgdesc="OpenRC php-fpm init script"
# 	depends=('php-fpm' 'openrc')
# 	optdepends=('apache-openrc: apache initscript'
# 			'lighttp-openrc: lighttp initscript'
# 			'nginx-openrc: nginx initscript')
# 	install=php-fpm.install
#
# 	_inst_initd 'php-fpm'
#
# 	sed -e 's|/lib/${PHPSLOT}||g' \
# 		-e 's|/etc/php/fpm-${PHPSLOT}|/etc/php|' \
# 		-e 's|/run/php-fpm-${PHPSLOT}|/run/php-fpm|' \
# 		-e 's|PHPSLOT=${SVCNAME#php-fpm-}||' \
# 		-e 's|^.*${PHPSLOT}.*||' \
# 		-i "${pkgdir}/etc/init.d/php-fpm"
# }

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

	_inst_confd 'postgresql'
	_inst_initd 'postgresql'

	sed -e 's|/etc/postgresql-@SLOT@/|/var/lib/postgres/data/|' \
		-e 's|/var/lib/postgresql/@SLOT@/data|/var/lib/postgres/data|' \
		-i "${pkgdir}/etc/conf.d/postgresql"

	sed -e 's|/@LIBDIR@/postgresql-@SLOT@||g' \
		-e 's|/etc/conf.d/postgresql-@SLOT@|/etc/conf.d/postgresql|' \
		-i "${pkgdir}/etc/init.d/postgresql"
}

package_subversion-openrc() {
	pkgdesc="OpenRC svnserve init script"
	depends=('subversion' 'openrc')
	backup=('etc/conf.d/svn')

	_inst_confd 'svn'
	_inst_initd 'svn'

	sed -e 's|/var/svn|/srv/svn|g' -i ${pkgdir}/etc/conf.d/svn

	sed -e 's|/var/svn|/srv/svn|g' \
		-e 's|-apache|-http|g' \
		-e 's|/run/svnserve.pid|/run/svnserve/svnserve.pid|g' \
		-e 's/--make-pidfile//' \
		-i "${pkgdir}/etc/init.d/svn"
}

package_distcc-openrc() {
	pkgdesc="OpenRC distcc init script"
	depends=('distcc' 'openrc')
	backup=('etc/conf.d/distccd')

	_inst_confd 'distccd'
	_inst_initd 'distccd'

	sed -e 's|/var/run|/run|' -i ${pkgdir}/etc/conf.d/distccd
}