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

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

_sed_args=(-e 's|/var/run|/run|g' -e 's|/usr/sbin|/usr/bin|g')
prefix=true

$_prefix && _sed_args+=(-e 's|#!/sbin/openrc-run|#!/usr/bin/openrc-run|g')

pkgbase=openrc-devel
pkgname=('distcc-openrc'
         'git-openrc'
         'jenkins-openrc'
         'mysql-openrc'
         #'php-fpm-openrc'
         'postgresql-openrc'
         'subversion-openrc')
pkgver=20170927
pkgrel=1
pkgdesc="OpenRC init scripts"
arch=('any')
url="https://github.com/artix-linux"
license=('GPL2')
groups=('openrc-devel')
conflicts=('systemd-sysvcompat')
source=("distccd.confd::${_url}/sys-devel/distcc/files/3.2/conf"
        "distccd.initd::${_url}/sys-devel/distcc/files/3.2/init"
        "git-daemon.confd::${_url}/dev-vcs/git/files/git-daemon.confd"
        "git-daemon.initd::${_url}/dev-vcs/git/files/git-daemon-r1.initd"
        'jenkins.initd'
        "jenkins.logrotate"
        "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"
        #"php-fpm.initd::${_url}/dev-lang/php/files/php-fpm-r4.init"
        "postgresql.confd::${_url}/dev-db/postgresql/files/postgresql.confd"
        "postgresql.initd::${_url}/dev-db/postgresql/files/postgresql.init-9.3"
        "svnserve.confd::${_url}/dev-vcs/subversion/files/svnserve.confd"
        "svnserve.initd::${_url}/dev-vcs/subversion/files/svnserve.initd3")
sha256sums=('253cfaa5b53fe4943a9db83e76ff6d6e8855665f69c2f7beca124af3ec63c88a'
            '4af1591a0f95e45648f0c5a7ffc5e49be012f2f6e497235b3363e9e709dc627f'
            '4703ba2372c661fb674a29fea7f64983f8b1b3136d971663509249655bca6e21'
            'c39eff8e0d0156f035b987521444476875852519ddfe6b36ea5c205d93a7f323'
            '7ef50b386bef359224dffb964387f651aa02cd610c3f73d585fa3ae78e9becee'
            '03dcaccbb0d398c2b600be0752ffc68d20c877b58a10026b7c59b0bd40c0e5bf'
            'b94756f2a5fe43893dea90fadbe47308e50fb4dbe2cbaa2676f34fa88181d8e7'
            'b6eb4576e654b1f4a8138df04408935a07fab69775e9663f736133c71bbb414b'
            '57c1ad0b14e8458024c713dd8cc2390023b95c27ba4cbd637333b1020f11f398'
            '120e872848eb13c949179b22f00a31bd043823ac75c547374225c6c3620a827d'
            '45f2dc1a718aed885559e71d98112e670c92bd6b4f19c5cf593eced6cd2bbd97'
            '3cba218e648f7722e6e5541deb9e8ca0f53188195e33b17ca19efb8a300651cb')

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

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

    sed ${_sed_args[@]} -i ${pkgdir}/etc/init.d/$1
}

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

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
}

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_jenkins-openrc() {
    pkgdesc="OpenRC jenkins init script"
    depends=('jenkins' 'openrc')

    _inst_initd 'jenkins'

    install -Dm644 "${srcdir}/jenkins.logrotate" "${pkgdir}/etc/logrotate.d/jenkins"
}

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/svnserve')

    _inst_confd 'svnserve'
    _inst_initd 'svnserve'

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

    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/svnserve"
}