diff options
author | nekgem | 2020-05-06 04:40:44 +0300 |
---|---|---|
committer | nekgem | 2020-05-06 04:44:14 +0300 |
commit | 78c959f278e8a20a5ca42a3c8e2f1dc2fad914d6 (patch) | |
tree | 8b3ec28c4d045c7b4cfbc1dbfedb07f88e9bba76 | |
download | aur-78c959f278e8a20a5ca42a3c8e2f1dc2fad914d6.tar.gz |
initial commit
-rw-r--r-- | .SRCINFO | 29 | ||||
-rw-r--r-- | PKGBUILD | 66 | ||||
-rw-r--r-- | lokinet-bootstrap.service | 11 | ||||
-rw-r--r-- | lokinet-default-config.service | 12 | ||||
-rw-r--r-- | lokinet.install | 14 | ||||
-rw-r--r-- | lokinet.service | 23 | ||||
-rw-r--r-- | lokinet.sysusers | 1 | ||||
-rw-r--r-- | lokinet.tmpfiles | 1 |
8 files changed, 157 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO new file mode 100644 index 000000000000..866f5839d542 --- /dev/null +++ b/.SRCINFO @@ -0,0 +1,29 @@ +pkgbase = lokinet + pkgdesc = Anonymous, decentralized and IP based overlay network for the internet. + pkgver = 0.7.1 + pkgrel = 1 + url = https://lokinet.org + install = lokinet.install + arch = x86_64 + arch = aarch64 + license = ZLIB + makedepends = git + makedepends = cmake + depends = libuv + depends = libsodium + depends = curl + source = git+https://github.com/loki-project/loki-network.git#tag=v0.7.1 + source = lokinet.service + source = lokinet-bootstrap.service + source = lokinet-default-config.service + source = lokinet.sysusers + source = lokinet.tmpfiles + sha256sums = SKIP + sha256sums = 15518029aa39bbd15b18611037177175d0c66ac9d3c0f7f2d1e3eda289d31eba + sha256sums = 21c9bc83f8466ab17fa927561d7f24f930f97c996a8aa0fbbbbb2b65cb97b342 + sha256sums = 6ef779170b72856bbb8df40c34a808acffddd156684bdb66a55e71d50cf95841 + sha256sums = 137cf7eeebc8737d62f3ccfad2398fb1c442a91cb9db7d650429b218dd949a00 + sha256sums = 53837c9cfc90b93d55558045108a5d1d7a8b8a75a266af264d7f9101363d043f + +pkgname = lokinet + diff --git a/PKGBUILD b/PKGBUILD new file mode 100644 index 000000000000..29d742ae9999 --- /dev/null +++ b/PKGBUILD @@ -0,0 +1,66 @@ +# Maintainer: nekgem <nekgem@cock.li> +pkgname=lokinet +_gitname=loki-network +pkgver=0.7.1 +pkgrel=1 +pkgdesc="Anonymous, decentralized and IP based overlay network for the internet." +arch=('x86_64' 'aarch64') +url="https://lokinet.org" +license=('ZLIB') +depends=('libuv' 'libsodium' 'curl') +makedepends=('git' 'cmake') +install='lokinet.install' +source=("git+https://github.com/loki-project/$_gitname.git#tag=v$pkgver" # github archives don't embed submodules + 'lokinet.service' + 'lokinet-bootstrap.service' + 'lokinet-default-config.service' + 'lokinet.sysusers' + 'lokinet.tmpfiles') +sha256sums=('SKIP' + '15518029aa39bbd15b18611037177175d0c66ac9d3c0f7f2d1e3eda289d31eba' + '21c9bc83f8466ab17fa927561d7f24f930f97c996a8aa0fbbbbb2b65cb97b342' + '6ef779170b72856bbb8df40c34a808acffddd156684bdb66a55e71d50cf95841' + '137cf7eeebc8737d62f3ccfad2398fb1c442a91cb9db7d650429b218dd949a00' + '53837c9cfc90b93d55558045108a5d1d7a8b8a75a266af264d7f9101363d043f') + +prepare() { + # XXX maybe should include submodules as part of sources? + # XXX --remote ? + git -C "$_gitname" submodule update --init --recursive +} + +build() { + cd "$_gitname" + + rm -rf build && mkdir build && cd build + # XXX cmake stuff overrides CFLAGS + cmake \ + -DCMAKE_BUILD_TYPE=Release \ + -DCMAKE_INSTALL_PREFIX=/usr \ + -DCMAKE_C_FLAGS="$CFLAGS" \ + -DCMAKE_CXX_FLAGS="$CXXFLAGS" \ + -DNATIVE_BUILD=OFF \ + -DSTATIC_LINK_RUNTIME=OFF \ + -DUSE_NETNS=OFF \ + -DUSE_AVX2=OFF \ + -DXSAN=OFF \ + -DWITH_SHARED=OFF \ + -DWITH_TESTS=OFF \ + -DDOWNLOAD_SODIUM=OFF \ + -Wno-dev \ + .. + make +} + +package() { + cd "$_gitname" + install -Dm644 LICENSE.txt "$pkgdir/usr/share/licenses/$pkgname/LICENSE" + cd build + make DESTDIR="$pkgdir" install + + install -D -m 644 "$srcdir/lokinet.service" "$pkgdir/usr/lib/systemd/system/lokinet.service" + install -D -m 644 "$srcdir/lokinet-bootstrap.service" "$pkgdir/usr/lib/systemd/system/lokinet-bootstrap.service" + install -D -m 644 "$srcdir/lokinet-default-config.service" "$pkgdir/usr/lib/systemd/system/lokinet-default-config.service" + install -D -m 644 "$srcdir/lokinet.sysusers" "$pkgdir/usr/lib/sysusers.d/lokinet.conf" + install -D -m 644 "$srcdir/lokinet.tmpfiles" "$pkgdir/usr/lib/tmpfiles.d/lokinet.conf" +} diff --git a/lokinet-bootstrap.service b/lokinet-bootstrap.service new file mode 100644 index 000000000000..bfaa21059708 --- /dev/null +++ b/lokinet-bootstrap.service @@ -0,0 +1,11 @@ +[Unit] +Description=Lokinet bootstrap +ConditionFileNotEmpty=!/var/lib/lokinet/bootstrap.signed +Wants=network-online.target +After=network-online.target + +[Service] +Type=oneshot +User=lokinet +WorkingDirectory=/var/lib/lokinet +ExecStart=/usr/bin/lokinet-bootstrap lokinet bootstrap.signed diff --git a/lokinet-default-config.service b/lokinet-default-config.service new file mode 100644 index 000000000000..aa2523263b09 --- /dev/null +++ b/lokinet-default-config.service @@ -0,0 +1,12 @@ +[Unit] +Description=Lokinet default config generator +ConditionPathExists=!/var/lib/lokinet/lokinet.ini +Wants=local-fs.target +After=local-fs.target + +[Service] +Type=oneshot +User=lokinet +WorkingDirectory=/var/lib/lokinet +# at the time of writing it generates wrong paths when invoked without explicit path +ExecStart=/usr/bin/lokinet -g ./lokinet.ini diff --git a/lokinet.install b/lokinet.install new file mode 100644 index 000000000000..7feaaa338b4a --- /dev/null +++ b/lokinet.install @@ -0,0 +1,14 @@ + +post_install() { + cat <<-EOF + systemd-resolved is known to cause issues with lokinet so it's recommended to disable it: + systemctl disable --now systemd-resolved + To generate default config (optional, will be invoked by lokinet service if needed): + systemctl start lokinet-default-config + To adjust upstream DNS servers and other options, edit /var/lib/lokinet/lokinet.ini + To start lokinet: + systemctl start lokinet + To get .loki domains resolve, replace /etc/resolv.conf contents with: + nameserver 127.3.2.1 + EOF +} diff --git a/lokinet.service b/lokinet.service new file mode 100644 index 000000000000..fa68d88467a0 --- /dev/null +++ b/lokinet.service @@ -0,0 +1,23 @@ +[Unit] +Description=LokiNET: Anonymous Network layer thingydoo +Wants=network-online.target +After=network-online.target +Wants=lokinet-bootstrap.service +After=lokinet-bootstrap.service +Wants=lokinet-default-config.service +After=lokinet-default-config.service + +[Service] +Type=simple +User=lokinet +SyslogIdentifier=lokinet +WorkingDirectory=/var/lib/lokinet +CapabilityBoundingSet=CAP_NET_ADMIN CAP_NET_BIND_SERVICE +AmbientCapabilities=CAP_NET_ADMIN CAP_NET_BIND_SERVICE +ExecStart=/usr/bin/lokinet /var/lib/lokinet/lokinet.ini +Environment=LOKINET_NETID=lokinet +Restart=always +RestartSec=5s + +[Install] +WantedBy=multi-user.target diff --git a/lokinet.sysusers b/lokinet.sysusers new file mode 100644 index 000000000000..4ba9d09706af --- /dev/null +++ b/lokinet.sysusers @@ -0,0 +1 @@ +u lokinet - "Lokinet daemon user" /var/lib/lokinet diff --git a/lokinet.tmpfiles b/lokinet.tmpfiles new file mode 100644 index 000000000000..2afd4a4bc7a8 --- /dev/null +++ b/lokinet.tmpfiles @@ -0,0 +1 @@ +d /var/lib/lokinet 0700 lokinet lokinet - - |