diff options
author | feinedsquirrel | 2021-06-10 12:02:12 -0600 |
---|---|---|
committer | feinedsquirrel | 2021-06-10 12:02:12 -0600 |
commit | 73079694d1ba548994d30876640c21345f7613a3 (patch) | |
tree | 1f41087b3738a9f5d5c105f0dc2150f41a37bad7 | |
download | aur-73079694d1ba548994d30876640c21345f7613a3.tar.gz |
initial submission of photoview with new name
-rw-r--r-- | .SRCINFO | 35 | ||||
-rw-r--r-- | .gitignore | 8 | ||||
-rw-r--r-- | PKGBUILD | 98 | ||||
-rw-r--r-- | photoview.env.patch | 37 | ||||
-rw-r--r-- | photoview.install | 22 | ||||
-rw-r--r-- | photoview.service | 16 |
6 files changed, 216 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO new file mode 100644 index 000000000000..b6b745e2bc6c --- /dev/null +++ b/.SRCINFO @@ -0,0 +1,35 @@ +pkgbase = photoview + pkgdesc = Photo gallery for self-hosted personal servers + pkgver = 2.3.4 + pkgrel = 1 + url = https://github.com/photoview/photoview + install = photoview.install + arch = x86_64 + license = AGPL3 + makedepends = git + makedepends = go + makedepends = npm + depends = nodejs + depends = libjpeg-turbo + depends = libheif + depends = blas + depends = cblas + depends = lapack + depends = dlib + optdepends = mariadb: for mysql database backend + optdepends = postgresql: for database backend + optdepends = sqlite: for database backend + optdepends = darktable: for RAW image support + optdepends = ffmpeg: for video file playback in the browser + optdepends = perl-image-exiftool: for faster and more reliable EXIF metadata parsing + conflicts = golang-photoview + replaces = golang-photoview + backup = etc/photoview.env + source = git+https://github.com/photoview/photoview.git#commit=72fd6c39ea0dd42c0aa13132be33576c9b742e5c + source = photoview.service + source = photoview.env.patch + sha512sums = SKIP + sha512sums = 5184097e279dc400e8ca2b811b7ca3101c16e27d8da94b5409105ee8c253098356596be402424a9bfa52a3a2fcbf32780f7c8b21dee09aa3e912cbe7bd5af286 + sha512sums = 5f1a57316fb1d682bb5df1564bae46f282aaff3fa05a8bf8bd2c7c27a6c015101f2eea158be3ec9822ab63defc3b097156db5cf3afa957b5a31ba27d152b0308 + +pkgname = photoview diff --git a/.gitignore b/.gitignore new file mode 100644 index 000000000000..fbf2c402398e --- /dev/null +++ b/.gitignore @@ -0,0 +1,8 @@ +* +!.gitignore +!.SRCINFO +!PKGBUILD +!*.install +!*.patch +!*.service +!*.diff diff --git a/PKGBUILD b/PKGBUILD new file mode 100644 index 000000000000..e1b57d7a5024 --- /dev/null +++ b/PKGBUILD @@ -0,0 +1,98 @@ +# Maintainer: feinedsquirrel < feinedsquirrel at gmail dot com > + +# instructions by photoview author: +# https://photoview.github.io/docs/installation-manual/ + +pkgname=photoview +pkgver=2.3.4 +pkgrel=1 +pkgdesc="Photo gallery for self-hosted personal servers" +arch=('x86_64') +url="https://github.com/photoview/photoview" +license=('AGPL3') +_commit="72fd6c39ea0dd42c0aa13132be33576c9b742e5c" +depends=( + 'nodejs' + 'libjpeg-turbo' + 'libheif' + 'blas' + 'cblas' + 'lapack' + 'dlib' +) +makedepends=( + 'git' + 'go' + 'npm' +) +optdepends=( + 'mariadb: for mysql database backend' + 'postgresql: for database backend' + 'sqlite: for database backend' + 'darktable: for RAW image support' + 'ffmpeg: for video file playback in the browser' + 'perl-image-exiftool: for faster and more reliable EXIF metadata parsing' +) +conflicts=( + 'golang-photoview' +) +replaces=( + 'golang-photoview' +) +backup=( + "etc/${pkgname}.env" +) +install=${pkgname}.install +source=( + "git+${url}.git#commit=${_commit}" + "${pkgname}.service" + "${pkgname}.env.patch" +) +sha512sums=( + 'SKIP' + '5184097e279dc400e8ca2b811b7ca3101c16e27d8da94b5409105ee8c253098356596be402424a9bfa52a3a2fcbf32780f7c8b21dee09aa3e912cbe7bd5af286' + '5f1a57316fb1d682bb5df1564bae46f282aaff3fa05a8bf8bd2c7c27a6c015101f2eea158be3ec9822ab63defc3b097156db5cf3afa957b5a31ba27d152b0308' +) + +prepare() { + cd "${srcdir}/${pkgname}" + patch --forward --strip=1 --input="${srcdir}/${pkgname}.env.patch" +} + +build() { + cd "${srcdir}/${pkgname}/ui" + npm install --yes + npm run build + + cd "${srcdir}/${pkgname}/api" + export CGO_CPPFLAGS="${CPPFLAGS}" + export CGO_CFLAGS="${CFLAGS}" + export CGO_CXXFLAGS="${CXXFLAGS}" + export CGO_LDFLAGS="${LDFLAGS}" + export GOFLAGS="-buildmode=pie -trimpath -ldflags=-linkmode=external -mod=readonly -modcacherw" + go build -v -o photoview . +} + +package() { + # --ui-- + cd "${srcdir}/photoview/ui/dist" + find * -type f -exec install -Dm0644 "{}" "${pkgdir}/usr/share/webapps/photoview-ui/{}" \; + + # --api-- + # binary + install -Dm0755 -t "${pkgdir}/usr/lib/${pkgname}" "${srcdir}/${pkgname}/api/${pkgname}" + install -d "${pkgdir}/usr/bin" + ln -s "/usr/lib/${pkgname}/${pkgname}" "${pkgdir}/usr/bin/" + # data/ + cd "${srcdir}/photoview/api" + find data -type f -exec install -Dm0644 "{}" "${pkgdir}/usr/lib/${pkgname}/{}" \; + # .env file + install -Dm0644 "${srcdir}/${pkgname}/api/example.env" "${pkgdir}/etc/${pkgname}.env" + + # systemd unit file + install -Dm0644 -t "${pkgdir}/usr/lib/systemd/system" "${srcdir}/${pkgname}.service" + # sqlite and cache dirs + cd "${pkgdir}" + install -d "${pkgdir}/var/lib/photoview" + install -d "${pkgdir}/var/cache/photoview/media_cache" +} diff --git a/photoview.env.patch b/photoview.env.patch new file mode 100644 index 000000000000..8f4c7ce5cb49 --- /dev/null +++ b/photoview.env.patch @@ -0,0 +1,37 @@ +--- photoview/api/example.env 2021-06-06 03:38:16.387709283 -0600 ++++ photoview_new/api/example.env 2021-06-06 03:38:29.911001146 -0600 +@@ -1,4 +1,4 @@ +-# Copy this file to .env ++# Copy this file to /etc/photoview.env + + PHOTOVIEW_DATABASE_DRIVER=mysql + PHOTOVIEW_MYSQL_URL=user:password@tcp(localhost)/dbname +@@ -8,7 +8,7 @@ + # PHOTOVIEW_POSTGRES_URL=postgres://user:password@host:port/dbname?sslmode=(disable|allow|...) + + # Specifies the filepath for the sqlite database, if PHOTOVIEW_DATABASE_DRIVER is set to 'sqlite' +-# PHOTOVIEW_SQLITE_PATH=photoview.db ++# PHOTOVIEW_SQLITE_PATH=/var/lib/photoview/photoview.db + + PHOTOVIEW_LISTEN_IP=localhost + PHOTOVIEW_LISTEN_PORT=4001 +@@ -18,10 +18,11 @@ + PHOTOVIEW_UI_ENDPOINT=http://localhost:1234/ + + # Path where media should be cached, defaults to ./media_cache +-# PHOTOVIEW_MEDIA_CACHE=./media_cache ++PHOTOVIEW_MEDIA_CACHE=/var/cache/photoview/media_cache + + # Set to 1 for the server to also serve the built static ui files +-PHOTOVIEW_SERVE_UI=0 ++PHOTOVIEW_SERVE_UI=1 ++PHOTOVIEW_UI_PATH=/usr/share/webapps/photoview-ui + + # Enter a valid mapbox token, to enable maps feature + # A token can be created for free at https://mapbox.com +@@ -29,4 +30,4 @@ + + # Set to 1 to set server in development mode, this enables graphql playground + # Remove this if running in production +-PHOTOVIEW_DEVELOPMENT_MODE=1 ++PHOTOVIEW_DEVELOPMENT_MODE=0 diff --git a/photoview.install b/photoview.install new file mode 100644 index 000000000000..63950c95eb30 --- /dev/null +++ b/photoview.install @@ -0,0 +1,22 @@ +post_install() { + cat << EOF +!NOTE! + You need to have a database backend. Select one from the first three optional dependencies. + +Configure the server via its environment variables in /etc/photoview.env. +Especially assign the correct value to PHOTOVIEW_DATABASE_DRIVER, according to which database backend you have installed and want to use. + +If you selected mysql or postgresql, you need to create the database before running photoview. + +Additionally, you may wish to configure a webserver to serve the ui via a reverse proxy. + +More information on all the above can be found in the upstream documentation: +https://photoview.github.io/docs/ + +Create or edit drop-in file: +# systemctl edit photoview.service + +Enable and start the photoview systemd service: +# systemctl enable --now photoview.service +EOF +} diff --git a/photoview.service b/photoview.service new file mode 100644 index 000000000000..79d0c0fbd61b --- /dev/null +++ b/photoview.service @@ -0,0 +1,16 @@ +[Unit] +Description=Photoview - Photo gallery for self-hosted personal servers +Documentation=https://photoview.github.io/docs +After=network.target + +[Service] +ExecStart=/usr/lib/photoview/photoview +WorkingDirectory=/usr/lib/photoview + +ReadWritePaths=/var/lib/photoview + +EnvironmentFile=/etc/photoview.env +CacheDirectory=photoview/media_cache + +[Install] +WantedBy=multi-user.target |