From f43068ca50cb21c582d680f7856ead034f9abb1a Mon Sep 17 00:00:00 2001 From: Gustav Eek Date: Fri, 17 May 2024 21:42:03 +0200 Subject: System. Add Makefiles for all sorts of actions The general *lib/Makefile* contains all commands and should be included from other places. Add particular makefiles for archive and 2023 board minutes. --- .gitignore | 10 ++++++- archive/Makefile | 3 +++ board/2023/Makefile | 4 +++ lib/Makefile | 78 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 94 insertions(+), 1 deletion(-) create mode 100644 archive/Makefile create mode 100644 board/2023/Makefile create mode 100644 lib/Makefile diff --git a/.gitignore b/.gitignore index ec7fe88..fb72ca1 100644 --- a/.gitignore +++ b/.gitignore @@ -3,6 +3,7 @@ *#* # latex specific + *.aux *.dvi *.log @@ -14,6 +15,7 @@ *.vrb # misc file types + *.bak *.eps *.jpg @@ -21,10 +23,16 @@ *.eepic # Test files and temporary files + test.d test.d/test *_ *_.tex # Completed minutes (using sed scripts) -*-complete.tex \ No newline at end of file + +*-complete.tex + +# PDF for archiving + +!archive/*.pdf \ No newline at end of file diff --git a/archive/Makefile b/archive/Makefile new file mode 100644 index 0000000..36d070c --- /dev/null +++ b/archive/Makefile @@ -0,0 +1,3 @@ +SEND = $(wildcard *.pdf) + +include ../lib/Makefile diff --git a/board/2023/Makefile b/board/2023/Makefile new file mode 100644 index 0000000..a88a36a --- /dev/null +++ b/board/2023/Makefile @@ -0,0 +1,4 @@ +MINUTES = $(basename $(wildcard *.md)) + +include ../../lib/Makefile + diff --git a/lib/Makefile b/lib/Makefile new file mode 100644 index 0000000..bb8b55f --- /dev/null +++ b/lib/Makefile @@ -0,0 +1,78 @@ +#!/usr/bin/env make -f +# +# General library Makefile for Fripost meeting minutes and policy +# documents. + +SLIDES ?= # will be compiled with beamer +MINUTES ?= # will be compiled with *minutes* template +POLICY ?= # will be compiled with *by-laws* template + +# Targets + +.PHONY: all + +ALL = \ + $(addsuffix .pdf, $(SLIDES)) \ + $(addsuffix .pdf, $(POLICY)) \ + $(addsuffix .pdf, $(MINUTES)) \ + +all: $(ALL) + +# Compilation using pandoc + +$(addsuffix .pdf, $(SLIDES)): %.pdf: %.md + pandoc -s -f markdown -t beamer -o $@ < $< + +$(addsuffix .pdf, $(MINUTES)): %.pdf: %.md + pandoc -f markdown -t latex \ + --template=fripost-minutes \ + $$(test -f $*.yml && echo --metadata-file=$*.yml) \ + -o $@ $*.md + +$(addsuffix .pdf, $(POLICY)): %.pdf: %.yml %.md + pandoc -f markdown -t latex \ + --template=fripost-by-laws \ + $$(test -f $*.yml && echo --metadata-file=$*.yml) \ + -o $@ $*.md + +# Archive + +.PHONY: archive + +ARCHIVE ?= archive +ROOT ?= $(shell git rev-parse --show-toplevel) +SUFFIX ?= -$(subst /,,$(dir $(subst $(ROOT),,$(PWD)))) +PDF = $(basename $(wildcard *.pdf)) + +print: + @echo ARCHIVE = $(ARCHIVE) + @echo ROOT = $(ROOT) + @echo SUFFIX = $(SUFFIX) + +archive: + for p in $(PDF); do \ + rsync $$p.pdf $(ROOT)/$(ARCHIVE)/$$p$(SUFFIX).pdf; \ + done + +# Upload to server + +.PHONY: send + +SEND ?= # files to send + +send: + rsync -ruvp --chmod=Dugo+rx,Fugo+r $(SEND)\ + www.fripost.org:/var/www/fripost.org/minutes + @echo; echo Now avialable as; \ + for f in $(SEND); do echo " - https://fripost.org/minutes/$$f"; done + +# Clean + +.PHONY: clean + +clean: + rm -f $(ALL) + rm -f *~ + +# Sends to fripost.org for publication + -- cgit v1.2.3