Skip to content

Instantly share code, notes, and snippets.

@antoinealb
Created April 14, 2014 18:51
Show Gist options
  • Save antoinealb/10673855 to your computer and use it in GitHub Desktop.
Save antoinealb/10673855 to your computer and use it in GitHub Desktop.
An arch linux pkbuild for LM4F tool.
# This is an example PKGBUILD file. Use this as a start to creating your own,
# and remove these comments. For more information, see 'man PKGBUILD'.
# NOTE: Please fill out the license field for your package! If it is unknown,
# then please put 'unknown'.
# See http://wiki.archlinux.org/index.php/VCS_PKGBUILD_Guidelines
# for more information on packaging from GIT sources.
# Maintainer: Your Name <youremail@domain.com>
pkgname=lm4f-git
pkgver=r74.1cfd813
pkgrel=1
pkgdesc=""
arch=('i386', 'x86_64')
url=""
license=('GPL')
groups=()
depends=()
makedepends=('git')
provides=()
conflicts=()
replaces=()
backup=()
options=()
install=
source=()
noextract=()
md5sums=() #generate with 'makepkg -g'
_gitroot=https://github.com/utzig/lm4tools
_gitname=lm4f
pkgver() {
cd "$srcdir/$_gitname"
printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
}
build() {
cd "$srcdir"
msg "Connecting to GIT server...."
if [[ -d "$_gitname" ]]; then
cd "$_gitname" && git pull origin
msg "The local files are updated."
else
git clone "$_gitroot" "$_gitname"
fi
msg "GIT checkout done or server timeout"
msg "Starting build..."
rm -rf "$srcdir/$_gitname-build"
git clone "$srcdir/$_gitname" "$srcdir/$_gitname-build"
cd "$srcdir/$_gitname-build"
# Build
cd "lm4flash"
make
}
package() {
cd "$srcdir/$_gitname-build/lm4flash"
install -D -m755 lm4flash $pkgdir/usr/bin/lm4flash
}
# vim:set ts=2 sw=2 et:
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment