summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorTrevor Bergeron2018-07-02 18:44:36 -0400
committerTrevor Bergeron2018-07-02 18:44:36 -0400
commit584e15f0501719a81db15d323dd347b9ebf76164 (patch)
tree590b595ffadc46f2da3f081b3c7cdb20e01f1452
downloadaur-584e15f0501719a81db15d323dd347b9ebf76164.tar.gz
Initial Commit
-rw-r--r--.SRCINFO22
-rw-r--r--PKGBUILD78
-rw-r--r--cwtch-server.service15
-rw-r--r--cwtch.sysusers2
-rw-r--r--cwtch.tmpfiles1
5 files changed, 118 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 000000000000..72d0e47ed3db
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,22 @@
+pkgbase = cwtch-git
+ pkgdesc = Privacy Preserving Infrastructure for Asynchronous, Decentralized and Metadata Resistant Applications
+ pkgver = r143.e5bce02
+ pkgrel = 1
+ url = https://cwtch.im/
+ arch = x86_64
+ arch = i686
+ license = MIT
+ makedepends = go
+ makedepends = git
+ depends = tor
+ provides = cwtch
+ conflicts = cwtch
+ source = cwtch-server.service
+ source = cwtch.sysusers
+ source = cwtch.tmpfiles
+ sha256sums = b1c4ad9738f517317e1b5a373590469575dcc10044ece1ce551e483498d66caa
+ sha256sums = beab74c0441b6532c1f4b7365038f595372f7e7a3a4b3587d36a3cb9dc8605fb
+ sha256sums = 399bacb458e108df49dda328258ba0653506393cef465dd794efa3b371fba902
+
+pkgname = cwtch-git
+
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 000000000000..3e87901d7d59
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,78 @@
+# Maintainer: Trevor Bergeron <aur@sec.gd>
+
+_pkgname=cwtch
+_gourl=cwtch.im/$_pkgname
+pkgname=$_pkgname-git
+pkgver=r143.e5bce02
+pkgrel=1
+pkgdesc="Privacy Preserving Infrastructure for Asynchronous, Decentralized and Metadata Resistant Applications"
+arch=('x86_64' 'i686')
+url="https://cwtch.im/"
+license=('MIT')
+depends=('tor')
+makedepends=('go' 'git')
+provides=("$_pkgname")
+conflicts=("$_pkgname")
+#options=('!strip' '!emptydirs')
+source=("cwtch-server.service" "cwtch.sysusers" "cwtch.tmpfiles")
+sha256sums=('b1c4ad9738f517317e1b5a373590469575dcc10044ece1ce551e483498d66caa'
+ 'beab74c0441b6532c1f4b7365038f595372f7e7a3a4b3587d36a3cb9dc8605fb'
+ '399bacb458e108df49dda328258ba0653506393cef465dd794efa3b371fba902')
+
+prepare() {
+ export GOPATH="$srcdir/go"
+ mkdir -p "$GOPATH"
+
+ # "Fails" because no $project/main.go exists
+ # https://go-review.googlesource.com/c/vgo/+/120995
+ go get -u -v -d "$_gourl" || true
+
+ project="$GOPATH/src/$_gourl"
+ #mkdir -p "`dirname \"$project\"`"
+ #ln -sf "$srcdir/$_pkgname" "$project"
+
+ cd "$project/app/cli"
+ go fix
+ go get -u -v
+
+ cd "$project/server/app"
+ go fix
+ go get -u -v
+}
+
+pkgver() {
+ export GOPATH="$srcdir/go"
+ project="$GOPATH/src/$_gourl"
+ cd "$project"
+ ( set -o pipefail
+ git describe --long 2>/dev/null | sed 's/\([^-]*-g\)/r\1/;s/-/./g' ||
+ printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
+ )
+}
+
+build() {
+ export GOPATH="$srcdir/go"
+ project="$GOPATH/src/$_gourl"
+
+ cd "$project/app/cli"
+ go build -v
+
+ cd "$project/server/app"
+ go build -v
+}
+
+package() {
+ export GOPATH="$srcdir/go"
+ project="$GOPATH/src/$_gourl"
+
+ install -Dm0755 "$GOPATH/bin/cli" "$pkgdir/usr/bin/$_pkgname-cli"
+ install -Dm0755 "$GOPATH/bin/app" "$pkgdir/usr/bin/$_pkgname-server"
+ install -Dm0644 "$srcdir/$_pkgname-server.service" \
+ "$pkgdir/usr/lib/systemd/system/$_pkgname-server.service"
+ install -Dm0644 "$srcdir/$_pkgname.sysusers" "$pkgdir/usr/lib/sysusers.d/$_pkgname.conf"
+ # Create /var/lib/cwtch/ owned by cwtch user
+ install -Dm0644 "$srcdir/$_pkgname.tmpfiles" "$pkgdir/usr/lib/tmpfiles.d/$_pkgname.conf"
+ install -Dm0644 "$project/LICENSE" "$pkgdir/usr/share/licenses/$_pkgname/LICENSE"
+}
+
+# vim: set ts=4 sw=4 tw=79 et :
diff --git a/cwtch-server.service b/cwtch-server.service
new file mode 100644
index 000000000000..b949c3be1e73
--- /dev/null
+++ b/cwtch-server.service
@@ -0,0 +1,15 @@
+[Unit]
+Description=Cwtch Server
+Requires=tor.service
+After=tor.service
+
+[Service]
+Type=simple
+User=cwtch
+Group=cwtch
+Restart=always
+WorkingDirectory=/var/lib/cwtch/
+ExecStart=/usr/bin/cwtch-server
+
+[Install]
+WantedBy=multi-user.target
diff --git a/cwtch.sysusers b/cwtch.sysusers
new file mode 100644
index 000000000000..9c9f7e246863
--- /dev/null
+++ b/cwtch.sysusers
@@ -0,0 +1,2 @@
+u cwtch - - /var/lib/cwtch
+m cwtch tor
diff --git a/cwtch.tmpfiles b/cwtch.tmpfiles
new file mode 100644
index 000000000000..bfefdae6fc76
--- /dev/null
+++ b/cwtch.tmpfiles
@@ -0,0 +1 @@
+d /var/lib/cwtch 0700 cwtch cwtch - -