diff options
author | EuAndreh <eu@euandre.org> | 2025-04-29 09:00:07 -0300 |
---|---|---|
committer | EuAndreh <eu@euandre.org> | 2025-04-29 09:02:25 -0300 |
commit | 7904f2d53602222940db0898c2dc2fcadf8f4e5f (patch) | |
tree | 91958973dfe8599e622e7307d286a57796598165 /Makefile | |
parent | Makefile: Reify $(captured-assets) into variable (diff) | |
download | euandre.org-7904f2d53602222940db0898c2dc2fcadf8f4e5f.tar.gz euandre.org-7904f2d53602222940db0898c2dc2fcadf8f4e5f.tar.xz |
Makefile: Support flac -> ogg conversion and torrent file generation
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 13 |
1 files changed, 12 insertions, 1 deletions
@@ -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 > $@ |