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. LANGS = perl python
  9. MYTOOLS = emacs file-formula git htop joe nload nmap screen the_silver_searcher tree vim
  10. PIPMODULES = ansible pew pythonz-bd
  11.  
  12. # Nothing below here should need changing
  13.  
  14. TOOLSDIR = ${INSTALLDIR}/${TOOLS}
  15. BREW = ${TOOLSDIR}/bin/brew -v
  16. DATESTAMP = $(shell date +%Y%m%d)
  17.  
  18. # Get latest linuxbrew
  19.  
  20. getbrew:
  21. @echo "Make sure you have write permission on the target directory!"
  22. git clone https://github.com/Linuxbrew/brew.git ${TOOLSDIR}
  23.  
  24. bootstrap-build:
  25. @echo "Make sure you have the OS development tools installed!"
  26. ${BREW} install gcc make
  27.  
  28. bootstrap-release: tidyup
  29. cd ${INSTALLDIR} && mv -v ${TOOLS} ${TOOLS}-bootstrap-${DATESTAMP}
  30. cd ${INSTALLDIR} && tar -czvf ${EXPORTDIR}/${TOOLS}-bootstrap-${DATESTAMP}.tar.gz ${TOOLS}-bootstrap-${DATESTAMP}
  31.  
  32. full-build:
  33. @echo "Make sure the bootstrap is installed at ${TOOLSDIR}"
  34. -sudo yum -y install autoconf automake perl
  35. ${BREW} install ${LANGS}
  36. ln -nfs ${INSTALLDIR}/${TOOLS}/bin/python2 ${INSTALLDIR}/${TOOLS}/bin/python
  37. ln -nfs ${INSTALLDIR}/${TOOLS}/bin/pip2 ${INSTALLDIR}/${TOOLS}/bin/pip
  38. pip install ${PIPMODULES} -U --ignore-installed
  39. ${BREW} install ${MYTOOLS}
  40.  
  41. full-release: tidyup
  42. cd ${INSTALLDIR} && mv -v ${TOOLS} ${TOOLS}-${DATESTAMP}
  43. cd ${INSTALLDIR} && tar -czvf ${EXPORTDIR}/${TOOLS}-${DATESTAMP}.tar.gz ${TOOLS}-${DATESTAMP}
  44.  
  45. tidyup:
  46. ${BREW} config
  47. ${BREW} prune
  48. ${BREW} cleanup
  49. -${BREW} doctor
  50.  
  51. clean:
  52. cd ${INSTALLDIR} && rm -vrf ${TOOLS} ${TOOLS}-bootstrap-${DATESTAMP} ${TOOLS}-${DATESTAMP}