Newer
Older
tools-builder / makefile
  1. # Produce standard tools tarballs using linuxbrew
  2.  
  3. # Customize the variables as desired
  4.  
  5. EXPORTDIR = /shared
  6. INSTALLDIR = /opt/TundraWare
  7. TOOLS = tools
  8. MYTOOLS = perl python emacs joe htop nload nmap screen the_silver_searcher tree vim
  9. PIPMODULES = ansible pew pew[pythonz]
  10.  
  11. # Nothing below here should need changing
  12.  
  13. TOOLSDIR = ${INSTALLDIR}/${TOOLS}
  14. BREW = ${TOOLSDIR}/bin/brew -v
  15. DATESTAMP = $(shell date +%Y%m%d)
  16.  
  17. # Get latest linuxbrew
  18.  
  19. getbrew:
  20. echo "Make sure you have write permission on the target directory!"
  21. git clone https://github.com/Linuxbrew/brew.git ${TOOLSDIR}
  22.  
  23. bootstrap-build:
  24. echo "Make sure you have the OS development tools installed!"
  25. ${BREW} install gcc git make file-formula
  26.  
  27. bootstrap-release: tidyup
  28. cd ${INSTALLDIR} && mv -v ${TOOLS} ${TOOLS}-bootstrap-${DATESTAMP}
  29. cd ${INSTALLDIR} && tar -czvf ${EXPORTDIR}/${TOOLS}-bootstrap-${DATESTAMP}.tar.gz ${TOOLS}-bootstrap-${DATESTAMP}
  30.  
  31. full-build:
  32. echo "Make sure your OS autoconf, automake, and perl are installed!"
  33. echo 'Make sure the bootstrap is installed at $TOOLSDIR'
  34. ${BREW} install ${MYTOOLS}
  35. ln -nfs ${INSTALLDIR}/${TOOLS}/bin/python2 ${INSTALLDIR}/${TOOLS}/bin/python
  36. ln -nfs ${INSTALLDIR}/${TOOLS}/bin/pip2 ${INSTALLDIR}/${TOOLS}/bin/pip
  37. pip install $PIPMODULES -U --ignore-installed
  38.  
  39. full-release: tidyup
  40. cd ${INSTALLDIR} && mv -v ${TOOLS} ${TOOLS}-${DATESTAMP}
  41. cd ${INSTALLDIR} && tar -czvf ${EXPORTDIR}/${TOOLS}-${DATESTAMP}.tar.gz ${TOOLS}-${DATESTAMP}
  42.  
  43. tidyup:
  44. ${BREW} config
  45. ${BREW} prune
  46. ${BREW} cleanup
  47. -${BREW} doctor
  48.  
  49. clean:
  50. cd ${INSTALLDIR} && rm -vrf ${TOOLS} ${TOOLS}-bootstrap-${DATESTAMP} ${TOOLS}-${DATESTAMP}