Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build-on-netbsd: don't pine a specific py3 version #913

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 15 additions & 8 deletions tools/build-on-netbsd
Original file line number Diff line number Diff line change
Expand Up @@ -2,26 +2,33 @@

fail() { echo "FAILED:" "$@" 1>&2; exit 1; }

PYTHON="${PYTHON:-python3}"
if [ ! $(which ${PYTHON}) ]; then
echo "Please install python first."
exit 1
fi
py_prefix=$(${PYTHON} -c 'import sys; print("py%d%d" % (sys.version_info.major, sys.version_info.minor))')

# Check dependencies:
depschecked=/tmp/c-i.dependencieschecked
pkgs="
bash
dmidecode
py37-configobj
py37-jinja2
py37-oauthlib
py37-requests
py37-setuptools
py37-yaml
${py_prefix}-configobj
${py_prefix}-jinja2
${py_prefix}-oauthlib
${py_prefix}-requests
${py_prefix}-setuptools
${py_prefix}-yaml
sudo
"
[ -f "$depschecked" ] || pkg_add ${pkgs} || fail "install packages"

touch $depschecked

# Build the code and install in /usr/pkg/:
python3.7 setup.py build
python3.7 setup.py install -O1 --distro netbsd --skip-build --init-system sysvinit_netbsd
${PYTHON} setup.py build
${PYTHON} setup.py install -O1 --distro netbsd --skip-build --init-system sysvinit_netbsd
mv -v /usr/local/etc/rc.d/cloud* /etc/rc.d

# Enable cloud-init in /etc/rc.conf:
Expand Down