summarylogtreecommitdiffstats
path: root/PKGBUILD
diff options
context:
space:
mode:
authorArtem Vorotnikov2015-09-25 16:36:32 +0300
committerArtem Vorotnikov2015-09-25 16:36:32 +0300
commit1e4f7ae335ca96581717dd01e0f3bc5e1a8bef08 (patch)
tree4dbd94aa5ccbe3d063696e6d8638702439eaf86d /PKGBUILD
downloadaur-1e4f7ae335ca96581717dd01e0f3bc5e1a8bef08.tar.gz
Initial import
Diffstat (limited to 'PKGBUILD')
-rw-r--r--PKGBUILD35
1 files changed, 35 insertions, 0 deletions
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 000000000000..527823e3b487
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,35 @@
+_pkgname=gopacket
+pkgname=gopacket-git
+pkgver=20150922.702_63a65fa
+pkgrel=1
+pkgdesc="Provides packet processing capabilities for Go"
+arch=('i686' 'x86_64')
+license=('GPL')
+makedepends=('go' 'git')
+_gourl=("github.com/google/gopacket")
+GOPATH="/usr/lib/go"
+
+pkgver() {
+ cd "$srcdir/$_pkgname"
+ local date=$(git log -1 --format="%cd" --date=short | sed s/-//g)
+ local count=$(git rev-list --count HEAD)
+ local commit=$(git rev-parse --short HEAD)
+ echo "$date.${count}_$commit"
+}
+
+build() {
+ GOPATH="$srcdir" go get -fix -v -x ${_gourl}
+}
+
+package() {
+ mkdir -p "$pkgdir/$GOPATH"
+ cp -Rv --preserve=timestamps "$srcdir/"{src,pkg} "$pkgdir/$GOPATH"
+
+ # Package license (if available)
+ for f in LICENSE COPYING LICENSE.* COPYING.*; do
+ if [ -e "$srcdir/src/$_gourl/$f" ]; then
+ install -Dm644 "$srcdir/src/$_gourl/$f" \
+ "$pkgdir/usr/share/licenses/$_pkgname/$f"
+ fi
+ done
+}