diff options
author | EuAndreh <eu@euandre.org> | 2025-04-05 14:52:38 -0300 |
---|---|---|
committer | EuAndreh <eu@euandre.org> | 2025-04-05 14:52:38 -0300 |
commit | 46222bba365f4ea2e23bab295ede7abb13cdfb1e (patch) | |
tree | b4643ea6398950214936f220b54ae517cab1e709 | |
parent | Makefile: Prevent CI from trying to look at ~/.gnupg (diff) | |
download | papo.im-46222bba365f4ea2e23bab295ede7abb13cdfb1e.tar.gz papo.im-46222bba365f4ea2e23bab295ede7abb13cdfb1e.tar.xz |
Makefile: Update to match Makefile in euandre.org
-rw-r--r-- | .gitignore | 3 | ||||
-rw-r--r-- | Makefile | 72 | ||||
-rw-r--r-- | deps.mk | 21 | ||||
-rw-r--r-- | meta.json | 1 | ||||
-rwxr-xr-x | mkdeps.sh | 4 | ||||
-rw-r--r-- | src/content/favicon.ico | bin | 0 -> 265206 bytes | |||
-rw-r--r-- | src/static.conf (renamed from src/base.conf) | 3 |
7 files changed, 93 insertions, 11 deletions
@@ -2,6 +2,8 @@ *.embedded-config *.conf *.snippets +*.links +*.caslinks *.html *.html.*.txt *.indexentry @@ -21,6 +23,7 @@ feed.xml /install.txt /email.txt /baseurl.txt +/fingerprint.txt /expiry.txt /src/content/security.txt /src/content/.well-known/security.txt @@ -19,12 +19,13 @@ EXEC = ./ ## Where to store the installation. Empty by default. DESTDIR = LDLIBS = +PUBURL = public.asc .SUFFIXES: .SUFFIXES: .adoc .conf .snippets .indexentry .feedentry .sortdata .xml -.SUFFIXES: .htmlbody .htmlheader .htmlfooter .htmllisting .html +.SUFFIXES: .htmlbody .htmlheader .htmlfooter .htmllisting .html .links .caslinks .SUFFIXES: .gz .adoc.conf: @@ -57,6 +58,14 @@ LDLIBS = .conf.sortdata: mkwb sortdata $< > $@ +.adoc.links: + mkwb links $< > $@ + +.links.caslinks: + grep -v '^link:' $< | xargs -I_ sh -c '\ + printf "%s\n" "_" | sha256sum | \ + printf "%s\t%s\n" "`cut -d" " -f1`" "_"' > $@ + all: @@ -69,6 +78,8 @@ sources.html = $(sources.adoc:.adoc=.html) sources.snippets = $(sources.adoc:.adoc=.snippets) sources.snippets.gz = $(sources.adoc:.adoc=.snippets.gz) sources.conf = $(sources.adoc:.adoc=.conf) +sources.links = $(sources.adoc:.adoc=.links) +sources.caslinks = $(sources.adoc:.adoc=.caslinks) articles.indexentry = $(articles.adoc:.adoc=.indexentry) articles.feedentry = $(articles.adoc:.adoc=.feedentry) articles.sortdata = $(articles.adoc:.adoc=.sortdata) @@ -79,8 +90,11 @@ listings.html = $(listings.adoc:.adoc=.html) sources = \ $(sources.adoc) \ + $(sources.extras) \ $(images.svg) \ + src/content/favicon.ico \ src/content/style.css \ + src/content/$(PUBURL) \ dynamic-contents = \ $(sources.html) \ @@ -89,14 +103,18 @@ dynamic-contents = \ static-contents = \ $(sources.extras) \ $(images.svg) \ + src/content/favicon.ico \ src/content/style.css \ + src/content/$(PUBURL) \ src/content/.well-known/security.txt \ dynamic-contents.gz = $(dynamic-contents:=.gz) static-contents.gz = \ $(images.svg:=.gz) \ + src/content/favicon.ico.gz \ src/content/style.css.gz \ + src/content/$(PUBURL).gz \ src/content/.well-known/security.txt.gz \ contents.gz = \ @@ -124,7 +142,11 @@ derived-assets = \ $(sources.htmlbody) \ $(sources.snippets) \ $(sources.snippets.gz) \ + $(sources.links) \ + $(sources.caslinks) \ $(sources.conf) \ + src/dyn.conf \ + src/base.conf \ src/global.conf \ $(listings.htmlheader) \ $(listings.htmlfooter) \ @@ -134,6 +156,7 @@ derived-assets = \ $(articles.sortdata) \ email.txt \ baseurl.txt \ + fingerprint.txt \ expiry.txt \ src/content/security.txt \ src/content/security.txt.gz \ @@ -159,13 +182,23 @@ side-assets = \ ## Default target. Builds all artifacts required for testing ## and installation. all: $(derived-assets) -all: src/content/public.asc +all: src/content/$(PUBURL) src/content/favicon.ico $(derived-assets): Makefile deps.mk $(sources.conf): src/global.conf src/headers.txt +src/dyn.conf: email.txt baseurl.txt fingerprint.txt + printf "export url_pre='%s'\n" "`cat baseurl.txt`" > $@ + printf "export email='%s'\n" "`cat email.txt`" >> $@ + printf "export publickey='%s'\n" "`cat fingerprint.txt`" >> $@ + printf "export publickey_url='$(PUBURL)'\n" >> $@ + printf 'export sourcecode_url="$$url_pre/git/$(NAME)"\n' >> $@ + +src/base.conf: src/dyn.conf src/static.conf + cat src/dyn.conf src/static.conf > $@ + src/global.conf: src/base.conf mkwb conf -G src/base.conf > $@ @@ -177,24 +210,34 @@ $(feeds.xml): $(contents.gz): gzip -9fk $* - touch $@ + touch $@ $(sources.snippets.gz): if [ -s $* ]; then gzip -9fk `cat $*`; fi sed 's/$$/.gz/' $* > $@ -src/content/public.asc: +src/content/$(PUBURL).gz: src/content/$(PUBURL) +src/content/$(PUBURL): gpg --export --armour "`jq -r '.email' < meta.json`" > $@ +src/content/favicon.ico.gz: src/content/favicon.ico +src/content/favicon.ico: src/content/img/favicon.svg + convert src/content/img/favicon.svg $@ + email.txt: meta.json jq -r '.email' < meta.json > $@ baseurl.txt: meta.json jq -r '.baseurl' < meta.json > $@ -expiry.txt: src/content/public.asc +fingerprint.txt: src/content/$(PUBURL) + gpg --always-trust --no-keyring --show-key --with-colons \ + src/content/$(PUBURL) | \ + awk -F: '/^pub:/ { print $$5 }' > $@ + +expiry.txt: src/content/$(PUBURL) gpg --always-trust --no-keyring --show-key --with-colons \ - src/content/public.asc | \ + src/content/$(PUBURL) | \ awk -F: '/^pub:/ { print $$7 }' | \ xargs -I% date -Is -d@% > $@ @@ -208,7 +251,7 @@ src/content/.well-known/security.txt: email.txt baseurl.txt expiry.txt mkdir -p $(@D) printf 'Contact: mailto:%s\n' "`cat email.txt`" > $@ printf 'Expires: %s\n' "`cat expiry.txt`" >> $@ - printf 'Encryption: %s/public.asc\n' "`cat baseurl.txt`" >> $@ + printf 'Encryption: %s/$(PUBURL)\n' "`cat baseurl.txt`" >> $@ printf 'Preferred-Languages: en, pt, fr, eo, es\n' >> $@ src/sources.txt: @@ -230,7 +273,20 @@ sources.txt install.txt: -check-unit: +.SUFFIXES: .links-check-internal +sources.links-check-internal = $(sources.adoc:.adoc=.links-check-internal) +$(sources.links-check-internal): $(sources.html) + grep '^link:' $*.links | cut -d: -f2- | xargs -tI% test -e $(*D)/% + +check-internal: $(sources.links-check-internal) + + +check-external: + + +check-links: check-internal check-external + +check-unit: check-links integration-tests = \ @@ -80,6 +80,27 @@ src/content/incidents/index.snippets.gz: src/content/incidents/index.snippets src/content/blog/feed.xml.gz: src/content/blog/feed.xml src/content/incidents/feed.xml.gz: src/content/incidents/feed.xml +src/content/about.links-check-internal: src/content/about.links +src/content/index.links-check-internal: src/content/index.links +src/content/pricing.links-check-internal: src/content/pricing.links +src/content/privacy.links-check-internal: src/content/privacy.links +src/content/terms.links-check-internal: src/content/terms.links +src/content/blog/1970/01/01/launch.links-check-internal: src/content/blog/1970/01/01/launch.links +src/content/blog/2000/01/01/feature-ann.links-check-internal: src/content/blog/2000/01/01/feature-ann.links +src/content/incidents/2000/01/01/service-start.links-check-internal: src/content/incidents/2000/01/01/service-start.links +src/content/blog/index.links-check-internal: src/content/blog/index.links +src/content/incidents/index.links-check-internal: src/content/incidents/index.links +src/content/about.caslinks: src/content/about.links +src/content/index.caslinks: src/content/index.links +src/content/pricing.caslinks: src/content/pricing.links +src/content/privacy.caslinks: src/content/privacy.links +src/content/terms.caslinks: src/content/terms.links +src/content/blog/1970/01/01/launch.caslinks: src/content/blog/1970/01/01/launch.links +src/content/blog/2000/01/01/feature-ann.caslinks: src/content/blog/2000/01/01/feature-ann.links +src/content/incidents/2000/01/01/service-start.caslinks: src/content/incidents/2000/01/01/service-start.links +src/content/blog/index.caslinks: src/content/blog/index.links +src/content/incidents/index.caslinks: src/content/incidents/index.links + src/content/blog/1970/01/01/launch.feedentry: src/content/blog/1970/01/01/launch.conf src/content/blog/1970/01/01/launch.htmlbody src/content/blog/2000/01/01/feature-ann.feedentry: src/content/blog/2000/01/01/feature-ann.conf src/content/blog/2000/01/01/feature-ann.htmlbody src/content/incidents/2000/01/01/service-start.feedentry: src/content/incidents/2000/01/01/service-start.conf src/content/incidents/2000/01/01/service-start.htmlbody @@ -1,4 +1,5 @@ { + "description": "Landing page for Papo website (papo.im).", "baseurl": "https://papo.im", "email": "support@papo.im" } @@ -53,6 +53,10 @@ files | sed 's/^\(.*\)\.adoc$/\1.snippets.gz:\t\1.snippets/' listings | sed 's|^\(.*\)/index\.adoc$|\1/feed.xml.gz:\t\1/feed.xml|' printf '\n' +files | sed 's/^\(.*\)\.adoc$/\1.links-check-internal:\t\1.links/' +files | sed 's/^\(.*\)\.adoc$/\1.caslinks:\t\1.links/' +printf '\n' + articles | sed 's/^\(.*\)\.adoc$/\1.feedentry:\t\1.conf\t\1.htmlbody/' articles | sed 's/^\(.*\)\.adoc$/\1.sortdata:\t\1.conf/' printf '\n' diff --git a/src/content/favicon.ico b/src/content/favicon.ico Binary files differnew file mode 100644 index 0000000..27e23c2 --- /dev/null +++ b/src/content/favicon.ico diff --git a/src/base.conf b/src/static.conf index 22358f0..f2ec25f 100644 --- a/src/base.conf +++ b/src/static.conf @@ -1,10 +1,7 @@ export root_dir=src/content export header_links=src/headers.txt -export url_pre='https://papo.im' -export email='info@papo.im' export list_addr='~euandreh/papoim@lists.sr.ht' export discussions_url_prefix='https://lists.sr.ht/~euandreh/papoim?search=' -export sourcecode_url='https://papo.im/git/papo.im' export sourcecode_url_prefix="$sourcecode_url/tree" export author='papo.im' export site_name='Papo' |