From d64e20a8362a751bfd249cca728cd3b821edeb17 Mon Sep 17 00:00:00 2001 From: Jeff Carr Date: Sun, 29 Jan 2023 00:57:35 -0600 Subject: [PATCH] more notes Signed-off-by: Jeff Carr --- .gitignore | 6 +++-- Makefile | 22 +++++++++++++++++++ photoprism/Makefile | 10 ++++++--- photoprism/control | 2 +- .../etc/systemd/system/photoprism.service | 15 +++++++++++++ 5 files changed, 49 insertions(+), 6 deletions(-) create mode 100644 Makefile create mode 100644 photoprism/files/etc/systemd/system/photoprism.service diff --git a/.gitignore b/.gitignore index 2788bcc..4466c0f 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,6 @@ -*.deb -*tar.gz md5sums +/*.deb +/*.tgz +/*.tar.gz +/*.tar.xz /files diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..9fae551 --- /dev/null +++ b/Makefile @@ -0,0 +1,22 @@ +help: + @echo + @echo "# this are just simple shortcuts to package up files on a system once you have it compiled and installed" + @echo "cd ; make all" + @echo + +# +# Just for reference, you can make a debian package using 'ar' from the command line +# +# A .deb file is just output from 'ar rcs' +# +tar-ar: + cd DEBIAN && tar --ignore-failed-read -cvJf ../control.tar.xz . + cd files && tar -cvJf ../data.tar.xz . + ar rcs ${BASENAME}_${VERSION}_amd64.deb debian-binary control.tar.xz data.tar.xz + dpkg-deb --info ${BASENAME}_${VERSION}_amd64.deb + +clean: + rm -rf files/ + rm -f *.deb + rm -f *.tar.xz data.tar.xz + rm -rf */DEBIAN/ diff --git a/photoprism/Makefile b/photoprism/Makefile index c510e4d..effc2ed 100644 --- a/photoprism/Makefile +++ b/photoprism/Makefile @@ -1,6 +1,6 @@ .PHONY: control -VERSION=0.6.2 +VERSION=221118-e58fee0fb BASENAME=photoprism help: @@ -31,11 +31,15 @@ download: @echo @echo This uses the binary /usr/local/bin/photoprism @echo + @echo https://github.com/photoprism/photoprism/releases + @echo mkdir ~/go/src/github.com/photoprism; cd ~/go/src/github.com/photoprism/ + @echo git clone http://github.com/photoprism/photoprism + @echo cd photoprims/; go get -v -u ... extract: cp -a files ../ - mkdir -p ../files/usr/bin - cp /usr/local/bin/photoprism ../files/usr/bin + mkdir -p ../files/opt/ + cd ../files/opt/ && tar xfz ../../221118-e58fee0fb.tar.gz # makes the DEBIAN/ directory DEBIAN: diff --git a/photoprism/control b/photoprism/control index 840538d..fdb35c2 100644 --- a/photoprism/control +++ b/photoprism/control @@ -1,7 +1,7 @@ Source: photoprism Build-Depends: golang Package: photoprism -Version: 0.6.2 +Version: 221118-e58fee0fb Maintainer: Jeff Carr Architecture: any Depends: diff --git a/photoprism/files/etc/systemd/system/photoprism.service b/photoprism/files/etc/systemd/system/photoprism.service new file mode 100644 index 0000000..0f7aa86 --- /dev/null +++ b/photoprism/files/etc/systemd/system/photoprism.service @@ -0,0 +1,15 @@ +[Unit] +Description=PhotoPrism service +After=network.target + +[Service] +Type=forking +User=photoprism +Group=photoprism +WorkingDirectory=/opt/photoprism +EnvironmentFile=/var/lib/photoprism/.env +ExecStart=/opt/photoprism/bin/photoprism up -d +ExecStop=/opt/photoprism/bin/photoprism down + +[Install] +WantedBy=multi-user.target