Newer
Older
tools-builder / makefile
  1. # Produce standard tools tarballs using linuxbrew
  2.  
  3. # Customize the variables as desired
  4.  
  5. # Where to store build tarballs
  6. EXPORTDIR = /shared
  7.  
  8. # Where tools directory lives
  9. INSTALLDIR = /opt/TundraWare
  10.  
  11. # Name of the tools directory
  12. TOOLS = tools
  13.  
  14. # Things that have to be built during the bootstrap phase with system tools
  15. BOOTSTRAP = gcc make nload
  16.  
  17. # Languages to install after bootstrap but before other packages
  18. LANGS = perl python
  19.  
  20. # Stuff we want pip to install
  21. PIPMODULES = ansible pew pythonz-bd
  22.  
  23. # Set of packages we want to include in the distribution tarball
  24. MYTOOLS = emacs file-formula git htop joe nmap screen the_silver_searcher tree vim
  25.  
  26.  
  27. # ----------- Nothing below here should need changing ----------- #
  28.  
  29. TOOLSDIR = ${INSTALLDIR}/${TOOLS}
  30. BREW = ${TOOLSDIR}/bin/brew -v
  31. DATESTAMP = $(shell date +%Y%m%d)
  32.  
  33. # Get latest linuxbrew
  34.  
  35. getbrew:
  36. @echo "Make sure you have write permission on the target directory!"
  37. git clone https://github.com/Linuxbrew/brew.git ${TOOLSDIR}
  38.  
  39. bootstrap-build:
  40. @echo "Make sure you have the OS development tools installed!"
  41. ${BREW} install ${BOOTSTRAP}
  42.  
  43. bootstrap-release: tidyup
  44. cd ${INSTALLDIR} && mv -v ${TOOLS} ${TOOLS}-bootstrap-${DATESTAMP}
  45. cd ${INSTALLDIR} && tar -czvf ${EXPORTDIR}/${TOOLS}-bootstrap-${DATESTAMP}.tar.gz ${TOOLS}-bootstrap-${DATESTAMP}
  46.  
  47. full-build:
  48. @echo "Make sure the bootstrap is installed at ${TOOLSDIR}"
  49. -sudo yum -y install autoconf automake perl
  50. ${BREW} install ${LANGS}
  51. ln -nfs ${INSTALLDIR}/${TOOLS}/bin/python2 ${INSTALLDIR}/${TOOLS}/bin/python
  52. ln -nfs ${INSTALLDIR}/${TOOLS}/bin/pip2 ${INSTALLDIR}/${TOOLS}/bin/pip
  53. pip install ${PIPMODULES} -U --ignore-installed
  54. ${BREW} install ${MYTOOLS}
  55.  
  56. full-release: tidyup
  57. cd ${INSTALLDIR} && mv -v ${TOOLS} ${TOOLS}-${DATESTAMP}
  58. cd ${INSTALLDIR} && tar -czvf ${EXPORTDIR}/${TOOLS}-${DATESTAMP}.tar.gz ${TOOLS}-${DATESTAMP}
  59.  
  60. tidyup:
  61. ${BREW} config
  62. ${BREW} prune
  63. ${BREW} cleanup
  64. -${BREW} doctor
  65.  
  66. clean:
  67. cd ${INSTALLDIR} && rm -vrf ${TOOLS} ${TOOLS}-bootstrap-${DATESTAMP} ${TOOLS}-${DATESTAMP}