aur.sh 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. #!/bin/sh
  2. # SPDX-License-Identifier: GPL-3.0-or-later
  3. # Copyright (c) 2012-2024 Daniele Bartolini et al.
  4. while true; do
  5. case "$1" in
  6. -c|--clean)
  7. echo "Cleaning..."
  8. rm -rf pkg 2> /dev/null
  9. rm -rf src 2> /dev/null
  10. rm crown-*.tar.gz 2> /dev/null
  11. rm crown-*.tar.xz 2> /dev/null
  12. exit 0
  13. ;;
  14. -b|--build)
  15. PKGVER=$2
  16. PKGREL=$3
  17. COMMITLOG="Crown v${PKGVER}-${PKGREL}"
  18. sed -i "s/^pkgver.*/pkgver=${PKGVER}/g" PKGBUILD
  19. sed -i "s/^pkgrel.*/pkgrel=${PKGREL}/g" PKGBUILD
  20. updpkgsums
  21. makepkg --printsrcinfo > .SRCINFO
  22. git add .SRCINFO PKGBUILD
  23. git commit -m "${COMMITLOG}"
  24. exit $?
  25. ;;
  26. -f|--force)
  27. makepkg -f
  28. exit $?
  29. ;;
  30. -p|--publish)
  31. git push
  32. exit $?
  33. ;;
  34. --update-icons)
  35. CROWN_GIT=~/git/crown
  36. CROWN_ICONS=${CROWN_GIT}/tools/level_editor/resources/icons
  37. for _res in 512x512 256x256 128x128 64x64 48x48 32x32 16x16; do
  38. mkdir -p "icons/${_res}/apps"
  39. cp -r "${CROWN_ICONS}/${_res}/apps/crown.png" "icons/${_res}/apps"
  40. done
  41. cp "${CROWN_ICONS}/crown.svg" icons
  42. tar czf icons.tar.gz icons
  43. rm -r icons
  44. exit 0
  45. ;;
  46. -h|--help)
  47. echo "Usage:"
  48. echo "1) $0 --clean"
  49. echo "2) $0 --build <pkgver> <pkgrel>"
  50. echo "3) $0 --publish"
  51. exit 0
  52. ;;
  53. *)
  54. echo "Unknown option \`$1\`"
  55. exit 1
  56. ;;
  57. esac
  58. done