diff --git a/apacheconfig b/apacheconfig index 68c1a2d..6100828 100755 --- a/apacheconfig +++ b/apacheconfig @@ -1,7 +1,7 @@ #!/bin/bash # -*- coding: utf-8 mode: sh -*- vim:sw=4:sts=4:et:ai:si:sta:fenc=utf-8 source "$(dirname "$0")/lib/ulib/ulib" || exit 1 -urequire DEFAULTS apache.config +urequire DEFAULTS template apache.tools function display_help() { uecho "$scriptname: Gérer une configuration apache pour déploiement @@ -155,7 +155,7 @@ __templatectl_parseopts "$@" && \ set -- "${args[@]}" || die "$args" # répertoire source -srcdir="$scriptdir/lib/apacheconfig.template" +setx srcdir=templatesrc apacheconfig # répertoire de référence autocreate= if [ -z "$destdir" ]; then diff --git a/lib/ulib/.ulibver b/lib/ulib/.ulibver index dfdd991..c22b486 100644 --- a/lib/ulib/.ulibver +++ b/lib/ulib/.ulibver @@ -1 +1 @@ -005001000 +006000000 diff --git a/lib/ulib/apache b/lib/ulib/apache index 17612f0..bdff35a 100644 --- a/lib/ulib/apache +++ b/lib/ulib/apache @@ -1,5 +1,5 @@ ##@cooked comments # -*- coding: utf-8 mode: sh -*- vim:sw=4:sts=4:et:ai:si:sta:fenc=utf-8 -## Gestion du service apache (démarrage/arrêt), et de sa configuration +## Gestion du service apache et de sa configuration ##@cooked nocomments ##@require base ##@require sysinfos diff --git a/lib/ulib/apache.config b/lib/ulib/apache.tools similarity index 98% rename from lib/ulib/apache.config rename to lib/ulib/apache.tools index a0d2ccb..cf22751 100644 --- a/lib/ulib/apache.config +++ b/lib/ulib/apache.tools @@ -1,11 +1,11 @@ ##@cooked comments # -*- coding: utf-8 mode: sh -*- vim:sw=4:sts=4:et:ai:si:sta:fenc=utf-8 -## Templates pour apache +## Outils de haut niveau pour gérer apache et sa configuration ##@cooked nocomments ##@require base ##@require sysinfos -##@require template -uprovide apache.config -urequire base sysinfos template apache +##@require apache +uprovide apache.tools +urequire base sysinfos apache function __apache_resolvcert() { [ -n "$__rc_dir" ] || __rc_dir="$(dirname "$__rc_conf")" diff --git a/lib/ulib/template b/lib/ulib/template index 3812a8d..86617b6 100644 --- a/lib/ulib/template +++ b/lib/ulib/template @@ -227,6 +227,15 @@ function template_diff() { done | page_maybe -S } +function templatesrc() { + urequire ulib + if [ -n "$ULIBDIR" ]; then + echo "$ULIBDIR/templates/$1" + else + abspath "templates/$1" + fi +} + function __templatectl_display_help() { :; } __TEMPLATECTL_OTHER_OPTS=() function __templatectl_parseopts() { diff --git a/lib/apacheconfig.template/RewriteRules/.udir b/lib/ulib/templates/apacheconfig/RewriteRules/.udir similarity index 100% rename from lib/apacheconfig.template/RewriteRules/.udir rename to lib/ulib/templates/apacheconfig/RewriteRules/.udir diff --git a/lib/apacheconfig.template/RewriteRules/RewriteRules.conf b/lib/ulib/templates/apacheconfig/RewriteRules/RewriteRules.conf similarity index 100% rename from lib/apacheconfig.template/RewriteRules/RewriteRules.conf rename to lib/ulib/templates/apacheconfig/RewriteRules/RewriteRules.conf diff --git a/lib/apacheconfig.template/RewriteRules/lib/uinst/rootconf b/lib/ulib/templates/apacheconfig/RewriteRules/lib/uinst/rootconf similarity index 100% rename from lib/apacheconfig.template/RewriteRules/lib/uinst/rootconf rename to lib/ulib/templates/apacheconfig/RewriteRules/lib/uinst/rootconf diff --git a/lib/apacheconfig.template/RewriteRules/rewrite.rules b/lib/ulib/templates/apacheconfig/RewriteRules/rewrite.rules similarity index 100% rename from lib/apacheconfig.template/RewriteRules/rewrite.rules rename to lib/ulib/templates/apacheconfig/RewriteRules/rewrite.rules diff --git a/lib/apacheconfig.template/RewriteRules/rules.html b/lib/ulib/templates/apacheconfig/RewriteRules/rules.html similarity index 100% rename from lib/apacheconfig.template/RewriteRules/rules.html rename to lib/ulib/templates/apacheconfig/RewriteRules/rules.html diff --git a/lib/apacheconfig.template/RewriteRules/update.conf b/lib/ulib/templates/apacheconfig/RewriteRules/update.conf similarity index 100% rename from lib/apacheconfig.template/RewriteRules/update.conf rename to lib/ulib/templates/apacheconfig/RewriteRules/update.conf diff --git a/lib/apacheconfig.template/RewriteRules/update.sh b/lib/ulib/templates/apacheconfig/RewriteRules/update.sh similarity index 100% rename from lib/apacheconfig.template/RewriteRules/update.sh rename to lib/ulib/templates/apacheconfig/RewriteRules/update.sh diff --git a/lib/apacheconfig.template/apacheconfig.txt b/lib/ulib/templates/apacheconfig/apacheconfig.txt similarity index 100% rename from lib/apacheconfig.template/apacheconfig.txt rename to lib/ulib/templates/apacheconfig/apacheconfig.txt diff --git a/lib/apacheconfig.template/certsconf/default-certs.conf b/lib/ulib/templates/apacheconfig/certsconf/default-certs.conf similarity index 100% rename from lib/apacheconfig.template/certsconf/default-certs.conf rename to lib/ulib/templates/apacheconfig/certsconf/default-certs.conf diff --git a/lib/apacheconfig.template/cgi-bin/.udir b/lib/ulib/templates/apacheconfig/cgi-bin/.udir similarity index 100% rename from lib/apacheconfig.template/cgi-bin/.udir rename to lib/ulib/templates/apacheconfig/cgi-bin/.udir diff --git a/lib/apacheconfig.template/cgi-bin/test.cgi b/lib/ulib/templates/apacheconfig/cgi-bin/test.cgi similarity index 100% rename from lib/apacheconfig.template/cgi-bin/test.cgi rename to lib/ulib/templates/apacheconfig/cgi-bin/test.cgi diff --git a/lib/apacheconfig.template/modules.conf b/lib/ulib/templates/apacheconfig/modules.conf similarity index 100% rename from lib/apacheconfig.template/modules.conf rename to lib/ulib/templates/apacheconfig/modules.conf diff --git a/lib/apacheconfig.template/ports.conf b/lib/ulib/templates/apacheconfig/ports.conf similarity index 100% rename from lib/apacheconfig.template/ports.conf rename to lib/ulib/templates/apacheconfig/ports.conf diff --git a/lib/apacheconfig.template/sites.conf b/lib/ulib/templates/apacheconfig/sites.conf similarity index 100% rename from lib/apacheconfig.template/sites.conf rename to lib/ulib/templates/apacheconfig/sites.conf diff --git a/lib/apacheconfig.template/sites/default.conf b/lib/ulib/templates/apacheconfig/sites/default.conf similarity index 100% rename from lib/apacheconfig.template/sites/default.conf rename to lib/ulib/templates/apacheconfig/sites/default.conf diff --git a/lib/apacheconfig.template/sites/default.ssl.conf b/lib/ulib/templates/apacheconfig/sites/default.ssl.conf similarity index 100% rename from lib/apacheconfig.template/sites/default.ssl.conf rename to lib/ulib/templates/apacheconfig/sites/default.ssl.conf diff --git a/lib/apacheconfig.template/workers.properties b/lib/ulib/templates/apacheconfig/workers.properties similarity index 100% rename from lib/apacheconfig.template/workers.properties rename to lib/ulib/templates/apacheconfig/workers.properties diff --git a/lib/apacheconfig.template/www/.udir b/lib/ulib/templates/apacheconfig/www/.udir similarity index 100% rename from lib/apacheconfig.template/www/.udir rename to lib/ulib/templates/apacheconfig/www/.udir diff --git a/lib/runsconfig.template/config b/lib/ulib/templates/runsconfig/config similarity index 100% rename from lib/runsconfig.template/config rename to lib/ulib/templates/runsconfig/config diff --git a/lib/runsconfig.template/default b/lib/ulib/templates/runsconfig/default similarity index 100% rename from lib/runsconfig.template/default rename to lib/ulib/templates/runsconfig/default diff --git a/lib/runsconfig.template/runs.conf b/lib/ulib/templates/runsconfig/runs.conf similarity index 100% rename from lib/runsconfig.template/runs.conf rename to lib/ulib/templates/runsconfig/runs.conf diff --git a/lib/runsconfig.template/script.template b/lib/ulib/templates/runsconfig/script.template similarity index 100% rename from lib/runsconfig.template/script.template rename to lib/ulib/templates/runsconfig/script.template diff --git a/lib/runsconfig.template/services b/lib/ulib/templates/runsconfig/services similarity index 100% rename from lib/runsconfig.template/services rename to lib/ulib/templates/runsconfig/services diff --git a/lib/runsconfig.template/sysinfos.conf b/lib/ulib/templates/runsconfig/sysinfos.conf similarity index 100% rename from lib/runsconfig.template/sysinfos.conf rename to lib/ulib/templates/runsconfig/sysinfos.conf diff --git a/lib/runsconfig.template/userdefault b/lib/ulib/templates/runsconfig/userdefault similarity index 100% rename from lib/runsconfig.template/userdefault rename to lib/ulib/templates/runsconfig/userdefault diff --git a/runsconfig b/runsconfig index d9f2e8a..f7c9cec 100755 --- a/runsconfig +++ b/runsconfig @@ -33,7 +33,7 @@ __templatectl_parseopts "$@" && \ set -- "${args[@]}" || die "$args" # répertoire source -srcdir="$scriptdir/lib/runsconfig.template" +setx srcdir=templatesrc runsconfig # répertoire de référence [ -n "$destdir" ] || destdir=.