2015-07-21 09:21:13 +02:00
|
|
|
# In order to build a copy of Oddmuse with all the version numbers, use:
|
|
|
|
|
# make build. This creates modified copies of the files in the build
|
|
|
|
|
# subdirectory.
|
2003-03-27 23:38:22 +00:00
|
|
|
|
2012-04-24 00:49:27 +02:00
|
|
|
VERSION_NO=$(shell git describe --tags)
|
2021-08-08 09:10:38 +02:00
|
|
|
TRANSLATIONS=$(wildcard modules/translations/*-utf8.pl)
|
2018-11-21 10:11:48 +01:00
|
|
|
MODULES=$(sort $(wildcard modules/*.pl))
|
2012-07-18 18:34:57 +02:00
|
|
|
BUILD=build/wiki.pl $(foreach file, $(notdir $(MODULES)) $(notdir $(TRANSLATIONS)), build/$(file))
|
|
|
|
|
|
|
|
|
|
# PREPARE/BUILD: this creates copies of wiki.pl and all the modules
|
|
|
|
|
# and translations in the build subdirectory. These copies all contain
|
|
|
|
|
# a reference to the revision they were created from (git describe
|
|
|
|
|
# --tags).
|
|
|
|
|
|
|
|
|
|
prepare: build $(BUILD)
|
|
|
|
|
|
|
|
|
|
build:
|
|
|
|
|
mkdir -p build
|
|
|
|
|
|
2015-04-03 09:21:37 +02:00
|
|
|
clean:
|
|
|
|
|
rm -rf build
|
2015-12-19 11:53:12 +01:00
|
|
|
prove t/setup.pl
|
|
|
|
|
|
|
|
|
|
release:
|
2016-07-06 18:14:47 +02:00
|
|
|
perl stuff/release ~/oddmuse.org/releases 2.3.3
|
2015-04-03 09:21:37 +02:00
|
|
|
|
2012-07-18 18:34:57 +02:00
|
|
|
build/wiki.pl: wiki.pl
|
2018-08-06 12:07:18 +02:00
|
|
|
perl -lne "s/(\\\$$q->a\(\{-href=>'https:\/\/www.oddmuse.org\/'\}, 'Oddmuse'\))/\\\$$q->a({-href=>'https:\/\/alexschroeder.ch\/cgit\/oddmuse\/tag\/?id=$(VERSION_NO)'}, 'wiki.pl') . ' ($(VERSION_NO)), see ' . \$$1/; print" < $< > $@
|
2012-07-18 18:34:57 +02:00
|
|
|
|
|
|
|
|
build/%-utf8.pl: modules/translations/%-utf8.pl
|
2014-08-24 22:20:50 +02:00
|
|
|
perl -lne "s/(AddModuleDescription\('[^']+', '[^']+')\)/\$$1, 'translations\/', '$(VERSION_NO)')/; print" < $< > $@
|
2012-07-18 18:34:57 +02:00
|
|
|
|
2015-04-03 09:21:37 +02:00
|
|
|
build/national-%.pl: modules/translations/national-%.pl
|
|
|
|
|
perl -lne "s/(AddModuleDescription\('[^']+', '[^']+')\)/\$$1, 'translations\/', '$(VERSION_NO)')/; print" < $< > $@
|
|
|
|
|
|
|
|
|
|
build/month-names-%.pl: modules/translations/month-names-%.pl
|
|
|
|
|
perl -lne "s/(AddModuleDescription\('[^']+', '[^']+')\)/\$$1, 'translations\/', '$(VERSION_NO)')/; print" < $< > $@
|
|
|
|
|
|
2017-04-11 12:50:09 +02:00
|
|
|
# from: https://git.savannah.gnu.org/cgit/oddmuse.git/tree/modules/namespaces.pl
|
|
|
|
|
# to: https://git.savannah.gnu.org/cgit/oddmuse.git/tree/modules/namespaces.pl?id=2.1-11-gd4f1e27
|
2012-07-18 18:34:57 +02:00
|
|
|
|
|
|
|
|
build/%.pl: modules/%.pl
|
2014-08-24 22:20:50 +02:00
|
|
|
perl -lne "s/(AddModuleDescription\('[^']+', '[^']+')\)/\$$1, undef, '$(VERSION_NO)')/; print" < $< > $@
|
2012-07-18 18:34:57 +02:00
|
|
|
|
2015-09-30 17:35:02 +02:00
|
|
|
modules/translations/new-utf8.pl: wiki.pl $(MODULES)
|
|
|
|
|
cp $@ $@-old
|
|
|
|
|
perl stuff/oddtrans -l $@-old wiki.pl $(MODULES) > $@
|
|
|
|
|
rm -f $@-old
|
|
|
|
|
|
2014-08-24 12:31:15 +02:00
|
|
|
translations: $(TRANSLATIONS)
|
|
|
|
|
for f in $^; do \
|
|
|
|
|
echo updating $$f...; \
|
2015-09-30 17:35:02 +02:00
|
|
|
perl stuff/oddtrans -l $$f wiki.pl $(MODULES) > $$f-new && mv $$f-new $$f; \
|
2014-08-24 12:31:15 +02:00
|
|
|
done
|
2012-07-18 18:34:57 +02:00
|
|
|
|
2015-10-12 15:13:22 +02:00
|
|
|
# Running four jobs in parallel, but clean up data directories without
|
|
|
|
|
# race conditions!
|
|
|
|
|
|
2015-10-13 03:21:11 +03:00
|
|
|
jobs ?= 4
|
2015-05-01 19:33:14 +02:00
|
|
|
test:
|
2015-10-12 15:13:22 +02:00
|
|
|
prove t/setup.pl
|
2017-11-03 17:51:30 +01:00
|
|
|
prove --jobs=$(jobs) --state=slow,save t
|
2019-07-16 23:02:10 +02:00
|
|
|
|
|
|
|
|
# Spin up a quick test
|
|
|
|
|
|
|
|
|
|
development:
|
2020-10-25 10:31:36 +01:00
|
|
|
@if grep --quiet 'ScriptName = "http://127.0.0.1:8080";' test-data/config; then \
|
|
|
|
|
echo Not overwriting \$$ScriptName in test-data/config; \
|
|
|
|
|
else \
|
|
|
|
|
echo '$ScriptName = "http://127.0.0.1:8080";' >> test-data/config; \
|
|
|
|
|
fi
|
2019-07-16 23:02:10 +02:00
|
|
|
morbo --listen http://*:8080 \
|
2020-10-25 10:31:36 +01:00
|
|
|
--watch wiki.pl --watch test-data/config --watch test-data/modules/ \
|
|
|
|
|
stuff/mojolicious-app.pl
|
2020-06-15 17:18:01 +02:00
|
|
|
|
|
|
|
|
%.pem:
|
|
|
|
|
openssl req -new -x509 -days 365 -nodes -out cert.pem -keyout key.pem
|
|
|
|
|
|
|
|
|
|
gemini: cert.pem key.pem
|
|
|
|
|
perl stuff/gemini-server.pl --wiki_cert_file=cert.pem --wiki_key_file=key.pem
|