summaryrefslogtreecommitdiff
path: root/pcr/openrc-devel
diff options
context:
space:
mode:
authorOmar Vega Ramos <ovruni@gnu.org.pe>2015-10-17 05:05:17 -0500
committerOmar Vega Ramos <ovruni@gnu.org.pe>2015-10-17 05:05:17 -0500
commit2eba4176c3accb245bfc3f950b45c84dccaddafd (patch)
treeab36b4bdb99a636662ec2394389190d37cc276e1 /pcr/openrc-devel
parent19f95c7d623dcca230cc1340efaacf4de4423e93 (diff)
openrc-devel: add new package to [pcr]
Diffstat (limited to 'pcr/openrc-devel')
-rw-r--r--pcr/openrc-devel/PKGBUILD130
-rw-r--r--pcr/openrc-devel/git.install16
-rw-r--r--pcr/openrc-devel/mysql.install23
-rw-r--r--pcr/openrc-devel/php-fpm.install16
-rw-r--r--pcr/openrc-devel/postgresql.install19
-rw-r--r--pcr/openrc-devel/subversion.install16
6 files changed, 220 insertions, 0 deletions
diff --git a/pcr/openrc-devel/PKGBUILD b/pcr/openrc-devel/PKGBUILD
new file mode 100644
index 000000000..c3ccedb3c
--- /dev/null
+++ b/pcr/openrc-devel/PKGBUILD
@@ -0,0 +1,130 @@
+# Maintainer (Manjaro): artoo <artoo@manjaro.org>
+# Maintainer: Omar Vega Ramos <ovruni@gnu.org.pe>
+
+_gentoo_uri="https://raw.githubusercontent.com/gentoo/gentoo/master"
+
+pkgbase=openrc-devel
+pkgname=('git-openrc'
+ 'mysql-openrc'
+ 'postgresql-openrc'
+ 'subversion-openrc'
+ 'php-fpm-openrc')
+pkgver=20151014
+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::${_gentoo_uri}/dev-vcs/git/files/git-daemon.confd"
+ "git-daemon.initd::${_gentoo_uri}/dev-vcs/git/files/git-daemon-r1.initd"
+ "mysql.confd::${_gentoo_uri}/dev-db/mysql-init-scripts/files/conf.d-2.0"
+ "mysql.initd::${_gentoo_uri}/dev-db/mysql-init-scripts/files/init.d-2.0"
+ "svn.confd::${_gentoo_uri}/dev-vcs/subversion/files/svnserve.confd"
+ "svn.initd::${_gentoo_uri}/dev-vcs/subversion/files/svnserve.initd3"
+ "postgresql.confd::${_gentoo_uri}/dev-db/postgresql/files/postgresql.confd"
+ "postgresql.initd::${_gentoo_uri}/dev-db/postgresql/files/postgresql.init-9.3"
+ "php-fpm.initd::${_gentoo_uri}/dev-lang/php/files/php-fpm-r4.init")
+sha256sums=('4703ba2372c661fb674a29fea7f64983f8b1b3136d971663509249655bca6e21'
+ '069878aba8d7c7f229b6049f679d1f93873bdada1107b77fc9a9b2bd8be94516'
+ '6f8720ccbb241b08e5f9abb4be0899f55c857f6308ac82c7f12417ee2c02c1a5'
+ '9fbee10105b6be9dd128a11cc9ed67f85ba92fac8f3640628e6cd6356824511b'
+ '45f2dc1a718aed885559e71d98112e670c92bd6b4f19c5cf593eced6cd2bbd97'
+ '9e0eabfd8f07e0c77c4addf21b963b254c84432dd1983083b7da79216f4df80f'
+ '57c1ad0b14e8458024c713dd8cc2390023b95c27ba4cbd637333b1020f11f398'
+ 'fd3d3cd1913969edf51a98189cdb9b166eef52c9ea984ae467c6036194c0aef1'
+ '37e34461babfb5881169f9729fbdde7d4aba533f123e2c480fe25ac3b863d3e7')
+
+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')
+ install=git.install
+
+ _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|/@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')
+ install=subversion.install
+
+ _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"
+}
diff --git a/pcr/openrc-devel/git.install b/pcr/openrc-devel/git.install
new file mode 100644
index 000000000..397e97d7d
--- /dev/null
+++ b/pcr/openrc-devel/git.install
@@ -0,0 +1,16 @@
+_svc="git-daemon"
+_rlvl="default"
+
+post_install() {
+ _cmd="rc-update add ${_svc} ${_rlvl}"
+ echo " ==> run '${_cmd}'"
+}
+
+post_upgrade() {
+ post_install "$1"
+}
+
+post_remove() {
+ _cmd="rc-update del ${_svc} ${_rlvl}"
+ echo " ==> run '${_cmd}'"
+}
diff --git a/pcr/openrc-devel/mysql.install b/pcr/openrc-devel/mysql.install
new file mode 100644
index 000000000..e0c28d025
--- /dev/null
+++ b/pcr/openrc-devel/mysql.install
@@ -0,0 +1,23 @@
+_svc="mysql"
+_rlvl="default"
+
+post_install() {
+ conf1='basedir = /usr'
+ conf2='pid-file = /var/run/mysqld/mysqld.pid'
+ conf3='user = mysql'
+ file="/etc/mysql/my.cnf"
+ echo " ==> $file requires $conf1"
+ echo " ==> $file requires $conf2"
+ echo " ==> $file requires $conf3"
+ _cmd="rc-update add ${_svc} ${_rlvl}"
+ echo " ==> run '${_cmd}'"
+}
+
+post_upgrade() {
+ post_install "$1"
+}
+
+post_remove() {
+ _cmd="rc-update del ${_svc} ${_rlvl}"
+ echo " ==> run '${_cmd}'"
+}
diff --git a/pcr/openrc-devel/php-fpm.install b/pcr/openrc-devel/php-fpm.install
new file mode 100644
index 000000000..2f2b7061e
--- /dev/null
+++ b/pcr/openrc-devel/php-fpm.install
@@ -0,0 +1,16 @@
+_svc="php-fpm"
+_rlvl="default"
+
+post_install() {
+ _cmd="rc-update add ${_svc} ${_rlvl}"
+ echo " ==> run '${_cmd}'"
+}
+
+post_upgrade() {
+ post_install "$1"
+}
+
+post_remove() {
+ _cmd="rc-update del ${_svc} ${_rlvl}"
+ echo " ==> run '${_cmd}'"
+}
diff --git a/pcr/openrc-devel/postgresql.install b/pcr/openrc-devel/postgresql.install
new file mode 100644
index 000000000..e54258ecb
--- /dev/null
+++ b/pcr/openrc-devel/postgresql.install
@@ -0,0 +1,19 @@
+_svc="postgresql"
+_rlvl="default"
+
+post_install() {
+ local datadir="/var/lib/data"
+ echo " ==> requires datadir $datadir"
+ echo " ==> run as user postgres: 'initdb -D $datadir'"
+ _cmd="rc-update add ${_svc} ${_rlvl}"
+ echo " ==> run '${_cmd}'"
+}
+
+post_upgrade() {
+ post_install "$1"
+}
+
+post_remove() {
+ _cmd="rc-update del ${_svc} ${_rlvl}"
+ echo " ==> run '${_cmd}'"
+}
diff --git a/pcr/openrc-devel/subversion.install b/pcr/openrc-devel/subversion.install
new file mode 100644
index 000000000..b83c73ebd
--- /dev/null
+++ b/pcr/openrc-devel/subversion.install
@@ -0,0 +1,16 @@
+_svc="svn"
+_rlvl="default"
+
+post_install() {
+ _cmd="rc-update add ${_svc} ${_rlvl}"
+ echo " ==> run '${_cmd}'"
+}
+
+post_upgrade() {
+ post_install "$1"
+}
+
+pre_remove() {
+ _cmd="rc-update del ${_svc} ${_rlvl}"
+ echo " ==> run '${_cmd}'"
+}