1
0
Fork 0

Compare commits

...

4 Commits

5 changed files with 26 additions and 25 deletions

4
.gitignore vendored
View File

@ -1,3 +1,5 @@
bin/*
!bin/.keep
.vscode
.vscode
web/*.jade.go
web/jade.go

View File

@ -2,29 +2,34 @@ TARGET=dwelling-files
SYSDDIR_=${shell pkg-config systemd --variable=systemdsystemunitdir}
SYSDDIR=${SYSDDIR_:/%=%}
DESTDIR=/
LDFLAGS=-ldflags "-s -w -X main.version=23.8.0" -tags osusergo,netgo
DESTDIR:=
PREFIX:=/usr/local
all: ${TARGET}
VERSION=23.24.0
LDFLAGS=-ldflags "-s -w -X main.version=${VERSION}" -tags osusergo,netgo
all: web/*.jade.go ${TARGET}
.PHONY: ${TARGET}
${TARGET}:
go generate web/web.go
go build -o bin/$@ ${LDFLAGS} cmd/$@/main.go
web/*.jade.go: web/templates/*.jade
go install github.com/Joker/jade/cmd/jade@latest
go generate web/web.go
run:
bin/${TARGET} -file-handling -path /mnt/data -listen 127.0.0.1:19135
install:
install -Dm 0755 bin/${TARGET} ${DESTDIR}usr/bin/${TARGET}
install -Dm 0644 LICENSE ${DESTDIR}usr/share/licenses/${TARGET}/LICENSE
install -Dm 0755 bin/${TARGET} ${DESTDIR}${PREFIX}/bin/${TARGET}
install -Dm 0644 init/systemd/${TARGET}.service ${DESTDIR}${SYSDDIR}/${TARGET}.service
install -Dm 0644 init/systemd/${TARGET}.service ${DESTDIR}/${SYSDDIR}/${TARGET}.service
uninstall:
rm ${DESTDIR}usr/bin/${TARGET}
rm ${DESTDIR}usr/share/licenses/${TARGET}/LICENSE
rm ${DESTDIR}${PREFIX}/bin/${TARGET}
rm ${DESTDIR}${SYSDDIR}/${TARGET}.service
rm ${DESTDIR}/${SYSDDIR}/${TARGET}.service

View File

@ -1,30 +1,24 @@
# Maintainer: Alexander "Arav" Andreev <me@arav.su>
pkgname=dwelling-files
pkgver=23.8.0
pkgver=23.24.0
pkgrel=1
pkgdesc="Arav's dwelling / Files"
arch=('i686' 'x86_64' 'arm' 'armv6h' 'armv7h' 'aarch64')
url="https://git.arav.su/Arav/dwelling-files"
license=('MIT')
groups=()
depends=()
makedepends=('go')
makedepends=('go>=1.16')
provides=('dwelling-files')
conflicts=('dwelling-files')
replaces=()
backup=()
options=()
install=
source=('https://git.arav.su/Arav/dwelling-files/archive/23.8.0.tar.gz')
noextract=()
source=("${pkgver}.tar.gz::https://git.arav.su/Arav/dwelling-files/archive/${pkgver}.tar.gz")
md5sums=('SKIP')
build() {
cd "$srcdir/$pkgname"
make DESTDIR="$pkgdir/"
export GOPATH="$srcdir"/gopath
make VERSION=$pkgver DESTDIR="$pkgdir" PREFIX="/usr"
}
package() {
cd "$srcdir/$pkgname"
make DESTDIR="$pkgdir/" install
make DESTDIR="$pkgdir" PREFIX="/usr" install
}

2
go.mod
View File

@ -1,5 +1,5 @@
module dwelling-files
go 1.19
go 1.16
require github.com/julienschmidt/httprouter v1.3.0

View File

@ -5,7 +5,7 @@ import (
"net/http"
)
//go:generate $GOPATH/bin/jade -pkg=web -stdlib -stdbuf -writer templates/index.jade
//go:generate $GOPATH/bin/jade -pkg=web -stdbuf -writer templates/index.jade
//go:embed assets
var assetsDir embed.FS