From: Daniel Lezcano Date: Mon, 7 Jun 2010 09:33:55 +0000 (+0200) Subject: move script templates to an adequate place X-Git-Tag: lxc-0.7.0~22 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c01d62f21b21ba6c2b8b78ab3c2b37cc8f8fd265;p=thirdparty%2Flxc.git move script templates to an adequate place At present the lxc-{template} scripts are installed in the $bindir. This is not the right place as specified by the FHS, so they go to $libdir/lxc/templates. Signed-off-by: Daniel Lezcano --- diff --git a/Makefile.am b/Makefile.am index 90b771bd1..9945d00c7 100644 --- a/Makefile.am +++ b/Makefile.am @@ -2,8 +2,8 @@ ACLOCAL_AMFLAGS = -I config -SUBDIRS = src scripts doc -DIST_SUBDIRS = config src scripts doc +SUBDIRS = src templates doc +DIST_SUBDIRS = config src templates doc EXTRA_DIST = autogen.sh lxc.spec CONTRIBUTING MAINTAINERS ChangeLog pcdatadir = $(datadir)/pkgconfig diff --git a/configure.ac b/configure.ac index 1df6ab513..867c1dfb4 100644 --- a/configure.ac +++ b/configure.ac @@ -57,6 +57,7 @@ AS_AC_EXPAND(LXC_GENERATE_DATE, "$(date)") AS_AC_EXPAND(LXCPATH, "${with_config_path}") AS_AC_EXPAND(LXCROOTFSMOUNT, "${with_rootfs_path}") AS_AC_EXPAND(LXCINITDIR, $libdir/lxc) +AS_AC_EXPAND(LXCTEMPLATEDIR, $libdir/lxc/templates) AH_TEMPLATE([LXCPATH], [lxc configuration repository]) AH_TEMPLATE([LXCINITDIR], [lxc-init directory location]) AH_TEMPLATE([LXCROOTFSMOUNT], [lxc default rootfs mount point]) @@ -133,12 +134,12 @@ AC_CONFIG_FILES([ doc/examples/lxc-veth.conf doc/examples/lxc-complex.conf - scripts/Makefile - scripts/lxc-debian - scripts/lxc-ubuntu - scripts/lxc-busybox - scripts/lxc-fedora - scripts/lxc-sshd + templates/Makefile + templates/lxc-debian + templates/lxc-ubuntu + templates/lxc-busybox + templates/lxc-fedora + templates/lxc-sshd src/Makefile src/lxc/Makefile diff --git a/src/lxc/lxc-create.in b/src/lxc/lxc-create.in index c23006569..ee5173e2e 100644 --- a/src/lxc/lxc-create.in +++ b/src/lxc/lxc-create.in @@ -44,6 +44,7 @@ shortoptions='hn:f:t:' longoptions='help,name:,config:,template:' lxc_path=@LXCPATH@ bindir=@BINDIR@ +templatedir=@LXCTEMPLATEDIR@ getopt=$(getopt -o $shortoptions --longoptions $longoptions -- "$@") if [ $? != 0 ]; then @@ -133,7 +134,7 @@ fi if [ ! -z $lxc_template ]; then - type ${bindir}/lxc-$lxc_template >/dev/null + type ${templatedir}/lxc-$lxc_template >/dev/null if [ $? -ne 0 ]; then echo "unknown template '$lxc_template'" ${bindir}/lxc-destroy -n $lxc_name @@ -166,7 +167,7 @@ if [ ! -z $lxc_template ]; then read dummy fi - ${bindir}/lxc-$lxc_template --path=$lxc_path/$lxc_name --name=$lxc_name + ${templatedir}/lxc-$lxc_template --path=$lxc_path/$lxc_name --name=$lxc_name if [ $? -ne 0 ]; then echo "failed to execute template '$lxc_template'" ${bindir}/lxc-destroy -n $lxc_name diff --git a/scripts/Makefile.am b/templates/Makefile.am similarity index 55% rename from scripts/Makefile.am rename to templates/Makefile.am index 39d13a36c..d55f53aff 100644 --- a/scripts/Makefile.am +++ b/templates/Makefile.am @@ -1,4 +1,6 @@ -bin_SCRIPTS = \ +templatesdir=@LXCTEMPLATEDIR@ + +templates_SCRIPTS = \ lxc-debian \ lxc-ubuntu \ lxc-fedora \ diff --git a/scripts/lxc-busybox.in b/templates/lxc-busybox.in similarity index 99% rename from scripts/lxc-busybox.in rename to templates/lxc-busybox.in index 5f04dd8e9..cdd14b5c7 100644 --- a/scripts/lxc-busybox.in +++ b/templates/lxc-busybox.in @@ -305,4 +305,3 @@ if [ $? -ne 0 ]; then echo "failed to write configuration file" exit 1 fi - diff --git a/scripts/lxc-debian.in b/templates/lxc-debian.in old mode 100755 new mode 100644 similarity index 99% rename from scripts/lxc-debian.in rename to templates/lxc-debian.in index d940b7f50..5a6f5532b --- a/scripts/lxc-debian.in +++ b/templates/lxc-debian.in @@ -217,7 +217,7 @@ clean() # lock, so we won't purge while someone is creating a repository ( - flock -n -x 200 + flock -n -x 200 if [ $? != 0 ]; then echo "Cache repository is busy." exit 1 @@ -276,7 +276,7 @@ fi if [ "$(id -u)" != "0" ]; then echo "This script should be run as 'root'" exit 1 -fi +fi rootfs=$path/rootfs diff --git a/scripts/lxc-fedora.in b/templates/lxc-fedora.in similarity index 100% rename from scripts/lxc-fedora.in rename to templates/lxc-fedora.in diff --git a/scripts/lxc-sshd.in b/templates/lxc-sshd.in old mode 100755 new mode 100644 similarity index 99% rename from scripts/lxc-sshd.in rename to templates/lxc-sshd.in index 497bbfd88..d47420685 --- a/scripts/lxc-sshd.in +++ b/templates/lxc-sshd.in @@ -189,4 +189,3 @@ if [ $? -ne 0 ]; then echo "failed to write configuration file" exit 1 fi - diff --git a/scripts/lxc-ubuntu.in b/templates/lxc-ubuntu.in similarity index 100% rename from scripts/lxc-ubuntu.in rename to templates/lxc-ubuntu.in