[Lunar-commits] <lunar> Backport - mostly cosmetics and internals.
Auke Kok
sofar at lunar-linux.org
Mon Jul 2 04:43:09 CEST 2012
commit a6af5798caf0f3288a6001c640946f2c6f2707f0
Author: Auke Kok <sofar at lunar-linux.org>
Date: Sun Jan 29 19:28:29 2006 +0000
Backport - mostly cosmetics and internals.
---
var/lib/lunar/functions/build.lunar | 83 +++++++++++++++++++--------------
var/lib/lunar/functions/depends.lunar | 6 +--
var/lib/lunar/functions/init.lunar | 2 +-
3 files changed, 51 insertions(+), 40 deletions(-)
diff --git a/var/lib/lunar/functions/build.lunar b/var/lib/lunar/functions/build.lunar
index 18c0d8f..899fd5f 100644
--- a/var/lib/lunar/functions/build.lunar
+++ b/var/lib/lunar/functions/build.lunar
@@ -147,57 +147,66 @@ default_pre_build() {
}
+# wrapper function to call ./configure
+_configure()
+{
+ debug_msg "_configure($@)"
+ if [ -e ./configure ]; then
+ verbose_msg "CFLAGS=\"$CFLAGS\""
+ verbose_msg "LDFLAGS=\"$LDFLAGS\""
+ verbose_msg "./configure $@"
+ ./configure $@
+ elif [ -e Makefile -o -e makefile ]; then
+ verbose_msg "Missing \"configure\": skipping configure stage."
+ else
+ error_message "${PROBLEM_COLOR}Missing ${FILE_COLOR}configure${PROBLEM_COLOR} and/or ${FILE_COLOR}Makefile${PROBLEM_COLOR}!${DEFAULT_COLOR}"
+ return 1
+ fi
+}
+
+
default_config() {
debug_msg "default_config ($@)"
verbose_msg "running \"default_config\""
-
- verbose_msg "CFLAGS=\"$CFLAGS\"" &&
- verbose_msg "OPTS=\"$OPTS\"" &&
- verbose_msg "./configure --build=$BUILD --prefix=$MODULE_PREFIX --sysconfdir=/etc --localstatedir=/var --infodir=$MODULE_PREFIX/share/info --mandir=$MODULE_PREFIX/share/man $OPTS"
-
- ./configure --build=$BUILD \
- --prefix=$MODULE_PREFIX \
- --sysconfdir=/etc \
- --localstatedir=/var \
- --infodir=$MODULE_PREFIX/share/info \
- --mandir=$MODULE_PREFIX/share/man \
- $OPTS
+ _configure --build=$BUILD \
+ --prefix=$MODULE_PREFIX \
+ --sysconfdir=/etc \
+ --localstatedir=/var \
+ --infodir=$MODULE_PREFIX/share/info \
+ --mandir=$MODULE_PREFIX/share/man \
+ $OPTS
} > $C_FIFO 2>&1
default_game_config() {
debug_msg "default_game_config ($@)"
verbose_msg "running \"default_game_config\""
- verbose_msg "CFLAGS=\"$CFLAGS\"" &&
- verbose_msg "OPTS=\"$OPTS\"" &&
- verbose_msg "./configure --build=$BUILD --prefix=$MODULE_PREFIX --bindir=$MODULE_PREFIX/games --datadir=$MODULE_PREFIX/share/games --sysconfdir=/etc --localstatedir=/var --infodir=$MODULE_PREFIX/share/info --mandir=$MODULE_PREFIX/share/man $OPTS"
-
- ./configure --build=$BUILD \
- --prefix=$MODULE_PREFIX \
- --bindir=$MODULE_PREFIX/games \
- --datadir=$MODULE_PREFIX/share/games \
- --sysconfdir=/etc \
- --localstatedir=/var \
- --infodir=$MODULE_PREFIX/share/info \
- --mandir=$MODULE_PREFIX/share/man \
- $OPTS
+ _configure --build=$BUILD \
+ --prefix=$MODULE_PREFIX \
+ --bindir=$MODULE_PREFIX/games \
+ --datadir=$MODULE_PREFIX/share/games \
+ --sysconfdir=/etc \
+ --localstatedir=/var/games \
+ --infodir=$MODULE_PREFIX/share/info \
+ --mandir=$MODULE_PREFIX/share/man \
+ $OPTS
} > $C_FIFO 2>&1
default_cvs_config() {
debug_msg "default_cvs_config ($@)"
verbose_msg "running \"default_cvs_config\""
- verbose_msg "CFLAGS=\"$CFLAGS\"" &&
- verbose_msg "OPTS=\"$OPTS\"" &&
- verbose_msg "./autogen.sh --build=$BUILD --prefix=$MODULE_PREFIX --sysconfdir=/etc --localstatedir=/var --infodir=$MODULE_PREFIX/share/info --mandir=$MODULE_PREFIX/share/man $OPTS"
-
- ./autogen.sh --build=$BUILD \
- --prefix=$MODULE_PREFIX \
- --sysconfdir=/etc \
- --localstatedir=/var \
- --infodir=$MODULE_PREFIX/share/info \
- --mandir=$MODULE_PREFIX/share/man \
- $OPTS
+ verbose_msg "CFLAGS=\"$CFLAGS\""
+ verbose_msg "LDFLAGS=\"$LDFLAGS\""
+ verbose_msg "MODULE_PREFIX=\"$MODULE_PREFIX\""
+
+ ./autogen.sh --build=$BUILD \
+ --prefix=$MODULE_PREFIX \
+ --sysconfdir=/etc \
+ --localstatedir=/var \
+ --infodir=$MODULE_PREFIX/share/info \
+ --mandir=$MODULE_PREFIX/share/man \
+ $OPTS
} > $C_FIFO 2>&1
@@ -209,6 +218,7 @@ default_make() {
make install
} > $C_FIFO 2>&1
+
default_game_build() {
debug_msg "default_game_build ($@)"
verbose_msg "running \"default_game_build\""
@@ -216,6 +226,7 @@ default_game_build() {
default_make
} > $C_FIFO 2>&1
+
default_build() {
debug_msg "default_build ($@)"
verbose_msg "running \"default_build\""
diff --git a/var/lib/lunar/functions/depends.lunar b/var/lib/lunar/functions/depends.lunar
index 49b688c..c4cb5c7 100644
--- a/var/lib/lunar/functions/depends.lunar
+++ b/var/lib/lunar/functions/depends.lunar
@@ -203,9 +203,9 @@ run_depends() {
fi
if module_installed $DEP ; then
- DEPMOD_AVAIL="Use optional ${MESSAGE_COLOR}(presently installed) module${QUERY_COLOR} $DEP"
+ DEPMOD_AVAIL="Use optional (${FILE_COLOR}installed${QUERY_COLOR}) module ${MODULE_COLOR}$DEP${DEFAULT_COLOR}${MESSAGE_COLOR}"
else
- DEPMOD_AVAIL="Install & use optional ${PROBLEM_COLOR}(not yet installed) ${MESSAGE_COLOR}module${QUERY_COLOR} $DEP"
+ DEPMOD_AVAIL="Install & use optional (${PROBLEM_COLOR}not installed${QUERY_COLOR}) module ${MODULE_COLOR}$DEP${DEFAULT_COLOR}${MESSAGE_COLOR}"
fi
# this is shortcut case s1) as discussed in lunar-dev ML
@@ -214,7 +214,7 @@ run_depends() {
add_depends "$MODULE" "$DEP" "on" "optional" "$2" "$3"
lin --deps $DEP
elif query "$DEPMOD_AVAIL
- dependency - purpose: $4? " $DEFAULT ; then
+ ${QUERY_COLOR}Purpose: ${DEFAULT_COLOR}${MESSAGE_COLOR}$4 ${QUERY_COLOR}?" $DEFAULT ; then
add_depends "$MODULE" "$DEP" "on" "optional" "$2" "$3"
lin --deps $DEP
else
diff --git a/var/lib/lunar/functions/init.lunar b/var/lib/lunar/functions/init.lunar
index 97c222c..a62745a 100644
--- a/var/lib/lunar/functions/init.lunar
+++ b/var/lib/lunar/functions/init.lunar
@@ -31,7 +31,7 @@
enviro_check() {
debug_msg "enviro_check ($@)"
if [ -z $LUNAR_INSTALL ]; then
- if [ -z "$SHELL" ] || [ "$USER" != "root" ] ; then
+ if [ -z "$SHELL" ] || [ "$(getent passwd $USER | cut -d: -f3)" != "0" ] ; then
message "${PROBLEM_COLOR}WARNING:${DEFAULT_COLOR}${MESSAGE_COLOR}" \
"You are not running a fully initialized root shell, consider"
message "running a proper root shell with 'su -'" \
More information about the Lunar-commits
mailing list