~ubuntu-branches/ubuntu/saucy/intlfonts/saucy

« back to all changes in this revision

Viewing changes to make-dist

  • Committer: Bazaar Package Importer
  • Author(s): Milan Zamazal
  • Date: 2003-11-13 08:31:28 UTC
  • Revision ID: james.westby@ubuntu.com-20031113083128-twlakixijcdvb52u
Tags: upstream-1.2.1
ImportĀ upstreamĀ versionĀ 1.2.1

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/bin/sh
 
2
 
 
3
#### make-dist: create an Intlfonts distribution tar file from the current
 
4
#### source tree.
 
5
 
 
6
prog="$0"
 
7
 
 
8
if [ ! -f README -o ! -d European ] ; then
 
9
  echo "${prog}: Can't find README file or European subdirectory." >&2
 
10
  echo "${prog} must be run in the top directory of the intlfonts" >&2
 
11
  echo "distribution tree." >&2
 
12
  exit 1
 
13
fi
 
14
 
 
15
version=`sed -n '1 s/.*International Fonts Ver\.\([0-9][0-9]*\)\.\([0-9][0-9]*\)\.\([0-9][0-9]*\).*/\1 \2 \3/p' < README`
 
16
 
 
17
if [ -z "${version}" ] ; then
 
18
  echo "${prog}: Header of README doesn't contain valid version number." >&2
 
19
  exit 1
 
20
fi
 
21
 
 
22
files="README NEWS ChangeLog configure.in configure Makefile.in rmoldfnt.sh install-sh Emacs.ap make-dist"
 
23
subdirs="European European.BIG Asian Chinese Chinese.BIG Chinese.X\
 
24
        Japanese Japanese.BIG Japanese.X Korean.X Ethiopic Misc\
 
25
        TrueType Type1"
 
26
sizes="14 16 18 24 32 40 48"
 
27
 
 
28
dist=no
 
29
tar=no
 
30
split=no
 
31
diff=no
 
32
pack=no
 
33
 
 
34
while [ $# -gt 0 ] ; do
 
35
  case "$1" in
 
36
    ## This option tells make-dist to make the new distribution normally,
 
37
    ## This will make a directory, for instance, intlfonts-1.1.
 
38
    "--dist" )
 
39
      dist=yes
 
40
    ;;
 
41
    ## This option tells make-dist to make an archive file
 
42
    ## (e.g. intlfonts-1.1.tar.gz) of the latest distribution.
 
43
    "--arc" )
 
44
      arc=yes
 
45
    ;;
 
46
    ## This option tells make-dist to make an splited archives files
 
47
    ## (e.g. intlfonts-1.1-split/Asian.tar.gz) of the latest distribution.
 
48
    ## This also enable `--dist'.
 
49
    "--split" )
 
50
      split=yes
 
51
    ;;
 
52
    ## This option tells make-dist to make a diff file
 
53
    ## (e.g. intlfonts-1.1-1.2.diff) between previous and latest
 
54
    ## distributions.
 
55
    ## This also enable `--dist'.
 
56
    "--diff" )
 
57
      diff=yes
 
58
    ;;
 
59
    ## This option tells make-dist to pack the latest files in this directory
 
60
    ## into intlfonts.tar.gz.  This may be useful to move this directory to
 
61
    ## some other place.
 
62
    ## Note that old versions are not included in the packed file!
 
63
    "--pack" )
 
64
      pack=yes
 
65
    ;;
 
66
    * )
 
67
      echo "${prog}: Unrecognized argument: $1" >&2
 
68
      echo "The valid arguments are --dist, --arc, --diff, and --pack." >&2
 
69
      exit 1
 
70
    ;;
 
71
  esac
 
72
  shift
 
73
done
 
74
 
 
75
if [ "${pack}" = "yes" ] ; then
 
76
  echo "Packing the latest files in this directory into intlfonts.tar.gz..."
 
77
  mkdir intlfonts
 
78
  ln ${files} make-dist README.split intlfonts
 
79
  for dir in ${subdirs}; do
 
80
    mkdir intlfonts/${dir}
 
81
    for file in ${dir}/*; do
 
82
      if [ -f ${file} ] ; then
 
83
        ln ${file} ${distdir}/${dir}
 
84
      fi
 
85
    done
 
86
  done
 
87
  mkdir intlfonts/RCS
 
88
  for f in RCS/*; do
 
89
    ln ${f} intlfonts/RCS
 
90
  done
 
91
  tar cfz intlfonts.tar.gz intlfonts
 
92
  rm -rf intlfonts
 
93
  exit 0
 
94
fi
 
95
 
 
96
set ${version}
 
97
major=$1
 
98
minor=$2
 
99
release=$3
 
100
if [ "x$release" = "x" ] ; then
 
101
  version=${major}.${minor}
 
102
else
 
103
  version=${major}.${minor}.${release}
 
104
fi
 
105
 
 
106
echo "The latest version is ${version}."
 
107
 
 
108
if [ "${dist}" = "no" -a "${arc}" = "no" -a "${diff}" = "no" ] ; then
 
109
  echo "${prog}: Specify at least one of --dist, --arc, and --diff." >&2
 
110
  exit 1
 
111
fi
 
112
 
 
113
distdir=intlfonts-${version}
 
114
 
 
115
## If the latest distribution directory is not yet created,
 
116
## create it for the arguments --arc, --split, and --diff.
 
117
if [ ! -d ${distdir} ] ; then
 
118
  if [ "${arc}" = "yes" -o "${split}" = "yes" -o "${diff}" = "yes" ] ; then
 
119
    dist=yes
 
120
  fi
 
121
fi
 
122
 
 
123
if [ "${dist}" = "yes" ] ; then
 
124
  if [ -d ${distdir} ] ; then
 
125
    echo "${prog}: Directory ${distdir} already exists." >&2
 
126
    exit 1
 
127
  fi
 
128
 
 
129
  echo "Creating the distribution directory ${distdir}..."
 
130
 
 
131
  mkdir ${distdir}
 
132
  echo "Linking ${files}..."
 
133
  ln ${files} ${distdir}
 
134
  for dir in ${subdirs}; do
 
135
    echo "Linking ${dir}..."
 
136
    mkdir ${distdir}/${dir}
 
137
    for file in ${dir}/*; do
 
138
      if [ -f ${file} ] ; then
 
139
        ln ${file} ${distdir}/${dir}
 
140
      fi
 
141
    done
 
142
#    ln ${dir}/README ${distdir}/${dir}
 
143
#    ln ${dir}/*.bdf ${distdir}/${dir}
 
144
#    if [ -f ${dir}/fonts.alias ] ; then
 
145
#      ln ${dir}/fonts.alias ${distdir}/${dir}
 
146
#    fi
 
147
  done
 
148
fi
 
149
 
 
150
if [ "${arc}" = "yes" ] ; then
 
151
  echo "Making ${distdir}.tar.gz..."
 
152
  
 
153
  tar cfz ${distdir}.tar.gz ${distdir}
 
154
  echo "Contents of ${distdir}.tar.gz are:"
 
155
  tar tfz ${distdir}.tar.gz
 
156
  echo "Archive file ${distdir}.tar.gz is ready to be copied to ftp directory."
 
157
fi
 
158
 
 
159
if [ "${split}" = "yes" ] ; then
 
160
  echo "Making splitted archives files under ${distdir}-split..."
 
161
  mkdir ${distdir}-split
 
162
  cp README.split ${distdir}-split
 
163
  for dir in ${subdirs}; do
 
164
    echo "Making ${distdir}-split/${dir}.tar.gz..."
 
165
    tar cfz ${distdir}-split/${dir}.tar.gz ${distdir}/${dir} \
 
166
        `for f in ${files}; do echo ${distdir}/$f; done`
 
167
  done
 
168
  for size in ${sizes}; do
 
169
    echo "Making ${distdir}-split/${size}dots.tar.gz..."
 
170
    tar cfz ${distdir}-split/${size}dots.tar.gz ${distdir}/*/*${size}*.bdf \
 
171
        `for f in ${files}; do echo ${distdir}/$f; done`
 
172
  done
 
173
fi
 
174
 
 
175
if [ "${diff}" = "yes" ] ; then
 
176
  if [ ${minor} = "0" ] ; then
 
177
    if [ ${major} = "1" ] ; then
 
178
      echo "${prog}:  There is no previous version." >&2
 
179
      exit 1
 
180
    fi
 
181
    prev_major=`expr ${major} - 1`
 
182
    # Find the previous greatest minor version.
 
183
    prev_minor=0
 
184
    for dir in intlfonts-${prev_major}.*; do
 
185
      this=`echo ${dir} | sed  's/intlfonts-[0-9][0-9]*\.\([0-9][0-9]*\)/\1/`
 
186
      if [ ${this} -gt ${prev_minor} ] ; then prev_minor=${this}; fi
 
187
    done
 
188
  else
 
189
    prev_major=${major}
 
190
    prev_minor=`expr ${minor} - 1`
 
191
  fi
 
192
  prev_version=${prev_major}.${prev_minor}
 
193
  prevdir=intlfonts-${prev_version}
 
194
  diff_file=intlfonts-${prev_version}-${version}.diff
 
195
  echo "Making ${diff_file}..."
 
196
 
 
197
  if [ ! -d ${prevdir} ] ; then
 
198
    echo "${prog}: Directory ${prevdir} does not exist." >&2
 
199
    exit 1
 
200
  fi
 
201
  
 
202
  diff -acrN ${prevdir} ${distdir} > ${diff_file}
 
203
fi
 
204
    
 
205
exit 0
 
206
### make-dist ends here