Author: justi9
Date: 2010-05-10 13:25:54 -0400 (Mon, 10 May 2010)
New Revision: 3952
Removed:
mgmt/newdata/cumin/bin/cumin-instance-init
Modified:
mgmt/newdata/cumin/Makefile
mgmt/newdata/etc/Makefile.common
Log:
Simplify install rule around CUMIN_HOME variable
Modified: mgmt/newdata/cumin/Makefile
===================================================================
--- mgmt/newdata/cumin/Makefile 2010-05-10 16:00:01 UTC (rev 3951)
+++ mgmt/newdata/cumin/Makefile 2010-05-10 17:25:54 UTC (rev 3952)
@@ -2,34 +2,32 @@
include ../etc/Makefile.common
-name := cumin
-home := ${SHARE_DIR}/${name}
+CUMIN_HOME := $(shell mktemp -d)
build:
python -m compileall -x '/\.svn' -f python
install: build
- install -d ${BIN_DIR}
- install -pm 0755 bin/cumin bin/cumin-* ${BIN_DIR}
- install -d ${DOC_DIR}/${name}
- install -pm 0644 LICENSE COPYING ${DOC_DIR}/${name}
- install -pm 0644 ../wooly/LICENSE-for-wsgiserver ${DOC_DIR}/${name}
- install -pm 0644 ../wooly/COPYING-for-wsgiserver ${DOC_DIR}/${name}
- install -d ${home}/model
- install -pm 0644 model/*.xml ${home}/model
- install -d ${home}/resources
- install -pm 0644 ../wooly/resources/* ${home}/resources
- install -pm 0644 resources/* ${home}/resources
- install -d ${ETC_DIR}/${name}
- ln -sf ${ETC_DIR}/${name} ${home}/etc
- install -pm 0644 etc/cumin.* ${ETC_DIR}/${name}
- install -pm 0755 etc/sysvinit-cumin ${ETC_DIR}/${name}
- install -d ${VAR_DIR}/log/${name}
- ln -sf ${VAR_DIR}/log/${name} ${home}/log
- bin/install-python-code python ${home}/python
- bin/install-python-code ../wooly/python ${home}/python
- bin/install-python-code ../rosemary/python ${home}/python
- bin/install-python-code ../mint/python ${home}/python
- bin/install-python-code ../parsley/python ${home}/python
+ install -d ${CUMIN_HOME}/bin
+ install -pm 0755 bin/cumin bin/cumin-* ${CUMIN_HOME}/bin
+ install -d ${CUMIN_HOME}/doc
+ install -pm 0644 LICENSE COPYING ${CUMIN_HOME}/doc
+ install -pm 0644 ../wooly/LICENSE-for-wsgiserver ${CUMIN_HOME}/doc
+ install -pm 0644 ../wooly/COPYING-for-wsgiserver ${CUMIN_HOME}/doc
+ install -d ${CUMIN_HOME}/model
+ install -pm 0644 model/*.xml ${CUMIN_HOME}/model
+ install -d ${CUMIN_HOME}/resources
+ install -pm 0644 ../wooly/resources/* ${CUMIN_HOME}/resources
+ install -pm 0644 resources/* ${CUMIN_HOME}/resources
+ install -d ${CUMIN_HOME}/etc
+ install -pm 0644 etc/cumin.* ${CUMIN_HOME}/etc
+ install -pm 0755 etc/sysvinit-cumin ${CUMIN_HOME}/etc
+ install -d ${CUMIN_HOME}/log
+ bin/install-python-code python ${CUMIN_HOME}/python
+ bin/install-python-code ../wooly/python ${CUMIN_HOME}/python
+ bin/install-python-code ../rosemary/python ${CUMIN_HOME}/python
+ bin/install-python-code ../mint/python ${CUMIN_HOME}/python
+ bin/install-python-code ../parsley/python ${CUMIN_HOME}/python
+ find ${CUMIN_HOME} -type d
clean: clean-python-files
Deleted: mgmt/newdata/cumin/bin/cumin-instance-init
===================================================================
--- mgmt/newdata/cumin/bin/cumin-instance-init 2010-05-10 16:00:01 UTC (rev 3951)
+++ mgmt/newdata/cumin/bin/cumin-instance-init 2010-05-10 17:25:54 UTC (rev 3952)
@@ -1,78 +0,0 @@
-#!/usr/bin/python
-
-import sys, os
-from os.path import *
-
-def usage():
- print "Usage: cumin-instance-init [system|local|prefix PREFIX]"
- sys.exit(1)
-
-def check_home(dir):
- if isdir(dir):
- # Check writable
- pass
- else:
- os.makedirs(dir)
-
-if "-h" in sys.argv or "--help" in sys.argv:
- usage()
-
-try:
- type = sys.argv[1]
-except IndexError:
- usage()
-
-if type == "system":
- prefix = join(sep, "usr")
- home = join(sep, "var", "lib", "cumin")
-
- check_home(home)
-
- map = ((join(sep, "etc", "cumin"), join(home, "etc")),
- (join(sep, "var", "log", "cumin"), join(home,
"log")),
- (join(prefix, "share", "wooly", "resources"),
join(home, "resources-wooly")),
- (join(prefix, "share", "cumin", "resources"),
join(home, "resources")),
- (join(prefix, "share", "mint", "sql"),
join(home, "sql")),
- (join(prefix, "share", "mint", "xml"),
join(home, "xml")))
-elif type == "local":
- prefix = join(sep, "usr", "local")
- home = join(sep, "var", "local", "lib",
"cumin")
-
- check_home(home)
-
- map = ((join(prefix, "etc", "cumin"), join(home,
"etc")),
- (join(sep, "var", "local", "log",
"cumin"), join(home, "log")),
- (join(prefix, "share", "wooly", "resources"),
join(home, "resources-wooly")),
- (join(prefix, "share", "cumin", "resources"),
join(home, "resources")),
- (join(prefix, "share", "mint", "sql"),
join(home, "sql")),
- (join(prefix, "share", "mint", "xml"),
join(home, "xml")))
-elif type == "prefix":
- try:
- prefix = sys.argv[2]
- except IndexError:
- usage()
-
- home = join(prefix, "var", "lib", "cumin")
-
- check_home(home)
-
- map = ((join(prefix, "etc", "cumin"), join(home,
"etc")),
- (join(prefix, "var", "log", "cumin"), join(home,
"log")),
- (join(prefix, "share", "wooly", "resources"),
join(home, "resources-wooly")),
- (join(prefix, "share", "cumin", "resources"),
join(home, "resources")),
- (join(prefix, "share", "mint", "sql"),
join(home, "sql")),
- (join(prefix, "share", "mint", "xml"),
join(home, "xml")))
-else:
- print "Error: '%s' is not a recognized instance type" % type
- usage()
-
-for src, dst in map:
- if exists(dst):
- #print "File already exists: %s" % dst
- pass
- elif islink(dst):
- #print "Link already exists: %s" % dst
- pass
- else:
- #print "Creating symlink: %s -> %s" % (dst, src)
- os.symlink(src, dst)
Modified: mgmt/newdata/etc/Makefile.common
===================================================================
--- mgmt/newdata/etc/Makefile.common 2010-05-10 16:00:01 UTC (rev 3951)
+++ mgmt/newdata/etc/Makefile.common 2010-05-10 17:25:54 UTC (rev 3952)
@@ -13,5 +13,7 @@
VAR_DIR := ${PREFIX}/var
endif
+LOG_DIR := ${VAR_DIR}/log
+
clean-python-files:
find python -type f -name \*.py[co] -delete