diff options
author | Modelmat | 2019-10-26 12:42:08 +1100 |
---|---|---|
committer | Modelmat | 2019-10-26 12:42:08 +1100 |
commit | 327fa01d753df66499df7c12176cf28727f3e6ab (patch) | |
tree | d24cd90c773891d615099825adb29da151865c1a | |
download | aur-327fa01d753df66499df7c12176cf28727f3e6ab.tar.gz |
Adds package
-rw-r--r-- | .SRCINFO | 21 | ||||
-rw-r--r-- | .gitignore | 3 | ||||
-rw-r--r-- | PKGBUILD | 78 | ||||
-rw-r--r-- | psiphon.conf | 10 | ||||
-rw-r--r-- | psiphon.service | 11 |
5 files changed, 123 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO new file mode 100644 index 000000000000..b7134b57507e --- /dev/null +++ b/.SRCINFO @@ -0,0 +1,21 @@ +pkgbase = psiphon-tunnel-core-git + pkgdesc = Psiphon Tunnelling Proxy + pkgver = 2.0.9.r2900.d7d491e4 + pkgrel = 1 + url = https://github.com/Psiphon-Labs/psiphon-tunnel-core + arch = x86_64 + license = GPL + makedepends = go-pie + makedepends = perl + depends = glibc + backup = etc/psiphon.conf + backup = usr/lib/systemd/user/psiphon.service + source = git+https://github.com/Psiphon-Labs/psiphon-tunnel-core.git + source = psiphon.conf + source = psiphon.service + md5sums = SKIP + md5sums = c99b40eb39a44e492793d5decd692bc6 + md5sums = a6d6b01633a39325abbdb3597c50a4cc + +pkgname = psiphon-tunnel-core-git + diff --git a/.gitignore b/.gitignore new file mode 100644 index 000000000000..661469e45519 --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +src +pkg +*.tar diff --git a/PKGBUILD b/PKGBUILD new file mode 100644 index 000000000000..f7eb17ba01d0 --- /dev/null +++ b/PKGBUILD @@ -0,0 +1,78 @@ +# Maintainer: Modelmat <modelmat@outlook.com.au> + +# Usage: +# This package provides a configuration file in /etc/psiphon.conf +# as well as systemd user service, `psiphon.service`. The service +# will crash (probably a bug) as the `DataStoreDirectory` option +# is empty. +# +# However, if it is not set it will store temporary files in the +# current working directory, which will fail for a user-service +# (does not have write permissions for its directory). Hence, it +# it advised that you set it to a writeable directory. +# +# If it is necessary to have per-user configuration files, it is +# advised to create them in `~/.config/systemd/user/` to override +# the system-wide user service. +# +# This application also installs `/usr/bin/psiphon-tunnel-core`. + +_pkgname=psiphon-tunnel-core +pkgname="$_pkgname-git" +pkgver=2.0.9.r2900.d7d491e4 +pkgrel=1 +pkgdesc='Psiphon Tunnelling Proxy' +arch=('x86_64') +url="https://github.com/Psiphon-Labs/psiphon-tunnel-core" +license=('GPL') +makedepends=('go-pie' 'perl') +depends=('glibc') +source=("git+$url.git" + "psiphon.conf" + "psiphon.service") +backup=('etc/psiphon.conf' 'usr/lib/systemd/user/psiphon.service') +md5sums=('SKIP' + 'c99b40eb39a44e492793d5decd692bc6' + 'a6d6b01633a39325abbdb3597c50a4cc') + +pkgver() { + cd $_pkgname + TAG=$(git describe --tags $(git rev-list --tags --max-count=1) | sed 's/^v//') + COMMIT=$(git rev-parse --short HEAD) + REVISION=$(git rev-list --count HEAD) + printf "%s.r%s.%s" "$TAG" "$REVISION" "$COMMIT" +} + +build() { + cd "$_pkgname/ConsoleClient" + + # 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 \ +" + + # TODO: Figure out how to do the stripping? + # https://wiki.archlinux.org/index.php/Go_package_guidelines#Flags_and_build_options + + go build \ + -trimpath \ + -ldflags "$LDFLAGS" \ + -o $_pkgname . +} + +package() { + cd "$_pkgname/ConsoleClient" + install -Dm755 $_pkgname "$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" +} diff --git a/psiphon.conf b/psiphon.conf new file mode 100644 index 000000000000..8cb9cd226c4b --- /dev/null +++ b/psiphon.conf @@ -0,0 +1,10 @@ +{ + "___comment": "More options: https://github.com/Psiphon-Labs/psiphon-tunnel-core/blob/master/psiphon/config.go", + "___comment": "DataStoreDirectory must exist (otherwise this crashes). If the key is missing, it uses the current directory.", + "DataStoreDirectory": "", + "LocalHttpProxyPort": 8080, + "LocalSocksProxyPort": 1080, + "PropagationChannelId": "FFFFFFFFFFFFFFFF", + "SponsorId": "FFFFFFFFFFFFFFFF", + "UpstreamProxyURL": "" +} diff --git a/psiphon.service b/psiphon.service new file mode 100644 index 000000000000..15ce0c6fdc39 --- /dev/null +++ b/psiphon.service @@ -0,0 +1,11 @@ +[Unit] +Description=Psiphon Tunnelling Proxy +After=network-online.target +Wants=network-online.target + +[Service] +ExecStart=/usr/bin/psiphon-tunnel-core --config /etc/psiphon.conf -formatNotices +ExecStop= /usr/bin/killall psiphon-tunnel- + +[Install] +WantedBy=multi-user.target |