LANGS := $(shell ls po/*/mwcc.po|cut -d/ -f2)
+DESTDIR =
+
+docdir = /usr/share/doc/madewithcc
+
+install = install
+
all: pdf epub
+install:
+ $(install) *.pdf *.epub $(DESTDIR)/$(docdir)
+
distclean: clean
rm -f $(SOURCE).md
clean:
pot: po/mwcc.pot po/*/mwcc.po
po/mwcc.pot: $(SOURCE).xml
TEMP=`tempfile -p mwcc` && \
- po4a-gettextize -f docbook -m $(SOURCE).xml -p $$TEMP -M utf-8 --package-name 'Made with Creative Commons' --package-version $(VERSION) && \
+ po4a-gettextize -f docbook -m $(SOURCE).xml -p $$TEMP -M utf-8 \
+ -o nodefault="<imageobject> <copyright> <publisher> <address> <city>" \
+ -o untranslated="<imageobject>" \
+ -o translated='<copyright> <publisher><publisername> <publisher><address><city>' \
+ --package-name 'Made with Creative Commons' \
+ --package-version $(VERSION) && \
echo '# MADE WITH CREATIVE COMMONS' > $@ && \
echo '# Copyright (C) 2017 by Creative Commons.' >> $@ && \
echo '# This file is published under a Creative Commons Attribution-ShareAlike license (CC BY-SA), version 4.0' >> $@ && \
for LANG in $(LANGS); do \
$(MAKE) $(SOURCE).$$LANG.pdf ; \
done
-%.pdf: %.tex
- pdflatex $^
- pdflatex $^
+DBLATEX_OPTS = -T simple -t pdf -b xetex -p extra/pdf.xsl
+%.pdf: %.xml
+ dblatex $(DBLATEX_OPTS) $^
epub: $(SOURCE).epub
for LANG in $(LANGS); do \
$(MAKE) $(SOURCE).$$LANG.epub ; \
+ flightcrew-cli $(SOURCE).$$LANG.epub || exit 1 ; \
done
%.epub: %.xml
dbtoepub $^
-DBLATEX_OPTS = -T simple -t tex -b xetex -p extra/pdf.xsl
-# Replace Unicode Hair Space (U+200A) with space, as   is not
-# handled by LaTeX/dblatex, see <URL: https://bugs.debian.org/889603 >.
-%.tex: %.xml
- dblatex $(DBLATEX_OPTS) $^
- perl -p -i -e 's/ / /g' $@
+# Useful for spell checking the text
+%.txt: %.xml
+ xmlto txt $<
XMLLINTOPTS = --nonet --noout --xinclude --postvalid
lint: $(SOURCE).xml
check-urls:
retval=0; for u in $$(perl -n -e'/<ulink url="(.+)"\/>/ && print "$$1\n"' MadewithCreativeCommonsmostup-to-dateversion.xml | sort -u); do \
- HEAD -H "User-Agent: Docbook XML URL checker" "$$u" > /dev/null || echo "error fetching $$u"; retval=1; \
+ GET -H "User-Agent: Docbook XML URL checker" "$$u" > /dev/null || echo "error fetching $$u"; retval=1; \
done; exit $$retval
# Experimental build rule to test Docbook XSL + FOP processor