Build custom repository of Arch AUR packages for use with the live CD

build.sh 1.2KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. #!/bin/zsh
  2. # Pull the packages in from a more human readable file
  3. packages=("${(@f)$(cat packages.list)}")
  4. # Clean everything up
  5. if [[ -d ./packages ]]; then
  6. if [[ -e ./packages/* ]]; then
  7. rm -rf ./packages/*
  8. fi
  9. else
  10. mkdir ./packages
  11. fi
  12. if [[ -d ./x86_64 ]]; then
  13. if [[ -e ./x86_64/* ]]; then
  14. rm -rf ./x86_64/*
  15. fi
  16. else
  17. mkdir ./x86_64
  18. fi
  19. if [[ -d ./i686 ]]; then
  20. if [[ -e ./i686/* ]]; then
  21. rm -rf ./i686/*
  22. fi
  23. else
  24. mkdir ./i686
  25. fi
  26. # Move to our working directory
  27. cd packages
  28. for p in $packages;
  29. do
  30. # Grab the most recent packages
  31. wget https://aur.archlinux.org/packages/$p[0,2]/$p/$p.tar.gz
  32. # Unpackage the compressed packages
  33. tar -xvf $p.tar.gz
  34. # Make the Arch packages
  35. if [[ -d "$p" ]]; then
  36. cd $p
  37. makepkg --config ../../makepkg64.conf && mv *.pkg.tar.xz ../../x86_64
  38. #linux32 makepkg --config ../../makepkg32.conf && mv *.pkg.tar.xz ../../i686
  39. cd ..
  40. fi
  41. done
  42. # Add the Arch packages to the repositories
  43. cd ..
  44. if [[ -e ./x86_64/*.tar.xz ]]; then
  45. repo-add -n ./x86_64/customrepo.db.tar.gz ./x86_64/*.tar.xz
  46. fi
  47. if [[ -e ./i686/*.tar.xz ]]; then
  48. repo-add -n ./i686/customrepo.db.tar.gz ./i686/*.tar.xz
  49. fi