Skip to content

Instantly share code, notes, and snippets.

@joscdk

joscdk/PKGBUILD Secret

Created June 29, 2021 20:16
Show Gist options
  • Save joscdk/ff22486a5d767a1be5d6dbeb7bd89d84 to your computer and use it in GitHub Desktop.
Save joscdk/ff22486a5d767a1be5d6dbeb7bd89d84 to your computer and use it in GitHub Desktop.
[Desktop Entry]
Type=Application
Name=Lens
GenericName=Kubernetes IDE
Comment=The Kubernetes IDE
Icon=lens-bin
Exec=lens %U
Categories=System;
StartupNotify=true
# Maintainer: "Amhairghin" Oscar Garcia Amor (https://ogarcia.me)
# Maintainer: istimaldar_sntlk <istimaldar@gmail.com>
# Contributor: zer0def <zer0def@github>
_pkgname=lens
pkgname=lens-bin
pkgver=5.0.0
pkgdate=20210629.3
pkgrel=1
pkgdesc='The Kubernetes IDE'
arch=('x86_64')
license=('MIT')
url='https://k8slens.dev'
depends=('alsa-lib' 'gtk3' 'libxss' 'libxtst' 'nss')
provides=('lens')
conflicts=('lens')
source=(${_pkgname}-${pkgver}-latest.${pkgdate}.${arch}.AppImage::"https://api.k8slens.dev/binaries/Lens-${pkgver}-latest.${pkgdate}.${arch}.AppImage"
"${_pkgname}.desktop")
sha256sums=('679ee43f2a0a2043bf520e25faa8bfb84db16e45e2dfb0cb4d5bf12a9fe06c31'
'd7eef757ebf7675ed3732db9fdbef282551675f0fce6938c438ec7b7e3098b5a')
prepare() {
chmod +x "${_pkgname}-${pkgver}-latest.${pkgdate}.${arch}.AppImage"
"./${_pkgname}-${pkgver}-latest.${pkgdate}.${arch}.AppImage" --appimage-extract
}
package() {
# move the entire distribution to /usr/share
mkdir -p "${pkgdir}"/usr/share/${_pkgname}
mv "${srcdir}"/squashfs-root/* \
"${pkgdir}"/usr/share/${_pkgname}
# icon
install -Dm 644 "${pkgdir}"/usr/share/${_pkgname}/usr/share/icons/hicolor/512x512/apps/${_pkgname}.png \
"${pkgdir}"/usr/share/icons/hicolor/512x512/apps/${pkgname}.png
# desktop file
install -Dm 644 "${srcdir}"/${_pkgname}.desktop \
"${pkgdir}"/usr/share/applications/${_pkgname}.desktop
# symlink binary
mkdir -p "${pkgdir}"/usr/bin
ln -sf /usr/share/${_pkgname}/lens \
"${pkgdir}"/usr/bin/lens
# clean and fix permissions
find "${pkgdir}" -type d -exec chmod 755 {} \;
chmod -x "${pkgdir}"/usr/share/${_pkgname}/*.so
rm -rf "${pkgdir}"/usr/share/${_pkgname}/lens.png
rm -rf "${pkgdir}"/usr/share/${_pkgname}/usr
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment