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 <dlezcano@fr.ibm.com>
This commit is contained in:
Daniel Lezcano 2010-06-07 11:33:55 +02:00
parent d6b1784e1e
commit c01d62f21b
9 changed files with 17 additions and 15 deletions

View File

@ -2,8 +2,8 @@
ACLOCAL_AMFLAGS = -I config ACLOCAL_AMFLAGS = -I config
SUBDIRS = src scripts doc SUBDIRS = src templates doc
DIST_SUBDIRS = config src scripts doc DIST_SUBDIRS = config src templates doc
EXTRA_DIST = autogen.sh lxc.spec CONTRIBUTING MAINTAINERS ChangeLog EXTRA_DIST = autogen.sh lxc.spec CONTRIBUTING MAINTAINERS ChangeLog
pcdatadir = $(datadir)/pkgconfig pcdatadir = $(datadir)/pkgconfig

View File

@ -57,6 +57,7 @@ AS_AC_EXPAND(LXC_GENERATE_DATE, "$(date)")
AS_AC_EXPAND(LXCPATH, "${with_config_path}") AS_AC_EXPAND(LXCPATH, "${with_config_path}")
AS_AC_EXPAND(LXCROOTFSMOUNT, "${with_rootfs_path}") AS_AC_EXPAND(LXCROOTFSMOUNT, "${with_rootfs_path}")
AS_AC_EXPAND(LXCINITDIR, $libdir/lxc) AS_AC_EXPAND(LXCINITDIR, $libdir/lxc)
AS_AC_EXPAND(LXCTEMPLATEDIR, $libdir/lxc/templates)
AH_TEMPLATE([LXCPATH], [lxc configuration repository]) AH_TEMPLATE([LXCPATH], [lxc configuration repository])
AH_TEMPLATE([LXCINITDIR], [lxc-init directory location]) AH_TEMPLATE([LXCINITDIR], [lxc-init directory location])
AH_TEMPLATE([LXCROOTFSMOUNT], [lxc default rootfs mount point]) AH_TEMPLATE([LXCROOTFSMOUNT], [lxc default rootfs mount point])
@ -133,12 +134,12 @@ AC_CONFIG_FILES([
doc/examples/lxc-veth.conf doc/examples/lxc-veth.conf
doc/examples/lxc-complex.conf doc/examples/lxc-complex.conf
scripts/Makefile templates/Makefile
scripts/lxc-debian templates/lxc-debian
scripts/lxc-ubuntu templates/lxc-ubuntu
scripts/lxc-busybox templates/lxc-busybox
scripts/lxc-fedora templates/lxc-fedora
scripts/lxc-sshd templates/lxc-sshd
src/Makefile src/Makefile
src/lxc/Makefile src/lxc/Makefile

View File

@ -44,6 +44,7 @@ shortoptions='hn:f:t:'
longoptions='help,name:,config:,template:' longoptions='help,name:,config:,template:'
lxc_path=@LXCPATH@ lxc_path=@LXCPATH@
bindir=@BINDIR@ bindir=@BINDIR@
templatedir=@LXCTEMPLATEDIR@
getopt=$(getopt -o $shortoptions --longoptions $longoptions -- "$@") getopt=$(getopt -o $shortoptions --longoptions $longoptions -- "$@")
if [ $? != 0 ]; then if [ $? != 0 ]; then
@ -133,7 +134,7 @@ fi
if [ ! -z $lxc_template ]; then if [ ! -z $lxc_template ]; then
type ${bindir}/lxc-$lxc_template >/dev/null type ${templatedir}/lxc-$lxc_template >/dev/null
if [ $? -ne 0 ]; then if [ $? -ne 0 ]; then
echo "unknown template '$lxc_template'" echo "unknown template '$lxc_template'"
${bindir}/lxc-destroy -n $lxc_name ${bindir}/lxc-destroy -n $lxc_name
@ -166,7 +167,7 @@ if [ ! -z $lxc_template ]; then
read dummy read dummy
fi 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 if [ $? -ne 0 ]; then
echo "failed to execute template '$lxc_template'" echo "failed to execute template '$lxc_template'"
${bindir}/lxc-destroy -n $lxc_name ${bindir}/lxc-destroy -n $lxc_name

View File

@ -1,4 +1,6 @@
bin_SCRIPTS = \ templatesdir=@LXCTEMPLATEDIR@
templates_SCRIPTS = \
lxc-debian \ lxc-debian \
lxc-ubuntu \ lxc-ubuntu \
lxc-fedora \ lxc-fedora \

View File

@ -305,4 +305,3 @@ if [ $? -ne 0 ]; then
echo "failed to write configuration file" echo "failed to write configuration file"
exit 1 exit 1
fi fi

4
scripts/lxc-debian.in → templates/lxc-debian.in Executable file → Normal file
View File

@ -217,7 +217,7 @@ clean()
# lock, so we won't purge while someone is creating a repository # lock, so we won't purge while someone is creating a repository
( (
flock -n -x 200 flock -n -x 200
if [ $? != 0 ]; then if [ $? != 0 ]; then
echo "Cache repository is busy." echo "Cache repository is busy."
exit 1 exit 1
@ -276,7 +276,7 @@ fi
if [ "$(id -u)" != "0" ]; then if [ "$(id -u)" != "0" ]; then
echo "This script should be run as 'root'" echo "This script should be run as 'root'"
exit 1 exit 1
fi fi
rootfs=$path/rootfs rootfs=$path/rootfs

1
scripts/lxc-sshd.in → templates/lxc-sshd.in Executable file → Normal file
View File

@ -189,4 +189,3 @@ if [ $? -ne 0 ]; then
echo "failed to write configuration file" echo "failed to write configuration file"
exit 1 exit 1
fi fi