How to create an AUR package from a bash script?

I came across this GitHub repository, and the software can be installed with this shell script.

#!/bin/bash
install -D quick-lookup.js /usr/bin/quick-lookup
install com.github.johnfactotum.QuickLookup.desktop /usr/share/applications
install com.github.johnfactotum.QuickLookup.svg /usr/share/icons/hicolor/scalable/apps
install com.github.johnfactotum.QuickLookup-symbolic.svg /usr/share/icons/hicolor/symbolic/apps
install com.github.johnfactotum.QuickLookup.gschema.xml /usr/share/glib-2.0/schemas
gtk-update-icon-cache -qtf /usr/share/icons/hicolor
update-desktop-database -q /usr/share/applications
glib-compile-schemas /usr/share/glib-2.0/schemas

Is there any way to turn the shell script into an AUR?

What should be the contents of build() and package()?

pkgname=quick-lookup
pkgver=1.2.0
pkgrel=1
pkgdesc="Simple GTK dictionary application powered by Wiktionary "
arch=("any")
license=("GPL3")
depends=("gjs" "webkit2gtk")
makedepends=("git")

source=("$pkgname-$pkgver.tar.gz"::"https://github.com/johnfactotum/quick-lookup/archive/$pkgver.tar.gz")
sha256sums=("SKIP")


build() {
}

package() {
}

I don’t mind if someone else (e.g. the one who answers this question) wants to maintain the package in AUR. Otherwise, I would be happy to maintain it.

quick-lookup is already in the AUR so you can look at the PKGBUILD. :wink:

1 Like

Oops

So, we can just translate the contents of the shell script into the package() field?

Basically. However, there are already libalpm hooks for gtk-update-icon-cache, update-desktop-database and glib-compile-schemas so those aren’t necessary.

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.