Newer
Older
tools-builder / makefile
  1. # Produce standard tools tarballs using linuxbrew
  2.  
  3. # Customize the variables as desired
  4.  
  5. # Software depot to archive releases
  6. DEPOT = depot@slice.tundraware.com:/opt/depot/
  7.  
  8. # Where to store build tarballs
  9. EXPORTDIR = /shared
  10.  
  11. # Where tools directory lives
  12. INSTALLDIR = /opt/TundraWare
  13.  
  14. # Name of the tools directory
  15. TOOLS = tools
  16.  
  17. # Things that have to be built during the bootstrap phase with system tools
  18. BOOTSTRAP = gcc glibc make
  19.  
  20. # Languages to install after bootstrap but before other packages
  21. LANGS = go perl python
  22.  
  23. # Stuff we want pip to install
  24. PIPMODULES = pip ansible pew pythonz-bd
  25.  
  26. # Set of packages we want to include in the distribution tarball
  27. MYTOOLS = bash-completion emacs file-formula git htop nload nmap screen socat source-highlight the_silver_searcher tmux tree vim
  28.  
  29.  
  30. # ----------- Nothing below here should need changing ----------- #
  31.  
  32. TOOLSDIR = ${INSTALLDIR}/${TOOLS}
  33. BREW = ${TOOLSDIR}/bin/brew -v
  34. DATESTAMP = $(shell date +%Y%m%d)
  35.  
  36. # Get latest linuxbrew
  37.  
  38. getbrew:
  39. @echo "Make sure you have write permission on the target directory!"
  40. git clone https://github.com/Homebrew/brew ${TOOLSDIR}
  41.  
  42.  
  43. # Bootstrapping
  44.  
  45. bootstrap-build:
  46. @echo "Make sure you have the OS development tools installed!"
  47. sudo yum -y install texinfo
  48. ${BREW} install ${BOOTSTRAP}
  49.  
  50. bootstrap-release: tidyup
  51. cd ${INSTALLDIR} && mv -v ${TOOLS} ${TOOLS}-bootstrap-${DATESTAMP}
  52. cd ${INSTALLDIR} && tar -czvf ${EXPORTDIR}/${TOOLS}-bootstrap-${DATESTAMP}.tar.gz ${TOOLS}-bootstrap-${DATESTAMP}
  53. cd ${INSTALLDIR} && mv -v ${TOOLS}-bootstrap-${DATESTAMP} ${TOOLS}
  54.  
  55.  
  56. # Full tools set
  57.  
  58. full-build:
  59. @echo "Make sure the bootstrap is installed at ${TOOLSDIR}"
  60. sudo yum -y install autoconf automake patch perl texinfo
  61. ${BREW} install ${LANGS}
  62. ln -nfs ${INSTALLDIR}/${TOOLS}/bin/python3 ${INSTALLDIR}/${TOOLS}/bin/python
  63. ln -nfs ${INSTALLDIR}/${TOOLS}/bin/pip3 ${INSTALLDIR}/${TOOLS}/bin/pip
  64. pip install ${PIPMODULES} -U --ignore-installed
  65. ${BREW} install ${MYTOOLS}
  66. ln -nfs ${INSTALLDIR}/${TOOLS}/bin/vim ${INSTALLDIR}/${TOOLS}/bin/vi
  67.  
  68. full-release: tidyup
  69. cd ${INSTALLDIR} && mv -v ${TOOLS} ${TOOLS}-${DATESTAMP}
  70. cd ${INSTALLDIR} && tar -czvf ${EXPORTDIR}/${TOOLS}-${DATESTAMP}.tar.gz ${TOOLS}-${DATESTAMP}
  71. cd ${INSTALLDIR} && mv -v ${TOOLS}-${DATESTAMP} ${TOOLS}
  72.  
  73. upgrade:
  74. brew update
  75. brew upgrade
  76. pip install ${PIPMODULES} -U --ignore-installed
  77.  
  78.  
  79. # Housekeeping
  80.  
  81. push-release:
  82. scp ${EXPORTDIR}/${TOOLS}-${DATESTAMP}.tar.gz ${DEPOT}
  83.  
  84. tidyup:
  85. ${BREW} config
  86. ${BREW} cleanup
  87. -${BREW} doctor
  88.  
  89. clean:
  90. cd ${INSTALLDIR} && rm -vrf ${TOOLS} ${TOOLS}-bootstrap-${DATESTAMP} ${TOOLS}-${DATESTAMP}