mirror of
https://github.com/valitydev/salt.git
synced 2024-11-07 17:09:03 +00:00
Merge pull request #44881 from twangboy/osx_update_build
Update OSX Build Scripts
This commit is contained in:
commit
cd128e8fd5
@ -31,11 +31,20 @@
|
||||
# ./build.sh v2015.8.3 2 /tmp/custom_pkg
|
||||
#
|
||||
############################################################################
|
||||
echo -n -e "\033]0;Build: Variables\007"
|
||||
|
||||
############################################################################
|
||||
# Make sure the script is launched with sudo
|
||||
############################################################################
|
||||
if [[ $(id -u) -ne 0 ]]
|
||||
then
|
||||
exec sudo /bin/bash -c "$(printf '%q ' "$BASH_SOURCE" "$@")"
|
||||
fi
|
||||
|
||||
############################################################################
|
||||
# Check passed parameters, set defaults
|
||||
############################################################################
|
||||
echo -n -e "\033]0;Build: Variables\007"
|
||||
|
||||
if [ "$1" == "" ]; then
|
||||
VERSION=`git describe`
|
||||
else
|
||||
@ -80,24 +89,24 @@ fi
|
||||
# Create the Build Environment
|
||||
############################################################################
|
||||
echo -n -e "\033]0;Build: Build Environment\007"
|
||||
sudo $PKGRESOURCES/build_env.sh $PYVER
|
||||
$PKGRESOURCES/build_env.sh $PYVER
|
||||
|
||||
############################################################################
|
||||
# Install Salt
|
||||
############################################################################
|
||||
echo -n -e "\033]0;Build: Install Salt\007"
|
||||
sudo rm -rf $SRCDIR/build
|
||||
sudo rm -rf $SRCDIR/dist
|
||||
sudo $PYTHON $SRCDIR/setup.py build -e "$PYTHON -E -s"
|
||||
sudo $PYTHON $SRCDIR/setup.py install
|
||||
rm -rf $SRCDIR/build
|
||||
rm -rf $SRCDIR/dist
|
||||
$PYTHON $SRCDIR/setup.py build -e "$PYTHON -E -s"
|
||||
$PYTHON $SRCDIR/setup.py install
|
||||
|
||||
############################################################################
|
||||
# Build Package
|
||||
############################################################################
|
||||
echo -n -e "\033]0;Build: Package Salt\007"
|
||||
sudo $PKGRESOURCES/build_pkg.sh $VERSION $PYVER $PKGDIR
|
||||
$PKGRESOURCES/build_pkg.sh $VERSION $PYVER $PKGDIR
|
||||
|
||||
############################################################################
|
||||
# Sign Package
|
||||
############################################################################
|
||||
sudo $PKGRESOURCES/build_sig.sh salt-$VERSION-py$PYVER-$CPUARCH.pkg salt-$VERSION-py$PYVER-$CPUARCH-signed.pkg
|
||||
$PKGRESOURCES/build_sig.sh salt-$VERSION-py$PYVER-$CPUARCH.pkg salt-$VERSION-py$PYVER-$CPUARCH-signed.pkg
|
||||
|
@ -24,6 +24,14 @@
|
||||
#
|
||||
############################################################################
|
||||
|
||||
############################################################################
|
||||
# Make sure the script is launched with sudo
|
||||
############################################################################
|
||||
if [[ $(id -u) -ne 0 ]]
|
||||
then
|
||||
exec sudo /bin/bash -c "$(printf '%q ' "$BASH_SOURCE" "$@")"
|
||||
fi
|
||||
|
||||
############################################################################
|
||||
# Set to Exit on all Errors
|
||||
############################################################################
|
||||
@ -54,17 +62,18 @@ ulimit -n 1200
|
||||
SRCDIR=`git rev-parse --show-toplevel`
|
||||
SCRIPTDIR=`pwd`
|
||||
SHADIR=$SCRIPTDIR/shasums
|
||||
PKG_CONFIG_PATH=/opt/salt/lib/pkgconfig
|
||||
CFLAGS="-I/opt/salt/include"
|
||||
LDFLAGS="-L/opt/salt/lib"
|
||||
INSTALL_DIR=/opt/salt
|
||||
PKG_CONFIG_PATH=$INSTALL_DIR/lib/pkgconfig
|
||||
CFLAGS="-I$INSTALL_DIR/include"
|
||||
LDFLAGS="-L$INSTALL_DIR/lib"
|
||||
if [ "$PYVER" == "2" ]; then
|
||||
PYDIR=/opt/salt/lib/python2.7
|
||||
PYTHON=/opt/salt/bin/python
|
||||
PIP=/opt/salt/bin/pip
|
||||
PYDIR=$INSTALL_DIR/lib/python2.7
|
||||
PYTHON=$INSTALL_DIR/bin/python
|
||||
PIP=$INSTALL_DIR/bin/pip
|
||||
else
|
||||
PYDIR=/opt/salt/lib/python3.5
|
||||
PYTHON=/opt/salt/bin/python3
|
||||
PIP=/opt/salt/bin/pip3
|
||||
PYDIR=$INSTALL_DIR/lib/python3.5
|
||||
PYTHON=$INSTALL_DIR/bin/python3
|
||||
PIP=$INSTALL_DIR/bin/pip3
|
||||
fi
|
||||
|
||||
############################################################################
|
||||
@ -74,10 +83,10 @@ fi
|
||||
# Fink, Brew)
|
||||
# Check for Xcode Command Line Tools first
|
||||
if [ -d '/Library/Developer/CommandLineTools/usr/bin' ]; then
|
||||
PATH=/Library/Developer/CommandLineTools/usr/bin:/opt/salt/bin:$PATH
|
||||
PATH=/Library/Developer/CommandLineTools/usr/bin:$INSTALL_DIR/bin:$PATH
|
||||
MAKE=/Library/Developer/CommandLineTools/usr/bin/make
|
||||
elif [ -d '/Applications/Xcode.app/Contents/Developer/usr/bin' ]; then
|
||||
PATH=/Applications/Xcode.app/Contents/Developer/usr/bin:/opt/salt/bin:$PATH
|
||||
PATH=/Applications/Xcode.app/Contents/Developer/usr/bin:$INSTALL_DIR/bin:$PATH
|
||||
MAKE=/Applications/Xcode.app/Contents/Developer/usr/bin/make
|
||||
else
|
||||
echo "No installation of XCode found. This script requires XCode."
|
||||
@ -125,12 +134,15 @@ download(){
|
||||
############################################################################
|
||||
# Ensure Paths are present and clean
|
||||
############################################################################
|
||||
echo "################################################################################"
|
||||
echo "Ensure Paths are present and clean"
|
||||
echo "################################################################################"
|
||||
echo -n -e "\033]0;Build_Env: Clean\007"
|
||||
|
||||
# Make sure /opt/salt is clean
|
||||
sudo rm -rf /opt/salt
|
||||
sudo mkdir -p /opt/salt
|
||||
sudo chown $USER:staff /opt/salt
|
||||
# Make sure $INSTALL_DIR is clean
|
||||
rm -rf $INSTALL_DIR
|
||||
mkdir -p $INSTALL_DIR
|
||||
chown $USER:staff $INSTALL_DIR
|
||||
|
||||
# Make sure build staging is clean
|
||||
rm -rf build
|
||||
@ -140,7 +152,7 @@ BUILDDIR=$SCRIPTDIR/build
|
||||
############################################################################
|
||||
# Download and install pkg-config
|
||||
############################################################################
|
||||
echo -n -e "\033]0;Build_Env: pkg-config\007"
|
||||
echo -n -e "\033]0;Build_Env: pkg-config: download\007"
|
||||
|
||||
PKGURL="http://pkgconfig.freedesktop.org/releases/pkg-config-0.29.2.tar.gz"
|
||||
PKGDIR="pkg-config-0.29.2"
|
||||
@ -151,18 +163,22 @@ echo "##########################################################################
|
||||
echo "Building pkg-config"
|
||||
echo "################################################################################"
|
||||
cd $PKGDIR
|
||||
env LDFLAGS="-framework CoreFoundation -framework Carbon" ./configure --prefix=/opt/salt --with-internal-glib
|
||||
echo -n -e "\033]0;Build_Env: pkg-config: configure\007"
|
||||
env LDFLAGS="-framework CoreFoundation -framework Carbon" ./configure --prefix=$INSTALL_DIR --with-internal-glib
|
||||
echo -n -e "\033]0;Build_Env: pkg-config: make\007"
|
||||
$MAKE
|
||||
echo -n -e "\033]0;Build_Env: pkg-config: make check\007"
|
||||
$MAKE check
|
||||
sudo -H $MAKE install
|
||||
echo -n -e "\033]0;Build_Env: pkg-config: make install\007"
|
||||
$MAKE install
|
||||
|
||||
############################################################################
|
||||
# Download and install libsodium
|
||||
############################################################################
|
||||
echo -n -e "\033]0;Build_Env: libsodium\007"
|
||||
echo -n -e "\033]0;Build_Env: libsodium: download\007"
|
||||
|
||||
PKGURL="https://download.libsodium.org/libsodium/releases/libsodium-1.0.13.tar.gz"
|
||||
PKGDIR="libsodium-1.0.13"
|
||||
PKGURL="https://download.libsodium.org/libsodium/releases/libsodium-1.0.15.tar.gz"
|
||||
PKGDIR="libsodium-1.0.15"
|
||||
|
||||
download $PKGURL
|
||||
|
||||
@ -170,15 +186,19 @@ echo "##########################################################################
|
||||
echo "Building libsodium"
|
||||
echo "################################################################################"
|
||||
cd $PKGDIR
|
||||
./configure --prefix=/opt/salt
|
||||
echo -n -e "\033]0;Build_Env: libsodium: configure\007"
|
||||
./configure --prefix=$INSTALL_DIR
|
||||
echo -n -e "\033]0;Build_Env: libsodium: make\007"
|
||||
$MAKE
|
||||
echo -n -e "\033]0;Build_Env: libsodium: make check\007"
|
||||
$MAKE check
|
||||
sudo -H $MAKE install
|
||||
echo -n -e "\033]0;Build_Env: libsodium: make install\007"
|
||||
$MAKE install
|
||||
|
||||
############################################################################
|
||||
# Download and install zeromq
|
||||
############################################################################
|
||||
echo -n -e "\033]0;Build_Env: zeromq\007"
|
||||
echo -n -e "\033]0;Build_Env: zeromq: download\007"
|
||||
|
||||
PKGURL="http://download.zeromq.org/zeromq-4.1.4.tar.gz"
|
||||
PKGDIR="zeromq-4.1.4"
|
||||
@ -189,18 +209,22 @@ echo "##########################################################################
|
||||
echo "Building zeromq"
|
||||
echo "################################################################################"
|
||||
cd $PKGDIR
|
||||
./configure --prefix=/opt/salt
|
||||
echo -n -e "\033]0;Build_Env: zeromq: configure\007"
|
||||
./configure --prefix=$INSTALL_DIR
|
||||
echo -n -e "\033]0;Build_Env: zeromq: make\007"
|
||||
$MAKE
|
||||
echo -n -e "\033]0;Build_Env: zeromq: make check\007"
|
||||
$MAKE check
|
||||
sudo -H $MAKE install
|
||||
echo -n -e "\033]0;Build_Env: zeromq: make install\007"
|
||||
$MAKE install
|
||||
|
||||
############################################################################
|
||||
# Download and install OpenSSL
|
||||
############################################################################
|
||||
echo -n -e "\033]0;Build_Env: OpenSSL\007"
|
||||
echo -n -e "\033]0;Build_Env: OpenSSL: download\007"
|
||||
|
||||
PKGURL="http://openssl.org/source/openssl-1.0.2l.tar.gz"
|
||||
PKGDIR="openssl-1.0.2l"
|
||||
PKGURL="http://openssl.org/source/openssl-1.0.2n.tar.gz"
|
||||
PKGDIR="openssl-1.0.2n"
|
||||
|
||||
download $PKGURL
|
||||
|
||||
@ -208,19 +232,23 @@ echo "##########################################################################
|
||||
echo "Building OpenSSL"
|
||||
echo "################################################################################"
|
||||
cd $PKGDIR
|
||||
./Configure darwin64-x86_64-cc --prefix=/opt/salt --openssldir=/opt/salt/openssl
|
||||
echo -n -e "\033]0;Build_Env: OpenSSL: configure\007"
|
||||
./Configure darwin64-x86_64-cc --prefix=$INSTALL_DIR --openssldir=$INSTALL_DIR/openssl
|
||||
echo -n -e "\033]0;Build_Env: OpenSSL: make\007"
|
||||
$MAKE
|
||||
echo -n -e "\033]0;Build_Env: OpenSSL: make test\007"
|
||||
$MAKE test
|
||||
sudo -H $MAKE install
|
||||
echo -n -e "\033]0;Build_Env: OpenSSL: make install\007"
|
||||
$MAKE install
|
||||
|
||||
############################################################################
|
||||
# Download and install Python
|
||||
############################################################################
|
||||
echo -n -e "\033]0;Build_Env: Python\007"
|
||||
echo -n -e "\033]0;Build_Env: Python: download\007"
|
||||
|
||||
if [ "$PYVER" == "2" ]; then
|
||||
PKGURL="https://www.python.org/ftp/python/2.7.13/Python-2.7.13.tar.xz"
|
||||
PKGDIR="Python-2.7.13"
|
||||
PKGURL="https://www.python.org/ftp/python/2.7.14/Python-2.7.14.tar.xz"
|
||||
PKGDIR="Python-2.7.14"
|
||||
else
|
||||
PKGURL="https://www.python.org/ftp/python/3.5.3/Python-3.5.3.tar.xz"
|
||||
PKGDIR="Python-3.5.3"
|
||||
@ -233,15 +261,17 @@ echo "Building Python"
|
||||
echo "################################################################################"
|
||||
echo "Note there are some test failures"
|
||||
cd $PKGDIR
|
||||
./configure --prefix=/opt/salt --enable-shared --enable-toolbox-glue --with-ensurepip=install
|
||||
echo -n -e "\033]0;Build_Env: Python: configure\007"
|
||||
./configure --prefix=$INSTALL_DIR --enable-shared --enable-toolbox-glue --with-ensurepip=install
|
||||
echo -n -e "\033]0;Build_Env: Python: make\007"
|
||||
$MAKE
|
||||
# $MAKE test
|
||||
sudo -H $MAKE install
|
||||
echo -n -e "\033]0;Build_Env: Python: make install\007"
|
||||
$MAKE install
|
||||
|
||||
############################################################################
|
||||
# upgrade pip
|
||||
############################################################################
|
||||
sudo -H $PIP install --upgrade pip
|
||||
$PIP install --upgrade pip
|
||||
|
||||
############################################################################
|
||||
# Download and install salt python dependencies
|
||||
@ -253,23 +283,21 @@ cd $BUILDDIR
|
||||
echo "################################################################################"
|
||||
echo "Installing Salt Dependencies with pip (normal)"
|
||||
echo "################################################################################"
|
||||
sudo -H $PIP install \
|
||||
-r $SRCDIR/pkg/osx/req.txt \
|
||||
--no-cache-dir
|
||||
$PIP install -r $SRCDIR/pkg/osx/req.txt \
|
||||
--no-cache-dir
|
||||
|
||||
echo "################################################################################"
|
||||
echo "Installing Salt Dependencies with pip (build_ext)"
|
||||
echo "################################################################################"
|
||||
sudo -H $PIP install \
|
||||
-r $SRCDIR/pkg/osx/req_ext.txt \
|
||||
--global-option=build_ext \
|
||||
--global-option="-I/opt/salt/include" \
|
||||
--no-cache-dir
|
||||
$PIP install -r $SRCDIR/pkg/osx/req_ext.txt \
|
||||
--global-option=build_ext \
|
||||
--global-option="-I$INSTALL_DIR/include" \
|
||||
--no-cache-dir
|
||||
|
||||
echo "--------------------------------------------------------------------------------"
|
||||
echo "Create Symlink to certifi for openssl"
|
||||
echo "--------------------------------------------------------------------------------"
|
||||
sudo ln -s $PYDIR/site-packages/certifi/cacert.pem /opt/salt/openssl/cert.pem
|
||||
ln -s $PYDIR/site-packages/certifi/cacert.pem $INSTALL_DIR/openssl/cert.pem
|
||||
|
||||
echo -n -e "\033]0;Build_Env: Finished\007"
|
||||
|
||||
|
@ -28,6 +28,14 @@
|
||||
#
|
||||
############################################################################
|
||||
|
||||
############################################################################
|
||||
# Make sure the script is launched with sudo
|
||||
############################################################################
|
||||
if [[ $(id -u) -ne 0 ]]
|
||||
then
|
||||
exec sudo /bin/bash -c "$(printf '%q ' "$BASH_SOURCE" "$@")"
|
||||
fi
|
||||
|
||||
############################################################################
|
||||
# Set to Exit on all Errors
|
||||
############################################################################
|
||||
@ -96,8 +104,8 @@ mkdir -p $PKGDIR
|
||||
############################################################################
|
||||
echo -n -e "\033]0;Build_Pkg: Copy Start Scripts\007"
|
||||
|
||||
sudo cp $PKGRESOURCES/scripts/start-*.sh /opt/salt/bin/
|
||||
sudo cp $PKGRESOURCES/scripts/salt-config.sh /opt/salt/bin
|
||||
cp $PKGRESOURCES/scripts/start-*.sh /opt/salt/bin/
|
||||
cp $PKGRESOURCES/scripts/salt-config.sh /opt/salt/bin
|
||||
|
||||
############################################################################
|
||||
# Copy Service Definitions from Salt Repo to the Package Directory
|
||||
@ -118,20 +126,20 @@ cp $PKGRESOURCES/scripts/com.saltstack.salt.api.plist $PKGDIR/Library/LaunchDaem
|
||||
############################################################################
|
||||
echo -n -e "\033]0;Build_Pkg: Trim unneeded files\007"
|
||||
|
||||
sudo rm -rdf $PKGDIR/opt/salt/bin/pkg-config
|
||||
sudo rm -rdf $PKGDIR/opt/salt/lib/pkgconfig
|
||||
sudo rm -rdf $PKGDIR/opt/salt/lib/engines
|
||||
sudo rm -rdf $PKGDIR/opt/salt/share/aclocal
|
||||
sudo rm -rdf $PKGDIR/opt/salt/share/doc
|
||||
sudo rm -rdf $PKGDIR/opt/salt/share/man/man1/pkg-config.1
|
||||
rm -rdf $PKGDIR/opt/salt/bin/pkg-config
|
||||
rm -rdf $PKGDIR/opt/salt/lib/pkgconfig
|
||||
rm -rdf $PKGDIR/opt/salt/lib/engines
|
||||
rm -rdf $PKGDIR/opt/salt/share/aclocal
|
||||
rm -rdf $PKGDIR/opt/salt/share/doc
|
||||
rm -rdf $PKGDIR/opt/salt/share/man/man1/pkg-config.1
|
||||
if [ "$PYVER" == "2" ]; then
|
||||
sudo rm -rdf $PKGDIR/opt/salt/lib/python2.7/test
|
||||
rm -rdf $PKGDIR/opt/salt/lib/python2.7/test
|
||||
else
|
||||
sudo rm -rdf $PKGDIR/opt/salt/lib/python3.5/test
|
||||
rm -rdf $PKGDIR/opt/salt/lib/python3.5/test
|
||||
fi
|
||||
|
||||
echo -n -e "\033]0;Build_Pkg: Remove compiled python files\007"
|
||||
sudo find $PKGDIR/opt/salt -name '*.pyc' -type f -delete
|
||||
find $PKGDIR/opt/salt -name '*.pyc' -type f -delete
|
||||
|
||||
############################################################################
|
||||
# Copy Config Files from Salt Repo to the Package Directory
|
||||
|
@ -1,31 +1,31 @@
|
||||
apache-libcloud==2.1.0
|
||||
apache-libcloud==2.2.1
|
||||
backports.ssl_match_hostname==3.5.0.1
|
||||
backports_abc==0.5
|
||||
certifi
|
||||
cffi==1.10.0
|
||||
CherryPy==11.0.0
|
||||
cffi==1.11.2
|
||||
CherryPy==13.0.0
|
||||
click==6.7
|
||||
enum34==1.1.6
|
||||
gitdb==0.6.4
|
||||
GitPython==2.1.1
|
||||
idna==2.5
|
||||
GitPython==2.1.7
|
||||
idna==2.6
|
||||
ipaddress==1.0.18
|
||||
Jinja2==2.9.6
|
||||
Jinja2==2.10
|
||||
linode-python==1.1.1
|
||||
Mako==1.0.7
|
||||
MarkupSafe==1.0
|
||||
msgpack-python==0.4.8
|
||||
pyasn1==0.2.3
|
||||
pyasn1==0.4.2
|
||||
pycparser==2.18
|
||||
pycrypto==2.6.1
|
||||
python-dateutil==2.6.1
|
||||
python-gnupg==0.4.1
|
||||
PyYAML==3.12
|
||||
pyzmq==16.0.2
|
||||
requests==2.18.1
|
||||
pyzmq==17.0.0b3
|
||||
requests==2.18.4
|
||||
singledispatch==3.4.0.3
|
||||
six==1.10.0
|
||||
six==1.11.0
|
||||
smmap==0.9.0
|
||||
timelib==0.2.4
|
||||
tornado==4.5.1
|
||||
tornado==4.5.2
|
||||
vultr==1.0rc1
|
||||
|
@ -1,2 +1,2 @@
|
||||
cryptography==2.0
|
||||
pyOpenSSL==17.1.0
|
||||
cryptography==2.1.4
|
||||
pyOpenSSL==17.5.0
|
||||
|
@ -1 +0,0 @@
|
||||
f37c9a28ce129d01e63c84d7db627a06402854578f62d17927334ea21ede318e04bbf66e890e3f47c85333e6b19f6e5581fb3f3e27efd24be27017d1b6529c4b ./Python-2.7.13.tar.xz
|
1
pkg/osx/shasums/Python-2.7.14.tar.xz.sha512
Normal file
1
pkg/osx/shasums/Python-2.7.14.tar.xz.sha512
Normal file
@ -0,0 +1 @@
|
||||
78310b0be6388ffa15f29a80afb9ab3c03a572cb094e9da00cfe391afadb51696e41f592eb658d6a31a2f422fdac8a55214a382cbb8cfb43d4a127d5b35ea7f9 ./Python-2.7.14.tar.xz
|
@ -1 +0,0 @@
|
||||
c619b12fdf0b2e59174b6e383a62d5499ebcd720fdbb2c1a41a98a46c285df075202423454b294fefee185432441e943805397d7656f7cd7837de425da623929 ./libsodium-1.0.13.tar.gz
|
1
pkg/osx/shasums/libsodium-1.0.15.tar.gz.sha512
Normal file
1
pkg/osx/shasums/libsodium-1.0.15.tar.gz.sha512
Normal file
@ -0,0 +1 @@
|
||||
299a208f8342793d13498e95b23f1749f5b5b13ec276db3ec401130615e837ef475b6a1283b6e87a5f8227d23e70e38ca721073dadd5dc88fe4aff342aa64adc ./libsodium-1.0.15.tar.gz
|
@ -1 +0,0 @@
|
||||
047d964508ad6025c79caabd8965efd2416dc026a56183d0ef4de7a0a6769ce8e0b4608a3f8393d326f6d03b26a2b067e6e0c750f35b20be190e595e8290c0e3 ./openssl-1.0.2l.tar.gz
|
1
pkg/osx/shasums/openssl-1.0.2n.tar.gz.sha512
Normal file
1
pkg/osx/shasums/openssl-1.0.2n.tar.gz.sha512
Normal file
@ -0,0 +1 @@
|
||||
144bf0d6aa27b4af01df0b7b734c39962649e1711554247d42e05e14d8945742b18745aefdba162e2dfc762b941fd7d3b2d5dc6a781ae4ba10a6f5a3cadb0687 ./openssl-1.0.2n.tar.gz
|
Loading…
Reference in New Issue
Block a user