Commit 6b85df17 authored by Tres Seaver's avatar Tres Seaver

Restore old-sk00l configure / setup / makefile stuff (no zpkg).

parent 96a2aa95
......@@ -38,7 +38,8 @@ usage()
{
echo
echo "configure [--help] [--quiet] [--with-python=path] [--prefix=path] "
echo " [--ignore-largefile] [--ignore-zlib] [--optimize]"
echo " [--build-base=path] [--ignore-largefile] [--ignore-zlib]"
echo " [--optimize]"
echo
echo " Creates a Makefile suitable for building and installing Zope"
echo
......@@ -47,6 +48,7 @@ usage()
echo " --quiet suppress nonessential output"
echo " --with-python specify a path to a Python interpreter to use"
echo " --prefix specify an installation path for binary data"
echo " --build-base specify a temporary path for build files"
echo " --ignore-largefile ignore large file support warnings"
echo " --ignore-expat ignore warnings about expat/pyexpat"
echo " --ignore-zlib ignore warnings about zlib"
......
......@@ -10,14 +10,17 @@ RELEASE_TAG=<<VERSION_RELEASE_TAG>>
PACKAGE_NAME=${NAME}-${MAJOR_VERSION}.${MINOR_VERSION}-${RELEASE_TAG}
PYTHON="<<PYTHON>>"
ZPKG=zpkg
TMPDIR=<<TMP_DIR>>
PREFIX=<<PREFIX>>
BASE_DIR=<<BASE_DIR>>
BUILD_BASE=<<BUILD_BASE>>
DISTUTILS_OPTS=<<DISTUTILS_OPTS>>
INSTALL_FLAGS=<<INSTALL_FLAGS>>
TESTOPTS=-v
BUILD_FLAGS=-i
BUILD_FLAGS=--build-base="${BUILD_BASE}" \
--build-lib="${BUILD_BASE}/build-lib" \
--build-scripts="${BUILD_BASE}/build-scripts"\
--build-temp="${BUILD_BASE}/build-temp"
RM=rm -f
RMRF=rm -rf
......@@ -29,7 +32,7 @@ CP=cp
TAR=tar
MKDIR=mkdir -p
.PHONY : clean install instance untestinst testinst build
.PHONY : clean install instance untestinst testinst build unbuild
.PHONY : default
# default: The default step (invoked when make is called without a target)
......@@ -39,23 +42,38 @@ default: build
@echo to run a Zope instance directly from the build directory\).
@echo
# build:
# build: Do whatever 'setup.py build' implies
build:
${PYTHON} "${BASE_DIR}/setup.py" \
${DISTUTILS_OPTS} build_ext ${BUILD_FLAGS}
${DISTUTILS_OPTS} build ${BUILD_FLAGS}
# unbuild: Remove the build directory (undo the make build step)
unbuild:
${RMRF} ${BUILD_BASE}
# install: Install a software home.
install:
${PYTHON} "${BASE_DIR}/setup.py" ${DISTUTILS_OPTS} \
build_ext ${BUILD_FLAGS} \
install --home="${PREFIX}" ${INSTALL_FLAGS}
install: build version_txt
${PYTHON} "${BASE_DIR}/setup.py" ${DISTUTILS_OPTS} install \
--home="${PREFIX}" ${BUILD_FLAGS} ${INSTALL_FLAGS}
[ -f ${PREFIX}/bin/python ] || ${LN} ${PYTHON} ${PREFIX}/bin/python
@echo
@echo Zope binaries installed successfully.
@echo Now run \'${PREFIX}/bin/mkzopeinstance.py\'
# inplace: Do an in-place build
inplace: build
# inplace: Install a software home into to the source directory.
#
# Note: We used to run 'build_ext -i' for 'inplace', but that was
# suboptimal because it had a tendency to try to rebuild all of the
# (possibly already-built) extensions that might be built during a
# previous 'make' step. built_ext doesn't understand '--build-base'
# and friends so we can't stop it from doing this easily. So instead,
# we rely on the stock install step and name the prefix as the current
# directory. This is a little less efficient than just building the
# extensions because it also compiles bytecode, but it's more intuitive and
# less expensive in the common case than letting distutils
# potentially rebuild the binaries when we've done that already.
inplace: PREFIX=${BASE_DIR}
inplace: install
# test: Do an inplace build and run the Zope test suite.
test: inplace
......@@ -83,7 +101,7 @@ uninstance:
# clean: Delete the build files and any binaries/bytecode files in
# the source directory for good measure.
clean:
clean: unbuild
${FIND} "${BASE_DIR}" \
-name '*.py[co]' -o -name '*.so' -o -name '*.o' | ${XARGS} ${RM}
${RMRF} build
......@@ -93,9 +111,23 @@ version_txt:
printf "Zope ${MAJOR_VERSION}.${MINOR_VERSION}-${RELEASE_TAG}" >\
"${BASE_DIR}/lib/python/Zope2/version.txt"
# Building a source distribution requires that zpkg be available:
sdist: version_txt
${ZPKG} -C ${BASE_DIR}/releases/Zope2.cfg -r ${MAJOR_VERSION}.${MINOR_VERSION}${RELEASE_TAG}
# sdist: Create a source distribution file (implies clobber).
#
sdist: clobber sdist_tgz
# sdist_tgz: Create a tgz archive file as a source distribution.
#
sdist_tgz: version_txt
${MKDIR} ${TMPDIR}
${CD} ${TMPDIR} && ${LN} ${BASE_DIR} ${PACKAGE_NAME} && \
${TAR} czfh ${BASE_DIR}/${PACKAGE_NAME}.tgz \
--exclude=${PACKAGE_NAME}.tgz\
--exclude=.svn\
--exclude=makefile \
--exclude=build-base \
--exclude=*~ \
--exclude=.#* ${PACKAGE_NAME}
${RMRF} ${TMPDIR}/${PACKAGE_NAME}
# clobber: Make the source tree 'pristine' again.
clobber: clean uninstance
......
......@@ -34,6 +34,8 @@ def main():
# below assumes this script is in the BASE_DIR/inst directory
global PREFIX
BASE_DIR=os.path.abspath(os.path.dirname(os.path.dirname(sys.argv[0])))
BUILD_BASE=os.path.join(os.getcwd(), 'build-base',
'python-%s.%s' % sys.version_info[:2])
PYTHON=sys.executable
TMP_DIR = tempfile.gettempdir()
MAKEFILE=open(os.path.join(BASE_DIR, 'inst', IN_MAKEFILE)).read()
......@@ -67,6 +69,8 @@ def main():
INSTALL_FLAGS = '--optimize=1 --no-compile'
if o == '--no-compile':
INSTALL_FLAGS = '--no-compile'
if o == '--build-base':
BUILD_BASE = a
if o == '--quiet':
DISTUTILS_OPTS = '-q'
global QUIET
......@@ -84,6 +88,7 @@ def main():
'<<PYTHON>>':PYTHON,
'<<PREFIX>>':PREFIX,
'<<BASE_DIR>>':BASE_DIR,
'<<BUILD_BASE>>':BUILD_BASE,
'<<TMP_DIR>>':TMP_DIR,
'<<INSTALL_FLAGS>>':INSTALL_FLAGS,
'<<ZOPE_MAJOR_VERSION>>':versions.ZOPE_MAJOR_VERSION,
......
This diff is collapsed.
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