Commit c4447efb authored by Nikos Skalkotos's avatar Nikos Skalkotos
Browse files

Add commondir variable to helper's building system

parent d46fb573
base_name=$(subst -helper,,$(PACKAGE))
SUBDIRS = tasks
base_name=$(subst -helper,,$(PACKAGE))
initdir=$(sysconfdir)
commondir=$(datarootdir)/$(base_name)
export base_name
export commondir
dist_doc_DATA = COPYING AUTHORS ChangeLog
dist_init_SCRIPTS = rc.local snf-passtohash.py
dist_init_DATA = common.sh
dist_common_SCRIPTS= snf-passtohash.py
dist_common_DATA = common.sh
edit = sed \
-e 's|@sysconfdir[@]|$(sysconfdir)|g' \
-e 's|@localstatedir[@]|$(localstatedir)|g' \
-e 's|@datarootdir[@]|$(datarootdir)|g' \
-e 's|@base_name[@]|$(base_name)|g'
-e 's|@base_name[@]|$(base_name)|g'\
-e 's|@RESIZE2FS[@]|$(RESIZE2FS)|g' \
-e 's|@XMLSTARLET[@]|$(XMLSTARLET)|g'
%:%.in Makefile
@echo "Real Path is: $(rootdir)"
rm -f $@ $@.tmp
srcdir=''; \
test -f ./$@.in || srcdir=$(srcdir)/; \
......
......@@ -7,7 +7,7 @@
### END TAST INFO
set -e
. @datarootdir@/@base_name@/common.sh
. @commondir@/common.sh
if [ ! -b "$SNF_IMAGE_DEV" ]; then
log_error "Device file:\`${SNF_IMAGE_DEV}' is not a block device"
......
......@@ -7,7 +7,7 @@
### END TAST INFO
set -e
. @datarootdir@/@base_name@/common.sh
. @commondir@/common.sh
if [ ! -d "$SNF_IMAGE_TARGET" ]; then
log_error "Target dir:\`$SNF_IMAGE_TARGET' is missing"
......
......@@ -8,7 +8,7 @@
### END TAST INFO
set -e
. @datarootdir@/@base_name@/common.sh
. @commondir@/common.sh
if [ ! -d "$SNF_IMAGE_TARGET" ]; then
log_error "Target dir: \`$SNF_IMAGE_TARGET' is missing"
......
......@@ -7,7 +7,7 @@
### END TAST INFO
set -e
. @datarootdir@/@base_name@/common.sh
. @commondir@/common.sh
if [ ! -d "$SNF_IMAGE_TARGET" ]; then
log_error "Target dir: \`$SNF_IMAGE_TARGET' is missing."
......
......@@ -8,7 +8,7 @@
### END TAST INFO
set -e
. @datarootdir@/@base_name@/common.sh
. @commondir@/common.sh
if [ -z "$SNF_IMAGE_TARGET" ]; then
log_error "Target dir: \`$SNF_IMAGE_TARGET' is missing"
......
......@@ -8,7 +8,7 @@
### END TAST INFO
set -e
. @datarootdir@/@base_name@/common.sh
. @commondir@/common.sh
if [ ! -d "$SNF_IMAGE_TARGET" ]; then
log_error "Target directory \`$SNF_IMAGE_TARGET' is missing"
......
......@@ -8,7 +8,7 @@
### END TAST INFO
set -e
. @datarootdir@/@base_name@/common.sh
. @commondir@/common.sh
if [ ! -d "$SNF_IMAGE_TARGET" ]; then
log_error "Target dir: \`$SNF_IMAGE_TARGET' is missing"
......
......@@ -8,7 +8,7 @@
### END TAST INFO
set -e
. @datarootdir@/@base_name@/common.sh
. @commondir@/common.sh
windows_hostname() {
local target=$1
......
......@@ -8,7 +8,7 @@
### END TAST INFO
set -e
. @datarootdir@/@base_name@/common.sh
. @commondir@/common.sh
windows_password() {
local target=$1
......@@ -31,7 +31,7 @@ linux_password() {
local target=$1
local password=$2
local hash=$(/usr/share/snf-image/snf-passtohash.py $password)
local hash=$(@commondir@/snf-passtohash.py $password)
if [ ! -e ${target}/etc/shadow ]; then
log_error "No /etc/shadow found!"
fi
......
......@@ -8,7 +8,7 @@
### END TAST INFO
set -e
. @datarootdir@/@base_name@/common.sh
. @commondir@/common.sh
if [ ! -d "$SNF_IMAGE_TARGET" ]; then
log_error "Target dir:\`$SNF_IMAGE_TARGET' is missing"
......
base_name=$(subst -helper,,$(PACKAGE))
tasksdir=${libdir}/$(base_name)/tasks
dist_tasks_SCRIPTS = \
10ResizeUnmounted \
30MountImage \
......@@ -18,7 +17,7 @@ edit = sed \
-e 's|@sysconfdir[@]|$(sysconfdir)|g' \
-e 's|@localstatedir[@]|$(localstatedir)|g' \
-e 's|@datarootdir[@]|$(datarootdir)|g' \
-e 's|@base_name[@]|$(base_name)|g'
-e 's|@commondir[@]|$(commondir)|g'
%:%.in Makefile
rm -f $@ $@.tmp
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment