Merge pull request #30940 from twangboy/mac_build_3

Fix Build Process for OSX
This commit is contained in:
Mike Place 2016-02-05 11:44:34 -07:00
commit 21a83065aa
20 changed files with 172 additions and 167 deletions

View File

@ -178,13 +178,13 @@ sudo $MAKE install
echo -n -e "\033]0;Build_Evn: OpenSSL\007"
PKGURL="http://openssl.org/source/openssl-1.0.2e.tar.gz"
PKGDIR="openssl-1.0.2e"
PKGURL="http://openssl.org/source/openssl-1.0.2f.tar.gz"
PKGDIR="openssl-1.0.2f"
download $PKGURL
echo "################################################################################"
echo "Building OpenSSL 1.0.2e"
echo "Building OpenSSL 1.0.2f"
echo "################################################################################"
cd $PKGDIR
./Configure darwin64-x86_64-cc --prefix=/opt/salt --openssldir=/opt/salt/openssl
@ -193,49 +193,6 @@ $MAKE test
sudo $MAKE install
############################################################################
# Download and install GDBM
############################################################################
echo -n -e "\033]0;Build_Evn: GDBM\007"
PKGURL="ftp://ftp.gnu.org/gnu/gdbm/gdbm-1.11.tar.gz"
PKGDIR="gdbm-1.11"
download $PKGURL
echo "################################################################################"
echo "Building gdbm 1.11"
echo "################################################################################"
cd $PKGDIR
./configure --prefix=/opt/salt --enable-libgdbm-compat
$MAKE
$MAKE check
sudo $MAKE install
############################################################################
# Download and install Gnu Readline
############################################################################
echo -n -e "\033]0;Build_Evn: Gnu Readline\007"
PKGURL="ftp://ftp.cwru.edu/pub/bash/readline-6.3.tar.gz"
PKGDIR="readline-6.3"
download $PKGURL
curl -O# ftp://ftp.cwru.edu/pub/bash/readline-6.3.tar.gz
echo "################################################################################"
echo "Building GNU Readline 6.3"
echo "################################################################################"
cd $PKGDIR
./configure --prefix=/opt/salt
$MAKE
sudo $MAKE install
############################################################################
# Download and install Python
############################################################################
@ -255,47 +212,13 @@ cd $PKGDIR
./configure --prefix=/opt/salt --enable-shared --enable-toolbox-glue --with-ensurepip=install
$MAKE
# $MAKE test
sudo $MAKE install
sudo -H $MAKE install
############################################################################
# Download and install CMake
# upgrade pip
############################################################################
echo -n -e "\033]0;Build_Evn: CMake\007"
PKGURL="https://cmake.org/files/v3.4/cmake-3.4.1.tar.gz"
PKGDIR="cmake-3.4.1"
download $PKGURL
echo "################################################################################"
echo "Building CMake 3.4.1"
echo "################################################################################"
cd $PKGDIR
./bootstrap
$MAKE
sudo $MAKE install
############################################################################
# Download and install libgit2
############################################################################
echo -n -e "\033]0;Build_Evn: libgit2\007"
PKGURL="https://codeload.github.com/libgit2/libgit2/tar.gz/v0.23.4"
PKGDIR="libgit2-0.23.4"
download $PKGURL
echo "################################################################################"
echo "Building libgit2 0.23.4"
echo "################################################################################"
cd $PKGDIR
mkdir build && cd build
cmake .. -DCMAKE_INSTALL_PREFIX=/opt/salt
sudo cmake --build . --target install
sudo -H /opt/salt/bin/pip install --upgrade pip
############################################################################

View File

@ -72,7 +72,7 @@ fi
echo -n -e "\033]0;Build_Pkg: Clean Staging Area\007"
# Clean folder in the staging area
rm -rf $PKGDIR
rm -rdf $PKGDIR
mkdir -p $PKGDIR
PKGRESOURCES=$SRCDIR/pkg/osx
@ -126,6 +126,19 @@ cp $PKGRESOURCES/scripts/com.saltstack.salt.master.plist $PKGDIR/Library/LaunchD
cp $PKGRESOURCES/scripts/com.saltstack.salt.syndic.plist $PKGDIR/Library/LaunchDaemons
cp $PKGRESOURCES/scripts/com.saltstack.salt.api.plist $PKGDIR/Library/LaunchDaemons
############################################################################
# Remove pkg-config files from the distro
############################################################################
echo -n -e "\033]0;Build_Pkg: Remove pkg-config 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
############################################################################
# Copy Additional Resources from Salt Repo to the Package Directory
############################################################################
@ -138,8 +151,8 @@ cp $PKGRESOURCES/*.rtf $PKGDIR/resources
# I can't get this to work for some reason
mkdir -p $PKGDIR/scripts
cp $PKGRESOURCES/scripts/postflight.sh $PKGDIR/scripts
cp $PKGRESOURCES/scripts/preflight.sh $PKGDIR/scripts
cp $PKGRESOURCES/scripts/postinstall $PKGDIR/scripts
cp $PKGRESOURCES/scripts/preinstall $PKGDIR/scripts
############################################################################
# Copy Config Files from Salt Repo to the Package Directory
@ -152,7 +165,7 @@ cp $SRCDIR/conf/minion $PKGDIR/etc/salt/minion.dist
cp $SRCDIR/conf/master $PKGDIR/etc/salt/master.dist
############################################################################
# I don't know what this does, it doesn't look like the .xml file goes anywhere
# Add Version to distribution.xml
############################################################################
echo -n -e "\033]0;Build_Pkg: Add Version to .xml\007"
@ -170,6 +183,7 @@ sed -i '' $SEDSTR distribution.xml
echo -n -e "\033]0;Build_Pkg: Build Package\007"
pkgbuild --root $PKGDIR \
--scripts $PKGDIR/scripts \
--identifier=com.saltstack.salt \
--version=$VERSION \
--ownership=recommended salt-src-$VERSION.pkg
@ -177,6 +191,5 @@ pkgbuild --root $PKGDIR \
productbuild --resources=$PKGDIR/resources \
--distribution=distribution.xml \
--package-path=salt-src-$VERSION.pkg \
--scripts $PKGDIR/scripts \
--version=$VERSION salt-$VERSION.pkg

View File

@ -1,14 +1,27 @@
<?xml version="1.0" encoding="utf-8" standalone="no"?>
<installer-gui-script minSpecVersion="1">
<installer-gui-script minSpecVersion="2">
<title>Salt @VERSION@</title>
<organization>com.saltstack.salt</organization>
<domains enable_localSystem="true"/>
<options rootVolumeOnly="true" />
<!-- Define minimum system requirements -->
<volume-check>
<allowed-os-versions>
<os-version min="10.11" />
</allowed-os-versions>
</volume-check>
<options rootVolumeOnly="true"
hostArchitectures="x86_64" />
<domains enable_localSystem="true" />
<!-- Define background image -->
<background file="saltstack.png"
mime-type="image/png"
scaling="proportional" />
<!-- Define documents displayed at various steps -->
<background file="saltstack.png" mime-type="image/png" scaling="proportional"/>
<welcome file="welcome.rtf" mime-type="text/rtf" />
<license file="license.rtf" mime-type="text/rtf" />
<conclusion file="conclusion.rtf" mime-type="text/rtf" />
<welcome file="welcome.rtf"
mime-type="text/rtf" />
<license file="license.rtf"
mime-type="text/rtf" />
<conclusion file="conclusion.rtf"
mime-type="text/rtf" />
<!-- List all component packages -->
<pkg-ref id="com.saltstack.salt"
version="@VERSION@"
@ -16,15 +29,14 @@
<!-- List them again here. They can now be organized
as a hierarchy if you want. -->
<choices-outline>
<line choice="com.saltstack.salt"/>
<line choice="com.saltstack.salt" />
</choices-outline>
<!-- Define each choice above -->
<choice
id="com.saltstack.salt"
visible="false"
title="Salt @VERSION@"
description="Salt @VERSION@"
start_selected="true">
<pkg-ref id="com.saltstack.salt"/>
<choice id="com.saltstack.salt"
visible="false"
title="Salt @VERSION@"
description="Salt @VERSION@"
start_selected="true">
<pkg-ref id="com.saltstack.salt" />
</choice>
</installer-gui-script>

View File

@ -1,15 +1,15 @@
{\rtf1\ansi\ansicpg1252\cocoartf1404\cocoasubrtf130
{\rtf1\ansi\ansicpg1252\cocoartf1404\cocoasubrtf340
{\fonttbl\f0\froman\fcharset0 Times-Roman;}
{\colortbl;\red255\green255\blue255;\red0\green0\blue0;}
{\colortbl;\red255\green255\blue255;}
\vieww10800\viewh8400\viewkind0
\deftab720
\pard\pardeftab720\sl560\sa321\partightenfactor0
\f0\b\fs48 \cf2 \expnd0\expndtw0\kerning0
\outl0\strokewidth0 \strokec2 Salt - Remote execution system\
\f0\b\fs48 \cf0 \expnd0\expndtw0\kerning0
Salt - Remote execution system\
\pard\pardeftab720\sl280\sa240\partightenfactor0
\b0\fs24 \cf2 Copyright 2014-2015 SaltStack Team\
\b0\fs24 \cf0 Copyright 2014-2016 SaltStack Team\
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at\
http://www.apache.org/licenses/LICENSE-2.0\
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.\
}
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.}

View File

@ -1,31 +1,31 @@
apache-libcloud==0.19.0
backports.ssl_match_hostname==3.4.0.2
apache-libcloud==0.20.1
backports.ssl_match_hostname==3.5.0.1
backports_abc==0.4
certifi
cffi==1.3.1
CherryPy==3.2.3
click==4.1
enum34==1.1.1
cffi==1.5.0
CherryPy==4.0.0
click==6.2
enum34==1.1.2
gitdb==0.6.4
GitPython==1.0.1
idna==2.0
ioflo==1.4.9
ipaddress==1.0.15
ioflo==1.5.0
ipaddress==1.0.16
Jinja2==2.8
libnacl==1.4.3
libnacl==1.4.4
linode-python==1.1.1
Mako==1.0.3
MarkupSafe==0.23
msgpack-python==0.4.6
msgpack-python==0.4.7
pyasn1==0.1.9
pycparser==2.14
pycrypto==2.6.1
python_dateutil==2.4.2
python-dateutil==2.4.2
python-gnupg==0.3.8
PyYAML==3.11
pyzmq==15.1.0
pyzmq==15.2.0
raet==0.6.5
requests==2.9.0
requests==2.9.1
singledispatch==3.4.0.3
six==1.10.0
smmap==0.9.0

View File

@ -1,4 +1,2 @@
cryptography==1.1.2
cryptography==1.2.2
pyOpenSSL==0.15.1
pygit2==0.23.2

View File

@ -3,7 +3,7 @@
<plist version="1.0">
<dict>
<key>Label</key>
<string>salt-api</string>
<string>com.saltstack.salt.api</string>
<key>RunAtLoad</key>
<true/>
<key>KeepAlive</key>

View File

@ -3,7 +3,7 @@
<plist version="1.0">
<dict>
<key>Label</key>
<string>salt-master</string>
<string>com.saltstack.salt.master</string>
<key>RunAtLoad</key>
<true/>
<key>KeepAlive</key>

View File

@ -3,7 +3,7 @@
<plist version="1.0">
<dict>
<key>Label</key>
<string>salt-minion</string>
<string>com.saltstack.salt.minion</string>
<key>RunAtLoad</key>
<true/>
<key>KeepAlive</key>

View File

@ -3,7 +3,7 @@
<plist version="1.0">
<dict>
<key>Label</key>
<string>salt-syndic</string>
<string>com.saltstack.salt.syndic</string>
<key>RunAtLoad</key>
<true/>
<key>KeepAlive</key>

View File

@ -1,30 +0,0 @@
#!/bin/bash
###############################################################################
#
# Title: Post Script for Salt Installation
# Authors: Shane Lee
# Date: December 2015
#
# Description: This script copies the minion config file and starts the salt
# service
#
# Requirements:
# - None
#
# Usage:
# This script is run as a part of the OSX Salt Installation
#
###############################################################################
###############################################################################
# Check for existing minion config, copy if it doesn't exist
###############################################################################
if [ ! -f /etc/salt/minion ]; then
cp /etc/salt/minion.dist /etc/salt/minion
fi
###############################################################################
# Register Salt as a service
###############################################################################
set -e
launchctl load "/Library/LaunchDaemons/com.saltstack.salt.minion.plist"

67
pkg/osx/scripts/postinstall Executable file
View File

@ -0,0 +1,67 @@
#!/bin/bash
###############################################################################
#
# Title: Post Script for Salt Installation
# Authors: Shane Lee
# Date: December 2015
#
# Description: This script copies the minion config file and starts the salt
# service
#
# Requirements:
# - None
#
# Usage:
# This script is run as a part of the OSX Salt Installation
#
###############################################################################
echo "Post install started on:" > /tmp/postinstall.txt
date >> /tmp/postinstall.txt
trap 'quit_on_error $LINENO $BASH_COMMAND' ERR
quit_on_error() {
echo "$(basename $0) caught error on line : $1 command was: $2" >> /tmp/postinstall.txt
exit -1
}
###############################################################################
# Check for existing minion config, copy if it doesn't exist
###############################################################################
if [ ! -f /etc/salt/minion ]; then
echo "Config copy: Started..." >> /tmp/postinstall.txt
cp /etc/salt/minion.dist /etc/salt/minion
echo "Config copy: Successful" >> /tmp/postinstall.txt
fi
###############################################################################
# Register Salt as a service
###############################################################################
echo "Service start: Started..." >> /tmp/postinstall.txt
# launchctl load "/Library/LaunchDaemons/com.saltstack.salt.minion.plist"
echo "Service start: Enabling service..." >> /tmp/postinstall.txt
launchctl enable system/com.saltstack.salt.minion
echo "Service start: Bootstrapping service..." >> /tmp/postinstall.txt
launchctl bootstrap system /Library/LaunchDaemons/com.saltstack.salt.minion.plist
if /bin/launchctl list "com.saltstack.salt.minion" &> /dev/null; then
echo "Service is running" >> /tmp/postinstall.txt
else
echo "Service start: Kickstarting service..." >> /tmp/postinstall.txt
launchctl kickstart -kp system/com.saltstack.salt.minion
fi
echo "Service start: Successful" >> /tmp/postinstall.txt
echo "Service disable: Disabling Master, Syndic, and API" >> /tmp/postinstall.txt
launchctl disable system/com.saltstack.salt.master
launchctl disable system/com.saltstack.salt.syndic
launchctl disable system/com.saltstack.salt.api
# echo "Path: Adding salt to the path..." >> /tmp/postinstall.txt
# echo "/opt/salt/bin" > /etc/paths.d/salt
echo "Post install completed successfully" >> /tmp/postinstall.txt
exit 0

View File

@ -15,11 +15,26 @@
# This script is run as a part of the OSX Salt Installation
#
###############################################################################
echo "Preinstall started on:" > /tmp/preinstall.txt
date >> /tmp/preinstall.txt
trap 'quit_on_error $LINENO $BASH_COMMAND' ERR
quit_on_error() {
echo "$(basename $0) caught error on line : $1 command was: $2" >> /tmp/preinstall.txt
exit -1
}
###############################################################################
# Stop the service
###############################################################################
set -e
if /bin/launchctl list "com.saltstack.salt.minion" &> /dev/null; then
/bin/launchctl unload "/Library/LaunchDaemons/com.saltstack.salt.minion.plist"
echo "Stop service: Started..." >> /tmp/preinstall.txt
# /bin/launchctl unload "/Library/LaunchDaemons/com.saltstack.salt.minion.plist"
launchctl disable system/com.saltstack.salt.minion
launchctl bootout system /Library/LaunchDaemons/com.saltstack.salt.minion.plist
echo "Stop service: Successful" >> /tmp/preinstall.txt
fi
echo "Preinstall Completed Successfully" >> /tmp/preinstall.txt
exit 0

View File

@ -1 +0,0 @@
072bbfc3ffe3a838945ce6e7c4bbce267362673c3b870886accdc5a5ee01dbd071604fca6aa519d077676423d37bfe987b71f22f14a194f8d6ec8fb9de0a6049 ./cmake-3.4.1.tar.gz

View File

@ -1 +0,0 @@
272fb65ab9ca0a21e9f0dcfb2c638457e87cbb938c65ee850123474d11f2858496f84d3fa9edca27cd91c7220160cfdb59f90bd46ddc45395514addc9fd4151c ./gdbm-1.11.tar.gz

View File

@ -1 +0,0 @@
b73f114a117ccab284cf5891dac050e3016d28e0b1fc71639442cdb42accef676115af90a12deff4bcc1f599cc0cbdeb38142cbf4570bd7d03634786ad32c95f ./openssl-1.0.2e.tar.gz

View File

@ -0,0 +1 @@
50abf6dc94cafd06e7fd20770808bdc675c88daa369e4f752bd584ab17f72a57357c1ca1eca3c83e6745b5a3c9c73c99dce70adaa904d73f6df4c75bc7138351 ./openssl-1.0.2f.tar.gz

View File

@ -1 +0,0 @@
f70efaf46d570b85c7637172b0ee2eb9a4aa73ba38a62bb45075e665929d9701b96fba0aea6c767fd9a2a0d39dfe8e70ab06da08f8524aee76a7c502f370a401 ./readline-6.3.tar.gz

11
pkg/osx/shasums/readme.md Normal file
View File

@ -0,0 +1,11 @@
ShaSums
=======
This directory contains shasums for files that are downloaded by the `build_env.sh` script.
The sha's have been created using the following command:
```
shasum -a 512 ./<filename> > ./<filename>.sha512
```

View File

@ -1 +0,0 @@
f2f6244dfee4dab2dc5ef9607808404467a1f6baa684aa4e24b7116e7e7f63f396eef3282c1bcffbef47f19824731c2887deadbe3b2dad8a075b0639e5965d9e ./v0.23.4