Created
December 18, 2014 16:15
-
-
Save MerlinDMC/0f7932d240683e15a3aa to your computer and use it in GitHub Desktop.
setup a SmartOS zone for building pkgsrc packages
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# skip if we already have the env set up | |
if [[ ! -e /content/pkgsrc ]]; then | |
PKGSRC_REPO_URL=$(awk '{ print $2 }' FS='=' /opt/local/etc/pkg_install.conf) | |
PKGSRC_BRANCH=$(awk '{ print $(NF-2) }' FS='/' /opt/local/etc/pkg_install.conf) | |
PKGSRC_BINPKG_SITES=${PKGSRC_REPO_URL%/*} | |
pkgin -y in gcc47 git-base | |
mkdir -p /content/{distfiles,packages} | |
( cd /content | |
git clone git://github.com/joyent/pkgsrc.git | |
cd pkgsrc | |
git checkout joyent/release/${PKGSRC_BRANCH} | |
git submodule init | |
git submodule update | |
) | |
cat >> /opt/local/etc/mk.conf << EOF | |
# | |
# | |
DISTDIR= /content/distfiles | |
PACKAGES= /content/packages | |
WRKOBJDIR= /var/tmp/pkgsrc-build | |
# | |
ALLOW_VULNERABLE_PACKAGES= yes | |
SKIP_LICENSE_CHECK= yes | |
# | |
MAKE_JOBS= 8 | |
# | |
FETCH_USING= curl | |
# | |
# Adjust BINPKG_SITES, depending upon the dataset chosen, it should be the URL | |
# from /opt/local/etc/pkgin/repositories.conf without the trailing 'All'. | |
# | |
BINPKG_SITES= ${PKGSRC_BINPKG_SITES}/ | |
DEPENDS_TARGET= bin-install | |
EOF | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment