diff options
author | Dany Marcoux | 2016-11-22 21:41:59 +0100 |
---|---|---|
committer | Dany Marcoux | 2016-11-22 21:57:07 +0100 |
commit | 66da950a67d578ee433140ff6df3af63a37a9a59 (patch) | |
tree | a6f04b830c02ab928d696aa51b8b504eef31387d | |
parent | e1c02d998a78ff4cb0b21927896fbe739f35178a (diff) | |
download | aur-66da950a67d578ee433140ff6df3af63a37a9a59.tar.gz |
Use precompiled binary from official repository
-rw-r--r-- | .SRCINFO | 11 | ||||
-rw-r--r-- | PKGBUILD | 29 | ||||
-rw-r--r-- | README.md | 46 | ||||
-rwxr-xr-x | pre-commit.sh | 24 |
4 files changed, 64 insertions, 46 deletions
@@ -1,17 +1,18 @@ pkgbase = lf - pkgdesc = lf: A terminal file manager, heavily inspired by ranger + pkgdesc = lf: A terminal file manager, heavily inspired by ranger (Precompiled binary from official repository) pkgver = nightly - pkgrel = 1 + pkgrel = 2 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 + source_i686 = https://github.com/gokcehan/lf/releases/download/nightly/lf-linux-386.tar.gz + md5sums_i686 = ec80368879f1b5f7ff015dc059833473 + source_x86_64 = https://github.com/gokcehan/lf/releases/download/nightly/lf-linux-amd64.tar.gz + md5sums_x86_64 = 323ef3957df4a31bb6dc15ad0f56bf49 pkgname = lf @@ -2,33 +2,18 @@ pkgname=lf pkgver=nightly -pkgrel=1 -pkgdesc='lf: A terminal file manager, heavily inspired by ranger' +pkgrel=2 +pkgdesc='lf: A terminal file manager, heavily inspired by ranger (Precompiled binary from official repository)' 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 -} +source_i686=("https://github.com/gokcehan/lf/releases/download/$pkgver/lf-linux-386.tar.gz") +source_x86_64=("https://github.com/gokcehan/lf/releases/download/$pkgver/lf-linux-amd64.tar.gz") +md5sums_i686=('ec80368879f1b5f7ff015dc059833473') +md5sums_x86_64=('323ef3957df4a31bb6dc15ad0f56bf49') package() { - cd "lf-$pkgver" - install -Dm755 "lf-$pkgver" "$pkgdir/usr/bin/lf" - install -Dm644 LICENSE "$pkgdir/usr/share/licenses/lf/LICENSE" + install -Dm755 "lf" "$pkgdir/usr/bin/lf" } diff --git a/README.md b/README.md index ccf8e5064584..0b7454269e9a 100644 --- a/README.md +++ b/README.md @@ -17,8 +17,8 @@ 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: +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 @@ -28,23 +28,33 @@ $ aura -A lf This section is mostly notes on how this package is maintained. -### Write Access to the AUR +## Initial Setup + +Whenever setting up the environment to maintain this package, these manual steps +must be done once. + +### 1. 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 +### 2. 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: +`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 +## Routine Update + +Whenever updating this package, these steps must always be done. + +### 1. Generate the .SRCINFO file The tool `mksrcinfo` provided by the [AUR package `pkgbuild-introspection-git`](https://aur.archlinux.org/packages/pkgbuild-introspection-git) @@ -55,22 +65,32 @@ repository's root directory to use it: $ mksrcinfo ``` -### Generate the sha256sums in the PKGBUILD file +### 2. Generate the checksums 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 +a simple way to generate the checksums in the `PKGBUILD` file. It is as simple as running the script in the repository's root directory: ```bash $ updpkgsums ``` -### Automation +### 3. Validate the PKGBUILD file + +The script `makepkg` (which comes with `pacman`) is the usual way to validate a +`PKGBUILD` file. With a valid `PKGBUILD` file, it will create a package; with a +nonvalid `PKGBUILD` file, it will raise an error. Simply run the command in the +repository's root directory to use it: + +```bash +$ makepkg +``` + +## 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: +All steps in the `Routine Update` section can be automated. To do so, I use a +git pre-commit hook ([pre-commit.sh](pre-commit.sh)). 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 index 2663b34cdba0..56706677ce22 100755 --- a/pre-commit.sh +++ b/pre-commit.sh @@ -1,17 +1,18 @@ -#!/bin/bash +#!/usr/bin/env bash # git pre-commit hook: -# - Generate the sha256sums in the PKGBUILD file and add it to the commit if needed +# - Generate the checksums in the PKGBUILD file and add it to the commit if needed # - Generate the .SRCINFO file and add it to the commit if needed +# - Validate the PKGBUILD file -# Generate the sha256sums in the PKGBUILD file +# Generate the checksums 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" +# Check if the checksums in the PKGBUILD file changed +if [ -n "$(git diff PKGBUILD | grep '^+md5sums')" ]; then + printf "Updated the checksums in the PKGBUILD file\n" git add PKGBUILD printf "Added the PKGBUILD file to the commit\n" fi @@ -25,3 +26,14 @@ if [ -n "$(git status --short | grep ' .SRCINFO$')" ]; then git add .SRCINFO printf "Added the .SRCINFO file to the commit\n" fi + +# Validate the PKGBUILD file by "making" it +makepkg + +# Check if the package was successfully built +if [ $? -eq 0 ]; then + printf "The package was successfully built\n" +fi + +# Remove directories and files created/downloaded by makepkg +rm --force --recursive pkg src *.pkg.tar.xz *.tar.gz |