summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorgilcu32021-02-18 23:55:58 +0100
committergilcu32021-02-18 23:55:58 +0100
commit474068bfd7df4751399597731f715ca2a9566288 (patch)
treeeb3c30ed29e2ce68ba2c2557c168ff7a17589c34
parentc3756707686c10ea6368d72aa0af6407947335f8 (diff)
downloadaur-474068bfd7df4751399597731f715ca2a9566288.tar.gz
now using the docker build system
-rw-r--r--.SRCINFO3
-rw-r--r--PKGBUILD55
2 files changed, 27 insertions, 31 deletions
diff --git a/.SRCINFO b/.SRCINFO
index 9da0b8e0efc5..26adcf8bbdce 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,12 +1,13 @@
pkgbase = psiphon-tunnel-core-git
pkgdesc = Psiphon Tunnelling Proxy
- pkgver = 2.0.10.r3020.a9bed696
+ pkgver = 2.0.14.r3347.8a2f672e
pkgrel = 1
url = https://github.com/Psiphon-Labs/psiphon-tunnel-core
arch = x86_64
license = GPL
makedepends = go-pie
makedepends = perl
+ makedepends = docker
depends = glibc
backup = etc/psiphon.conf
backup = usr/lib/systemd/user/psiphon.service
diff --git a/PKGBUILD b/PKGBUILD
index d790e9544e7e..416b710bde0f 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -19,13 +19,13 @@
_pkgname=psiphon-tunnel-core
pkgname="$_pkgname-git"
-pkgver=2.0.10.r3020.a9bed696
+pkgver=2.0.14.r3347.8a2f672e
pkgrel=1
pkgdesc='Psiphon Tunnelling Proxy'
arch=('x86_64')
url="https://github.com/Psiphon-Labs/psiphon-tunnel-core"
license=('GPL')
-makedepends=('go-pie' 'perl')
+makedepends=('go-pie' 'perl' 'docker')
depends=('glibc')
source=("git+$url.git"
"psiphon.conf"
@@ -43,40 +43,35 @@ pkgver() {
printf "%s.r%s.%s" "$TAG" "$REVISION" "$COMMIT"
}
-build() {
- cd "$_pkgname/ConsoleClient"
+prepare(){
+ if ! groups ${USER} | grep &>/dev/null '\bdocker\b'; then
+ >&2 echo "The user ${USER} does not belong to the docker group. Please add it."
+ exit 1
+ fi
- # This errors but seems to fix building
- go get || true
-
- # Copied from the README file
- BUILDDATE=$(date --iso-8601=seconds)
- BUILDREPO=$(git config --get remote.origin.url)
- BUILDREV=$(git rev-parse --short HEAD)
- GOVERSION=$(go version | perl -ne '/go version (.*?) / && print $1')
- DEPENDENCIES=$(echo -n "{" && go list -f '{{range $dep := .Deps}}{{printf "%s\n" $dep}}{{end}}' | xargs go list -f '{{if not .Standard}}{{.ImportPath}}{{end}}' | xargs -I pkg bash -c 'cd $GOPATH/src/pkg && echo -n "\"pkg\":\"$(git rev-parse --short HEAD)\","' | sed 's/,$/}/')
-
- LDFLAGS="\
--X github.com/Psiphon-Labs/psiphon-tunnel-core/psiphon/common/buildinfo.buildDate=$BUILDDATE \
--X github.com/Psiphon-Labs/psiphon-tunnel-core/psiphon/common/buildinfo.buildRepo=$BUILDREPO \
--X github.com/Psiphon-Labs/psiphon-tunnel-core/psiphon/common/buildinfo.buildRev=$BUILDREV \
--X github.com/Psiphon-Labs/psiphon-tunnel-core/psiphon/common/buildinfo.goVersion=$GOVERSION \
--X github.com/Psiphon-Labs/psiphon-tunnel-core/psiphon/common/buildinfo.dependencies=$DEPENDENCIES \
--s -w
-"
+ if ! systemctl is-active docker | grep &>/dev/null '\bactive\b'; then
+ >&2 echo "Docker service is not started. Please start it."
+ exit 1
+ fi
+}
- # TODO: Figure out how to do the stripping?
- # https://wiki.archlinux.org/index.php/Go_package_guidelines#Flags_and_build_options
+build() {
+ cd "$_pkgname/ConsoleClient"
- go build \
- -trimpath \
- -ldflags "$LDFLAGS" \
- -o $_pkgname .
+ docker build --no-cache=true -t psiclient .
+ docker images
+ cd .. && \
+ docker run \
+ --rm \
+ -v $PWD:/go/src/github.com/Psiphon-Labs/psiphon-tunnel-core \
+ psiclient \
+ /bin/bash -c './make.bash linux' \
+ ; cd -
}
package() {
- cd "$_pkgname/ConsoleClient"
- install -Dm755 $_pkgname "$pkgdir"/usr/bin/$_pkgname
+ cd "$_pkgname/ConsoleClient/bin/linux/"
+ install -Dm755 ${_pkgname}-x86_64 "$pkgdir"/usr/bin/$_pkgname
install -Dm644 "$srcdir/psiphon.conf" "$pkgdir/etc/psiphon.conf"
install -Dm644 "$srcdir/psiphon.service" "$pkgdir/usr/lib/systemd/user/psiphon.service"
}