gitfile-info/build

51 lines
2.6 KiB
Bash
Executable File

#!/bin/bash
echo "===================================================================" >> build.log
rm -v gitfile-info/gitfile-info.bib
echo "=+-Lauf vom `date +%Y-%m-%d:%H:%M:%S`----------------------------------+=" >> build.log
sty2dtx -O -c gitfile-info.sty -o gitfile-info/gitfile-info.sty >> build.log
echo "=+-sty2dtx abgeschlossen-----------------------------------------+=" >> build.log
cp -v gfi-run.py gitfile-info/
cp -v post-commit.py gitfile-info/
cp -v post-merge.py gitfile-info/
cp -v dokumentation.gfi gitfile-info/gitfile-info.gfi
sed "s/Version: [0-9].[0-9]*/Version: $1/1" README > /tmp/output.readme
sed "s/Last Change: [0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]/Last Change: `date +%Y-%m-%d`/1" /tmp/output.readme > output.readme
mv -v output.readme gitfile-info/README
echo "=+-Kopieren und Anpassen abgeschlossen---------------------------+=" >> build.log
cd gitfile-info
echo "=+-Packe DTX-----------------------------------------------------+=" >> build.log
../makedtx.pl -src "(.*)\.sty=>\1.sty" -doc ../dokumentation.tex \
-src "gfi-run.py=>gfi-run.py" -src "post-commit.py=>post-commit.py" -src "post-merge.py=>post-merge.py" \
-macrocode "gfi-run.py" -macrocode "post-commit.py" -macrocode "post-merge.py" \
-macrocode "gitfile-info.gfi" -setambles "gitfile-info.gfi=>\\nopreamble\\nopostamble"\
-src "gitfile-info.gfi=>gitfile-info.gfi" -comment "gitfile-info.gfi" \
-setambles "gfi-run.py=>\\nopreamble\\nopostamble" -setambles "post-commit.py=>\\nopreamble\\nopostamble" \
-setambles "post-merge.py=>\\nopreamble\\nopostamble" \
-comment "gfi-run.py" -comment "post-commit.py" -comment "post-merge.py" \
-date "`date +%Y-%m-%d:%H:%M:%S` -- Version $1" \
-author "André Hilbig, mail@andrehilbig.de" -codetitle "Code" gitfile-info
pdflatex gitfile-info.dtx
CHECKSUM=$(grep "The checksum should be" gitfile-info.log | grep -o "[0-9]*")
echo "The checksum is: $CHECKSUM"
sed -e s/CheckSum\{[0-9]*\}/CheckSum\{$CHECKSUM\}/1 gitfile-info.dtx > output.dtx
rm gitfile-info.dtx
mv output.dtx gitfile-info.dtx
latexmk -pdf gitfile-info.dtx
cd ..
mkdir -v gitfile-info_latest
cp -v gitfile-info/gitfile-info.dtx gitfile-info_latest/
cp -v gitfile-info/gitfile-info.ins gitfile-info_latest/
mkdir -v gitfile-info_latest/doc/
cp -v gitfile-info/README gitfile-info_latest/doc/
cp -v gitfile-info/gitfile-info.pdf gitfile-info_latest/doc/
cp -v gitfile-info/post-merge.py gitfile-info_latest/doc/
cp -v gitfile-info/post-commit.py gitfile-info_latest/doc/
cp -v gitfile-info/gfi-run.py gitfile-info_latest/doc/
mv gitfile-info_latest /tmp/gitfile-info
WD=`echo $PWD`
cd /tmp
zip -r gitfile-info_latest.zip gitfile-info
mv gitfile-info_latest.zip $WD
rm -rvf /tmp/gitfile-info