~ubuntu-branches/ubuntu/intrepid/plplot/intrepid

« back to all changes in this revision

Viewing changes to scripts/htdocs-gen_plot-examples.sh

  • Committer: Bazaar Package Importer
  • Author(s): Rafael Laboissiere
  • Date: 2006-11-04 10:19:34 UTC
  • mfrom: (2.1.8 edgy)
  • Revision ID: james.westby@ubuntu.com-20061104101934-mlirvdg4gpwi6i5q
Tags: 5.6.1-10
* Orphaning the package
* debian/control: Changed the maintainer to the Debian QA Group

Show diffs side-by-side

added added

removed removed

Lines of Context:
6
6
# This script must be run in the top plplot source directory as:
7
7
#
8
8
#     scripts/htdocs-gen_plot-examples.sh
9
 
10
 
# The tarball will be copied to SourceForge and unpacked at the www area.  
 
9
#
 
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:
13
 
#     
 
13
#
14
14
#     WWW_USER=joeplplotter scripts/htdocs-gen_plot-examples.sh
15
15
#
 
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.
 
18
#
16
19
# To avoid rebuild launch it like this:
17
20
#     build=false scripts/htdocs-gen_plot-examples.sh
18
21
 
27
30
 
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
31
34
 
32
35
    make
33
36
    make install
43
46
cp examples/c/lena.pgm .
44
47
 
45
48
EXDIR=htdocs/examples-data
46
 
 
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
48
 
 
49
 
    echo Working in example ${exe}
 
49
TTFDIR=/usr/share/fonts/truetype
 
50
 
 
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
 
52
 
 
53
    echo Working on example ${exe}
50
54
 
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
 
58
            SMOOTH=0
 
59
        else
 
60
            SMOOTH=1
 
61
        fi
 
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;
 
66
    else
 
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
 
76
      rm test.ps
 
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.
 
79
      mv x24.01.png x24.01
 
80
      mv prev-x24.01.png prev-x24.01
 
81
    fi
54
82
 
55
83
    # give png extension
56
84
    for i in `ls x${exe}.?? prev-x${exe}.??`; do
58
86
    done;
59
87
 
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            \
68
 
       $EXDIR/demo${exe}
 
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
 
97
        if test -f $f ; then
 
98
            cp $f $EXDIR/demo${exe}
 
99
        else
 
100
            echo Example `basename $f` is not yet available \
 
101
                > $EXDIR/demo${exe}/`basename $f`
 
102
        fi
 
103
    done
69
104
 
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
73
109
            mv $j $j-
74
110
    done
75
 
    )  
 
111
    )
76
112
 
77
113
done
78
114
 
88
124
# Transfer the tarball to Sourceforge and unpack it, such that the files will
89
125
# appear in the PLplot web site
90
126
 
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}
93
130
 
 
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
 
145