1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
|
# Installation
## Requirements
* **Bash 5.1 or newer.** shuriken uses features that require it and exits with
an error on older Bash.
* **ImageMagick.** The script prefers the modern `magick` command and falls back
to `convert` / `identify` when only the legacy tools are present.
* **rsync** (only needed for `shuriken --sync`).
## Build and install from a source checkout
```sh
just build
sudo just install
```
`just install` installs:
* `shuriken` to `/usr/bin`,
* templates to `/usr/share/shuriken/templates/default` and static assets to
`/usr/share/shuriken/assets`,
* the default config to `/etc/default/shuriken`.
## Packaging / staging overrides
Override install paths with `DESTDIR`, `PREFIX`, `BINDIR`, `DATADIR`, or
`SYSCONFDIR` when packaging or staging an install:
```sh
DESTDIR="$PWD/pkg" PREFIX=/usr just install
DESTDIR="$PWD/pkg" PREFIX=/usr just deinstall
```
`just uninstall` is an alias for `just deinstall`.
Defaults: `PREFIX=/usr`, `BINDIR=$PREFIX/bin`, `DATADIR=$PREFIX/share`,
`SYSCONFDIR=/etc/default`.
## The generated `bin/shuriken` artifact
`bin/shuriken` is a committed generated artifact kept in sync with
`src/shuriken.sh` for compatibility with existing checkouts and packaging. Its
source of truth is `src/shuriken.sh` rendered through the `VERSION` and
`LIB_SOURCES` values in `Justfile`.
* Run `just build` after changing `src/shuriken.sh` or any `src/lib/*.source.sh`
file, and keep `bin/shuriken` synchronized.
* Run `just check-generated` to verify that the tracked script has not drifted.
`just test` and `just install` run that drift check before rebuilding, so a
stale committed output is never silently hidden.
## Running from a checkout (no install)
You can run `./bin/shuriken` directly from a source checkout. The stock default
template directory resolves to the installed location when it exists, and
otherwise falls back to the source tree's `share/templates/default`. Likewise
the bundled favicon falls back to `assets/site/favicon.ico`.
## Docker image
Build the Alpine-based image from the source checkout:
```sh
docker build -t shuriken .
```
Run it with an album project mounted as `/work`. The default container command
is `shuriken --generate`, so a directory containing `shuriken.conf`,
`INCOMING_DIR`, and `DIST_DIR` can be generated with:
```sh
docker run --rm \
--user "$(id -u):$(id -g)" \
-v "$PWD:/work" \
shuriken
```
Pass the normal shuriken CLI arguments after the image name:
```sh
docker run --rm \
--user "$(id -u):$(id -g)" \
-v "$PWD:/work" \
shuriken --generate --incoming ./photos --dist ./dist
```
Use `--user` when bind-mounting a host directory so generated files are owned by
the calling user instead of root.
|