forked from swails/heroku-buildpack-mosquitto
-
Notifications
You must be signed in to change notification settings - Fork 0
/
compile
32 lines (27 loc) · 923 Bytes
/
compile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#!/bin/sh
indent() {
sed -u 's/^/ /'
}
cwd=`pwd`
cd $1
echo "-----> Building mosquitto and installing to $1"
# Make sure we can properly find ares_build.h... sigh.
if [ -f $1/.apt/usr/include/x86_64-linux-gnu/ares_build.h ]; then
cp $1/.apt/usr/include/x86_64-linux-gnu/ares_build.h $1/.apt/usr/include/
fi
# Download and install mosquitto
wget http://mosquitto.org/files/source/mosquitto-1.5.4.tar.gz > /dev/null 2>&1
tar zxf mosquitto-1.5.4.tar.gz
cd mosquitto-1.5.4/
cmake -DARES_HEADER=$1/.apt/usr/include -DCMAKE_INSTALL_PREFIX=$1 . | indent
make install 2>&1 | indent
export PATH=$PATH\:$1/bin:$1/sbin
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH\:$1/lib
echo "-----> Setting MQTT_HOME environment variable"
cd $cwd
cat > ${HOME}/.profile.d/mqtt.sh << EOF
export MQTT_HOME=$1/bin
export LD_LIBRARY_PATH=$1/lib:$LD_LIBRARY_PATH
EOF
echo "-----> Contents of .profile.d:"
ls -C ${HOME}/.profile.d | indent