Mercurial > forge
annotate octinst.sh.in @ 2720:d0b400de8b3f octave-forge
Include special casing of active nav-link, like for octave page (Soren want to change the colour scheme?)
author | adb014 |
---|---|
date | Tue, 17 Oct 2006 22:54:51 +0000 |
parents | 250c9ad7c68e |
children | 9df9c6d6c5a0 |
rev | line source |
---|---|
0 | 1 #! /bin/sh |
2 | |
1019 | 3 # octinst.sh source mpath opath xpath [altmpath altopath] |
0 | 4 |
5 # Copies all m-files and oct-files from the source directory to the | |
6 # mpath and opath respectively. Preserves links. Files in | |
7 # source/data are copied to mpath. Files in the source/bin are copied | |
1019 | 8 # to xpath. m-files and oct-files in source/alternatives are copied to |
9 # altmpath and altopath respectively | |
0 | 10 |
1019 | 11 if test $# -lt 4 ; then |
0 | 12 echo 'Not enough arguments' |
13 exit 1 | |
14 fi | |
15 | |
16 # interpret input parameters | |
17 source=$1; shift | |
18 mpath=$1; shift | |
19 opath=$1; shift | |
20 xpath=$1; shift | |
1304
2e8272f0e514
(for David Billinghurst) avoid bashisms: in sh, shift fails if no more args
pkienzle
parents:
1063
diff
changeset
|
21 if test $# -ge 1; then altmpath=$1; shift; fi |
2e8272f0e514
(for David Billinghurst) avoid bashisms: in sh, shift fails if no more args
pkienzle
parents:
1063
diff
changeset
|
22 if test $# -ge 1; then altopath=$1; shift; fi |
0 | 23 INSTALL="@INSTALL@" |
24 INSTALL_DATA="@INSTALL_DATA@" | |
25 INSTALL_PROGRAM="@INSTALL_PROGRAM@" | |
1720
b4586377f0a6
[for Dan McMahill] use INSTALL_SCRIPT for scripts
pkienzle
parents:
1304
diff
changeset
|
26 INSTALL_SCRIPT="@INSTALL_SCRIPT@" |
848
c7db2c52c5d1
[David Bateman] Build and install the PKG_ADD files. {Modified by PAK without
pkienzle
parents:
106
diff
changeset
|
27 MKPKGADD="@TOPDIR@/admin/mkpkgadd" |
937
95178cedbc08
Use COPY_FLAGS to set options for cp when installing .oct files.
persquare
parents:
856
diff
changeset
|
28 COPY_FLAGS="@COPY_FLAGS@" |
0 | 29 |
30 # grab the m-files | |
31 files=`echo $source/*.m` | |
32 if test "$files" != "$source/*.m" ; then | |
33 $INSTALL -d $mpath | |
34 $INSTALL_DATA $files $mpath | |
35 fi | |
36 | |
37 # grab the oct-files | |
38 files=`echo $source/*.oct` | |
39 if test "$files" != "$source/*.oct" ; then | |
40 $INSTALL -d $opath | |
41 ## Grrr... install doesn't preserve links. Hope this works. | |
937
95178cedbc08
Use COPY_FLAGS to set options for cp when installing .oct files.
persquare
parents:
856
diff
changeset
|
42 cp $COPY_FLAGS $files $opath |
0 | 43 fi |
44 | |
1019 | 45 # install alternatives |
46 if test -d "$source/alternatives" ; then | |
47 # m-files | |
48 files=`echo $source/alternatives/*.m` | |
49 if test "$files" != "$source/alternatives/*.m" ; then | |
50 $INSTALL -d $altmpath | |
51 $INSTALL_DATA $files $altmpath | |
52 fi | |
53 # oct-files | |
54 files=`echo $source/alternatives/*.oct` | |
55 if test "$files" != "$source/alternatives/*.oct" ; then | |
56 $INSTALL -d $altopath | |
57 $INSTALL_DATA $files $altopath | |
58 fi | |
59 fi | |
60 | |
1893
250c9ad7c68e
Clean up install so that it is quiet unless there is a problem and so that
pkienzle
parents:
1720
diff
changeset
|
61 # Create PKG_ADD, and destroy it immediately if it is empty |
250c9ad7c68e
Clean up install so that it is quiet unless there is a problem and so that
pkienzle
parents:
1720
diff
changeset
|
62 # XXX FIXME XXX no PKG_ADD created if only oct-files and no m-files. |
250c9ad7c68e
Clean up install so that it is quiet unless there is a problem and so that
pkienzle
parents:
1720
diff
changeset
|
63 if test -d "$mpath" ; then |
250c9ad7c68e
Clean up install so that it is quiet unless there is a problem and so that
pkienzle
parents:
1720
diff
changeset
|
64 $MKPKGADD $source > $mpath/PKG_ADD |
250c9ad7c68e
Clean up install so that it is quiet unless there is a problem and so that
pkienzle
parents:
1720
diff
changeset
|
65 if test -z "`cat $mpath/PKG_ADD`" ; then rm -f $mpath/PKG_ADD; fi |
848
c7db2c52c5d1
[David Bateman] Build and install the PKG_ADD files. {Modified by PAK without
pkienzle
parents:
106
diff
changeset
|
66 fi |
1063 | 67 # PKG_ADD for alternatives |
1893
250c9ad7c68e
Clean up install so that it is quiet unless there is a problem and so that
pkienzle
parents:
1720
diff
changeset
|
68 if test -d "$source/alternatives" -a -d "$altmpath" ; then |
250c9ad7c68e
Clean up install so that it is quiet unless there is a problem and so that
pkienzle
parents:
1720
diff
changeset
|
69 $MKPKGADD $source/alternatives > $altmpath/PKG_ADD |
250c9ad7c68e
Clean up install so that it is quiet unless there is a problem and so that
pkienzle
parents:
1720
diff
changeset
|
70 if test -z "`cat $altmpath/PKG_ADD`" ; then rm $altmpath/PKG_ADD; fi |
1063 | 71 fi |
848
c7db2c52c5d1
[David Bateman] Build and install the PKG_ADD files. {Modified by PAK without
pkienzle
parents:
106
diff
changeset
|
72 |
106
918cc682e7be
Allow ./configure; make; make install directly from the CVS tree
pkienzle
parents:
0
diff
changeset
|
73 # grab the data files, skipping the CVS directory |
918cc682e7be
Allow ./configure; make; make install directly from the CVS tree
pkienzle
parents:
0
diff
changeset
|
74 files=`echo $source/data/* | sed -e "s/[^ ]*CVS//"` |
1893
250c9ad7c68e
Clean up install so that it is quiet unless there is a problem and so that
pkienzle
parents:
1720
diff
changeset
|
75 if test -n "$files" -a "$files" != "$source/data/*" ; then |
0 | 76 $INSTALL -d $mpath |
77 $INSTALL_DATA $files $mpath | |
78 fi | |
79 | |
106
918cc682e7be
Allow ./configure; make; make install directly from the CVS tree
pkienzle
parents:
0
diff
changeset
|
80 # grab the executable files, skipping the CVS directory |
918cc682e7be
Allow ./configure; make; make install directly from the CVS tree
pkienzle
parents:
0
diff
changeset
|
81 files=`echo $source/bin/* | sed -e "s/[^ ]*CVS//"` |
1893
250c9ad7c68e
Clean up install so that it is quiet unless there is a problem and so that
pkienzle
parents:
1720
diff
changeset
|
82 if test -n "$files" -a "$files" != "$source/bin/*" ; then |
0 | 83 $INSTALL -d $xpath |
84 $INSTALL_PROGRAM $files $xpath | |
85 fi | |
86 | |
1720
b4586377f0a6
[for Dan McMahill] use INSTALL_SCRIPT for scripts
pkienzle
parents:
1304
diff
changeset
|
87 # grab the script files, skipping the CVS directory |
b4586377f0a6
[for Dan McMahill] use INSTALL_SCRIPT for scripts
pkienzle
parents:
1304
diff
changeset
|
88 files=`echo $source/scripts/* | sed -e "s/[^ ]*CVS//"` |
1893
250c9ad7c68e
Clean up install so that it is quiet unless there is a problem and so that
pkienzle
parents:
1720
diff
changeset
|
89 if test -n "$files" -a "$files" != "$source/scripts/*" ; then |
1720
b4586377f0a6
[for Dan McMahill] use INSTALL_SCRIPT for scripts
pkienzle
parents:
1304
diff
changeset
|
90 $INSTALL -d $xpath |
b4586377f0a6
[for Dan McMahill] use INSTALL_SCRIPT for scripts
pkienzle
parents:
1304
diff
changeset
|
91 $INSTALL_SCRIPT $files $xpath |
b4586377f0a6
[for Dan McMahill] use INSTALL_SCRIPT for scripts
pkienzle
parents:
1304
diff
changeset
|
92 fi |
b4586377f0a6
[for Dan McMahill] use INSTALL_SCRIPT for scripts
pkienzle
parents:
1304
diff
changeset
|
93 |