Makefile
author František Kučera <franta-hg@frantovo.cz>
Wed, 25 Sep 2019 23:59:20 +0200
branchv_0
changeset 36 9e5c3383ba50
parent 33 d6cb9fe26aed
child 47 7e665331bc32
permissions -rw-r--r--
add PDF output (using LibreOffice)
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
15
96fc2f42b1e1 conversion to XML format, XSD, XSLT
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
     1
# Sane Software Manifesto helper tools
96fc2f42b1e1 conversion to XML format, XSD, XSLT
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
     2
# Copyright © 2019 František Kučera (Frantovo.cz, GlobalCode.info)
96fc2f42b1e1 conversion to XML format, XSD, XSLT
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
     3
#
96fc2f42b1e1 conversion to XML format, XSD, XSLT
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
     4
# This program is free software: you can redistribute it and/or modify
96fc2f42b1e1 conversion to XML format, XSD, XSLT
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
     5
# it under the terms of the GNU General Public License as published by
96fc2f42b1e1 conversion to XML format, XSD, XSLT
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
     6
# the Free Software Foundation, version 3.
96fc2f42b1e1 conversion to XML format, XSD, XSLT
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
     7
#
96fc2f42b1e1 conversion to XML format, XSD, XSLT
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
     8
# This program is distributed in the hope that it will be useful,
96fc2f42b1e1 conversion to XML format, XSD, XSLT
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
     9
# but WITHOUT ANY WARRANTY; without even the implied warranty of
96fc2f42b1e1 conversion to XML format, XSD, XSLT
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    10
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
96fc2f42b1e1 conversion to XML format, XSD, XSLT
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    11
# GNU General Public License for more details.
96fc2f42b1e1 conversion to XML format, XSD, XSLT
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    12
#
96fc2f42b1e1 conversion to XML format, XSD, XSLT
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    13
# You should have received a copy of the GNU General Public License
96fc2f42b1e1 conversion to XML format, XSD, XSLT
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    14
# along with this program.  If not, see <https://www.gnu.org/licenses/>.
96fc2f42b1e1 conversion to XML format, XSD, XSLT
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    15
36
9e5c3383ba50 add PDF output (using LibreOffice)
František Kučera <franta-hg@frantovo.cz>
parents: 33
diff changeset
    16
all: validate xhtml txt pdf logo-png statistics
25
8da11cce2c98 add TXT output + change directory structure
František Kučera <franta-hg@frantovo.cz>
parents: 20
diff changeset
    17
15
96fc2f42b1e1 conversion to XML format, XSD, XSLT
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    18
validate:
25
8da11cce2c98 add TXT output + change directory structure
František Kučera <franta-hg@frantovo.cz>
parents: 20
diff changeset
    19
	xmllint --noout --schema schema/ssm.xsd text/ssm.en.xml
8da11cce2c98 add TXT output + change directory structure
František Kučera <franta-hg@frantovo.cz>
parents: 20
diff changeset
    20
15
96fc2f42b1e1 conversion to XML format, XSD, XSLT
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    21
xhtml:
25
8da11cce2c98 add TXT output + change directory structure
František Kučera <franta-hg@frantovo.cz>
parents: 20
diff changeset
    22
	mkdir -p build
8da11cce2c98 add TXT output + change directory structure
František Kučera <franta-hg@frantovo.cz>
parents: 20
diff changeset
    23
	xsltproc --output build/index.xhtml --nonet templates/ssm.xhtml.xsl text/ssm.en.xml
8da11cce2c98 add TXT output + change directory structure
František Kučera <franta-hg@frantovo.cz>
parents: 20
diff changeset
    24
	cp templates/*.css build
30
841bec790da8 add Sawasdee.woff web font
František Kučera <franta-hg@frantovo.cz>
parents: 27
diff changeset
    25
	cp templates/*.woff build
25
8da11cce2c98 add TXT output + change directory structure
František Kučera <franta-hg@frantovo.cz>
parents: 20
diff changeset
    26
36
9e5c3383ba50 add PDF output (using LibreOffice)
František Kučera <franta-hg@frantovo.cz>
parents: 33
diff changeset
    27
pdf:
9e5c3383ba50 add PDF output (using LibreOffice)
František Kučera <franta-hg@frantovo.cz>
parents: 33
diff changeset
    28
	mkdir -p build
9e5c3383ba50 add PDF output (using LibreOffice)
František Kučera <franta-hg@frantovo.cz>
parents: 33
diff changeset
    29
	xsltproc --output build/ssm.en.fodt --nonet templates/ssm.odt.xsl text/ssm.en.xml
9e5c3383ba50 add PDF output (using LibreOffice)
František Kučera <franta-hg@frantovo.cz>
parents: 33
diff changeset
    30
	libreoffice --convert-to pdf --outdir build build/ssm.en.fodt
9e5c3383ba50 add PDF output (using LibreOffice)
František Kučera <franta-hg@frantovo.cz>
parents: 33
diff changeset
    31
25
8da11cce2c98 add TXT output + change directory structure
František Kučera <franta-hg@frantovo.cz>
parents: 20
diff changeset
    32
# TODO: better line wrapping
8da11cce2c98 add TXT output + change directory structure
František Kučera <franta-hg@frantovo.cz>
parents: 20
diff changeset
    33
txt:
8da11cce2c98 add TXT output + change directory structure
František Kučera <franta-hg@frantovo.cz>
parents: 20
diff changeset
    34
	mkdir -p build
8da11cce2c98 add TXT output + change directory structure
František Kučera <franta-hg@frantovo.cz>
parents: 20
diff changeset
    35
	xsltproc --nonet templates/ssm.txt.xsl text/ssm.en.xml | fmt -w 74 -s | sed -E 's/(  +)([^- ])/\1  \2/g' > build/ssm.en.txt
15
96fc2f42b1e1 conversion to XML format, XSD, XSLT
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    36
33
d6cb9fe26aed logo: the first draft
František Kučera <franta-hg@frantovo.cz>
parents: 30
diff changeset
    37
logo-png:
d6cb9fe26aed logo: the first draft
František Kučera <franta-hg@frantovo.cz>
parents: 30
diff changeset
    38
	mkdir -p build
d6cb9fe26aed logo: the first draft
František Kučera <franta-hg@frantovo.cz>
parents: 30
diff changeset
    39
	inkscape -z -e build/sane-software-logo-circle.png logo/sane-software-logo-circle.svg
d6cb9fe26aed logo: the first draft
František Kučera <franta-hg@frantovo.cz>
parents: 30
diff changeset
    40
	inkscape -z -e build/sane-software-logo-rectangle.png logo/sane-software-logo-rectangle.svg
d6cb9fe26aed logo: the first draft
František Kučera <franta-hg@frantovo.cz>
parents: 30
diff changeset
    41
15
96fc2f42b1e1 conversion to XML format, XSD, XSLT
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    42
clean:
25
8da11cce2c98 add TXT output + change directory structure
František Kučera <franta-hg@frantovo.cz>
parents: 20
diff changeset
    43
	rm -rf build
18
f315b3d27a9d make: publish
František Kučera <franta-hg@frantovo.cz>
parents: 15
diff changeset
    44
f315b3d27a9d make: publish
František Kučera <franta-hg@frantovo.cz>
parents: 15
diff changeset
    45
publish:
25
8da11cce2c98 add TXT output + change directory structure
František Kučera <franta-hg@frantovo.cz>
parents: 20
diff changeset
    46
	scp build/* globalcode.info:/var/www/sane-software.globalcode.info/v_0/
20
fb939d9baaf4 make: statistics (just for fun)
František Kučera <franta-hg@frantovo.cz>
parents: 18
diff changeset
    47
fb939d9baaf4 make: statistics (just for fun)
František Kučera <franta-hg@frantovo.cz>
parents: 18
diff changeset
    48
fb939d9baaf4 make: statistics (just for fun)
František Kučera <franta-hg@frantovo.cz>
parents: 18
diff changeset
    49
# Prints a table with number of items in particular chapters:
fb939d9baaf4 make: statistics (just for fun)
František Kučera <franta-hg@frantovo.cz>
parents: 18
diff changeset
    50
statistics:
27
413a00a9cde7 merge two sections into Semantic versioning and upgrades
František Kučera <franta-hg@frantovo.cz>
parents: 25
diff changeset
    51
	cat text/ssm.en.xml \
20
fb939d9baaf4 make: statistics (just for fun)
František Kučera <franta-hg@frantovo.cz>
parents: 18
diff changeset
    52
	    | relpipe-in-xmltable \
fb939d9baaf4 make: statistics (just for fun)
František Kučera <franta-hg@frantovo.cz>
parents: 18
diff changeset
    53
		--namespace "m" "tag:globalcode.info,2019:sane-software/manifesto" \
fb939d9baaf4 make: statistics (just for fun)
František Kučera <franta-hg@frantovo.cz>
parents: 18
diff changeset
    54
		--relation "chapter" \
fb939d9baaf4 make: statistics (just for fun)
František Kučera <franta-hg@frantovo.cz>
parents: 18
diff changeset
    55
		    --records "//m:chapter" \
fb939d9baaf4 make: statistics (just for fun)
František Kučera <franta-hg@frantovo.cz>
parents: 18
diff changeset
    56
		    --attribute "name" string "m:name" \
fb939d9baaf4 make: statistics (just for fun)
František Kučera <franta-hg@frantovo.cz>
parents: 18
diff changeset
    57
		    --attribute "item_count" integer "count(descendant::m:item)" \
fb939d9baaf4 make: statistics (just for fun)
František Kučera <franta-hg@frantovo.cz>
parents: 18
diff changeset
    58
	    | relpipe-out-tabular
fb939d9baaf4 make: statistics (just for fun)
František Kučera <franta-hg@frantovo.cz>
parents: 18
diff changeset
    59
# try also relpipe-out-gui to get the chart