Skip to content

Instantly share code, notes, and snippets.

@four0four
Last active November 16, 2015 06:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save four0four/bc3c2c9df8524f375d77 to your computer and use it in GitHub Desktop.
Save four0four/bc3c2c9df8524f375d77 to your computer and use it in GitHub Desktop.
ec2drv PKGBUILD
post_upgrade() {
getent group "silabs" &>/dev/null || groupadd -r silabs
}
post_remove() {
getent group "silabs" &>/dev/null && groupdel silabs 1>/dev/null
}
post_install() {
post_upgrade
echo "Don't forget to add yourself (and any other users) to the silabs group for non-root access"
}
# Maintainer: Galen Schretlen <galen@shellspace.net>
pkgname=ec2drv-git
pkgdesc="ec2drv provides Linux support for the Silicon Laboritories EC2 serial debug adaptor."
_sourcename="ec2"
pkgrel=1
pkgver=86ffac6
arch=('i686' 'x86_64')
url="https://github.com/four0four/ec2"
license=('GPL')
depends=('python2' 'boost-libs' 'readline' 'libusb')
makedepends=('boost' 'cmake')
provides=('ec2drv')
install='ec2drv-git.install'
source=('git://github.com/four0four/ec2.git')
sha256sums=('SKIP')
pkgver() {
cd "$srcdir/$_sourcename"
git rev-parse --short HEAD | sed -r 's/([^-]*-g)/r\1/;s/-/./g'
}
build() {
cd "$srcdir/$_sourcename"
mkdir build
cd "$srcdir/$_sourcename/build"
cmake -DCMAKE_INSTALL_PREFIX:PATH=/usr ../src
make
}
package() {
cd "$srcdir/$_sourcename/build"
make DESTDIR="$pkgdir/" install
install -D -m644 "$srcdir/$_sourcename/doc/60-silabs.rules" "${pkgdir}/etc/udev/rules.d/60-silabs.rules"
install -D -m644 "$srcdir/$_sourcename/doc/silabs.conf" "${pkgdir}/etc/modprobe.d/silabs.conf"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment