Commit 084499b0 authored by Julien Muchembled's avatar Julien Muchembled

re6st: fix OBS packaging after the move to buildout 2

Since buildout 2 no longer supports using multiple versions of Python
in a single buildout, we're now forced to use slapos.rebootstrap.
parent 2f9bead0
......@@ -8,7 +8,7 @@ extends-cache = extends-cache
download-cache = download-cache
develop =
extensions =
extensions = slapos.rebootstrap
newest = false
parts += chrpath python
......@@ -17,8 +17,8 @@ parts += chrpath python
recipe = zc.recipe.egg
interpreter = ${:_buildout_section_name_}
eggs = setuptools
python = buildout
scripts =
# https://lab.nexedi.com/nexedi/slapos.buildout/merge_requests/11
scripts = dummy
# Uguu, upstream buildout.cfg must be patched as it works the other way
# around from a packager point of view at least, thus at the end static
......
......@@ -31,4 +31,7 @@ for x in path:
except OSError as e:
if e.errno != errno.EEXIST:
raise
shutil.copytree(x, d, True)
if os.path.isdir(x):
shutil.copytree(x, d, True)
else:
shutil.copy2(x, d)
......@@ -40,7 +40,7 @@
# If this way of packaging is reused for other software, postinst scripts
# should be implemented.
import os, rfc822, shutil, time, urllib
import os, rfc822, shutil, ssl, time, urllib
from glob import glob
from cStringIO import StringIO
from subprocess import check_call
......@@ -48,7 +48,7 @@ from make import *
from debian.changelog import Changelog
from debian.deb822 import Deb822
BOOTSTRAP_URL = "http://downloads.buildout.org/1/bootstrap.py"
BOOTSTRAP_URL = "https://bootstrap.pypa.io/bootstrap-buildout.py"
PACKAGE = "re6st-node"
BIN = "re6st-conf re6st-registry re6stnet".split()
......@@ -66,6 +66,10 @@ re6stnet = git("re6stnet", "https://lab.nexedi.com/nexedi/re6stnet.git",
slapos = git("slapos", "https://lab.nexedi.com/nexedi/slapos.git",
ctime=False) # ignore ctime due to hardlinks to *-cache
# The built Python can't use its certificates because its capath
# is already transformed to its installation value.
os.environ["SSL_CERT_DIR"] = ssl.get_default_verify_paths().capath
os.environ["TZ"] = "UTC"; time.tzset()
@task("buildout.cfg.in", BUILD + "/buildout.cfg")
......@@ -87,8 +91,12 @@ def bootstrap(task):
with cwd(BUILD):
rmtree("extends-cache")
os.mkdir("extends-cache")
check_output((sys.executable, "-S"), input=bootstrap)
check_call(("bin/buildout", "buildout:parts=python"))
check_output((sys.executable, "-S", "-",
# XXX: By starting with an older version,
# we'll have the wanted version in cache.
"--setuptools-version", "33.1.0"), input=bootstrap)
check_call(("bin/buildout", "buildout:extensions=",
"buildout:newest=true", "buildout:parts=python"))
def sdist_version(egg):
global MTIME, 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