summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorStephen Bell2016-04-13 11:00:06 -0400
committerStephen Bell2016-04-13 11:00:06 -0400
commit0ba999a4a3a4ce081b38675e296397f1e79b800e (patch)
tree2603ee2cbf5a493b0c1e7b81496c7bbbf4c89890
downloadaur-0ba999a4a3a4ce081b38675e296397f1e79b800e.tar.gz
Initial release
-rw-r--r--.SRCINFO15
-rw-r--r--PKGBUILD34
2 files changed, 49 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 00000000000..ab4d7dcf978
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,15 @@
+pkgbase = apk-thumbnailer
+ pkgdesc = a simple thumbnailer for apk files
+ pkgver = 1.0
+ pkgrel = 1
+ url = https://github.com/theredbaron1834/Scripts/blob/master/apk-thumbnailer
+ arch = i686
+ arch = x86_64
+ license = BSD 3 Clause
+ depends = java-runtime
+ depends = android-sdk-build-tools
+ depends = imagemagick
+ depends = unzip
+
+pkgname = apk-thumbnailer
+
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 00000000000..3e566f78e5d
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,34 @@
+# Maintainer: Stephen Bell <theredbaron1834 {at} yahoo {dot} com>
+pkgname=apk-thumbnailer
+pkgver=1.0
+pkgrel=1
+pkgdesc="a simple thumbnailer for apk files"
+arch=(i686 x86_64)
+url="https://github.com/theredbaron1834/Scripts/blob/master/apk-thumbnailer"
+license=('BSD 3 Clause')
+depends=('java-runtime' 'android-sdk-build-tools' 'imagemagick' 'unzip')
+
+
+prepare() {
+ cd "$srcdir"
+
+echo "[Thumbnailer Entry]
+TryExec=/usr/bin/apk-thumbnailer
+Exec=/usr/bin/apk-thumbnailer %u %o
+MimeType=application/vnd.android.package-archive" > apk-thumbnailer.thumbnailer
+
+
+echo "#!/bin/bash
+file=\$(echo "\$1" | sed s'/file:\/\///g' | sed s'/%20/ /g' | sed s'/%5B/\[/g'| sed s'/%5D/\]/g') # Clean up thumbnailer for aapt
+icon=\$(/opt/android-sdk/build-tools/*/aapt d --values badging "\$file" | grep application-icon- | sed s'/:/\n/g' | tail -n 1 | tr -d \') #Grab icon location
+mkdir /tmp/apkthumbnailer/
+cd /tmp/apkthumbnailer/
+unzip -o "\$file" "\$icon" # Extract icon
+convert -thumbnail 200 /tmp/apkthumbnailer/\$icon "\$2" # Make thumbnail" > apk-thumbnailer
+
+}
+
+package() {
+ install -Dm 0755 "${srcdir}/apk-thumbnailer.thumbnailer" "${pkgdir}/usr/share/thumbnailers/apk-thumbnailer.thumbnailer"
+ install -Dm 0755 "${srcdir}/apk-thumbnailer" "${pkgdir}/usr/bin/apk-thumbnailer"
+}