diff options
author | @RubenKelevra | 2020-06-13 08:06:06 +0200 |
---|---|---|
committer | @RubenKelevra | 2020-06-13 08:06:06 +0200 |
commit | 96e6253e6c7b1b87189bc0b275bb8171031fe5c7 (patch) | |
tree | 2feb805fed833c5cd80e6917311d7697a70b1d70 /PKGBUILD | |
parent | 7530fe20f1827d4df58c82f472788a9474276b76 (diff) | |
download | aur-96e6253e6c7b1b87189bc0b275bb8171031fe5c7.tar.gz |
move ipfs folder, move init process to install file, build without fuse support
Diffstat (limited to 'PKGBUILD')
-rw-r--r-- | PKGBUILD | 23 |
1 files changed, 17 insertions, 6 deletions
@@ -17,6 +17,7 @@ optdepends=('fuse2: for mounting/advanced use' 'bash-completion: bash completion support') provides=("$_pkgname") conflicts=("$_pkgname") +install="$pkgname.install" source=("git+${url}.git") b2sums=('SKIP') @@ -31,7 +32,6 @@ prepare() { go get -d -v ./... } - pkgver() { cd "$srcdir/$_pkgname" #VERSION=$(grep -E "^const CurrentVersionNumber = " version.go | awk '{ print $4 }' | sed 's/"//g') @@ -50,7 +50,7 @@ build() { export CGO_CFLAGS="${CFLAGS}" export CGO_CPPFLAGS="${CPPFLAGS}" export CGO_CXXFLAGS="${CXXFLAGS}" - make GOFLAGS="-buildmode=pie -trimpath -modcacherw" build + make GOFLAGS="-buildmode=pie -trimpath -modcacherw" nofuse } package() { @@ -58,16 +58,27 @@ package() { install -Dm 755 cmd/ipfs/ipfs "$pkgdir/usr/bin/ipfs" install -Dm 644 misc/systemd/ipfs-api.socket "$pkgdir/usr/lib/systemd/system/ipfs-api.socket" install -Dm 644 misc/systemd/ipfs-gateway.socket "$pkgdir/usr/lib/systemd/system/ipfs-gateway.socket" + # use the hardened service file install -Dm 644 misc/systemd/ipfs-hardened.service "$pkgdir/usr/lib/systemd/system/ipfs.service" - #avoid migrations on bootup (see #7269) and enable gc and pubsub by default (sane defaults) - sed -i 's/--migrate/--enable-gc --enable-pubsub-experiment --enable-namesys-pubsub/g' "$pkgdir/usr/lib/systemd/system/ipfs.service" - #increase timeouts (see #7283) + + ### Patch service file ### + + # set IPFS_PATH if not set by upstream already + sed -i '/StateDirectory=ipfs/,/ExecStart=\/usr\/bin\/ipfs daemon --init --migrate/c StateDirectory=ipfs\nEnvironment=IPFS_PATH=\~\nExecStart=\/usr\/bin\/ipfs daemon --init --migrate' "$pkgdir/usr/lib/systemd/system/ipfs.service" + # remove --init (handled by install file) and avoid migrations on bootup (see #7269) + sed -i 's/ExecStart=\/usr\/bin\/ipfs daemon --init --migrate/ExecStart=\/usr\/bin\/ipfs daemon/g' "$pkgdir/usr/lib/systemd/system/ipfs.service" + # enable gc and pubsub by default (sane defaults) + sed -i 's/ExecStart=\/usr\/bin\/ipfs daemon/ExecStart=\/usr\/bin\/ipfs daemon --enable-gc --enable-pubsub-experiment --enable-namesys-pubsub/g' "$pkgdir/usr/lib/systemd/system/ipfs.service" + # increase timeouts (see #7283) sed -i 's/MemorySwapMax=0/MemorySwapMax=0\n\nTimeoutStartSec=15min\nTimeoutStopSec=15min\nTimeoutAbortSec=15min/' "$pkgdir/usr/lib/systemd/system/ipfs.service" - # systemd-sysusers + + + install -Dm 644 "misc/systemd/ipfs-sysusers.conf" "${pkgdir}/usr/lib/sysusers.d/ipfs.conf" install -Dm 644 misc/completion/ipfs-completion.bash "$pkgdir/usr/share/bash-completion/completions/ipfs" install -Dm 644 -t "$pkgdir/usr/share/licenses/$pkgname/MIT" LICENSE-MIT install -Dm 644 -t "$pkgdir/usr/share/licenses/$pkgname/APACHE" LICENSE-APACHE install -Dm 644 -t "$pkgdir/usr/share/doc/$pkgname" README.md + # make sure the gopath is writeable chmod u+w -R "$GOPATH" } |