PKGBUILD 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. # Maintainer: Rain Clark <rain AT melonbread DOT dev>
  2. # Co-maintainer: txtsd <aur.archlinux@ihavea.quest>
  3. # Based on: https://daveparrish.net/posts/2019-11-16-Better-AppImage-PKGBUILD-template.html
  4. _pkgname=grabber
  5. _reponame=imgbrd-grabber
  6. _rdnsname=org.bionus.Grabber
  7. pkgname="${_reponame}"-appimage
  8. pkgver=7.10.1
  9. pkgrel=1
  10. pkgdesc="Very customizable imageboard/booru downloader with powerful filenaming features."
  11. arch=('x86_64')
  12. url="https://github.com/Bionus/${_reponame}"
  13. license=('Apache')
  14. depends=('hicolor-icon-theme' 'zlib' 'fuse')
  15. provides=("${_pkgname}")
  16. conflicts=("${_pkgname}")
  17. _appimage="Grabber_v${pkgver}-${arch}.AppImage"
  18. noextract=("${_appimage}")
  19. options=('!strip')
  20. source=("https://github.com/Bionus/${_reponame}/releases/download/v${pkgver}/${_appimage}"
  21. "https://raw.githubusercontent.com/Bionus/${_reponame}/v${pkgver}/LICENSE")
  22. sha256sums=('b3dec3400fa0f6a6419eba185887f8467842948494232445dbdf360d2a733e50'
  23. 'cfc7749b96f63bd31c3c42b5c471bf756814053e847c10f3eb003417bc523d30')
  24. prepare() {
  25. chmod +x "${_appimage}"
  26. ./"${_appimage}" --appimage-extract
  27. }
  28. build() {
  29. # Adjust .desktop so it will work outside of AppImage container
  30. sed -i -E "s|Exec=AppRun|Exec=env DESKTOPINTEGRATION=false /usr/bin/${_pkgname}|"\
  31. "squashfs-root/${_rdnsname}.desktop"
  32. # Fix permissions; .AppImage permissions are 700 for all directories
  33. chmod -R a-x+rX squashfs-root/usr
  34. }
  35. package() {
  36. # AppImage
  37. install -Dm755 "${srcdir}/${_appimage}" "${pkgdir}/opt/${pkgname}/${pkgname}.AppImage"
  38. install -Dm644 "${srcdir}/LICENSE" "${pkgdir}/opt/${pkgname}/LICENSE"
  39. # Desktop file
  40. install -Dm644 "${srcdir}/squashfs-root/${_rdnsname}.desktop" \
  41. "${pkgdir}/usr/share/applications/${_rdnsname}.desktop"
  42. # Icon images
  43. install -dm755 "${pkgdir}/usr/share/"
  44. cp -a "${srcdir}/squashfs-root/usr/share/icons" "${pkgdir}/usr/share/"
  45. # Symlink executable
  46. install -dm755 "${pkgdir}/usr/bin"
  47. ln -s "/opt/${pkgname}/${pkgname}.AppImage" "${pkgdir}/usr/bin/${_pkgname}"
  48. # Symlink license
  49. install -dm755 "${pkgdir}/usr/share/licenses/${pkgname}/"
  50. ln -s "/opt/$pkgname/LICENSE" "$pkgdir/usr/share/licenses/$pkgname"
  51. }