diff options
author | George Rawlinson | 2022-02-19 03:01:11 +0000 |
---|---|---|
committer | George Rawlinson | 2022-02-19 03:01:11 +0000 |
commit | 449080491c0874890efcd1b5e755b21d622bf988 (patch) | |
tree | 148382c65c2ed239fd8b4a5788f9c3b3cf25bc65 | |
download | aur-449080491c0874890efcd1b5e755b21d622bf988.tar.gz |
addpkg: shiori 1.5.1-1
-rw-r--r-- | .SRCINFO | 25 | ||||
-rw-r--r-- | PKGBUILD | 91 | ||||
-rw-r--r-- | systemd.service | 44 | ||||
-rw-r--r-- | sysusers.conf | 1 | ||||
-rw-r--r-- | tmpfiles.conf | 1 |
5 files changed, 162 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO new file mode 100644 index 000000000000..6bfdbc066aea --- /dev/null +++ b/.SRCINFO @@ -0,0 +1,25 @@ +pkgbase = shiori + pkgdesc = Simple bookmark manager + pkgver = 1.5.1 + pkgrel = 1 + url = https://github.com/go-shiori/shiori + arch = x86_64 + license = MIT + makedepends = git + makedepends = go + depends = glibc + options = !lto + source = shiori::git+https://github.com/go-shiori/shiori.git#commit=feb150f8c6681c87d9fa0ae7a0f82e349014925c + source = systemd.service + source = sysusers.conf + source = tmpfiles.conf + sha512sums = SKIP + sha512sums = 5afa2d8d02b414e106d6fcf41d3820b7c0b6c7fc86d12f5439c5d7330db874c0d58c905f646877b5d8b2bcc1ffc33c24756c8e3269c417f4b2abd185a5408de3 + sha512sums = 23f08378dcd3d40defd969e891a7759a8e59a103b6515d1748da66f1f8eef7a4eff5b02b0f5615a580aa5cde67fcbad98b5c610ed478ee32a4385ad7ee40766d + sha512sums = e0c5cae54966ac24c8227f09577ab0e62f9b0ae025b2667791b8ed773fdce36fe4188d0353ef03e365342126ae05b0faa9c31c0bd938fabe3358136eb5ed1281 + b2sums = SKIP + b2sums = 675e15e77d7328badaade040af67bbdcc8335de30c4ceef64e60aa761c80c38dc06c3e9cfaca51be6b353b8a2c872c242406ade487c738c50de44e94507ce87a + b2sums = 4a0fe59a05aa1275a3e42bf616ef4f9c0e2ca3639a516f6966ef1689ff20f6e84827ca43ab66e15f31c9628c452a274d5a888f45155100b851fdcecd5c327fe7 + b2sums = 1a119411823ab3f6a49ab66c9df7bcad747d594c95aa96918f3f416481ee791533e67ae9789232e7806bd4178d2af18f88c7cc5a1ac06daa3678c7a37adb175a + +pkgname = shiori diff --git a/PKGBUILD b/PKGBUILD new file mode 100644 index 000000000000..5babcbe4b0b9 --- /dev/null +++ b/PKGBUILD @@ -0,0 +1,91 @@ +# Maintainer: George Rawlinson <grawlinson@archlinux.org> + +pkgname=shiori +pkgver=1.5.1 +pkgrel=1 +pkgdesc="Simple bookmark manager" +arch=('x86_64') +url="https://github.com/go-shiori/shiori" +license=('MIT') +depends=('glibc') +makedepends=('git' 'go') +options=('!lto') +_commit='feb150f8c6681c87d9fa0ae7a0f82e349014925c' +source=( + "$pkgname::git+$url.git#commit=$_commit" + 'systemd.service' + 'sysusers.conf' + 'tmpfiles.conf' +) +sha512sums=('SKIP' + '5afa2d8d02b414e106d6fcf41d3820b7c0b6c7fc86d12f5439c5d7330db874c0d58c905f646877b5d8b2bcc1ffc33c24756c8e3269c417f4b2abd185a5408de3' + '23f08378dcd3d40defd969e891a7759a8e59a103b6515d1748da66f1f8eef7a4eff5b02b0f5615a580aa5cde67fcbad98b5c610ed478ee32a4385ad7ee40766d' + 'e0c5cae54966ac24c8227f09577ab0e62f9b0ae025b2667791b8ed773fdce36fe4188d0353ef03e365342126ae05b0faa9c31c0bd938fabe3358136eb5ed1281') +b2sums=('SKIP' + '675e15e77d7328badaade040af67bbdcc8335de30c4ceef64e60aa761c80c38dc06c3e9cfaca51be6b353b8a2c872c242406ade487c738c50de44e94507ce87a' + '4a0fe59a05aa1275a3e42bf616ef4f9c0e2ca3639a516f6966ef1689ff20f6e84827ca43ab66e15f31c9628c452a274d5a888f45155100b851fdcecd5c327fe7' + '1a119411823ab3f6a49ab66c9df7bcad747d594c95aa96918f3f416481ee791533e67ae9789232e7806bd4178d2af18f88c7cc5a1ac06daa3678c7a37adb175a') + +pkgver() { + cd "$pkgname" + + git describe --tags | sed 's/^v//' +} + +prepare() { + cd "$pkgname" + + # create directory for build output + mkdir build + + # download dependencies + go mod download +} + +build() { + cd "$pkgname" + + # set Go flags + export CGO_CFLAGS="${CFLAGS}" + export CGO_CXXFLAGS="${CXXFLAGS}" + + go build -v \ + -trimpath \ + -buildmode=pie \ + -mod=readonly \ + -modcacherw \ + -ldflags "-linkmode external -extldflags ${LDFLAGS}" \ + -o build \ + . + + # shell completions + for shell in bash fish zsh; do + ./build/shiori completion "$shell" > "build/completion-$shell" + done +} + +check() { + cd "$pkgname" + + go test -v ./... +} + +package() { + # systemd integration + install -vDm644 systemd.service "$pkgdir/usr/lib/systemd/system/$pkgname.service" + install -vDm644 sysusers.conf "$pkgdir/usr/lib/sysusers.d/$pkgname.conf" + install -vDm644 tmpfiles.conf "$pkgdir/usr/lib/tmpfiles.d/$pkgname.conf" + + cd "$pkgname" + + # binary + install -vDm755 -t "$pkgdir/usr/bin" build/shiori + + # shell completions + install -vDm644 build/completion-bash "$pkgdir/usr/share/bash-completion/completions/$pkgname" + install -vDm644 build/completion-fish "$pkgdir/usr/share/fish/vendor_completions.d/$pkgname.fish" + install -vDm644 build/completion-zsh "$pkgdir/usr/share/zsh/site-functions/_$pkgname" + + # license + install -vDm644 -t "$pkgdir/usr/share/licenses/$pkgname" LICENSE +} diff --git a/systemd.service b/systemd.service new file mode 100644 index 000000000000..f76fc6cb400c --- /dev/null +++ b/systemd.service @@ -0,0 +1,44 @@ +[Unit] +Description=shiori service +Requires=network-online.target +After=network-online.target + +[Service] +User=shiori +Group=shiori +ExecStart=/usr/bin/shiori serve +Restart=always +RestartSec=5 +Environment="SHIORI_DIR=/var/lib/shiori" +ReadWritePaths=/var/lib/shiori + +# hardening +NoNewPrivileges=true +LimitNOFILE=1048576 +UMask=0077 +ProtectSystem=strict +ProtectHome=true +PrivateUsers=yes +PrivateTmp=true +PrivateDevices=true +ProtectHostname=true +ProtectClock=true +ProtectKernelTunables=true +ProtectKernelModules=true +ProtectKernelLogs=true +ProtectControlGroups=true +RestrictAddressFamilies=AF_UNIX AF_INET AF_INET6 +RestrictNamespaces=true +LockPersonality=true +MemoryDenyWriteExecute=true +RestrictRealtime=true +RestrictSUIDSGID=true +RemoveIPC=true +CapabilityBoundingSet= +AmbientCapabilities= +SystemCallFilter=@system-service +SystemCallFilter=~@privileged @resources +SystemCallArchitectures=native + +[Install] +WantedBy=multi-user.target diff --git a/sysusers.conf b/sysusers.conf new file mode 100644 index 000000000000..6c8f702acacd --- /dev/null +++ b/sysusers.conf @@ -0,0 +1 @@ +u shiori - "Shiori daemon user" /var/lib/shiori diff --git a/tmpfiles.conf b/tmpfiles.conf new file mode 100644 index 000000000000..0a90b159263a --- /dev/null +++ b/tmpfiles.conf @@ -0,0 +1 @@ +d /var/lib/shiori 0755 shiori shiori |