2014-01-05 15:46:44 +00:00
|
|
|
# Esky builds for SmartOS
|
|
|
|
|
|
|
|
This is intentionally currently not marked executable.
|
|
|
|
There are some hard coded bits, it depends on a binary copy of patchelf, etc.
|
|
|
|
However it does document pretty thoroughly how I initially created a build environment
|
|
|
|
for packaging up esky builds for SmartOS
|
|
|
|
|
|
|
|
```bash
|
2016-05-28 13:59:14 +00:00
|
|
|
#!/bin/sh
|
|
|
|
set -ux
|
2014-01-05 15:46:44 +00:00
|
|
|
|
2016-05-28 13:59:14 +00:00
|
|
|
## environment
|
|
|
|
export PATH=$PATH:/opt/local/gcc49/bin/
|
|
|
|
BLDPATH=/tmp/bbfreeze_loader
|
|
|
|
SALTBASE=/data
|
2014-01-05 15:46:44 +00:00
|
|
|
|
2016-05-28 13:59:14 +00:00
|
|
|
## packages
|
2015-07-26 10:23:59 +00:00
|
|
|
pkgin -y in build-essential salt swig py27-pip unzip py27-mysqldb libsodium mysql-client patchelf
|
2014-08-14 19:51:55 +00:00
|
|
|
pkgin -y rm salt py27-zmq
|
2014-01-05 15:46:44 +00:00
|
|
|
|
2016-05-28 17:00:42 +00:00
|
|
|
pip install --no-use-wheel --egg esky bbfreeze
|
2014-01-05 15:46:44 +00:00
|
|
|
|
2016-05-28 13:59:14 +00:00
|
|
|
## bzfreeze-loader
|
2017-03-22 18:25:14 +00:00
|
|
|
COMPILE="gcc -fno-strict-aliasing -O2 -pipe -DHAVE_DB_185_H -I/usr/include -I/opt/local/include -I/opt/local/include/db4 -I/opt/local/include/gettext -I/opt/local/include/ncurses -DNDEBUG -fPIC -I/opt/local/include/python2.7 -static-libgcc"
|
|
|
|
LINK_OPTS="-L/opt/local/lib -L/opt/local/lib/python2.7/config -lsocket -lnsl -ldl -lrt -lm -lssp -static-libgcc"
|
2016-05-28 13:59:14 +00:00
|
|
|
mkdir -p ${BLDPATH}
|
|
|
|
cd ${BLDPATH}
|
2014-01-05 15:46:44 +00:00
|
|
|
curl -kO 'https://pypi.python.org/packages/source/b/bbfreeze-loader/bbfreeze-loader-1.1.0.zip'
|
|
|
|
unzip bbfreeze-loader-1.1.0.zip
|
2016-05-28 13:59:14 +00:00
|
|
|
${COMPILE} -c bbfreeze-loader-1.1.0/_bbfreeze_loader/console.c -o ${BLDPATH}/console.o
|
|
|
|
${COMPILE} -c bbfreeze-loader-1.1.0/_bbfreeze_loader/getpath.c -o ${BLDPATH}/getpath.o
|
|
|
|
gcc ${BLDPATH}/console.o ${BLDPATH}/getpath.o /opt/local/lib/python2.7/config/libpython2.7.a ${LINK_OPTS} -o ${BLDPATH}/console.exe
|
|
|
|
find /opt/local -name console.exe -exec cp ${BLDPATH}/console.exe {} \;
|
|
|
|
|
|
|
|
## clone saltstack repo
|
|
|
|
cd ${SALTBASE}
|
2017-03-22 18:25:14 +00:00
|
|
|
git clone git://github.com/saltstack/salt -b 2016.11
|
2016-05-28 13:59:14 +00:00
|
|
|
|
|
|
|
## salt requirements
|
|
|
|
cd ${SALTBASE}/salt
|
2016-05-28 17:00:42 +00:00
|
|
|
until pip install --no-use-wheel --egg -r pkg/smartos/esky/zeromq_requirements.txt ; do sleep 1 ; done ;
|
|
|
|
until pip install --no-use-wheel --egg -r pkg/smartos/esky/raet_requirements.txt ; do sleep 1 ; done ;
|
2014-08-14 19:51:55 +00:00
|
|
|
|
2016-05-28 13:59:14 +00:00
|
|
|
## sodium grabber
|
|
|
|
cd ${SALTBASE}/salt
|
2014-08-21 21:37:55 +00:00
|
|
|
python2.7 pkg/smartos/esky/sodium_grabber_installer.py install
|
2014-08-14 19:51:55 +00:00
|
|
|
|
2016-05-28 13:59:14 +00:00
|
|
|
## cleanup
|
|
|
|
rm -r ${BLDPATH}
|
2014-01-05 15:46:44 +00:00
|
|
|
|
2016-05-28 13:59:14 +00:00
|
|
|
## build esky package
|
|
|
|
cd ${SALTBASE}/salt
|
|
|
|
pkg/smartos/esky/build-tarball.sh
|
2014-01-05 15:46:44 +00:00
|
|
|
```
|