Commit d9481348 authored by Sidnei da Silva's avatar Sidnei da Silva

parent 625b8da3
...@@ -11,7 +11,7 @@ PACKAGE_NAME=${NAME}-${MAJOR_VERSION}.${MINOR_VERSION}-${RELEASE_TAG} ...@@ -11,7 +11,7 @@ PACKAGE_NAME=${NAME}-${MAJOR_VERSION}.${MINOR_VERSION}-${RELEASE_TAG}
PYTHON="<<PYTHON>>" PYTHON="<<PYTHON>>"
ZPKG=zpkg ZPKG=zpkg
TMPDIR=/tmp TMPDIR=<<TMP_DIR>>
PREFIX=<<PREFIX>> PREFIX=<<PREFIX>>
BASE_DIR=<<BASE_DIR>> BASE_DIR=<<BASE_DIR>>
DISTUTILS_OPTS=<<DISTUTILS_OPTS>> DISTUTILS_OPTS=<<DISTUTILS_OPTS>>
......
...@@ -10,16 +10,14 @@ RELEASE_TAG=<<VERSION_RELEASE_TAG>> ...@@ -10,16 +10,14 @@ RELEASE_TAG=<<VERSION_RELEASE_TAG>>
PACKAGE_NAME=$(NAME)-$(MAJOR_VERSION).$(MINOR_VERSION)-$(RELEASE_TAG) PACKAGE_NAME=$(NAME)-$(MAJOR_VERSION).$(MINOR_VERSION)-$(RELEASE_TAG)
PYTHON="<<PYTHON>>" PYTHON="<<PYTHON>>"
PREFIX=<<PREFIX>> ZPKG=zpkg
BASE_DIR=<<BASE_DIR>> TMPDIR="<<TMP_DIR>>"
BUILD_BASE=<<BUILD_BASE>> PREFIX="<<PREFIX>>"
BASE_DIR="<<BASE_DIR>>"
DISTUTILS_OPTS=<<DISTUTILS_OPTS>> DISTUTILS_OPTS=<<DISTUTILS_OPTS>>
INSTALL_FLAGS=<<INSTALL_FLAGS>> INSTALL_FLAGS=<<INSTALL_FLAGS>>
TESTOPTS=-v TESTOPTS=-v
BUILD_FLAGS=--build-base="$(BUILD_BASE)" \ BUILD_FLAGS=-i
--build-lib="$(BUILD_BASE)\build-lib" \
--build-scripts="$(BUILD_BASE)\build-scripts" \
--build-temp="$(BUILD_BASE)\build-temp"
RM=del /f /q RM=del /f /q
!IF ("$(OS)" == "Windows_NT") !IF ("$(OS)" == "Windows_NT")
...@@ -37,37 +35,74 @@ default: build ...@@ -37,37 +35,74 @@ default: build
@ echo Zope built. Next, do 'nmake install'. @ echo Zope built. Next, do 'nmake install'.
@ echo. @ echo.
.PHONY: clean install build unbuild .PHONY : clean install instance untestinst testinst build
.PHONY: default .PHONY : default
# build: Do whatever 'setup.py build' implies # build: Do whatever 'setup.py build' implies
build: build:
$(PYTHON) "$(BASE_DIR)\setup.py" \ $(PYTHON) "$(BASE_DIR)\setup.py" \
$(DISTUTILS_OPTS) build $(BUILD_FLAGS) $(DISTUTILS_OPTS) build_ext $(BUILD_FLAGS)
# unbuild: Remove the build directory (undo the make build step)
unbuild:
-$(RMRF) $(BUILD_BASE)
# install: Install a software home. # install: Install a software home.
install: build version_txt install: build version_txt
$(PYTHON) "$(BASE_DIR)\setup.py" $(DISTUTILS_OPTS) install \ $(PYTHON) "$(BASE_DIR)\setup.py" $(DISTUTILS_OPTS) \
--prefix="$(PREFIX)" $(BUILD_FLAGS) $(INSTALL_FLAGS) build_ext $(BUILD_FLAGS) \
install --home="$(PREFIX)" $(INSTALL_FLAGS)
@ echo. @ echo.
@ echo Zope binaries installed successfully. @ echo Zope binaries installed successfully.
@ echo Now run '$(PYTHON) $(PREFIX)\bin\mkzopeinstance.py' @ echo Now run '$(PYTHON) $(PREFIX)\bin\mkzopeinstance.py'
# inplace: Do an in-place build
inplace: build
# test: Do an inplace build and run the Zope test suite.
test: inplace
$(PYTHON) "$(BASE_DIR)\test.py" $(TESTOPTS)
# instance: Do an inplace build and create an instance home in the resulting
# software home.
instance: build
$(PYTHON) "$(BASE_DIR)\utilities\mkzopeinstance.py" $(MKZ_FLAGS)
# testinst: Perform an inplace build and create an instance home in the
# resulting software home without asking questions. Useful when
# performing automated testing.
# testinst: MKZ_FLAGS=--user=admin:admin --dir="$(BASE_DIR)"
# testinst: instance
# uninstance: Remove the instance files made by testinstance (w/ prejudice)
uninstance:
$(RMRF) "$(BASE_DIR)/bin"
$(RMRF) "$(BASE_DIR)/etc"
$(RMRF) "$(BASE_DIR)/import"
$(RMRF) "$(BASE_DIR)/log"
$(RMRF) "$(BASE_DIR)/var"
$(RMRF) "$(BASE_DIR)/Products"
# clean: Delete the build files and any binaries/bytecode files in
# the source directory for good measure.
clean:
$(CD) "$(BASE_DIR)"
-$(RM) /s *.pyc *.pyo *.dll *.o *.obj *.pyd
-$(RM) "$(BASE_DIR)\lib\python\version.txt"
-$(RMRF) build
# version_txt: create a version file in lib/python/version.txt # version_txt: create a version file in lib/python/version.txt
version_txt: version_txt:
echo Zope $(MAJOR_VERSION).$(MINOR_VERSION)-$(RELEASE_TAG) >\ echo Zope $(MAJOR_VERSION).$(MINOR_VERSION)-$(RELEASE_TAG) >\
"$(BASE_DIR)/lib/python/version.txt" "$(BASE_DIR)/lib/python/version.txt"
# clean: Delete the build files and any binaries/bytecode files in # Building a source distribution requires that zpkg be available:
# the source directory for good measure. sdist: version_txt
clean: unbuild $(ZPKG) -C $(BASE_DIR)\releases\Zope2.cfg -r $(MAJOR_VERSION).$(MINOR_VERSION)$(RELEASE_TAG)
$(CD) "$(BASE_DIR)
-$(RM) /s *.pyc *.pyo *.dll *.o *.obj *.pyd # clobber: Make the source tree 'pristine' again.
-$(RM) (BASE_DIR)\lib\python\version.txt clobber: clean uninstance
# distclean: Make the source tree *really* 'pristine' again.
distclean: clobber
$(RM) makefile Makefile
$(RMRF) build-base
...@@ -17,6 +17,7 @@ import getopt ...@@ -17,6 +17,7 @@ import getopt
import os import os
import sys import sys
import versions import versions
import tempfile
QUIET=0 QUIET=0
...@@ -34,6 +35,7 @@ def main(): ...@@ -34,6 +35,7 @@ def main():
global PREFIX global PREFIX
BASE_DIR=os.path.abspath(os.path.dirname(os.path.dirname(sys.argv[0]))) BASE_DIR=os.path.abspath(os.path.dirname(os.path.dirname(sys.argv[0])))
PYTHON=sys.executable PYTHON=sys.executable
TMP_DIR = tempfile.gettempdir()
MAKEFILE=open(os.path.join(BASE_DIR, 'inst', IN_MAKEFILE)).read() MAKEFILE=open(os.path.join(BASE_DIR, 'inst', IN_MAKEFILE)).read()
REQUIRE_LF_ENABLED = 1 REQUIRE_LF_ENABLED = 1
REQUIRE_ZLIB = 1 REQUIRE_ZLIB = 1
...@@ -82,6 +84,7 @@ def main(): ...@@ -82,6 +84,7 @@ def main():
'<<PYTHON>>':PYTHON, '<<PYTHON>>':PYTHON,
'<<PREFIX>>':PREFIX, '<<PREFIX>>':PREFIX,
'<<BASE_DIR>>':BASE_DIR, '<<BASE_DIR>>':BASE_DIR,
'<<TMP_DIR>>':TMP_DIR,
'<<INSTALL_FLAGS>>':INSTALL_FLAGS, '<<INSTALL_FLAGS>>':INSTALL_FLAGS,
'<<ZOPE_MAJOR_VERSION>>':versions.ZOPE_MAJOR_VERSION, '<<ZOPE_MAJOR_VERSION>>':versions.ZOPE_MAJOR_VERSION,
'<<ZOPE_MINOR_VERSION>>':versions.ZOPE_MINOR_VERSION, '<<ZOPE_MINOR_VERSION>>':versions.ZOPE_MINOR_VERSION,
......
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