summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorpdp8 <pdp8@pdp8.info>2024-07-25 12:07:49 +0200
committerpdp8 <pdp8@pdp8.info>2024-07-25 12:07:49 +0200
commitd13dc919f9fe0e14e8b58ec2e6ce727a6bbc1621 (patch)
tree8972f81fe05279097d3c9e94225c6e4348bd0cfd /Makefile
parent3b26e6ed999e3ebf913391d566cbf9459243c8df (diff)
Makefile for new /srv/media/pictures format
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile28
1 files changed, 18 insertions, 10 deletions
diff --git a/Makefile b/Makefile
index fadd139..eec9eef 100644
--- a/Makefile
+++ b/Makefile
@@ -1,21 +1,29 @@
+export PATH := /etc/profiles/per-user/ch/bin:$(PATH)
+
MEDIA_DIR := /srv/media
TEST_DIR := /srv/www/pdp8-test
PUB_DIR := /srv/www/pdp8
MUSIC_DIR := $(MEDIA_DIR)/music
FLAC := $(wildcard $(MUSIC_DIR)/*/*.flac)
-MP3 := $(subst flac,mp3,$(FLAC))
+MP3 := $(subst flac, mp3, $(FLAC))
IMG_DIR := $(MEDIA_DIR)/pictures
-WWW_DIR := $(IMG_DIR)/www
-IMG := $(wildcard $(IMG_DIR)/*.jpeg)
-IMG_WWW := $(subst $(IMG_DIR), $(WWW_DIR), $(subst jpeg,webp, $(IMG)))
+WEBP_DIR := $(IMG_DIR)/webp
+JPEG_DIR := $(IMG_DIR)/jpeg
+TXT_DIR := $(IMG_DIR)/txt
+
+JPEG_IMG := $(wildcard $(JPEG_DIR)/*.jpeg)
+WEBP_IMG := $(subst jpeg, webp, $(JPEG_IMG))
+TXT_IMG := $(subst jpeg, txt, $(JPEG_IMG))
+
+IMG_COLLECTIONS := $(wildcard $(IMG_DIR)/collections/*)
VIDEO_DIR := /srv/media/videos
VIDEO_WEBM := $(wildcard $(VIDEO_DIR)/*/*.webm)
-VIDEO_MP4 := $(subst webm,mp4, $(VIDEO_WEBM))
-VIDEO_WEBP := $(subst webm,webp, $(VIDEO_WEBM))
-VIDEO_PNG := $(subst webm,png, $(VIDEO_WEBM))
+VIDEO_MP4 := $(subst webm, mp4, $(VIDEO_WEBM))
+VIDEO_WEBP := $(subst webm, webp, $(VIDEO_WEBM))
+VIDEO_PNG := $(subst webm, png, $(VIDEO_WEBM))
CLIMBING_DIR := /srv/media/climbing
CLIMBING_WEBM := $(wildcard $(CLIMBING_DIR)/*.webm)
@@ -34,7 +42,7 @@ all: test
test: $(TEST_HTML) $(TEST_OTHER)
-www-pictures: $(IMG_WWW)
+pictures: $(WEBP_IMG) $(TXT_IMG)
$(TEST_DIR)/rss.xml: $(TEST_HTML)
./rss.rb
@@ -45,7 +53,7 @@ $(TEST_DIR)/index.html: $(TEST_DIR)/music.html
$(TEST_DIR)/music.html: $(MP3)
./music.rb
-$(TEST_DIR)/pictures.html: /srv/social/outbox/create/ $(IMG_WWW)
+$(TEST_DIR)/pictures.html: $(IMG_COLLECTIONS)
./pictures.rb
$(TEST_DIR)/videos.html: $(VIDEO_MP4) $(VIDEO_WEBP)
@@ -75,7 +83,7 @@ $(TEST_DIR)/%.txt: ./html/%.txt
%.webp: %.webm
ffmpeg -i $< -loglevel error -vf thumbnail -frames:v 1 -c:v png -f image2pipe - | magick - $@
-$(WWW_DIR)/%.webp: $(IMG_DIR)/%.jpeg
+$(WEBP_DIR)/%.webp: $(JPEG_DIR)/%.jpeg
magick $< -resize 1536x1024 -quality 85 $@
%.mp4: %.webm