Skip to content
Snippets Groups Projects
Commit 9e2288e8 authored by Eric Vidal's avatar Eric Vidal :speech_balloon:
Browse files

adapt to new 66 code

parent efdda513
No related branches found
No related tags found
No related merge requests found
...@@ -19,7 +19,6 @@ You can customize paths via flags given to configure. See `./configure --help` f ...@@ -19,7 +19,6 @@ You can customize paths via flags given to configure. See `./configure --help` f
- execline version 2.7.0.0 or later: http://skarnet.org/software/execline/ - execline version 2.7.0.0 or later: http://skarnet.org/software/execline/
- s6 version 2.10.0.0 or later: http://skarnet.org/software/s6/ - s6 version 2.10.0.0 or later: http://skarnet.org/software/s6/
- 66 version 0.6.0.0 or later https://framagit.org/Obarun/66/ - 66 version 0.6.0.0 or later https://git.obarun.org/Obarun/66/
- 66-tools version 0.0.7.0 or later https://framagit.org/Obarun/66-tools/ - 66-tools version 0.0.7.0 or later https://git.obarun.org/Obarun/66-tools/
- optional dependencies:
* dbus-66serv version 0.2.0 or later https://framagit.org/pkg/observice/dbus-66serv
...@@ -15,31 +15,11 @@ include package/targets.mak ...@@ -15,31 +15,11 @@ include package/targets.mak
INSTALL := ./tools/install.sh INSTALL := ./tools/install.sh
install: install-script install-service install-service-module install-service-instance-module install-configure install: install-module install-script
install-script: $(SCRIPT_TARGET:module/scandir@/configure/%=$(DESTDIR)$(module_directory)/scandir@/configure/%) install-module: $(MODULE_TARGET:module/%=$(DESTDIR)$(service_directory)/$(package)/%)
install-service: $(SERVICE_TARGET:service/%=$(DESTDIR)$(service_directory)/%) install-script: $(SCRIPT_TARGET:module/configure/%=$(DESTDIR)$(service_directory)/$(package)/configure/%)
install-service-module: $(MODULE_TARGET:module/scandir@/service/%=$(DESTDIR)$(module_directory)/scandir@/service/%)
install-service-instance-module: $(MODULE_INSTANCE_TARGET:module/scandir@/service@/%=$(DESTDIR)$(module_directory)/scandir@/service@/%)
install-configure: $(MODULE_CONFIGURE_TARGET:module/scandir@/configure/configure=$(DESTDIR)$(module_directory)/scandir@/configure/configure)
$(DESTDIR)$(service_directory)/$(package)/%: module/%
$(DESTDIR)$(module_directory)/scandir@/configure/%: module/scandir@/configure/%
exec $(INSTALL) -D -m 755 $< $@
sed -i -e 's,@BINDIR@,$(bindir),' $@
$(DESTDIR)$(module_directory)/scandir@/configure/configure: module/scandir@/configure/configure
exec $(INSTALL) -D -m 755 $< $@
sed -i -e 's,@BINDIR@,$(bindir),' $@
$(DESTDIR)$(module_directory)/scandir@/service/%: module/scandir@/service/%
exec $(INSTALL) -D -m 644 $< $@
$(DESTDIR)$(module_directory)/scandir@/service@/%: module/scandir@/service@/%
exec $(INSTALL) -D -m 644 $< $@
$(DESTDIR)$(service_directory)/%: service/%
exec $(INSTALL) -D -m 644 $< $@ exec $(INSTALL) -D -m 644 $< $@
sed -i -e 's,@VERSION@,$(version),' \ sed -i -e 's,@VERSION@,$(version),' \
-e "s,@LIVEDIR@,$(livedir)," \ -e "s,@LIVEDIR@,$(livedir)," \
...@@ -49,6 +29,10 @@ $(DESTDIR)$(service_directory)/%: service/% ...@@ -49,6 +29,10 @@ $(DESTDIR)$(service_directory)/%: service/%
-e "s,@VERBOSITY_LEVEL@,$(VERBOSITY_LEVEL)," \ -e "s,@VERBOSITY_LEVEL@,$(VERBOSITY_LEVEL)," \
-e "s,@NOTIFY@,$(NOTIFY)," $@ -e "s,@NOTIFY@,$(NOTIFY)," $@
$(DESTDIR)$(service_directory)/$(package)/configure/%: module/configure/%
exec $(INSTALL) -D -m 755 $< $@
sed -i -e 's,@BINDIR@,$(bindir),' $@
version: version:
@echo $(version) @echo $(version)
......
...@@ -16,18 +16,17 @@ Fine tuning of the installation directories: ...@@ -16,18 +16,17 @@ Fine tuning of the installation directories:
--bindir=BINDIR user executables [EPREFIX/bin] --bindir=BINDIR user executables [EPREFIX/bin]
--datarootdir=DATAROOTDIR read-only architecture-independent data root [PREFIX/share] --datarootdir=DATAROOTDIR read-only architecture-independent data root [PREFIX/share]
--with-system-service=DIR 66 service intallation directory [DATAROOTDIR/$package_macro_dir/service] --with-system-service=DIR 66 service intallation directory [DATAROOTDIR/$package_macro_dir/service]
--with-system-module=DIR 66 module intallation directory [DATAROOTDIR/$package_macro_dir/module]
--livedir=DIR 66 default live directory [/run/66] --livedir=DIR 66 default live directory [/run/66]
--with-user-service-conf=DIR 66 user service configuration directory [.66/conf] --with-user-service-conf=DIR 66 user service configuration directory [.66/conf]
Fine tunning of scandir configuration: Fine tunning of scandir configuration:
--LOGGER=BOOLEAN create an associated logger [!yes] --LOGGER=BOOLEAN create an associated logger [!yes]
--USE_ENVIRONMENT=BOOLEAN Launch the scandir with a environment [!yes] --USE_ENVIRONMENT=BOOLEAN Launch the scandir with a environment [!yes]
--NOTIFY=BOOLEAN use notification [!yes] --NOTIFY=BOOLEAN use notification [!yes]
--VERBOSITY_LEVEL=BOOLEAN level of verbosity [!3] --VERBOSITY_LEVEL=BOOLEAN level of verbosity [!3]
Use yes or no with lowercase character to set BOOLEAN values. Use yes or no with lowercase character to set BOOLEAN values.
Empty value is a commented one and not used at all. Empty value is a commented one and not used at all.
An exclamation mark '!' at the begin of the value unexport the variable An exclamation mark '!' at the begin of the value unexport the variable
...@@ -91,7 +90,6 @@ exec_prefix='$prefix' ...@@ -91,7 +90,6 @@ exec_prefix='$prefix'
bindir='$exec_prefix/bin' bindir='$exec_prefix/bin'
datarootdir='$prefix/share' datarootdir='$prefix/share'
service_directory='$datarootdir/$package_macro_dir/service' service_directory='$datarootdir/$package_macro_dir/service'
module_directory='$datarootdir/$package_macro_dir/module'
livedir='/run/66' livedir='/run/66'
service_userconf='.66/conf' service_userconf='.66/conf'
LOGGER='!yes' LOGGER='!yes'
...@@ -107,7 +105,6 @@ for arg ; do ...@@ -107,7 +105,6 @@ for arg ; do
--bindir=*) bindir=${arg#*=} ;; --bindir=*) bindir=${arg#*=} ;;
--datarootdir=*) datarootdir=${arg#*=} ;; --datarootdir=*) datarootdir=${arg#*=} ;;
--with-system-service=*) service_directory=${arg#*=} ;; --with-system-service=*) service_directory=${arg#*=} ;;
--with-system-module=*) module_directory=${arg#*=} ;;
--livedir=*) livedir=${arg#*=} ;; --livedir=*) livedir=${arg#*=} ;;
--with-user-service-conf=*) service_userconf=${arg#*=} ;; --with-user-service-conf=*) service_userconf=${arg#*=} ;;
--LOGGER=*) LOGGER=${arg#*=} ;; --LOGGER=*) LOGGER=${arg#*=} ;;
...@@ -130,14 +127,14 @@ fi ...@@ -130,14 +127,14 @@ fi
# Expand installation directories # Expand installation directories
stripdir prefix stripdir prefix
for i in exec_prefix bindir datarootdir \ for i in exec_prefix bindir datarootdir \
livedir service_directory module_directory ; do livedir service_directory; do
eval tmp=\${$i} eval tmp=\${$i}
eval $i=$tmp eval $i=$tmp
stripdir $i stripdir $i
done done
stripdir datarootdir stripdir datarootdir
for i in service_directory module_directory; do for i in service_directory; do
eval tmp=\${$i} eval tmp=\${$i}
eval $i=$tmp eval $i=$tmp
stripdir $i stripdir $i
...@@ -175,13 +172,13 @@ cat << EOF ...@@ -175,13 +172,13 @@ cat << EOF
# $cmdline # $cmdline
# Any changes made here will be lost if configure is re-run. # Any changes made here will be lost if configure is re-run.
package := $package
version := $version version := $version
prefix := $prefix prefix := $prefix
exec_prefix := $exec_prefix exec_prefix := $exec_prefix
bindir := $bindir bindir := $bindir
datarootdir := $datarootdir datarootdir := $datarootdir
service_directory := $service_directory service_directory := $service_directory
module_directory := $module_directory
package_macro_dir := $package_macro_dir package_macro_dir := $package_macro_dir
livedir := $livedir livedir := $livedir
service_userconf := $service_userconf service_userconf := $service_userconf
......
File moved
...@@ -6,23 +6,24 @@ export VERBOSITY="${MOD_VERBOSITY}" ...@@ -6,23 +6,24 @@ export VERBOSITY="${MOD_VERBOSITY}"
export CLOCK_ENABLED=0 export CLOCK_ENABLED=0
export COLOR_ENABLED="${MOD_COLOR}" export COLOR_ENABLED="${MOD_COLOR}"
## script variable
FRONTEND_PATH="${MOD_MODULE_DIR}/frontend"
ACTIVATED_PATH="${MOD_MODULE_DIR}/activated"
owner="${1}"
home_env=$(homeof "${owner}" 2>/dev/null)
home_env="${home_env}/${MOD_SERVICE_USERCONFDIR}svscan@${owner}"
svscan="${FRONTEND_PATH}/svscan@"
die(){ die(){
66-yeller -f "${@}" 66-yeller -f "${@}"
exit 111 exit 111
} }
owner="${1}"
home_env=$(homeof "${owner}" 2>/dev/null)
if [ -z "${home_env}" ]; then if [ -z "${home_env}" ]; then
die "invalid user: ${owner}" die "invalid user: ${owner}"
fi fi
home_env="${home_env}/${MOD_SERVICE_USERCONFDIR}svscan@${owner}"
service_dir="${MOD_MODULE_DIR}/service@"
svscan="${service_dir}/svscan@"
check_empty_var(){ check_empty_var(){
name="${1}" var_value="${2}" name="${1}" var_value="${2}"
if [ -z "${var_value}" ]; then if [ -z "${var_value}" ]; then
...@@ -39,10 +40,9 @@ disable() { ...@@ -39,10 +40,9 @@ disable() {
enable() { enable() {
name=${1} name=${1}
66-yeller %benable%n service: "${name}" 66-yeller %benable%n service: "${name}"
touch "${MOD_MODULE_DIR}/service/${name}" touch "${ACTIVATED_PATH}/${name}"
} }
absolute_path(){ absolute_path(){
name="${1}" var="${2}" name="${1}" var="${2}"
if [ "$(66-yeller -i "${var}" | cut -c 1)" != "/" ]; then if [ "$(66-yeller -i "${var}" | cut -c 1)" != "/" ]; then
...@@ -50,8 +50,6 @@ absolute_path(){ ...@@ -50,8 +50,6 @@ absolute_path(){
fi fi
} }
if execl-toc -X -V LIVE_DIRECTORY; then if execl-toc -X -V LIVE_DIRECTORY; then
check_empty_var "LIVE_DIRECTORY" "${LIVE_DIRECTORY}" check_empty_var "LIVE_DIRECTORY" "${LIVE_DIRECTORY}"
...@@ -65,13 +63,12 @@ else ...@@ -65,13 +63,12 @@ else
sed -i "s:@LIVE_DIR@:-l ${MOD_LIVE}:" "${svscan}" || die "unable to set the live directory to use" sed -i "s:@LIVE_DIR@:-l ${MOD_LIVE}:" "${svscan}" || die "unable to set the live directory to use"
fi fi
if [ "${USE_ENVIRONMENT}" = yes ]; then if [ "${USE_ENVIRONMENT}" = yes ]; then
enable "setenv@${owner}" enable "setenv@${owner}"
sed -i "s:@USE_ENVIRONMENT@:-e ${home_env}:" "${svscan}" || die "unable to set environment directory to use" sed -i "s:@USE_ENVIRONMENT@:-e ${home_env}:" "${svscan}" || die "unable to set environment directory to use"
sed -i "s:@PATH_ENVIRONMENT@:${home_env}:g" "${service_dir}/setenv@" || die "unable to set environment directory to use" sed -i "s:@PATH_ENVIRONMENT@:${home_env}:g" "${FRONTEND_PATH}/setenv@" || die "unable to set environment directory to use"
else else
disable "setenv@@I" disable "setenv@@I"
sed -i "s:@USE_ENVIRONMENT@::" "${svscan}" || die "unable to set environment directory to use" sed -i "s:@USE_ENVIRONMENT@::" "${svscan}" || die "unable to set environment directory to use"
...@@ -79,7 +76,7 @@ fi ...@@ -79,7 +76,7 @@ fi
if [ "${LOGGER}" != "yes" ]; then if [ "${LOGGER}" != "yes" ]; then
66-yeller %rdisable%n logger options 66-yeller %rdisable%n logger options
sed -i "s:#@options:@options:" "${svscan}" || die "unable to disable log options" sed -i "s:log:!log:" "${svscan}" || die "unable to disable log options"
else else
66-yeller %benable%n logger options 66-yeller %benable%n logger options
fi fi
......
File moved
...@@ -4,27 +4,24 @@ ...@@ -4,27 +4,24 @@
@description = "Create and start a nested scandir for @I" @description = "Create and start a nested scandir for @I"
@user = ( root ) @user = ( root )
@depends = ( setenv@@I ) @depends = ( setenv@@I )
#@options = ( !log )
@notify = 3 @notify = 3
@timeout-up = 3000 @timeout-up = 3000
@options = ( log )
[start] [start]
@runas = @I @runas = @I
@execute = ( @execute = (
s6-setsid -qb -- s6-setsid -qb --
umask 022 umask 022
if { execl-cmdline -s { 66 ${main_args} scandir start ${scandir_args} }
execl-cmdline -s { 66-scandir ${cmd_args_scandir} create }
}
execl-cmdline -s { 66-scanctl ${cmd_args_scanctl} start }
) )
[stop] [stop]
@runas = @I @runas = @I
@execute = ( @execute = (
66-scanctl @LIVE_DIR@ stop execl-cmdline -s { 66 ${main_args} scandir stop }
) )
[environment] [environment]
cmd_args_scandir=!@VERBOSITY_LEVEL@ @LIVE_DIR@ main_args=!@VERBOSITY_LEVEL@ @LIVE_DIR@
cmd_args_scanctl=!@VERBOSITY_LEVEL@ @NOTIFY@ @LIVE_DIR@ @USE_ENVIRONMENT@ scandir_args=!@NOTIFY@ @USE_ENVIRONMENT@
...@@ -3,6 +3,7 @@ ...@@ -3,6 +3,7 @@
@version = @VERSION@ @version = @VERSION@
@description = "Create a nested scandir for @I" @description = "Create a nested scandir for @I"
@user = ( root ) @user = ( root )
@intree = session
[regex] [regex]
@configure="@I" @configure="@I"
...@@ -30,6 +31,6 @@ ...@@ -30,6 +31,6 @@
@NOTIFY@ @NOTIFY@
## Level of verbosity [0-4] ## Level of verbosity [0-5]
@VERBOSITY_LEVEL@ @VERBOSITY_LEVEL@
package=scandir-66serv package=scandir
version=0.3.1 version=0.3.1
package_macro_dir=66 package_macro_dir=66
SCRIPT_TARGET := SCRIPT_TARGET := module/configure/configure
MODULE_TARGET := $(shell find module/ -type f)
SERVICE_TARGET := service/scandir@
MODULE_TARGET := $(shell find module/scandir@/service -type f)
MODULE_INSTANCE_TARGET := $(shell find module/scandir@/service@ -type f)
MODULE_CONFIGURE_TARGET := module/scandir@/configure/configure
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment