summaryrefslogtreecommitdiff
path: root/src/includes
diff options
context:
space:
mode:
authorRoy Marples <roy@marples.name>2008-02-28 11:08:49 +0000
committerRoy Marples <roy@marples.name>2008-02-28 11:08:49 +0000
commitf092045650faad778d25d000d80b3128664d2e2a (patch)
tree89188e92a4d01423ee59e33e5eaf5355fa14d103 /src/includes
parentaabf3976db5ffb41f8f8bbd47f5015b4158e095a (diff)
downloadopenrc-f092045650faad778d25d000d80b3128664d2e2a.tar.gz
openrc-f092045650faad778d25d000d80b3128664d2e2a.tar.bz2
openrc-f092045650faad778d25d000d80b3128664d2e2a.tar.xz
Support the use of PREFIX and PKG_PREFIX.
Diffstat (limited to 'src/includes')
-rw-r--r--src/includes/rc-misc.h25
1 files changed, 17 insertions, 8 deletions
diff --git a/src/includes/rc-misc.h b/src/includes/rc-misc.h
index f80684b..4ba0f83 100644
--- a/src/includes/rc-misc.h
+++ b/src/includes/rc-misc.h
@@ -38,21 +38,30 @@
#include <string.h>
#ifndef LIB
-# define LIB "lib"
+# define LIB "lib"
+#endif
+
+#ifndef PREFIX
+# define PREFIX ""
#endif
#define RC_LEVEL_BOOT "boot"
#define RC_LEVEL_DEFAULT "default"
-#define RC_LIBDIR "/" LIB "/rc"
+#define RC_LIBDIR PREFIX "/" LIB "/rc"
#define RC_SVCDIR RC_LIBDIR "/init.d"
#define RC_DEPTREE RC_SVCDIR "/deptree"
-#define RC_RUNLEVELDIR "/etc/runlevels"
-#define RC_INITDIR "/etc/init.d"
-#define RC_CONFDIR "/etc/conf.d"
-
-#define RC_INITDIR_LOCAL "/usr/local/etc/init.d"
-#define RC_CONFDIR_LOCAL "/usr/local/etc/conf.d"
+#define RC_RUNLEVELDIR PREFIX "/etc/runlevels"
+#define RC_INITDIR PREFIX "/etc/init.d"
+#define RC_CONFDIR PREFIX "/etc/conf.d"
+
+/* PKG_PREFIX is where packages are installed if different from the base OS
+ * On Gentoo this is normally unset, on FreeBSD /usr/local and on NetBSD
+ * /usr/pkg. */
+#ifdef PKG_PREFIX
+# define RC_PKG_INITDIR PKG_PREFIX "/etc/init.d"
+# define RC_PKG_CONFDIR PKG_PREFIX "/usr/local/etc/conf.d"
+#endif
#define RC_KSOFTLEVEL RC_SVCDIR "/ksoftlevel"
#define RC_STARTING RC_SVCDIR "/rc.starting"