]> www.wagner.pp.ru Git - fiction/Kate-the-Empress.git/blobdiff - Makefile
Typo fixes
[fiction/Kate-the-Empress.git] / Makefile
index e8fe561bfd5d2f1c5d3d110ce4ccbc7a724b666f..2b482bc5000570ee53672dac45bd541f7e63666b 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,4 +1,10 @@
-all: Kate-the-Empress.pdf Kate-the-Empress.html Kate-the-Empress.epub
+SRC_URL=http://www.wagner.pp.ru/~vitus/fiction
+UPLOAD_URL=https://www.wagner.pp.ru/dav/vitus/fiction
+all: Kate-the-Empress.pdf Kate-the-Empress.html Kate-the-Empress.epub Kate-the-Empress.fb2.zip
+
+publish: Kate-the-Empress.pdf Kate-the-Empress.html Kate-the-Empress.epub Kate-the-Empress.fb2.zip
+       for i in $^; do curl -n -T $$i $(UPLOAD_URL)/$$i || exit 1;done
+
 
 Kate-the-Empress.pdf: $(wildcard *.tex)
        pdflatex book
@@ -9,11 +15,22 @@ Kate-the-Empress.pdf: $(wildcard *.tex)
 Kate-the-Empress.html: onefile.tex
        pandoc  -t html  --toc  --standalone -o $@ $+
 
-Kate-the-Empress.epub: onefile.tex
-       pandoc  -t epub --standalone -o $@ $+
+Kate-the-Empress.epub: onefile.tex epub-metadata.xml
+       cat epub-metadata.xml > metadata-tmp.xml
+       echo "<dc:date>`date +%Y-%m-%d`</dc:date>">> metadata-tmp.xml
+       pandoc  -t epub --epub-metadata=metadata-tmp.xml --standalone -o $@ $+
+
+Kate-the-Empress.fb2.zip: Kate-the-Empress.fb2
+       zip Kate-the-Empress.fb2.zip Kate-the-Empress.fb2
+
+Kate-the-Empress.fb2: onefile.tex Tex2fb2 fb2meta.xml
+       ./Tex2fb2 fb2meta.xml onefile.tex >Kate-the-Empress.fb2
+
+fb2lint: Kate-the-Empress.fb2 $(wildcard *.xsd)
+       xmllint --schema FictionBook2.1.xsd Kate-the-Empress.fb2 >/dev/null 2>$@
 
 onefile.tex: joinfiles.awk $(wildcard *.tex)
-       awk -f joinfiles.awk book.tex >  $@
+       awk -f joinfiles.awk book.tex |sed -e 's!<<!«!g' -e 's!>>!»!g' >  $@
 
 clean:
-       rm -f onefile.tex book.log book.aux book.out book.toc
+       rm -f onefile.tex book.log book.aux book.out book.toc Kate-the-Empress.fb2 fb2lint