1
#! /bin/sh /usr/share/dpatch/dpatch-run
2
## 302-scripts-comply-with-FHS.dpatch by <kmccarty@debian.org>
4
## All lines beginning with `## DP:' are a description of the patch.
5
## DP: Put data files under @DATADIR@ and assume $CERN is @PREFIX@ by default
6
## DP: in scripts. (These values are filled in from add-ons/Makefile.)
7
## DP: Also some other improvements.
10
diff -urNad cernlib-2005.05.09.dfsg~/src/scripts/gxint cernlib-2005.05.09.dfsg/src/scripts/gxint
11
--- cernlib-2005.05.09.dfsg~/src/scripts/gxint 2005-04-18 11:41:16.000000000 -0400
12
+++ cernlib-2005.05.09.dfsg/src/scripts/gxint 2005-12-13 10:07:57.789716862 -0500
17
#*******************************************
20
#*******************************************
21
line="******************************************************"
24
-if [ $# -eq 0 ] ; then
28
GXINT [options] file(s)
30
on all systems. X11 is the default.
32
version of the program library to use. Possible values
33
- include pro ( default ), new and old.
34
+ include pro, new and old. This option only makes sense if you
35
+ have installed a non-Debian version of Cernlib. In that case
36
+ you must have defined the environment variable \$CERN.
38
- which version of geant to use. Current default is 315.
39
+ which version of geant to use. Current default is 321. This
40
+ also makes sense only if you have installed a non-Debian version
43
useful with the -d X11 option only. Specify the hostname
44
used for the display. Syntax identical to that of DISPLAY.
46
Do not immediately run GEANT, but produce an executable
47
file named outputfile.
49
- additional loader search path. Usefull if additional libraries
50
- are specified with -l option. This option may be repeated to
51
+ additional loader search path. Useful if additional libraries
52
+ are specified with -l option. This option may be repeated to
53
more than one pathname.
56
specify additional libraries. This option may be repeated to
58
-m do NOT use main program from cernlib area.
65
+if [ $# -eq 0 ] ; then
69
if [ -f /usr/bin/uname ] ; then
73
SHOPT="d:v:g:h:o:L:l:m"
75
# Check option set and give default values
76
if [ -f /bin/getopt -o -f /usr/bin/getopt ] ; then
77
set -- `getopt $SHOPT $*` ; cc=$?
78
if [ $cc -ne 0 ] ; then
87
-drv="/X11" ; ver="pro" ; OUT="${HOME}/GEANT$$"
89
+if [ -z "$TMPDIR" ] || [ "$TMPDIR" = "/tmp" ] ; then
92
+drv="/X11" ; ver="" ; OUT="$TMPDIR/GEANT$$"
97
- -d) drv="/$2"; shift ;;
98
+ -d) drv="/$2"; shift ;;
101
-h) DISPLAY=$2;export DISPLAY; shift ;;
102
-o) OUT=$2; norun="1"; shift ;;
103
- -L) userpath="$userpath -L$2"; shift ;;
104
- -l) userlibs="$userlibs -l$2"; shift ;;
105
+ -L) userpath="$userpath -L$2"; shift ;;
106
+ -l) userlibs="$userlibs -l$2"; shift ;;
109
+ --help|-\?) print_help ; exit 0 ;;
115
if [ $# -gt 0 ] ; then
119
echo "gxint_Warning: no user program specified"
124
-if [ -z "$CERN" ] ; then
125
- if [ ! -d /cern ]; then
126
- echo "gxint_Error: shell variable CERN must be set or /cern must exist"
129
- CERN="/cern" ; export CERN
131
+[ -z "$CERN" ] && export CERN="@PREFIX@"
133
if [ "$drv" = "/GKS" ] ; then
134
if [ -z "$GKSR" ] ; then
136
CLIB="geant${gvs} pawlib graflib$drv packlib mathlib"
138
[ -z "$_m" ] && gxint="${CERN}/${ver}/lib/gxint${gvs}.$_o"
139
+[ "$CERN" = "@PREFIX@" -a -z "$ver" ] && gxint=@DATADIR@/geant321/gxint.f
144
* gxint used : ${gxint:-user supplied}
148
-$LDN -o $OUT $gxint $pgm $userpath $userlibs `cernlib -v $ver $CLIB`; cc=$?
150
+[ -z "$ver" ] && verflag="" || verflag="-v"
151
+$LDN -o $OUT $gxint $pgm $userpath $userlibs `cernlib $verflag $ver $CLIB` ; \
154
[ $cc -ne 0 ] && exit $cc
156
diff -urNad cernlib-2005.05.09.dfsg~/src/scripts/paw cernlib-2005.05.09.dfsg/src/scripts/paw
157
--- cernlib-2005.05.09.dfsg~/src/scripts/paw 1995-02-07 04:54:06.000000000 -0500
158
+++ cernlib-2005.05.09.dfsg/src/scripts/paw 2005-12-13 10:10:17.850939931 -0500
162
[ "`uname -s`" = "DomainOS" ] && drv="GKS" || drv="X11"
163
- [ -z "$CERN" ] && CERN="/cern"
164
- [ -z "$CERN_LEVEL" ] && ver="pro" || ver="$CERN_LEVEL"
166
+ [ -z "$CERN" ] && CERN="@PREFIX@"
167
+ [ -z "$CERN_LEVEL" ] && ver="" || ver="$CERN_LEVEL"
168
+ [ -e "$CERN/$CERN_LEVEL/bin/pawX11" ] || drv="++" # use paw++ if no pawX11
171
-d) drv=$2 ; shift ;;
174
GDIR=$CERN/$ver/gksbin
176
- if [ "$drv" = "X11" -a -n "$hst" ] ; then
177
+ if [ \( "$drv" = "X11" -o "$drv" = "++" \) -a -n "$hst" ] ; then
178
nw=`echo $hst | awk -F: '{ print NF }'`
179
[ $nw -eq 1 ] && hst="$hst:0"
180
DISPLAY="$hst" ; export DISPLAY
182
- if [ "$ver" != "pro" ] ; then
183
+ if [ -n "$ver" ] ; then
185
echo " Calling $ver version of paw-$drv"
189
- [ ! -s paw.metafile ] && rm paw.metafile
190
+ if [ ! -x "$GDIR/paw$drv" ] ; then
191
+ echo " Error: PAW executable $GDIR/paw${drv} does not exist!"
194
+ "$GDIR/paw$drv" "$@"
195
+ [ ! -s paw.metafile ] && rm -f paw.metafile
196
+ [ ! -s PAW.METAFILE ] && rm -f PAW.METAFILE
198
+ # clean up comis temporary working directories if empty
199
+ [ "`(echo /tmp/comis*) 2> /dev/null`" = '/tmp/comis*' ] || \
200
+ rmdir /tmp/comis* > /dev/null 2>&1 || true
201
+ [ "`(echo "$TMPDIR"/comis*) 2> /dev/null`" = "$TMPDIR"/'comis*' ] || \
202
+ rmdir "$TMPDIR"/comis* > /dev/null 2>&1 || true