Created
May 9, 2017 02:48
-
-
Save andreldm/9f4fcda1674245d2f8abcde777f8db1c to your computer and use it in GitHub Desktop.
PKGBUILD for Medis
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[Desktop Entry] | |
Name=Medis Git | |
Comment=Medis is a beautiful, easy-to-use database management application for Redis. | |
Exec=/usr/bin/medis-git %U | |
Icon=medis-git.png | |
Type=Application | |
StartupNotify=true | |
Categories=GTK;Utility;Development; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
post_install() { | |
update-desktop-database -q | |
} | |
post_upgrade() { | |
post_install | |
} | |
post_remove() { | |
post_install | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Maintainer: John Doe <john.doe at gmail dot com> | |
_pkgname=medis | |
_version=git | |
pkgname=${_pkgname}-${_version} | |
pkgver=0.6.1.c212 | |
pkgrel=1 | |
pkgdesc='Medis is a beautiful, easy-to-use database management application for Redis.' | |
arch=('x86_64' 'i686') | |
url="https://github.com/luin/${_pkgname}" | |
license=('MIT') | |
depends=('alsa-lib' 'gconf' 'gtk2' 'libgnome-keyring' 'libnotify' 'libxtst' 'nss' 'python2') | |
makedepends=('git' 'npm') | |
install=${_pkgname}-${_version}.install | |
source=("git+${url}.git" | |
"${_pkgname}-${_version}.desktop" | |
#"${_pkgname}-${_version}" | |
) | |
sha256sums=('SKIP' | |
'433e661120112b769c9abf6d5151e71ff18f8f27ccd9a3f17d1a39937106fe58' | |
#'9fe12f1bc573f5d431fcc8f9ca3ed17fc1e1d30248ae3b58209fc53084ae0a4e' | |
) | |
pkgver() { | |
cd $srcdir/$_pkgname | |
_basever=$(cat package.json | grep version | sed 's/version//g' | sed 's/://g' | sed 's/ //g' | sed 's/"//g' | sed 's/,//g' | sed 's/-/./g') | |
_commitno=$(git rev-list --count HEAD) | |
printf "${_basever}.c${_commitno}" | |
} | |
prepare() { | |
cd "$srcdir/${_pkgname}" | |
# Totally fragile, consider a pull request for Linux packaging | |
sed -i -e "s/'mas'/'linux'/g" bin/pack.js | |
sed -i "/const app/d" bin/pack.js | |
sed -i "/console\.log('flating/d" bin/pack.js | |
sed -i "/flat(/d" bin/pack.js | |
sed -i "/process\.exit/d" bin/pack.js | |
sed -i "/ })/d" bin/pack.js | |
} | |
build() { | |
cd "$srcdir/${_pkgname}" | |
npm i | |
export PATH=node_modules/.bin:$PATH | |
webpack -p --config webpack.production.config.js | |
node bin/pack.js | |
} | |
package() { | |
cd "$srcdir/${_pkgname}" | |
_arch=x64 | |
if [ "${CARCH}" = "i686" ]; then | |
_arch=x86 | |
fi | |
install -dm755 ${pkgdir}/usr/bin | |
install -dm755 ${pkgdir}/usr/lib/${_pkgname} | |
install -dm755 ${pkgdir}/usr/share/${_pkgname} | |
install -dm755 ${pkgdir}/usr/share/applications | |
install -dm755 ${pkgdir}/usr/share/licenses/${_pkgname} | |
install -dm755 ${pkgdir}/usr/share/pixmaps | |
cp -r out/Medis-linux-${_arch}/* "${pkgdir}/usr/lib/${_pkgname}" | |
cp icns/Icon1024.png ${pkgdir}/usr/share/pixmaps/${_pkgname}-git.png | |
mv ${pkgdir}/usr/lib/${_pkgname}/LICENSE ${pkgdir}/usr/share/licenses/${_pkgname}/LICENSE | |
# install -Dm755 $srcdir/${_pkgname}-${_version} ${pkgdir}/usr/bin/${_pkgname}-${_version} | |
install -Dm644 $srcdir/${_pkgname}-${_version}.desktop ${pkgdir}/usr/share/applications/${_pkgname}-${_version}.desktop | |
# rm ${pkgdir}/usr/share/${_pkgname}-${_version}/resources/app/atom.sh | |
# rm -rf ${pkgdir}/usr/share/${_pkgname}-${_version}/resources/app.asar.unpacked/resources | |
ln -sf "/usr/lib/${_pkgname}/Medis" "${pkgdir}/usr/bin/medis-git" | |
# find "$pkgdir" \ | |
# -name "*.a" -exec rm '{}' \; \ | |
# -or -name "*.bat" -exec rm '{}' \; \ | |
# -or -name "benchmark" -prune -exec rm -r '{}' \; \ | |
# -or -name "doc" -prune -exec rm -r '{}' \; \ | |
# -or -name "html" -prune -exec rm -r '{}' \; \ | |
# -or -name "man" -prune -exec rm -r '{}' \; \ | |
# -or -path "*/less/gradle" -prune -exec rm -r '{}' \; \ | |
# -or -path "*/task-lists/src" -prune -exec rm -r '{}' \; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment