mongrel2.sh 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. #!/bin/bash
  2. fw_depends zeromq
  3. RETCODE=$(fw_exists ${IROOT}/mongrel2.installed)
  4. [ ! "$RETCODE" == 0 ] || { \
  5. source $IROOT/mongrel2.installed
  6. return 0; }
  7. MONGREL2=$IROOT/mongrel2
  8. MONGREL2_VERSION="v1.8.1"
  9. # TODO: Get away from apt-get
  10. # Dependencies
  11. sudo apt-get install -y sqlite3 libsqlite3-dev uuid uuid-runtime uuid-dev
  12. # Update linker cache
  13. sudo ldconfig -v
  14. fw_get -o mongrel2.tar.gz https://github.com/mongrel2/mongrel2/tarball/$MONGREL2_VERSION
  15. fw_untar mongrel2.tar.gz
  16. # mongrel2 untars into this folder
  17. mv mongrel2-mongrel2-aa2ecf8 mongrel2-install
  18. # for zmq4, we update the following file manually (not in v1.8.1)
  19. fw_get -O https://raw.githubusercontent.com/mongrel2/mongrel2/2cbf31de625b3476dfa541d6409f24364026f63a/src/zmq_compat.h
  20. mv -f zmq_compat.h mongrel2-install/src/
  21. cd mongrel2-install
  22. # Do this in a subshell to avoid leaking env variables
  23. (
  24. export PREFIX=${IROOT}/mongrel2
  25. export OPTFLAGS="-I$IROOT/zeromq-4.0.3/include"
  26. export OPTLIBS="-Wl,-rpath,$IROOT/zeromq-4.0.3/lib -L$IROOT/zeromq-4.0.3/lib"
  27. make clean all
  28. make install
  29. )
  30. echo "export MONGREL2_HOME=${MONGREL2}" > $IROOT/mongrel2.installed
  31. echo -e "export PATH=\$MONGREL2/bin:\$PATH" >> $IROOT/mongrel2.installed
  32. source $IROOT/mongrel2.installed