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 = go 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 socat the_silver_searcher tmux 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.  
  40. # Bootstrapping
  41.  
  42. bootstrap-build:
  43. @echo "Make sure you have the OS development tools installed!"
  44. ${BREW} install ${BOOTSTRAP}
  45.  
  46. bootstrap-release: tidyup
  47. cd ${INSTALLDIR} && mv -v ${TOOLS} ${TOOLS}-bootstrap-${DATESTAMP}
  48. cd ${INSTALLDIR} && tar -czvf ${EXPORTDIR}/${TOOLS}-bootstrap-${DATESTAMP}.tar.gz ${TOOLS}-bootstrap-${DATESTAMP}
  49.  
  50.  
  51. # Full tools set
  52.  
  53. full-build: openssl@1.1
  54. @echo "Make sure the bootstrap is installed at ${TOOLSDIR}"
  55. -sudo yum -y install autoconf automake perl
  56. ${BREW} install ${LANGS}
  57. ln -nfs ${INSTALLDIR}/${TOOLS}/bin/python2 ${INSTALLDIR}/${TOOLS}/bin/python
  58. ln -nfs ${INSTALLDIR}/${TOOLS}/bin/pip2 ${INSTALLDIR}/${TOOLS}/bin/pip
  59. pip install ${PIPMODULES} -U --ignore-installed
  60. ${BREW} install ${MYTOOLS}
  61.  
  62. full-release: tidyup
  63. cd ${INSTALLDIR} && mv -v ${TOOLS} ${TOOLS}-${DATESTAMP}
  64. cd ${INSTALLDIR} && tar -czvf ${EXPORTDIR}/${TOOLS}-${DATESTAMP}.tar.gz ${TOOLS}-${DATESTAMP}
  65.  
  66.  
  67. # Special cases and dependencies can go here
  68.  
  69. openssl@1.1:
  70. ${BREW} install openssl@1.1 --without-test
  71.  
  72.  
  73. # Housekeeping
  74.  
  75. tidyup:
  76. ${BREW} config
  77. ${BREW} prune
  78. ${BREW} cleanup
  79. -${BREW} doctor
  80.  
  81. clean:
  82. cd ${INSTALLDIR} && rm -vrf ${TOOLS} ${TOOLS}-bootstrap-${DATESTAMP} ${TOOLS}-${DATESTAMP}