From 1665af9745d2d86df8f897c6b49f11d84540c0a4 Mon Sep 17 00:00:00 2001 From: Jephte CLAIN Date: Thu, 23 Oct 2014 21:26:42 +0400 Subject: [PATCH] =?UTF-8?q?r=C3=A9organiser=20les=20fichiers=20passer=20en?= =?UTF-8?q?=20version=206.0.0=20renommer=20apache.config=20en=20apache.too?= =?UTF-8?q?ls?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apacheconfig | 4 ++-- lib/ulib/.ulibver | 2 +- lib/ulib/apache | 2 +- lib/ulib/{apache.config => apache.tools} | 8 ++++---- lib/ulib/template | 9 +++++++++ .../templates/apacheconfig}/RewriteRules/.udir | 0 .../apacheconfig}/RewriteRules/RewriteRules.conf | 0 .../apacheconfig}/RewriteRules/lib/uinst/rootconf | 0 .../templates/apacheconfig}/RewriteRules/rewrite.rules | 0 .../templates/apacheconfig}/RewriteRules/rules.html | 0 .../templates/apacheconfig}/RewriteRules/update.conf | 0 .../templates/apacheconfig}/RewriteRules/update.sh | 0 .../templates/apacheconfig}/apacheconfig.txt | 0 .../templates/apacheconfig}/certsconf/default-certs.conf | 0 .../templates/apacheconfig}/cgi-bin/.udir | 0 .../templates/apacheconfig}/cgi-bin/test.cgi | 0 .../templates/apacheconfig}/modules.conf | 0 .../templates/apacheconfig}/ports.conf | 0 .../templates/apacheconfig}/sites.conf | 0 .../templates/apacheconfig}/sites/default.conf | 0 .../templates/apacheconfig}/sites/default.ssl.conf | 0 .../templates/apacheconfig}/workers.properties | 0 .../templates/apacheconfig}/www/.udir | 0 .../templates/runsconfig}/config | 0 .../templates/runsconfig}/default | 0 .../templates/runsconfig}/runs.conf | 0 .../templates/runsconfig}/script.template | 0 .../templates/runsconfig}/services | 0 .../templates/runsconfig}/sysinfos.conf | 0 .../templates/runsconfig}/userdefault | 0 runsconfig | 2 +- 31 files changed, 18 insertions(+), 9 deletions(-) rename lib/ulib/{apache.config => apache.tools} (98%) rename lib/{apacheconfig.template => ulib/templates/apacheconfig}/RewriteRules/.udir (100%) rename lib/{apacheconfig.template => ulib/templates/apacheconfig}/RewriteRules/RewriteRules.conf (100%) rename lib/{apacheconfig.template => ulib/templates/apacheconfig}/RewriteRules/lib/uinst/rootconf (100%) rename lib/{apacheconfig.template => ulib/templates/apacheconfig}/RewriteRules/rewrite.rules (100%) rename lib/{apacheconfig.template => ulib/templates/apacheconfig}/RewriteRules/rules.html (100%) rename lib/{apacheconfig.template => ulib/templates/apacheconfig}/RewriteRules/update.conf (100%) rename lib/{apacheconfig.template => ulib/templates/apacheconfig}/RewriteRules/update.sh (100%) rename lib/{apacheconfig.template => ulib/templates/apacheconfig}/apacheconfig.txt (100%) rename lib/{apacheconfig.template => ulib/templates/apacheconfig}/certsconf/default-certs.conf (100%) rename lib/{apacheconfig.template => ulib/templates/apacheconfig}/cgi-bin/.udir (100%) rename lib/{apacheconfig.template => ulib/templates/apacheconfig}/cgi-bin/test.cgi (100%) rename lib/{apacheconfig.template => ulib/templates/apacheconfig}/modules.conf (100%) rename lib/{apacheconfig.template => ulib/templates/apacheconfig}/ports.conf (100%) rename lib/{apacheconfig.template => ulib/templates/apacheconfig}/sites.conf (100%) rename lib/{apacheconfig.template => ulib/templates/apacheconfig}/sites/default.conf (100%) rename lib/{apacheconfig.template => ulib/templates/apacheconfig}/sites/default.ssl.conf (100%) rename lib/{apacheconfig.template => ulib/templates/apacheconfig}/workers.properties (100%) rename lib/{apacheconfig.template => ulib/templates/apacheconfig}/www/.udir (100%) rename lib/{runsconfig.template => ulib/templates/runsconfig}/config (100%) rename lib/{runsconfig.template => ulib/templates/runsconfig}/default (100%) rename lib/{runsconfig.template => ulib/templates/runsconfig}/runs.conf (100%) rename lib/{runsconfig.template => ulib/templates/runsconfig}/script.template (100%) rename lib/{runsconfig.template => ulib/templates/runsconfig}/services (100%) rename lib/{runsconfig.template => ulib/templates/runsconfig}/sysinfos.conf (100%) rename lib/{runsconfig.template => ulib/templates/runsconfig}/userdefault (100%) 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=.