aboutsummaryrefslogtreecommitdiffstats
path: root/main/openrc
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2011-04-13 07:03:15 +0000
committerNatanael Copa <ncopa@alpinelinux.org>2011-04-13 07:25:03 +0000
commitf1e34f1dffbaa883e8733dfc5dafb6b1293c4e45 (patch)
treee5088f144f62cd6653ad83f99a481f12731fe3cd /main/openrc
parent2d116ff62c2f3bc5e25fafaadde1eb750c1b8096 (diff)
downloadaports-f1e34f1dffbaa883e8733dfc5dafb6b1293c4e45.tar.bz2
aports-f1e34f1dffbaa883e8733dfc5dafb6b1293c4e45.tar.xz
main/openrc: move /libexec/rc to /lib/rc to be more FHS compat
Also clean up the /etc/rc.local compat. We now in the post-upgrade look if there are any /etc/rc.local and if there are we create an /etc/local.d/rc.local-compat.start script, otherwise we just let it be.
Diffstat (limited to 'main/openrc')
-rw-r--r--main/openrc/APKBUILD12
-rw-r--r--main/openrc/local.start4
-rw-r--r--main/openrc/openrc.post-upgrade27
3 files changed, 28 insertions, 15 deletions
diff --git a/main/openrc/APKBUILD b/main/openrc/APKBUILD
index e71772994d..04d93ace54 100644
--- a/main/openrc/APKBUILD
+++ b/main/openrc/APKBUILD
@@ -2,7 +2,7 @@
pkgname=openrc
pkgver=0.8.0
_ver=${pkgver/_git*/}
-pkgrel=0
+pkgrel=1
pkgdesc="OpenRC manages the services, startup and shutdown of a host"
url="http://git.overlays.gentoo.org/gitweb/?p=proj/openrc.git"
arch="all"
@@ -22,7 +22,6 @@ source="http://distfiles.gentoo.org/distfiles/$pkgname-$_ver.tar.bz2
modules.initd
modloop.initd
networking.initd
- local.start
modloop.confd
"
@@ -39,12 +38,12 @@ prepare() {
build() {
cd "$_builddir"
- make || return 1
+ make LIBEXECDIR=/lib/rc || return 1
}
package() {
cd "$_builddir"
- make DESTDIR="$pkgdir/" install
+ make LIBEXECDIR=/lib/rc DESTDIR="$pkgdir/" install
# we cannot have anything turned on by default
rm -f "$pkgdir"/etc/runlevels/*/*
@@ -53,13 +52,13 @@ package() {
rm -f "$pkgdir"/etc/conf.d/network "$pkgdir"/etc/init.d/network
# we override some of the scripts
- for i in ../*.initd; do
+ for i in "$srcdir"/*.initd; do
j=${i##*/}
install -Dm755 $i "$pkgdir"/etc/init.d/${j%.initd}
done
install -D -m644 "$srcdir"/modloop.confd "$pkgdir"/etc/conf.d/modloop
- install -Dm644 ../local.start "$pkgdir"/etc/conf.d/local.start
+ install -d "$pkgdir"/etc/local.d
}
md5sums="54978ba3a1ff9fb8f04aae422c0416af openrc-0.8.0.tar.bz2
@@ -72,5 +71,4 @@ b1e64885f301166df30be3e3cf5338ff hwdrivers.initd
098a1f16812f56fcb56eb6b6f0fa31f6 modules.initd
408e28f247c7cc71fa104c07869417f4 modloop.initd
af16db0d798392c7c0ed3434e4bad241 networking.initd
-0a615d93aab691364c03539c3b496dcc local.start
c1ec888202d868710b5749f7b217d1e3 modloop.confd"
diff --git a/main/openrc/local.start b/main/openrc/local.start
deleted file mode 100644
index e0ce86071a..0000000000
--- a/main/openrc/local.start
+++ /dev/null
@@ -1,4 +0,0 @@
-
-if [ -f /etc/rc.local ]; then
- . /etc/rc.local
-fi
diff --git a/main/openrc/openrc.post-upgrade b/main/openrc/openrc.post-upgrade
index b09f2f240c..76c2da75eb 100644
--- a/main/openrc/openrc.post-upgrade
+++ b/main/openrc/openrc.post-upgrade
@@ -1,9 +1,28 @@
#!/bin/sh
-# in 0.5.x the state dir moved from /lib/rc/init.d to /libexec/rc/init.d
+# in 0.8.0-r1 the state dir moved from /libexec/rc/init.d to /lib/rc/init.d
-[ -d /lib/rc/init.d ] || exit 0
+[ -d /libexec/rc/init.d ] || exit 0
+
+for i in /libexec/rc/init.d/* ; do
+ [ -e "$i" ] || continue
+ mv $i /lib/rc/init.d/
+done
+
+rmdir /libexec/rc/init.d /libexec/rc /libexec 2>/dev/null
+
+
+# create rc.local compat
+if [ -f /etc/rc.local ]; then
+ cat >/etc/local.d/rc.local-compat.start<<__EOF__
+#!/bin/sh
+
+# this is only here for compatibility reasons
+if [ -f /etc/rc.local ]; then
+ . /etc/rc.local
+fi
+__EOF__
+ chmod +x /etc/local.d/rc.local-compat.start
+fi
-mv /lib/rc/init.d/* /libexec/rc/init.d/
-rmdir /lib/rc/init.d
exit 0