From 7904f2d53602222940db0898c2dc2fcadf8f4e5f Mon Sep 17 00:00:00 2001 From: EuAndreh Date: Tue, 29 Apr 2025 09:00:07 -0300 Subject: Makefile: Support flac -> ogg conversion and torrent file generation --- Makefile | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index ae9ace0..d9b2f82 100644 --- a/Makefile +++ b/Makefile @@ -20,13 +20,15 @@ EXEC = ./ DESTDIR = LDLIBS = PUBURL = public.asc.txt +FFMFLAGS = -y -hide_banner -loglevel warning +BASEURL = / .SUFFIXES: .SUFFIXES: .adoc .conf .snippets .indexentry .feedentry .sortdata .xml .txt .SUFFIXES: .htmlbody .htmlheader .htmlfooter .htmllisting .html .links .caslinks -.SUFFIXES: .categorydata .gz +.SUFFIXES: .categorydata .gz .torrent .flac .ogg .adoc.conf: mkwb conf src/global.conf $< > $@ @@ -66,6 +68,9 @@ PUBURL = public.asc.txt printf "%s\n" "_" | sha256sum | \ printf "%s\t%s\n" "`cut -d" " -f1`" "_"' > $@ +.flac.ogg: + ffmpeg $(FFMFLAGS) -i $< -ar 48000 -vn -c:a libvorbis -b:a 320k $@ + all: @@ -93,6 +98,7 @@ categories.htmllisting = $(categories.adoc:.adoc=.htmllisting) categories.txt = $(categories.adoc:.adoc=.txt) categories.xml = $(categories.adoc:.adoc=.xml) categories.xml.gz = $(categories.adoc:.adoc=.xml.gz) +sources.media.torrent = $(sources.media:=.torrent) sources = \ $(sources.adoc) \ @@ -189,6 +195,7 @@ captured-assets = \ src/content/$(PUBURL) \ src/content/favicon.ico \ src/content/favicon.png \ + $(sources.media.torrent) \ side-assets = \ src/collections/*/*/*/*/*.html.*.txt \ @@ -276,6 +283,10 @@ src/content/favicon.ico: src/content/img/favicon.svg src/content/favicon.png: src/content/img/favicon.svg convert src/content/img/favicon.svg $@ +$(sources.media.torrent): + F="`printf '%s\n' $* | cut -d/ -f3-`" && \ + mktorrent -xfd -n $(*F) -o $@ -w "https://$(NAME)$(BASEURL)$${F}" $* + email.txt: meta.json jq -r '.email' < meta.json > $@ -- cgit v1.2.3