* modify wikitemplate script to add the version number in download url
[dejavu.git] / dejavu-fonts / scripts / wikidownloadtemplate.sh
blob5a3d126cee74d1d524cdf3a185bb964ba04bb493
1 #!/bin/bash
3 # call this script from the main directory like scripts/wikidownloadtemplate.sh
5 # use the output of this script to update http://dejavu.sourceforge.net/wiki/index.php?title=Download
8 # assumes that version in Makefile is correct (which it should be or something was done wrong)
9 VERSION=`grep "VERSION = " Makefile -m1 | cut -d' ' -f3`
11 # directory where to look for the files
12 DIRECTORY=`grep "DISTDIR = " Makefile -m1 | cut -d' ' -f3`
15 function makeentry
16 # usage: makeentry filename description
18 file=$DIRECTORY/$1
20 if [ -f $file ]; then
22 echo "{{SFFile|"
24 echo " name= $1"
25 echo "| version= ${VERSION}"
26 echo "| size= `wc -c $file | cut -f1 -d' '`"
27 echo "| desc= $2"
28 echo "| md5= `md5sum $file | cut -f1 -d' '`"
29 echo "| sha256= `sha256sum $file | cut -f1 -d' '`"
31 echo "}}"
33 else
35 echo "Error: File '$file' does not exist"
41 makeentry "dejavu-fonts-ttf-${VERSION}.tar.bz2" "TrueType fonts packed as [[Wikipedia:tar.bz2|tar.bz2]] archive"
43 makeentry "dejavu-fonts-ttf-${VERSION}.zip" "TrueType fonts packed as [[Wikipedia:ZIP (file format)|zip]] archive"
45 makeentry "dejavu-fonts-${VERSION}.tar.bz2" "Fonts in source form (SFD) for [[FontForge]]"
47 makeentry "dejavu-lgc-fonts-ttf-${VERSION}.tar.bz2" "DejaVu LGC (Latin, Greek, Cyrillic) TrueType fonts packed as [[Wikipedia:tar.bz2|tar.bz2]] archive"
49 makeentry "dejavu-lgc-fonts-ttf-${VERSION}.zip" "DejaVu LGC (Latin, Greek, Cyrillic) TrueType fonts packed as [[Wikipedia:ZIP (file format)|zip]] archive"
51 makeentry "dejavu-sans-ttf-${VERSION}.zip" "This package only includes DejaVuSans.ttf in a [[Wikipedia:ZIP (file format)|zip]] archive"