mongrel2.sh 1.2 KB

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