s6-rc: new package
authorEric Le Bihan <eric.le.bihan.dev@free.fr>
Mon, 19 Dec 2016 21:29:12 +0000 (22:29 +0100)
committerThomas Petazzoni <thomas.petazzoni@free-electrons.com>
Thu, 9 Mar 2017 22:28:37 +0000 (23:28 +0100)
This new package provides s6-rc, a service manager for s6-based systems,
i.e. a suite of programs that can start and stop services, both
long-running daemons and one-time initialization scripts, in the proper
order according to a dependency tree.

The host variant is provided so s6-rc-compile is available and can
be used to build the services database offline, either in a package
Makefile or a post-build script.

Signed-off-by: Eric Le Bihan <eric.le.bihan.dev@free.fr>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
DEVELOPERS
package/Config.in
package/s6-rc/Config.in [new file with mode: 0644]
package/s6-rc/s6-rc.hash [new file with mode: 0644]
package/s6-rc/s6-rc.mk [new file with mode: 0644]

index e2b5a1ed07099f609e07865e04c0d61c69e17789..19392e0d4947e01e75562b77cf5bd8e1b92f78be 100644 (file)
@@ -443,6 +443,7 @@ F:  package/ninja/
 F:     package/s6/
 F:     package/s6-dns/
 F:     package/s6-networking/
+F:     package/s6-rc/
 F:     package/skalibs/
 F:     package/smack/
 F:     package/xvisor/
index 8e5880d0507150c13e995534c01f0fe2250ad8e8..d12649e9327978821a3cd9d7e7e6c298b6ddce98 100644 (file)
@@ -1803,6 +1803,7 @@ menu "System tools"
        source "package/rsyslog/Config.in"
        source "package/runc/Config.in"
        source "package/s6/Config.in"
+       source "package/s6-rc/Config.in"
        source "package/scrub/Config.in"
        source "package/scrypt/Config.in"
        source "package/smack/Config.in"
diff --git a/package/s6-rc/Config.in b/package/s6-rc/Config.in
new file mode 100644 (file)
index 0000000..d2ec75e
--- /dev/null
@@ -0,0 +1,11 @@
+config BR2_PACKAGE_S6_RC
+       bool "s6-rc"
+       select BR2_PACKAGE_S6
+       depends on BR2_USE_MMU # s6
+       help
+         s6-rc is a service manager for s6-based systems, i.e. a
+         suite of programs that can start and stop services, both
+         long-running daemons and one-time initialization scripts, in
+         the proper order according to a dependency tree.
+
+         http://skarnet.org/software/s6-rc/
diff --git a/package/s6-rc/s6-rc.hash b/package/s6-rc/s6-rc.hash
new file mode 100644 (file)
index 0000000..3d5186c
--- /dev/null
@@ -0,0 +1,2 @@
+# Locally generated
+sha256 d04a8a765740ed55e38a33da3639197f51f83b3e498bdef5bc1d1d322b1acff3 s6-rc-0.1.0.0.tar.gz
diff --git a/package/s6-rc/s6-rc.mk b/package/s6-rc/s6-rc.mk
new file mode 100644 (file)
index 0000000..1c28dcb
--- /dev/null
@@ -0,0 +1,73 @@
+################################################################################
+#
+# s6-rc
+#
+################################################################################
+
+S6_RC_VERSION = 0.1.0.0
+S6_RC_SITE = http://skarnet.org/software/s6-rc
+S6_RC_LICENSE = ISC
+S6_RC_LICENSE_FILES = COPYING
+S6_RC_INSTALL_STAGING = YES
+S6_RC_DEPENDENCIES = s6
+
+S6_RC_CONF_OPTS = \
+       --prefix=/usr \
+       --with-sysdeps=$(STAGING_DIR)/usr/lib/skalibs/sysdeps \
+       --with-include=$(STAGING_DIR)/usr/include \
+       --with-dynlib=$(STAGING_DIR)/usr/lib \
+       --with-lib=$(STAGING_DIR)/usr/lib/execline \
+       --with-lib=$(STAGING_DIR)/usr/lib/s6 \
+       --with-lib=$(STAGING_DIR)/usr/lib/skalibs \
+       $(if $(BR2_STATIC_LIBS),,--disable-allstatic) \
+       $(SHARED_STATIC_LIBS_OPTS)
+
+define S6_RC_CONFIGURE_CMDS
+       (cd $(@D); $(TARGET_CONFIGURE_OPTS) ./configure $(S6_RC_CONF_OPTS))
+endef
+
+define S6_RC_BUILD_CMDS
+       $(TARGET_MAKE_ENV) $(MAKE) -C $(@D)
+endef
+
+define S6_RC_REMOVE_STATIC_LIB_DIR
+       rm -rf $(TARGET_DIR)/usr/lib/s6-rc
+endef
+
+S6_RC_POST_INSTALL_TARGET_HOOKS += S6_RC_REMOVE_STATIC_LIB_DIR
+
+define S6_RC_INSTALL_TARGET_CMDS
+       $(TARGET_MAKE_ENV) $(MAKE) -C $(@D) DESTDIR=$(TARGET_DIR) install
+endef
+
+define S6_RC_INSTALL_STAGING_CMDS
+       $(TARGET_MAKE_ENV) $(MAKE) -C $(@D) DESTDIR=$(STAGING_DIR) install
+endef
+
+HOST_S6_RC_DEPENDENCIES = host-s6
+
+HOST_S6_RC_CONF_OPTS = \
+       --prefix=$(HOST_DIR)/usr \
+       --libexecdir=/usr/libexec \
+       --with-sysdeps=$(HOST_DIR)/usr/lib/skalibs/sysdeps \
+       --with-include=$(HOST_DIR)/usr/include \
+       --with-dynlib=$(HOST_DIR)/usr/lib \
+       --disable-static \
+       --enable-shared \
+       --disable-allstatic
+
+define HOST_S6_RC_CONFIGURE_CMDS
+       (cd $(@D); $(HOST_CONFIGURE_OPTS) ./configure $(HOST_S6_RC_CONF_OPTS))
+endef
+
+define HOST_S6_RC_BUILD_CMDS
+       $(HOST_MAKE_ENV) $(MAKE) -C $(@D)
+endef
+
+define HOST_S6_RC_INSTALL_CMDS
+       $(HOST_MAKE_ENV) $(MAKE) -C $(@D) install-dynlib install-bin
+       rm -f $(HOST_DIR)/usr/bin/s6-rc-dryrun
+endef
+
+$(eval $(generic-package))
+$(eval $(host-generic-package))