summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorFabioLolix2020-12-14 14:39:02 +0100
committerFabioLolix2020-12-14 14:39:02 +0100
commitbdeb19b2dc5668c024acfb89d0ca0c1b434beacb (patch)
tree431ff71d2d3674c84152dddd9a2b9035228dfea6
parente629fd9b935cf7dce501e7ace2d42a39486e2123 (diff)
downloadaur-bdeb19b2dc5668c024acfb89d0ca0c1b434beacb.tar.gz
vrevision
-rw-r--r--.SRCINFO16
-rw-r--r--PKGBUILD72
-rw-r--r--filebrowser.service13
-rw-r--r--filebrowser@.service13
4 files changed, 66 insertions, 48 deletions
diff --git a/.SRCINFO b/.SRCINFO
index 32b23c4514a1..8d88373aff78 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,20 +1,22 @@
pkgbase = filebrowser-git
- pkgdesc = Web File Manager which can be used as a middleware or standalone app
- pkgver = 1.9.0
+ pkgdesc = Standalone web file manager
+ pkgver = 2.10.0.r0.gc746c193
pkgrel = 1
- url = https://github.com/filebrowser/filebrowser
+ url = https://filebrowser.xyz/
arch = x86_64
license = Apache
- makedepends = dep
makedepends = git
makedepends = go
- makedepends = yarn
+ makedepends = npm
+ makedepends = go.rice
+ depends = glibc
provides = filebrowser
conflicts = filebrowser
+ options = emptydirs
source = git+https://github.com/filebrowser/filebrowser.git
- source = filebrowser.service
+ source = filebrowser@.service
sha512sums = SKIP
- sha512sums = 3b32f4fb7739afd6b2f7aeb372734e69ffe69e9a308a408a3e609b3b734053057f640343cce36110d8354bb132b0612b0fcf747b262aa0066651b39eb86bdbd0
+ sha512sums = 0846815afbb3c5ccbb097a5361461ca0ada69e04246935afb123f4609d09cd61f9e3fe50e3b6698b3e4c1f335cbb0aa3d998cae13b422e2989aad62ed7ce4682
pkgname = filebrowser-git
diff --git a/PKGBUILD b/PKGBUILD
index 864f603e0e9e..0846c96f706a 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -1,39 +1,55 @@
-# Maintainer: Dct Mei <dctxmei@gmail.com>
-_pkgname=filebrowser
+# Maintainer: Fabio 'Lolix' Loli <fabio.loli@disroot.org> -> https://github.com/FabioLolix
+# Contributor: Dct Mei <dctxmei@gmail.com>
+
pkgname=filebrowser-git
-pkgver=1.9.0
+pkgver=2.10.0.r0.gc746c193
pkgrel=1
-pkgdesc="Web File Manager which can be used as a middleware or standalone app"
-arch=('x86_64')
-url="https://github.com/filebrowser/filebrowser"
-license=('Apache')
-makedepends=("dep" "git" "go" "yarn")
-provides=('filebrowser')
-conflicts=('filebrowser')
-source=("git+${url}.git"
- "filebrowser.service")
-sha512sums=("SKIP"
- "3b32f4fb7739afd6b2f7aeb372734e69ffe69e9a308a408a3e609b3b734053057f640343cce36110d8354bb132b0612b0fcf747b262aa0066651b39eb86bdbd0")
+pkgdesc="Standalone web file manager"
+arch=(x86_64)
+url="https://filebrowser.xyz/"
+license=(Apache)
+depends=(glibc)
+makedepends=(git go npm go.rice)
+provides=(filebrowser)
+conflicts=(filebrowser)
+source=("git+https://github.com/filebrowser/filebrowser.git"
+ "filebrowser@.service")
+sha512sums=('SKIP'
+ '0846815afbb3c5ccbb097a5361461ca0ada69e04246935afb123f4609d09cd61f9e3fe50e3b6698b3e4c1f335cbb0aa3d998cae13b422e2989aad62ed7ce4682')
+options=(emptydirs)
pkgver() {
- git -C $_pkgname describe --tags | sed -e 's/^v//' -e 's/-/./g'
+ cd "${srcdir}/${pkgname%-git}"
+ git describe --long --tags | sed 's/^v//;s/\([^-]*-g\)/r\1/;s/-/./g'
}
build() {
- export GOPATH="$(pwd)/go"
- export PATH="$PATH:$GOPATH/bin"
- mkdir -p $GOPATH/src/github.com/$_pkgname
- mv $_pkgname $GOPATH/src/github.com/$_pkgname
- cd $GOPATH/src/github.com/$_pkgname/$_pkgname
- git submodule init
- git submodule update
- sed "s/(untracked)/$(git describe --tags | sed -e 's/^v//' -e 's/-/./g')/" -i lib/filebrowser.go
- sh build/build_all.sh
+ cd "${srcdir}/${pkgname%-git}/frontend"
+
+ npm install
+ npm update
+ npm audit fix
+ npm run build
+
+ cd "${srcdir}/${pkgname%-git}/http"
+ rice embed-go
+
+ cd "${srcdir}/${pkgname%-git}"
+ export GOPATH="$SRCDEST/go-modules"
+
+ go build \
+ -gcflags "all=-trimpath=${PWD}" \
+ -asmflags "all=-trimpath=${PWD}" \
+ -ldflags "-extldflags ${LDFLAGS}" \
+ -buildmode=pie
}
package() {
- install -Dm644 "$srcdir"/$_pkgname.service "$pkgdir"/usr/lib/systemd/system/$_pkgname.service
- sed -e 's/.pid/-%i.pid/' -e 's/config/%i/' -i filebrowser.service
- install -Dm644 "$srcdir"/$_pkgname.service "$pkgdir"/usr/lib/systemd/system/$_pkgname@.service
- install -Dm755 "$GOPATH"/src/github.com/$_pkgname/$_pkgname/cli/$_pkgname "$pkgdir"/usr/bin/$_pkgname
+ install -Dm644 filebrowser@.service "${pkgdir}"/usr/lib/systemd/system/filebrowser@.service
+ install -Dm755 "${srcdir}"/filebrowser/filebrowser "${pkgdir}"/usr/bin/filebrowser
+ install -d "${pkgdir}"/usr/share/filebrowser
+ install -d "${pkgdir}"/etc/filebrowser/
+# cd "${pkgdir}"/usr/share/filebrowser
+# "${srcdir}"/filebrowser/filebrowser config init
+# "${srcdir}"/filebrowser/filebrowser config export ${pkgdir}/etc/filebrowser/config.json
}
diff --git a/filebrowser.service b/filebrowser.service
deleted file mode 100644
index a0c512694b1c..000000000000
--- a/filebrowser.service
+++ /dev/null
@@ -1,13 +0,0 @@
-[Unit]
-Description=File Browser Service
-After=network.target
-Wants=network.target
-
-[Service]
-Type=simple
-PIDFile=/var/run/filebrowser.pid
-ExecStart=/usr/bin/filebrowser -c /etc/filebrowser/config.json
-Restart=on-failure
-
-[Install]
-WantedBy=multi-user.target
diff --git a/filebrowser@.service b/filebrowser@.service
new file mode 100644
index 000000000000..b4e22d776995
--- /dev/null
+++ b/filebrowser@.service
@@ -0,0 +1,13 @@
+[Unit]
+Description=Filebrowser Service
+After=network.target
+Wants=network.target
+
+[Service]
+Type=simple
+WorkingDirectory=/usr/share/filebrowser
+ExecStart=/usr/bin/filebrowser --config /etc/filebrowser/%i.json
+Restart=on-failure
+
+[Install]
+WantedBy=multi-user.target