diff options
author | Dany Marcoux | 2016-10-06 23:32:04 +0200 |
---|---|---|
committer | Dany Marcoux | 2016-10-06 23:32:04 +0200 |
commit | e1c02d998a78ff4cb0b21927896fbe739f35178a (patch) | |
tree | 87b15950c4bda95f4deacd165d7be67f6a052a87 | |
download | aur-e1c02d998a78ff4cb0b21927896fbe739f35178a.tar.gz |
Pre-release nightly
-rw-r--r-- | .SRCINFO | 17 | ||||
-rw-r--r-- | PKGBUILD | 34 | ||||
-rw-r--r-- | README.md | 77 | ||||
-rwxr-xr-x | pre-commit.sh | 27 |
4 files changed, 155 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO new file mode 100644 index 000000000000..33726dab0f86 --- /dev/null +++ b/.SRCINFO @@ -0,0 +1,17 @@ +pkgbase = lf + pkgdesc = lf: A terminal file manager, heavily inspired by ranger + pkgver = nightly + pkgrel = 1 + url = https://github.com/gokcehan/lf + arch = i686 + arch = x86_64 + license = MIT + makedepends = go + provides = lf + options = !strip + options = !emptydirs + source = https://github.com/gokcehan/lf/archive/nightly.tar.gz + sha256sums = ec0548d2169ef7748d8e9922c814adc4d445eb4886f6e8a51e90f5fff5ed7d90 + +pkgname = lf + diff --git a/PKGBUILD b/PKGBUILD new file mode 100644 index 000000000000..289d7723a804 --- /dev/null +++ b/PKGBUILD @@ -0,0 +1,34 @@ +# Maintainer: Dany Marcoux <danymarcoux+archlinux@gmail.com> + +pkgname=lf +pkgver=nightly +pkgrel=1 +pkgdesc='lf: A terminal file manager, heavily inspired by ranger' +arch=('i686' 'x86_64') +url='https://github.com/gokcehan/lf' +license=('MIT') # https://github.com/gokcehan/lf/blob/master/LICENSE +makedepends=('go') +options=('!strip' '!emptydirs') +provides=('lf') +source=("https://github.com/gokcehan/lf/archive/$pkgver.tar.gz") +sha256sums=('ec0548d2169ef7748d8e9922c814adc4d445eb4886f6e8a51e90f5fff5ed7d90') + +prepare() { + # Get lf's Go dependencies + mkdir -p go + export GOPATH="$srcdir/go" + go get github.com/nsf/termbox-go +} + +build() { + # Build lf's binary + export GOPATH="$srcdir/go" + cd "lf-$pkgver" + go build +} + +package() { + cd "lf-$pkgver" + install -Dm755 "lf-$pkgver" "$pkgdir/usr/bin/lf" + install -Dm644 LICENSE "$pkgdir/usr/share/licenses/lf/LICENSE" +} diff --git a/README.md b/README.md new file mode 100644 index 000000000000..ccf8e5064584 --- /dev/null +++ b/README.md @@ -0,0 +1,77 @@ +``` +@dmarcoux/lf + +AUR package for gokcehan/lf: A terminal file manager, heavily inspired by +ranger. +``` + +# Introduction + +This repository is an +[AUR](https://wiki.archlinux.org/index.php/Arch_User_Repository) package for +[gokcehan/lf](https://github.com/gokcehan/lf). For any information regarding +`lf` itself, please refer to its [repository](https://github.com/gokcehan/lf). +This AUR package is following GitHub releases of `lf`. It doesn't follow every +commit on the `master` branch. + +# Package Installation + +Using your favorite [AUR +helper](https://wiki.archlinux.org/index.php/AUR_helpers), install the [lf AUR +package](https://aur.archlinux.org/packages/lf/) like this: + +```bash +$ aura -A lf +``` + +# Package Maintenance + +This section is mostly notes on how this package is maintained. + +### Write Access to the AUR + +Have a look on the +[wiki](https://wiki.archlinux.org/index.php/Arch_User_Repository#Authentication) +if you don't already have write access to the AUR. + +### Git Mirror + +The `github.com/dmarcoux/lf` repository is a mirror of the +`aur.archlinux.org/lf` repository. Set it up by running the following commands: + +```bash +$ git clone git+ssh://aur@aur.archlinux.org/lf.git +$ git remote set-url origin --add git@github.com:dmarcoux/lf.git +``` + +### Generate the .SRCINFO file + +The tool `mksrcinfo` provided by the [AUR package +`pkgbuild-introspection-git`](https://aur.archlinux.org/packages/pkgbuild-introspection-git) +is really useful to generate the `.SRCINFO` file. Simply run the command in the +repository's root directory to use it: + +```bash +$ mksrcinfo +``` + +### Generate the sha256sums in the PKGBUILD file + +The script `updpkgsums` (which comes with `pacman`'s version 4.1 or greater) is +a simple way to generate the sha256sums in the `PKGBUILD` file. It is as simple +as running the script in the repository's root directory: + +```bash +$ updpkgsums +``` + +### Automation + +For the steps `Generate the .SRCINFO file` and `Generate the sha256sums in the +PKGBUILD file`, I prefer to use a git pre-commit hook +([pre-commit.sh](pre-commit.sh)) to do this automatically. Set it up by running +the following command in the repository's root directory: + +```bash +$ ln -s ../../pre-commit.sh .git/hooks/pre-commit +``` diff --git a/pre-commit.sh b/pre-commit.sh new file mode 100755 index 000000000000..2663b34cdba0 --- /dev/null +++ b/pre-commit.sh @@ -0,0 +1,27 @@ +#!/bin/bash +# git pre-commit hook: +# - Generate the sha256sums in the PKGBUILD file and add it to the commit if needed +# - Generate the .SRCINFO file and add it to the commit if needed + +# Generate the sha256sums in the PKGBUILD file +updpkgsums + +# Remove the archive downloaded by updpkgsums +rm *.tar.gz + +# Check if the sha256sums in the PKGBUILD file changed +if [ -n "$(git diff PKGBUILD | grep '^+sha256sums=(.*)$')" ]; then + printf "Updated the sha256sums in the PKGBUILD file\n" + git add PKGBUILD + printf "Added the PKGBUILD file to the commit\n" +fi + +# Generate the .SRCINFO file based on the PKGBUILD file +mksrcinfo + +# Check if the .SRCINFO file was created/changed +if [ -n "$(git status --short | grep ' .SRCINFO$')" ]; then + printf "Updated the .SRCINFO file\n" + git add .SRCINFO + printf "Added the .SRCINFO file to the commit\n" +fi |