summarylogtreecommitdiffstats
path: root/PKGBUILD
diff options
context:
space:
mode:
Diffstat (limited to 'PKGBUILD')
-rw-r--r--PKGBUILD72
1 files changed, 44 insertions, 28 deletions
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
}