From 3c7230c191ade30d5b9c8ef02a019ba42ab519f5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yaroslav=20de=20la=20Pe=C3=B1a=20Smirnov?= Date: Thu, 31 Mar 2022 02:06:41 +0300 Subject: Ready for packaging * Documentation * make install/uninstall * roscha truthy fix * Other fixes/improvements --- Makefile | 30 ++++++++++++++- README.md | 10 ++--- assets/templates/album.html | 2 + assets/templates/base.html | 6 +-- assets/templates/index.html | 31 ++++++++-------- docs/revela.1.scd | 65 ++++++++++++++++++++++++++++++++ docs/revela.5.scd | 90 +++++++++++++++++++++++++++++++++++++++++++++ include/config.h | 1 - include/site.h | 2 +- roscha | 2 +- src/components.c | 4 +- src/config.c | 7 ---- src/revela.c | 24 ++++++++---- src/site.c | 5 +-- src/tests/config.c | 1 - tests/site.ini | 1 - util/revela-init | 30 +++++++++++++++ 17 files changed, 259 insertions(+), 52 deletions(-) create mode 100644 docs/revela.1.scd create mode 100644 docs/revela.5.scd create mode 100755 util/revela-init diff --git a/Makefile b/Makefile index 41be2b8..b91f3d2 100644 --- a/Makefile +++ b/Makefile @@ -27,7 +27,9 @@ REVELA_OBJS:=$(REVELA_SRCS:%.c=$(OBJDIR)/%.o) ALL_OBJS:=$(ROSCHA_OBJS) $(PARCINI_OBJS) $(REVELA_OBJS) TEST_OBJS:=$(filter-out $(OBJDIR)/src/revela.o,$(ALL_OBJS)) -all: revela +PREFIX?=/usr/local/ + +all: revela docs test: tests/config tests/fs @@ -43,9 +45,33 @@ revela: $(ALL_OBJS) mkdir -p $(@D) $(CC) -o $(BUILDIR)/$@ $^ $(LIBS) $(CFLAGS) +docs: + mkdir -p build/man/ + scdoc < docs/revela.1.scd > build/man/revela.1 + scdoc < docs/revela.5.scd > build/man/revela.5 + +install: + mkdir -p $(PREFIX)/bin + mkdir -p $(PREFIX)/share/man/man1 + mkdir -p $(PREFIX)/share/man/man5 + mkdir -p $(PREFIX)/share/revela + install -m755 $(BUILDIR)/revela $(PREFIX)/bin/revela + install -m755 util/revela-init $(PREFIX)/share/revela/revela-init + ln -sf $(PREFIX)/share/revela/revela-init $(PREFIX)/bin/ + install -m644 build/man/revela.1 $(PREFIX)/share/man/man1/revela.1 + install -m644 build/man/revela.5 $(PREFIX)/share/man/man5/revela.5 + cp -r assets $(PREFIX)/share/revela/ + +uninstall: + rm -rf $(PREFIX)/share/revela + rm -f $(PREFIX)/bin/revela + rm -f $(PREFIX)/bin/revela-init + rm -f $(PREFIX)/share/man/man1/revela.1 + rm -f $(PREFIX)/share/man/man5/revela.5 + clean: rm -r build -.PHONY: clean all test +.PHONY: clean all test docs install uninstall .PRECIOUS: $(OBJDIR)/src/tests/%.o diff --git a/README.md b/README.md index 9d8e76c..5e8a2ee 100644 --- a/README.md +++ b/README.md @@ -4,8 +4,6 @@ A static web image gallery generator. It optimizes images for the web and generates HTML files to create a photo/image gallery web site ready to be served by an HTML server. -Alpha stages. It's functional but a little rough around the edges. - ## Building revela depends on GraphicsMagick (1.3+ tested) and libexif (0.6+ tested). @@ -21,11 +19,13 @@ or for debugging: DEBUG=1 make ``` +## Usage + +For information on how to use revela, consult `man revela` if installed on your +system, or read the contents in `docs/` in the source. + ## TODO: * Add exif tags to template hashmap. -* Improve unja or find better alternative. -* Get rid of previews variable. It is a temporary hack to limit the amount of - thumbnails for each album in the index. * Better test coverage? (if I am not too lazy) * Document. diff --git a/assets/templates/album.html b/assets/templates/album.html index 95d9935..856cf63 100644 --- a/assets/templates/album.html +++ b/assets/templates/album.html @@ -12,7 +12,9 @@

from {{ title }}