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