annotate src/installman.sh @ 1:f72be2054832

add: reditor.c reditor.h
author atsuki
date Sat, 10 Nov 2007 20:27:44 +0900
parents 76efa0be13f1
children e170173ecb68
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
1 #! /bin/sh
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
2 # installman.sh --- install or uninstall manpages for Vim
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
3 #
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
4 # arguments:
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
5 # 1 what: "install", "uninstall" or "xxd"
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
6 # 2 target directory e.g., "/usr/local/man/it/man1"
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
7 # 3 language addition e.g., "" or "-it"
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
8 # 4 vim location as used in manual pages e.g., "/usr/local/share/vim"
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
9 # 5 runtime dir for menu.vim et al. e.g., "/usr/local/share/vim/vim70"
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
10 # 6 runtime dir for global vimrc file e.g., "/usr/local/share/vim"
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
11 # 7 source dir for help files e.g., "../runtime/doc"
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
12 # 8 mode bits for manpages e.g., "644"
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
13 # 9 vim exe name e.g., "vim"
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
14 # 10 name of vimdiff exe e.g., "vimdiff"
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
15 # 11 name of evim exe e.g., "evim"
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
16
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
17 errstatus=0
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
18
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
19 what=$1
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
20 destdir=$2
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
21 langadd=$3
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
22 vimloc=$4
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
23 scriptloc=$5
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
24 vimrcloc=$6
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
25 helpsource=$7
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
26 manmod=$8
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
27 exename=$9
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
28 # older shells don't support ${10}
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
29 shift
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
30 vimdiffname=$9
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
31 shift
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
32 evimname=$9
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
33
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
34 helpsubloc=$scriptloc/doc
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
35 synsubloc=$scriptloc/syntax
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
36 tutorsubloc=$scriptloc/tutor
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
37
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
38 if test $what = "install" -o $what = "xxd"; then
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
39 if test ! -d $destdir; then
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
40 echo creating $destdir
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
41 ./mkinstalldirs $destdir
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
42 fi
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
43 fi
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
44
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
45 if test $what = "install"; then
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
46 # vim.1
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
47 echo installing $destdir/$exename.1
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
48 sed -e s+/usr/local/lib/vim+$vimloc+ \
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
49 -e s+$vimloc/doc+$helpsubloc+ \
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
50 -e s+$vimloc/syntax+$synsubloc+ \
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
51 -e s+$vimloc/tutor+$tutorsubloc+ \
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
52 -e s+$vimloc/vimrc+$vimrcloc/vimrc+ \
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
53 -e s+$vimloc/gvimrc+$vimrcloc/gvimrc+ \
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
54 -e s+$vimloc/menu.vim+$scriptloc/menu.vim+ \
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
55 -e s+$vimloc/bugreport.vim+$scriptloc/bugreport.vim+ \
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
56 -e s+$vimloc/filetype.vim+$scriptloc/filetype.vim+ \
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
57 -e s+$vimloc/ftoff.vim+$scriptloc/ftoff.vim+ \
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
58 -e s+$vimloc/scripts.vim+$scriptloc/scripts.vim+ \
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
59 -e s+$vimloc/optwin.vim+$scriptloc/optwin.vim+ \
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
60 -e 's+$vimloc/\*.ps+$scriptloc/\*.ps+' \
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
61 $helpsource/vim$langadd.1 > $destdir/$exename.1
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
62 chmod $manmod $destdir/$exename.1
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
63
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
64 # vimtutor.1
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
65 echo installing $destdir/$exename""tutor.1
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
66 sed -e s+/usr/local/lib/vim+$vimloc+ \
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
67 -e s+$vimloc/tutor+$tutorsubloc+ \
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
68 $helpsource/vimtutor$langadd.1 > $destdir/$exename""tutor.1
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
69 chmod $manmod $destdir/$exename""tutor.1
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
70
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
71 # vimdiff.1
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
72 echo installing $destdir/$vimdiffname.1
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
73 cp $helpsource/vimdiff$langadd.1 $destdir/$vimdiffname.1
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
74 chmod $manmod $destdir/$vimdiffname.1
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
75
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
76 # evim.1
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
77 echo installing $destdir/$evimname.1
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
78 sed -e s+/usr/local/lib/vim+$vimloc+ \
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
79 $helpsource/evim$langadd.1 > $destdir/$evimname.1
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
80 chmod $manmod $destdir/$evimname.1
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
81 fi
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
82
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
83 if test $what = "uninstall"; then
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
84 echo Checking for Vim manual pages in $destdir...
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
85 if test -r $destdir/$exename.1; then
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
86 echo deleting $destdir/$exename.1
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
87 rm -f $destdir/$exename.1
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
88 fi
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
89 if test -r $destdir/$exename""tutor.1; then
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
90 echo deleting $destdir/$exename""tutor.1
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
91 rm -f $destdir/$exename""tutor.1
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
92 fi
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
93 if test -r $destdir/$vimdiffname.1; then
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
94 echo deleting $destdir/$vimdiffname.1
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
95 rm -f $destdir/$vimdiffname.1
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
96 fi
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
97 if test -r $destdir/$evimname.1; then
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
98 echo deleting $destdir/$evimname.1
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
99 rm -f $destdir/$evimname.1
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
100 fi
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
101 fi
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
102
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
103 if test $what = "xxd"; then
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
104 echo installing $destdir/xxd.1
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
105 cp $helpsource/xxd$langadd.1 $destdir/xxd.1
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
106 chmod $manmod $destdir/xxd.1
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
107 fi
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
108
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
109 exit $errstatus
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
110
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
111 # vim: set sw=3 sts=3 :