6
6
# This script must be run in the top plplot source directory as:
8
8
# scripts/htdocs-gen_plot-examples.sh
10
# The tarball will be copied to SourceForge and unpacked at the www area.
10
# The tarball will be copied to SourceForge and unpacked at the www area.
11
11
# If your user name (as given by the environment variable USER) is different
12
12
# as that at SF, then launch the script like this:
14
14
# WWW_USER=joeplplotter scripts/htdocs-gen_plot-examples.sh
16
# It is also possible to override the variables WWW_GROUP, WWW_HOST,
17
# and WWW_DIR in the same way as with WWW_USER in the example above.
16
19
# To avoid rebuild launch it like this:
17
20
# build=false scripts/htdocs-gen_plot-examples.sh
28
31
./configure --disable-static --enable-dyndrivers --prefix=/tmp/plplot \
29
32
--disable-cxx --disable-python --disable-java --disable-itcl \
30
--disable-octave --enable-f77
33
--disable-octave --enable-f77 --enable-psttf --enable-psttfc
43
46
cp examples/c/lena.pgm .
45
48
EXDIR=htdocs/examples-data
47
for exe in 01 02 03 04 05 06 07 08 09 10 11 12 13 15 16 18 19 20 21 22; do
49
echo Working in example ${exe}
49
TTFDIR=/usr/share/fonts/truetype
51
for exe in 01 02 03 04 05 06 07 08 09 10 11 12 13 15 16 18 19 20 21 22 23 24 25; do
53
echo Working on example ${exe}
51
55
# generate standard and preview size images
52
examples/c/x${exe}c -dev png -o x${exe} -fam -fflen 2;
53
examples/c/x${exe}c -dev png -o prev-x${exe} -fam -fflen 2 -geometry 200x150;
56
if test $exe != 24 ; then
57
if test $exe = 02 ; then
62
examples/c/x${exe}c -dev png -drvopt text,smooth=$SMOOTH \
63
-o x${exe} -fam -fflen 2;
64
examples/c/x${exe}c -dev png -drvopt text,smooth=$SMOOTH \
65
-o prev-x${exe} -fam -fflen 2 -geometry 200x150;
67
# Temporary workaround for CTL problem with -dev png
68
PLPLOT_FREETYPE_SANS_FONT=$TTFDIR/arphic/bkai00mp.ttf \
69
PLPLOT_FREETYPE_SERIF_FONT=$TTFDIR/freefont/FreeSerif.ttf \
70
PLPLOT_FREETYPE_MONO_FONT=$TTFDIR/ttf-indic-fonts/lohit_hi.ttf \
71
PLPLOT_FREETYPE_SCRIPT_FONT=$TTFDIR/unfonts/UnBatang.ttf \
72
PLPLOT_FREETYPE_SYMBOL_FONT=$TTFDIR/ttf-bangla-fonts/JamrulNormal.ttf \
73
examples/c/x24c -dev psttfc -o test.ps
74
convert -rotate 90 test.ps -geometry 800x600 x24.01.png
75
convert -rotate 90 test.ps -geometry 200x150 prev-x24.01.png
77
# convert command needs the png suffix, but now take it off to
78
# be consistent with script below which puts it back on again.
80
mv prev-x24.01.png prev-x24.01
55
83
# give png extension
56
84
for i in `ls x${exe}.?? prev-x${exe}.??`; do
60
88
# move to www directory.
61
echo populatting www directory demo${exe}
89
echo populating www directory demo${exe}
62
90
mkdir -p $EXDIR/demo${exe}
63
91
mv *${exe}.??.png $EXDIR/demo${exe}/
64
cp examples/c/x${exe}c.c examples/tcl/x${exe}.tcl \
65
examples/java/x${exe}.java examples/f77/x${exe}f.f \
66
bindings/octave/demos/x${exe}c.m examples/python/xw${exe}.py \
67
examples/c++/x${exe}.cc examples/perl/x${exe}.pl \
92
for f in examples/c/x${exe}c.c examples/tcl/x${exe}.tcl \
93
examples/java/x${exe}.java examples/f77/x${exe}f.f \
94
bindings/octave/demos/x${exe}c.m \
95
examples/python/xw${exe}.py examples/c++/x${exe}.cc \
96
examples/perl/x${exe}.pl ; do
98
cp $f $EXDIR/demo${exe}
100
echo Example `basename $f` is not yet available \
101
> $EXDIR/demo${exe}/`basename $f`
70
# rename executables, to avoid browsers trying to execute files instead of showing them.
105
# rename executables, to avoid browsers trying to execute files
106
# instead of showing them.
71
107
(cd htdocs/examples-data/demo${exe};
72
108
for j in *.c *.cc *.f *.m *.tcl *.java *.py *.pl; do
88
124
# Transfer the tarball to Sourceforge and unpack it, such that the files will
89
125
# appear in the PLplot web site
91
WWW_HOST=${WWW_USER:+$WWW_USER@}shell.sf.net
92
WWW_DIR=/home/groups/p/pl/plplot
127
WWW_GROUP=${WWW_GROUP:-plplot}
128
WWW_HOST=${WWW_HOST:-${WWW_USER:+$WWW_USER@}shell.sf.net}
129
WWW_DIR=${WWW_DIR:-/home/groups/p/pl/plplot}
131
echo Removing remote examples directory
132
ssh $WWW_HOST rm -rf $WWW_DIR/$EXDIR
94
133
echo Copying the tarball to WWW site
95
134
scp $TARBALL $WWW_HOST:$WWW_DIR
96
135
echo Changing its permission to allow group access
97
136
ssh $WWW_HOST chmod g=u $WWW_DIR/$TARBALL
98
137
echo Unpacking the remote tarball
99
138
ssh $WWW_HOST tar -x -z -C $WWW_DIR -f $WWW_DIR/$TARBALL
100
echo Changing its group permissions of the remote demo direcotry
139
echo Changing group of the remote examples directory
140
ssh $WWW_HOST chgrp -R $WWW_GROUP $WWW_DIR/$EXDIR
141
echo Changing group permissions of the remote examples directory
101
142
ssh $WWW_HOST chmod -R g=u $WWW_DIR/$EXDIR
102
143
echo Removing the remote tarball
103
144
ssh $WWW_HOST rm -f $WWW_DIR/$TARBALL