浏览代码

bugfix https://trac.osgeo.org/grass/ticket/1034

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@41862 15284696-431f-4ddb-bdfa-cd5b030d7da7
Martin Landa 15 年之前
父节点
当前提交
2066ba853c
共有 4 个文件被更改,包括 29 次插入18 次删除
  1. 5 6
      binaryInstall.src
  2. 11 4
      include/Make/Install.make
  3. 11 0
      lib/init/Makefile
  4. 2 8
      lib/init/grass.py

+ 5 - 6
binaryInstall.src

@@ -9,7 +9,7 @@
 # GRASS binary package installation tool
 # GRASS binary package installation tool
 # platform independent
 # platform independent
 #
 #
-# 1999-2000 by Markus Neteler
+# 1999-2000, 2010 by Markus Neteler, and the GRASS development team
 #
 #
 ##########################################################################
 ##########################################################################
 
 
@@ -161,8 +161,8 @@ fi
 
 
 echo "Using $UNPACK decompressor..."
 echo "Using $UNPACK decompressor..."
 
 
-echo "The package $PACKAGE_NAME seems to be o.k."
-echo " Proceeding..."
+echo "The package $PACKAGE_NAME seems to be OK"
+echo "Proceeding..."
 echo ""
 echo ""
 
 
 # Check if the paths for the binary and the destination are the same
 # Check if the paths for the binary and the destination are the same
@@ -285,9 +285,8 @@ cd $CURR_DIR
 echo "Creating start script:"
 echo "Creating start script:"
 echo "$BINDIR/$GRASSPRG -> $BINDIR/grass-$NAME_VER"
 echo "$BINDIR/$GRASSPRG -> $BINDIR/grass-$NAME_VER"
 
 
-STRING="s|^GISBASE.*|GISBASE\=\'$DESTDIR\'|g"
-
-sed -e $STRING $DESTDIR/$GRASSPRG.tmp > $BINDIR/grass-$NAME_VER
+sed -e "s#@GISBASE@#$DESTDIR#g" \
+    $DESTDIR/$GRASSPRG.tmp > $BINDIR/grass-$NAME_VER
 if [ $? -eq 1 ] ; then
 if [ $? -eq 1 ] ; then
   echo "An error occured trying to create the grass start script! Exiting."
   echo "An error occured trying to create the grass start script! Exiting."
   echo "You probably do not have permission to install into $BINDIR."
   echo "You probably do not have permission to install into $BINDIR."

+ 11 - 4
include/Make/Install.make

@@ -2,7 +2,7 @@
 # This should be "include"d from the top-level Makefile, and nowhere else
 # This should be "include"d from the top-level Makefile, and nowhere else
 
 
 BIN_DIST_FILES = $(FILES) \
 BIN_DIST_FILES = $(FILES) \
-	grass$(GRASS_NAME).tmp \
+	$(GRASS_NAME).tmp \
 	bin \
 	bin \
 	docs \
 	docs \
 	driver \
 	driver \
@@ -81,11 +81,18 @@ install:
 real-install:
 real-install:
 	test -d $(INST_DIR) || $(MAKE_DIR_CMD) $(INST_DIR)
 	test -d $(INST_DIR) || $(MAKE_DIR_CMD) $(INST_DIR)
 	test -d $(UNIX_BIN) || $(MAKE_DIR_CMD) $(UNIX_BIN)
 	test -d $(UNIX_BIN) || $(MAKE_DIR_CMD) $(UNIX_BIN)
-	-sed 's#'$(RUN_GISBASE)'#'$(INST_DIR)'#g' $(ARCH_BINDIR)/$(GRASS_NAME) > $(UNIX_BIN)/$(GRASS_NAME)
-	-chmod a+x $(UNIX_BIN)/$(GRASS_NAME)
 ifneq ($(strip $(MINGW)),)
 ifneq ($(strip $(MINGW)),)
-	-sed 's#'$(RUN_GISBASE)'#'$(INST_DIR)'#g' $(ARCH_BINDIR)/$(GRASS_NAME).py > $(UNIX_BIN)/$(GRASS_NAME).py
+	-sed -e 's#'@GISBASE@'#'$(INST_DIR)'#g' \
+	     -e 's#'@LD_LIBRARY_PATH_VAR@'#'$(LD_LIBRARY_PATH_VAR)'#g' \
+	     -e 's#'@CONFIG_PROJSHARE@'#'$(PROJSHARE)'#g' \
+	     $(ARCH_DISTDIR)/$(GRASS_NAME).tmp > $(UNIX_BIN)/$(GRASS_NAME).py
 	-chmod a+x $(UNIX_BIN)/$(GRASS_NAME).py
 	-chmod a+x $(UNIX_BIN)/$(GRASS_NAME).py
+else
+	-sed -e 's#'@GISBASE@'#'$(INST_DIR)'#g' \
+	     -e 's#'@LD_LIBRARY_PATH_VAR@'#'$(LD_LIBRARY_PATH_VAR)'#g' \
+	     -e 's#'@CONFIG_PROJSHARE@'#'$(PROJSHARE)'#g' \
+	     $(ARCH_DISTDIR)/$(GRASS_NAME).tmp > $(UNIX_BIN)/$(GRASS_NAME)
+	-chmod a+x $(UNIX_BIN)/$(GRASS_NAME)
 endif
 endif
 	-tar cBCf $(GISBASE) - . | tar xBCf $(INST_DIR) - 2>/dev/null
 	-tar cBCf $(GISBASE) - . | tar xBCf $(INST_DIR) - 2>/dev/null
 	-sed 's#'$(GISBASE)'#'$(INST_DIR)'#g' $(GISBASE)/etc/fontcap > $(INST_DIR)/etc/fontcap
 	-sed 's#'$(GISBASE)'#'$(INST_DIR)'#g' $(GISBASE)/etc/fontcap > $(INST_DIR)/etc/fontcap

+ 11 - 0
lib/init/Makefile

@@ -15,6 +15,7 @@ LIBES = $(GISLIB) $(DATETIMELIB)
 
 
 FILES = \
 FILES = \
 	$(ARCH_BINDIR)/$(START_UP) \
 	$(ARCH_BINDIR)/$(START_UP) \
+	$(ARCH_DISTDIR)/$(START_UP).tmp	\
 	$(ETC)/clean_temp$(EXE) \
 	$(ETC)/clean_temp$(EXE) \
 	$(ETC)/lock$(EXE) \
 	$(ETC)/lock$(EXE) \
 	$(ETC)/run$(EXE) \
 	$(ETC)/run$(EXE) \
@@ -74,6 +75,16 @@ endif
 	$< > $@
 	$< > $@
 	chmod +x $@
 	chmod +x $@
 
 
+$(ARCH_DISTDIR)/$(START_UP).tmp: grass.py
+	rm -f $@
+	sed \
+	-e 's#@GRASS_VERSION_NUMBER@#$(GRASS_VERSION_NUMBER)#' \
+	-e 's#@START_UP@#$(START_UP)#' \
+	-e 's#@GRASS_CONFIG_DIR@#$(GRASS_CONFIG_DIR)#' \
+	-e 's#@LD_LIBRARY_PATH_VAR@#$(LD_LIBRARY_PATH_VAR)#' \
+	-e 's#@CONFIG_PROJSHARE@#$(PROJSHARE)#' \
+	$< > $@
+
 $(ETC)/echo$(EXE) $(ETC)/run$(EXE): $(ETC)/%$(EXE): $(OBJDIR)/%.o
 $(ETC)/echo$(EXE) $(ETC)/run$(EXE): $(ETC)/%$(EXE): $(OBJDIR)/%.o
 	$(call linker_base,$(LINK),$(LDFLAGS),$(MANIFEST_OBJ))
 	$(call linker_base,$(LINK),$(LDFLAGS),$(MANIFEST_OBJ))
 
 

+ 2 - 8
lib/init/grass.py

@@ -32,17 +32,11 @@ import re
 
 
 # Variables substituted during build process
 # Variables substituted during build process
 # Set the GISBASE variable
 # Set the GISBASE variable
-if os.getenv("GISBASE"):
-    gisbase = os.getenv("GISBASE")
-else:
-    gisbase = "@GISBASE@"
+gisbase = "@GISBASE@"
 cmd_name = "@START_UP@"
 cmd_name = "@START_UP@"
 grass_version = "@GRASS_VERSION_NUMBER@"
 grass_version = "@GRASS_VERSION_NUMBER@"
 ld_library_path_var = '@LD_LIBRARY_PATH_VAR@'
 ld_library_path_var = '@LD_LIBRARY_PATH_VAR@'
-if os.getenv("GRASS_PROJSHARE"):
-    config_projshare = os.getenv("GRASS_PROJSHARE")
-else:
-    config_projshare = "@CONFIG_PROJSHARE@"
+config_projshare = "@CONFIG_PROJSHARE@"
 grass_config_dirname = "@GRASS_CONFIG_DIR@"
 grass_config_dirname = "@GRASS_CONFIG_DIR@"
 
 
 gisbase = os.path.normpath(gisbase)
 gisbase = os.path.normpath(gisbase)